You are not logged in.

#1 2005-07-25 21:35:03

soloport
Member
Registered: 2005-03-01
Posts: 442

USB Takes a While (rc.sysinit)

FYI to anyone who needs USB support during rc.sysinit

I just spent most of a day trying dozens of modprobe this and modprobe that, trials and errors, with lenthy reboots in between, just to discover: It takes more than 5 seconds from a 'lshwd -a' to the time when /dev/sda* is available. :shock:

Here's some code that finally worked:

          lshwd -a > /dev/null
...add as much time-consuming junk as you can, here...
          # takes time for USB drive to activate
          for (( i=10; $i; i=$i-1 )); do
            if [ "`udevinfo -q path -n /dev/sda1 2>/dev/null | grep sda1`" ]; then
              /bin/mount -t ext2 /dev/sda1 /mnt >/dev/null 2>&1
              break
            fi
            sleep 1
            # echo "Countdown: $i"
          done
          if [ ! -f /mnt/keyfile.gpg ]; then
            echo "Ok, we probably really failed."
            exit 1
          fi
...do USB Drive related stuff here...
          /bin/umount /mnt
          /bin/umount /proc/bus/usb
          # rc.sysinit later tries to mount /proc/bus/usb

As always, with USB, YMMV

Offline

Board footer

Powered by FluxBB