Broke out boot-device locator for usb and cd booting seperatly.
git-svn-id: http://phraktured.net/archiso@14 00a9fe69-e71b-0410-bb23-df0e5024db41
This commit is contained in:
parent
c464db5951
commit
2b5cd0819f
@ -3,4 +3,6 @@
|
|||||||
MODULES=""
|
MODULES=""
|
||||||
BINARIES=""
|
BINARIES=""
|
||||||
FILES=""
|
FILES=""
|
||||||
HOOKS="base udev archlive ide scsi sata usb fw filesystems"
|
|
||||||
|
HOOKS="base udev boot-cd archiso ide scsi sata usb fw filesystems"
|
||||||
|
#HOOKS="base udev boot-usb archiso ide scsi sata usb fw filesystems"
|
||||||
|
@ -9,33 +9,16 @@ run_hook ()
|
|||||||
mkdir /tmpfs/bootcd
|
mkdir /tmpfs/bootcd
|
||||||
msg "done."
|
msg "done."
|
||||||
|
|
||||||
squashfound=0
|
if [ "x${BOOT_MOUNT}" -eq "x" ]; then
|
||||||
#TODO check for usb devices as well...
|
echo "ERROR: BOOT_MOUNT is not set. The boot-cd or boot-usb hook MUST"
|
||||||
msg -n ":: Scanning for boot cdrom device..."
|
echo " be run before this one. This image was improperly built"
|
||||||
squashimg="/tmpfs/bootcd/archlive.sqfs"
|
|
||||||
|
|
||||||
/bin/modprobe -q isofs >/dev/null 2>&1
|
|
||||||
for cdrom in /dev/cd/*; do
|
|
||||||
if mount -r -t iso9660 "${cdrom}" /tmpfs/bootcd >/dev/null 2>&1; then
|
|
||||||
if [ -e "${squashimg}" ]; then
|
|
||||||
squashfound=1
|
|
||||||
msg "${cdrom}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Failed to mount ${cdrom}"
|
|
||||||
fi
|
|
||||||
[ ${squashfound} -eq 0 ] && umount /tmpfs/bootcd >/dev/null 2>&1
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${squashfound} -eq 0 ]; then
|
|
||||||
echo "ERROR: cannot find booted cdrom device, cannot continue..."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
squashimg="${BOOT_MOUNT}/archiso.sqfs"
|
||||||
if [ "${copytoram}" = "y" ]; then
|
if [ "${copytoram}" = "y" ]; then
|
||||||
/bin/cat /tmpfs/bootcd/archlive.sqfs > /tmpfs/archlive.sqfs
|
/bin/cat ${squashimg} > /tmpfs/archiso.sqfs
|
||||||
squashimg="/tmpfs/archlive.sqfs"
|
squashimg="/tmpfs/archiso.sqfs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg ":: Mounting squashfs image"
|
msg ":: Mounting squashfs image"
|
@ -4,7 +4,6 @@ install ()
|
|||||||
MODULES="cdrom ide-cd ide-core ide-generic unionfs squashfs isofs $(all_modules '/kernel/fs' | grep -v "nls") "
|
MODULES="cdrom ide-cd ide-core ide-generic unionfs squashfs isofs $(all_modules '/kernel/fs' | grep -v "nls") "
|
||||||
BINARIES=""
|
BINARIES=""
|
||||||
FILES=""
|
FILES=""
|
||||||
add_binary /bin/mount /bin/mount.full
|
|
||||||
add_dir /real_root
|
add_dir /real_root
|
||||||
add_dir /tmpfs
|
add_dir /tmpfs
|
||||||
SCRIPT="archlive"
|
SCRIPT="archlive"
|
30
boot-cd_hook
Normal file
30
boot-cd_hook
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# vim: set ft=sh:
|
||||||
|
run_hook ()
|
||||||
|
{
|
||||||
|
msg ":: Scanning for boot cdrom device..."
|
||||||
|
|
||||||
|
/bin/mkdir -p /tmpfs/bootmnt
|
||||||
|
bootmnt="/tmpfs/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}/archiso.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
|
||||||
|
}
|
8
boot-cd_install
Normal file
8
boot-cd_install
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# vim: set ft=sh:
|
||||||
|
install ()
|
||||||
|
{
|
||||||
|
MODULES="cdrom ide-cd ide-core ide-generic unionfs squashfs isofs $(all_modules '/kernel/fs' | grep -v "nls") "
|
||||||
|
BINARIES=""
|
||||||
|
FILES=""
|
||||||
|
SCRIPT="from-cd"
|
||||||
|
}
|
30
boot-usb_hook
Normal file
30
boot-usb_hook
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# vim: set ft=sh:
|
||||||
|
run_hook ()
|
||||||
|
{
|
||||||
|
msg ":: Scanning for boot usb device..."
|
||||||
|
|
||||||
|
/bin/mkdir -p /tmpfs/bootmnt
|
||||||
|
bootmnt="/tmpfs/bootmnt/"
|
||||||
|
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
|
||||||
|
if [ -e "${bootmnt}/archiso.sqfs" ]; then
|
||||||
|
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
|
||||||
|
}
|
15
boot-usb_install
Normal file
15
boot-usb_install
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# vim: set ft=sh:
|
||||||
|
install ()
|
||||||
|
{
|
||||||
|
MODULES="cdrom ide-cd ide-core ide-generic unionfs squashfs $(all_modules '/kernel/fs' | grep -v "nls") "
|
||||||
|
|
||||||
|
MODULES="${MODULES} $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl1811-hcd" -e "isp116x-hcd")"
|
||||||
|
|
||||||
|
MODULES=$(echo ${MODULES}) #trim whitespace
|
||||||
|
if [ "x${MODULES}" != "x" ]; then
|
||||||
|
MODULES="${MODULES} usb_storage sd_mod sr_mod"
|
||||||
|
fi
|
||||||
|
BINARIES=""
|
||||||
|
FILES=""
|
||||||
|
SCRIPT="boot-usb"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user