Skip to content

Commit

Permalink
Skip loading usb modules when quickusbmodules parameter is specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcapriotti authored and daniel-baumann committed Feb 20, 2010
1 parent e45da93 commit 45d88e2
Showing 1 changed file with 35 additions and 27 deletions.
62 changes: 35 additions & 27 deletions scripts/live
Expand Up @@ -401,6 +401,11 @@ Arguments ()
export NOPERSISTENT
;;

quickusbmodules)
QUICKUSBMODULES="Yes"
export QUICKUSBMODULES
;;

preseed/file=*|file=*)
LOCATION="${ARGUMENT#*=}"
export LOCATION
Expand Down Expand Up @@ -1218,37 +1223,40 @@ setup_unionfs ()
# Looking for "${root_persistence}" device or file
if [ -n "${PERSISTENT}" ] && [ -z "${NOPERSISTENT}" ]
then
# Load USB modules
num_block=$(ls -l /sys/block | wc -l)
for module in sd_mod uhci-hcd ehci-hcd ohci-hcd usb-storage
do
modprobe -q -b ${module}
done

if [ -x /sbin/udevadm ]
if [ -z "${QUICKUSBMODULES}" ]
then
# lenny
udevadm trigger
udevadm settle
else
# etch
udevtrigger
udevsettle
fi

# For some reason, udevsettle does not block in this scenario,
# so we sleep for a little while.
#
# See https://bugs.launchpad.net/ubuntu/+source/casper/+bug/84591
for timeout in 5 4 3 2 1
do
sleep 1
# Load USB modules
num_block=$(ls -l /sys/block | wc -l)
for module in sd_mod uhci-hcd ehci-hcd ohci-hcd usb-storage
do
modprobe -q -b ${module}
done

if [ $(ls -l /sys/block | wc -l) -gt ${num_block} ]
if [ -x /sbin/udevadm ]
then
break
# lenny
udevadm trigger
udevadm settle
else
# etch
udevtrigger
udevsettle
fi
done

# For some reason, udevsettle does not block in this scenario,
# so we sleep for a little while.
#
# See https://bugs.launchpad.net/ubuntu/+source/casper/+bug/84591
for timeout in 5 4 3 2 1
do
sleep 1

if [ $(ls -l /sys/block | wc -l) -gt ${num_block} ]
then
break
fi
done
fi

# search for label and files (this could be hugely optimized)
cowprobe=$(find_cow_device "${root_persistence}")
Expand Down

0 comments on commit 45d88e2

Please sign in to comment.