diff options
-rw-r--r-- | hooks/filesystems | 14 | ||||
-rw-r--r-- | init | 4 | ||||
-rw-r--r-- | install/autodetect | 13 | ||||
-rw-r--r-- | install/keymap | 2 | ||||
-rw-r--r-- | install/pcmcia | 11 | ||||
-rw-r--r-- | install/sata | 2 | ||||
-rw-r--r-- | install/scsi | 2 | ||||
-rw-r--r-- | mkinitcpio | 5 |
8 files changed, 29 insertions, 24 deletions
diff --git a/hooks/filesystems b/hooks/filesystems index 12bc945..97d7d57 100644 --- a/hooks/filesystems +++ b/hooks/filesystems @@ -13,15 +13,19 @@ run_hook () /bin/sleep "${rootdelay}" msg "done." export rootdelay=0 - kinit_params="${kinit_params} rootdelay=0" + kparams "rootdelay=0" fi - eval $( /bin/parseblock "${root}") - if [ "${BLOCKNAME}" = "unknown" -o "x{BLOCKDEVICE}" = "x" ]; then + eval $(/bin/parseblock "${root}") + if [ "${BLOCKNAME}" = "unknown" ]; then FSTYPE="unknown" - echo "ERROR: Failed to parse block device '${root}'" + echo "ERROR: Failed to parse block device name for '${root}'" + elif [ "x${BLOCKDEVICE}" = "x" ]; then + FSTYPE="unknown" + echo "ERROR: Failed to parse block device ids for '${root}'" else export root="${BLOCKNAME}" + echo "/bin/mknod \"${BLOCKNAME}\" b ${BLOCKDEVICE}" /bin/mknod "${BLOCKNAME}" b ${BLOCKDEVICE} >/dev/null fi fi @@ -37,7 +41,7 @@ run_hook () if [ "${FSTYPE}" = "unknown" ]; then echo "ERROR: root fs cannot be detected. Try using the rootfstype= kernel parameter." else - kinit_params="${kinit_params} rootfstype=${FSTYPE}" + kparams "rootfstype=${FSTYPE}" /bin/modprobe -q "${FSTYPE}" >/dev/null 2>&1 fi } @@ -2,6 +2,7 @@ msg () { [ "${quiet}" != "y" ] && echo $@; } err () { echo "ERROR: $@"; } +kparams () { echo -n "$@" >> /arch.cmd; } msg ":: Loading Initramfs" @@ -13,7 +14,6 @@ export CMDLINE # Used so hooks can override params to kinit export root="" -export kinit_params="" echo "/bin/modprobe" > /proc/sys/kernel/modprobe for cmd in $CMDLINE; do @@ -81,4 +81,4 @@ fi msg ":: Initramfs Completed - control passing to kinit" echo "/sbin/modprobe" > /proc/sys/kernel/modprobe -exec /bin/kinit "root=${root}" ${kinit_params} < /dev/console > /dev/null 2>&1 +exec /bin/kinit "root=${root}" "${CMDLINE}" diff --git a/install/autodetect b/install/autodetect index e3543e7..ec7e624 100644 --- a/install/autodetect +++ b/install/autodetect @@ -4,15 +4,16 @@ install () { MODULE_FILE="$(mktemp /tmp/initcpio_modules.XXXXXX)" #blegh, we'll let /tmp clean itself up - AUTODETECT="$(auto_modules -e "/scsi/" -e "/block" -e "/fusion/" \ - -e "/usb/" -e "/ide/" -e "/ieee1394/" -e "/cdrom"\ - -e "/net/" -e "/pcmcia") + AUTODETECT="$(auto_modules -e '/scsi/' -e '/block' -e '/fusion/' \ + -e '/usb/' -e '/ide/' -e '/ieee1394/' -e '/cdrom' \ + -e '/net/' -e '/pcmcia') $(cat /proc/filesystems | grep -v nodev) " if [ -e /sbin/mdadm ]; then - if [ $UID -eq 0 -o "$(groups | grep disk)" != "" ]; then \ - AUTODETECT="$AUTODETECT $(mdadm -E -s /dev/hd* /dev/sd* /dev/rd/* /dev/ida/* \ - /dev/cciss/* /dev/ataraid/* | awk -Flevel= '{print $2}' | awk '{print $1}')" + if [ $UID -eq 0 -o "$(groups | grep disk)" != "" ]; then + AUTODETECT="$AUTODETECT + $(mdadm -E -s /dev/hd* /dev/sd* /dev/rd/* /dev/ida/* /dev/cciss/* /dev/ataraid/* \ + | awk -Flevel= '{print $2}' | awk '{print $1}')" else err "User does not have proper permissions to read superblocks, raid modules are not detected" fi diff --git a/install/keymap b/install/keymap index 800ab47..0518802 100644 --- a/install/keymap +++ b/install/keymap @@ -14,7 +14,7 @@ install () grep "KEYMAP=" /etc/rc.conf >> ${KEYMAP_FILE} grep "CONSOLEFONT=" /etc/rc.conf >> ${KEYMAP_FILE} grep "CONSOLEMAP=" /etc/rc.conf >> ${KEYMAP_FILE} - if [ "`echo $LOCALE | /bin/grep -i utf`" ]; then + if [ "$(echo $LOCALE | /bin/grep -i utf)" != "" ]; then echo UTF8="yes" >> ${KEYMAP_FILE} fi . ${KEYMAP_FILE} diff --git a/install/pcmcia b/install/pcmcia index 4e419c0..b5ca7fb 100644 --- a/install/pcmcia +++ b/install/pcmcia @@ -2,17 +2,14 @@ install () { - MODULES=" $(checked_modules "/pcmcia/" | grep -ve "sound" -e "net") $(checked_modules "/ide/legacy")" + MODULES=" $(checked_modules '/pcmcia/' | grep -ve 'sound' -e 'net') $(checked_modules '/ide/legacy')" MODULES=$(echo ${MODULES}) #trim whitespace if [ "x${MODULES}" != "x" ]; then - MODULES="${MODULES} sd_mod\nsr_mod\nide-disk\nide-cd" + MODULES="${MODULES} sd_mod sr_mod ide-disk ide-cd" fi - BINARIES="" - FILES="" + BINARIES="/sbin/pcmcia-socket-startup.static /sbin/pcmcia-check-broken-cis.static" + FILES="/etc/pcmcia/config.opts" SCRIPT="" - add_file "/sbin/pcmcia-socket-startup.static" "/sbin/pcmcia-socket-startup" - add_file "/sbin/pcmcia-check-broken-cis.static" "/sbin/pcmcia-check-broken-cis" - add_file "/etc/pcmcia/config.opts" } help () diff --git a/install/sata b/install/sata index 45484c7..dc20045 100644 --- a/install/sata +++ b/install/sata @@ -2,7 +2,7 @@ install () { - MODULES=" $(checked_modules "scsi/.*ata") $(checked_modules "block/sx8") \ + MODULES=" $(checked_modules "scsi/.*ata") $(checked_modules "block/sx8") $(checked_modules "scsi/ahci") $(checked_modules "scsi/pdc_adma")" MODULES=$(echo ${MODULES}) #trim whitespace diff --git a/install/scsi b/install/scsi index 8e8694b..396de33 100644 --- a/install/scsi +++ b/install/scsi @@ -8,7 +8,7 @@ install () MODULES=$(echo ${MODULES}) #trim whitespace if [ "x${MODULES}" != "x" ]; then - MODULES="${MODULES} sd_mod\nsr_mod" + MODULES="${MODULES} sd_mod sr_mod" fi BINARIES="" FILES="" @@ -10,13 +10,14 @@ # use "x${var}" = "x" to test for nulls/empty strings # incase of embedded spaces, quote all path names and string comarpisons # +#TODO trap and remove FILELIST # Settings BASEDIR="" FILELIST="$(mktemp /tmp/.tmpfilelist.XXXX)" KERNELVERSION="$(uname -r)" -FUNCTIONS="functions" #/lib/initramfs/functions +FUNCTIONS="functions" CONFIG="mkinitcpio.conf" HOOKDIR="hooks" INSTDIR="install" @@ -133,6 +134,8 @@ for hook in $HOOKS; do echo ":: Parsing hook [${hook}]" install parse_hook + else + die "Hook '${hook}' can not be found." fi done |