2006-09-28 06:36:34 +02:00
|
|
|
run_hook ()
|
|
|
|
{
|
|
|
|
msg ":: Scanning for boot usb device..."
|
|
|
|
|
2008-03-29 21:54:57 +01:00
|
|
|
/bin/mkdir -p /bootmnt
|
|
|
|
bootmnt="/bootmnt"
|
2006-09-28 06:36:34 +02:00
|
|
|
found=0
|
|
|
|
|
|
|
|
for usb in /dev/sd[a-z][0-9]; do
|
|
|
|
if mount -r -t vfat "${usb}" ${bootmnt} >/dev/null 2>&1 ||\
|
|
|
|
mount -r -t ext2 "${usb}" ${bootmnt} >/dev/null 2>&1; then
|
2007-10-06 03:52:03 +02:00
|
|
|
if [ -e "${bootmnt}/archlive.sqfs" ]; then
|
2006-09-28 06:36:34 +02:00
|
|
|
found=1
|
|
|
|
msg "${usb}"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Failed to mount ${usb}"
|
|
|
|
fi
|
|
|
|
[ ${found} -eq 0 ] && umount ${bootmnt} >/dev/null 2>&1
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ${found} -eq 0 ]; then
|
|
|
|
echo "ERROR: cannot find booted usb device, cannot continue..."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
export BOOT_MOUNT="${bootmnt}"
|
|
|
|
fi
|
|
|
|
}
|
2007-10-11 03:12:47 +02:00
|
|
|
|
|
|
|
# vim:ft=sh:ts=4:sw=4:et:
|