ISO/hooks/boot-cd
Simo Leone 69c9986a9c Got archiso into working condition
Several small changes just as a shim to get everything to work.

Signed-off-by: Simo Leone <simo@archlinux.org>
2007-10-09 20:59:26 -05:00

31 lines
760 B
Bash

# vim: set ft=sh:
run_hook ()
{
msg ":: Scanning for boot cdrom device..."
/bin/mkdir -p /bootmnt
bootmnt="/bootmnt/"
found=0
/bin/modprobe -q isofs >/dev/null 2>&1
for cdrom in /dev/cd/*; do
if mount -r -t iso9660 "${cdrom}" ${bootmnt} >/dev/null 2>&1; then
if [ -e "${bootmnt}/archlive.sqfs" ]; then
found=1
msg "${cdrom}"
break
fi
else
echo "Failed to mount ${cdrom}"
fi
[ ${found} -eq 0 ] && umount ${bootmnt} >/dev/null 2>&1
done
if [ ${found} -eq 0 ]; then
echo "ERROR: cannot find booted cdrom device, cannot continue..."
exit 1
else
export BOOT_MOUNT="${bootmnt}"
fi
}