···81touch /etc/udev/hwdb.bin # to shut up udev
82touch /etc/initrd-release
8384-# Function for waiting a device to appear.
85waitDevice() {
86 local device="$1"
0008788 # USB storage devices tend to appear with some delay. It would be
89 # great if we had a way to synchronously wait for them, but
90 # alas... So just wait for a few seconds for the device to
91 # appear.
92- if test ! -e $device; then
93- echo -n "waiting for device $device to appear..."
94- try=20
95- while [ $try -gt 0 ]; do
96- sleep 1
97- # also re-try lvm activation now that new block devices might have appeared
98- lvm vgchange -ay
99- # and tell udev to create nodes for the new LVs
100- udevadm trigger --action=add
101- if test -e $device; then break; fi
102- echo -n "."
103- try=$((try - 1))
104- done
105- echo
106- [ $try -ne 0 ]
107- fi
00108}
109110# Mount special file systems.
···81touch /etc/udev/hwdb.bin # to shut up udev
82touch /etc/initrd-release
8384+# Function for waiting for device(s) to appear.
85waitDevice() {
86 local device="$1"
87+ # Split device string using ':' as a delimiter as bcachefs
88+ # uses this for multi-device filesystems, i.e. /dev/sda1:/dev/sda2:/dev/sda3
89+ local IFS=':'
9091 # USB storage devices tend to appear with some delay. It would be
92 # great if we had a way to synchronously wait for them, but
93 # alas... So just wait for a few seconds for the device to
94 # appear.
95+ for dev in $device; do
96+ if test ! -e $dev; then
97+ echo -n "waiting for device $dev to appear..."
98+ try=20
99+ while [ $try -gt 0 ]; do
100+ sleep 1
101+ # also re-try lvm activation now that new block devices might have appeared
102+ lvm vgchange -ay
103+ # and tell udev to create nodes for the new LVs
104+ udevadm trigger --action=add
105+ if test -e $dev; then break; fi
106+ echo -n "."
107+ try=$((try - 1))
108+ done
109+ echo
110+ [ $try -ne 0 ]
111+ fi
112+ done
113}
114115# Mount special file systems.