index : mkinitcpio-archiso32 | |
Archlinux32 initcpio scripts used by archiso | gitolite user |
summaryrefslogtreecommitdiff |
author | Gerhard Brauer <gerbra@archlinux.de> | 2009-07-26 10:57:46 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-07-27 11:03:38 -0700 |
commit | dc33bbe9cdc1e03b5217f029387b50e3152b4dd5 (patch) | |
tree | bf9d687b05741128bbc3f500b8edf09729ffb98b | |
parent | 2657105f3b18684ea4f4c52db6c5ec90bc0dd3e8 (diff) |
-rw-r--r-- | archiso/hooks/archiso | 69 | ||||
-rw-r--r-- | archiso/hooks/archiso-early | 8 |
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d779478..688a880 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -50,61 +50,34 @@ run_hook () ramdisk_size="75%" fi msg -n ":: Mounting tmpfs, size=${ramdisk_size}..." - mount -t tmpfs -o "size=${ramdisk_size}" tmpfs /tmpfs + mount -t tmpfs -o "size=${ramdisk_size}" tmpfs /tmpfs msg "done." - # external drives may need to settle - msg ":: Waiting for devices to settle..." - /sbin/udevadm trigger --subsystem-match=usb - /sbin/udevadm settle - usbdelay=$(( ${usbdelay:-0} + 1 )) - msg ":: Waiting ${usbdelay}s for USB devices" - /bin/sleep "${usbdelay}" - - msg ":: Scanning for boot device..." + msg ":: Waiting for boot device..." /bin/mkdir -p /bootmnt - found=0 - - /bin/modprobe -q isofs >/dev/null 2>&1 - msg ":: Scanning cd drives..." - for cdrom in /dev/hd[a-z] /dev/sr[0-9]* /dev/scd[a-z] /dev/sg[0-9]*; do - [ ! -e "${cdrom}" ] && continue - if mount -r -t iso9660 "${cdrom}" /bootmnt >/dev/null 2>&1; then - if [ -e "/bootmnt/isomounts" ]; then - found=1 - msg "${cdrom}" - break - fi - else - echo "Failed to mount ${cdrom}" - fi - [ ${found} -eq 0 ] && umount /bootmnt >/dev/null 2>&1 + while ! poll_device /dev/archiso 30; do + echo "ERROR: boot device didn't show up after 30 seconds..." + echo " Falling back to interactive prompt" + echo " You can try to fix the problem manually, log out when you are finished" + PS1="ramfs$ " /bin/sh -i done - if [ ${found} -eq 0 ]; then - msg ":: Scanning usb drives..." - for usb in /dev/sd[a-z][0-9]; do - [ ! -e "${usb}" ] && continue - 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/isomounts" ]; then - found=1 - msg "${usb}" - break - fi - else - echo "Failed to mount ${usb}" - fi - [ ${found} -eq 0 ] && umount /bootmnt >/dev/null 2>&1 - done - fi - - if [ ${found} -eq 0 ]; then - echo "ERROR: cannot find boot device, cannot continue..." - echo " Falling back to interactive prompt" - PS1="ramfs$ " /bin/sh -i + eval $(fstype < /dev/archiso 2>/dev/null) + if [ -n "${FSTYPE}" -a "${FSTYPE}" != "unknown" ]; then + if mount -r -t "${FSTYPE}" /dev/archiso /bootmnt >/dev/null 2>&1; then + if [ -e "/bootmnt/isomounts" ]; then + echo "SUCCESS: Mounted archiso volume successfully." + else + echo "ERROR: Mounting was successful, but the isomounts file does not exist." + exit 1 + fi + else + echo "ERROR: Failed to mount /dev/archiso" exit 1 + fi + else + echo "ERROR: /dev/archiso found, but the filesystem type is unknown." fi /bin/modprobe -q squashfs >/dev/null 2>&1 diff --git a/archiso/hooks/archiso-early b/archiso/hooks/archiso-early index 884c4be..d57b73b 100644 --- a/archiso/hooks/archiso-early +++ b/archiso/hooks/archiso-early @@ -1,8 +1,8 @@ # vim: set ft=sh: run_hook () { - # Set our usbdelay time. Default: 0 - cd / - /bin/mkdir -p etc/modprobe.d/ - echo "options usb-storage delay_use=${usbdelay:-0}" > /etc/modprobe.d/usb-delay + if [ -n "${archisolabel}" ]; then + echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", IMPORT{program}=\"vol_id --export \$tempnode\"" > /lib/udev/rules.d/00-archiso-device.rules + echo "ENV{ID_FS_LABEL_ENC}==\"${archisolabel}\", SYMLINK+=\"archiso\"" >> /lib/udev/rules.d/00-archiso-device.rules + fi } |