···8181touch /etc/udev/hwdb.bin # to shut up udev
8282touch /etc/initrd-release
83838484-# Function for waiting a device to appear.
8484+# Function for waiting for device(s) to appear.
8585waitDevice() {
8686 local device="$1"
8787+ # Split device string using ':' as a delimiter as bcachefs
8888+ # uses this for multi-device filesystems, i.e. /dev/sda1:/dev/sda2:/dev/sda3
8989+ local IFS=':'
87908891 # USB storage devices tend to appear with some delay. It would be
8992 # great if we had a way to synchronously wait for them, but
9093 # alas... So just wait for a few seconds for the device to
9194 # appear.
9292- if test ! -e $device; then
9393- echo -n "waiting for device $device to appear..."
9494- try=20
9595- while [ $try -gt 0 ]; do
9696- sleep 1
9797- # also re-try lvm activation now that new block devices might have appeared
9898- lvm vgchange -ay
9999- # and tell udev to create nodes for the new LVs
100100- udevadm trigger --action=add
101101- if test -e $device; then break; fi
102102- echo -n "."
103103- try=$((try - 1))
104104- done
105105- echo
106106- [ $try -ne 0 ]
107107- fi
9595+ for dev in $device; do
9696+ if test ! -e $dev; then
9797+ echo -n "waiting for device $dev to appear..."
9898+ try=20
9999+ while [ $try -gt 0 ]; do
100100+ sleep 1
101101+ # also re-try lvm activation now that new block devices might have appeared
102102+ lvm vgchange -ay
103103+ # and tell udev to create nodes for the new LVs
104104+ udevadm trigger --action=add
105105+ if test -e $dev; then break; fi
106106+ echo -n "."
107107+ try=$((try - 1))
108108+ done
109109+ echo
110110+ [ $try -ne 0 ]
111111+ fi
112112+ done
108113}
109114110115# Mount special file systems.