From 3098153d537da7f3777b52495fa87cb9a1fe63dd Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 13 Apr 2006 15:04:13 +0000 Subject: [PATCH] Added a check for /dev/tty0 to setup_keymap, added raid personality modules for EVMS, and fixed lots of space/tab issues, along with a general style cleanup. I'm calling this one 3.3.11b internally, and hopefully it will be added to the tree if it resolves bug #124388. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@373 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- generic/initrd.scripts | 443 +++++++++++++++++++++-------------------- generic/linuxrc | 420 +++++++++++++++++++------------------- genkernel | 2 +- x86/busy-config | 2 +- x86/modules_load | 2 +- x86_64/busy-config | 2 +- x86_64/modules_load | 2 +- xen0/busy-config | 2 +- xen0/modules_load | 2 +- xenU/busy-config | 2 +- xenU/modules_load | 2 +- 11 files changed, 441 insertions(+), 440 deletions(-) diff --git a/generic/initrd.scripts b/generic/initrd.scripts index 5650306..c4d9b90 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -5,8 +5,7 @@ backup() { echo -ne "\033[0G\033[0K" } -strlen() -{ +strlen() { if [ -z "$1" ] then echo "usage: strlen " @@ -92,6 +91,7 @@ findcdmount() { fi fi } + cache_cd_contents() { # Check loop file exists and cache to ramdisk if DO_cache is enabled if [ "${LOOPTYPE}" != "noloop" ] && [ "${LOOPTYPE}" != "sgimips" ] @@ -113,16 +113,16 @@ cache_cd_contents() { fi } -mount_sysfs(){ - if [ "${KV_2_6_OR_GREATER}" ] - then - # Udev is semi-broken on non /sys sysfs mount points. - mount -t sysfs /sys /sys >/dev/null 2>&1 - ret=$? +mount_sysfs() { + if [ "${KV_2_6_OR_GREATER}" ] + then + # Udev is semi-broken on non /sys sysfs mount points. + mount -t sysfs /sys /sys >/dev/null 2>&1 + ret=$? - # sysfs mount failed .. udev wont work fall back to devfs if available - [ "$ret" -eq '0' ] || USE_UDEV_NORMAL=0 - fi + # sysfs mount failed .. udev wont work fall back to devfs if available + [ "$ret" -eq '0' ] || USE_UDEV_NORMAL=0 + fi } # Insert a directory tree $2 to an union specified by $1 @@ -130,8 +130,7 @@ mount_sysfs(){ # $1 = union absolute path (starting with /) # $2 = path to data directory # -union_insert_dir() -{ +union_insert_dir() { /sbin/unionctl $1 --add --after 0 --mode ro $2 if [ $? = '0' ] then @@ -140,14 +139,17 @@ union_insert_dir() } findnfsmount() { - if [ "${IP}" != '' ]; then - if [ "${NFSROOT}" = '' ]; then + if [ "${IP}" != '' ] + then + if [ "${NFSROOT}" = '' ] + then # Obtain NFSIP OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"` for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ]; then - NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`; + if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ] + then + NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` fi done @@ -155,11 +157,12 @@ findnfsmount() { OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"` for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ]; then - NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`; - fi + if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ] + then + NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` + fi done - + # Setup NFSROOT if [ "${NFSIP}" != '' ] && [ "$NFSPATH" != '' ] then @@ -170,11 +173,14 @@ findnfsmount() { fi fi - if [ "${NFSROOT}" != '' ]; then - if [ "${CDROOT}" != '0' ]; then + if [ "${NFSROOT}" != '' ] + then + if [ "${CDROOT}" != '0' ] + then good_msg "Attempting to mount NFS CD image on ${NFSROOT}" - mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}/mnt/cdrom - if [ "$?" = '0' ]; then + mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}/mnt/cdrom + if [ "$?" = '0' ] + then REAL_ROOT="/dev/nfs" else bad_msg "NFS Mounting failed. Is the path corrent ?" @@ -182,7 +188,8 @@ findnfsmount() { else good_msg "Attemping to mount NFS root on ${NFSROOT}" mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT} - if [ "$?" = '0' ]; then + if [ "$?" = '0' ] + then REAL_ROOT="/dev/nfs" else bad_msg "NFS Mounting failed. Is the path correct ?" @@ -200,15 +207,15 @@ kill_devfsd() { } check_loop() { - if [ "${LOOP}" = '' -o ! -e "mnt/cdrom/${LOOP}" ] - then + if [ "${LOOP}" = '' -o ! -e "mnt/cdrom/${LOOP}" ] + then - bad_msg "Invalid loop location: ${LOOP}" - bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...' - bad_msg 'kernel command line!' + bad_msg "Invalid loop location: ${LOOP}" + bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...' + bad_msg 'kernel command line!' - run_shell - fi + run_shell + fi } run_shell() { @@ -263,17 +270,17 @@ bind_mount_dev() { mount -o bind ${NEW_ROOT}/dev /dev } -start_dev_mgr(){ - # Check udev is available... - if [ "${KV_2_6_OR_GREATER}" -a ! "${USE_UDEV_NORMAL}" -eq '0' -a -x /sbin/udev ] - then +start_dev_mgr() { + # Check udev is available... + if [ "${KV_2_6_OR_GREATER}" -a ! "${USE_UDEV_NORMAL}" -eq '0' -a -x /sbin/udev ] + then USE_UDEV_NORMAL=1 - else + else USE_UDEV_NORMAL=0 - fi + fi - if [ "${USE_UDEV_NORMAL}" -eq '1' ] - then + if [ "${USE_UDEV_NORMAL}" -eq '1' ] + then cd /sys [ "${DO_slowusb}" ] && sleep 10 kill_devfsd @@ -281,116 +288,118 @@ start_dev_mgr(){ runUdev [ "${DO_slowusb}" ] && sleep 20 cd / - else + else if [ ! -e /dev/.devfsd ] then - good_msg 'Activating devfs' + good_msg 'Activating devfs' mount -t devfs devfs /dev devfsd /dev -np fi - fi + fi } bootstrapCD() { - # Locate the cdrom device with our media on it. - [ -n "${CDROOT_DEV}" ] && DEVICES="$DEVICES ${CDROOT_DEV}" # Device specified on the command line - DEVICES="$DEVICES /dev/cdroms/*" # CDROM DEVICES - DEVICES="$DEVICES /dev/ide/cd/*" # CDROM DEVICES - DEVICES="$DEVICES /dev/sr*" # UML DEVICES - DEVICES="$DEVICES /dev/sd*" # USB Keychain - DEVICES="$DEVICES /dev/hd*" # IDE devices - DEVICES="$DEVICES /dev/ubd* /dev/ubd/*" # UML DEVICES - DEVICES="$DEVICES /dev/iseries/vcd*" # iSeries Devices - - findcdmount $DEVICES + # Locate the cdrom device with our media on it. + [ -n "${CDROOT_DEV}" ] && DEVICES="$DEVICES ${CDROOT_DEV}" # Device specified on the command line + DEVICES="$DEVICES /dev/cdroms/*" # CDROM DEVICES + DEVICES="$DEVICES /dev/ide/cd/*" # CDROM DEVICES + DEVICES="$DEVICES /dev/sr*" # UML DEVICES + DEVICES="$DEVICES /dev/sd*" # USB Keychain + DEVICES="$DEVICES /dev/hd*" # IDE devices + DEVICES="$DEVICES /dev/ubd* /dev/ubd/*" # UML DEVICES + DEVICES="$DEVICES /dev/iseries/vcd*" # iSeries Devices + + findcdmount $DEVICES } cmdline_hwopts() { - # Scan CMDLINE for any "doscsi" or "noscsi"-type arguments - - local FOUND - local TMP_HWOPTS - - for x in $HWOPTS - do - for y in $CMDLINE + # Scan CMDLINE for any "doscsi" or "noscsi"-type arguments + + local FOUND + local TMP_HWOPTS + + for x in $HWOPTS do - if [ "${y}" = "do${x}" ] - then - MY_HWOPTS="${MY_HWOPTS} $x" - elif [ "${y}" = "no${x}" ] - then - MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`" - fi + for y in $CMDLINE + do + if [ "${y}" = "do${x}" ] + then + MY_HWOPTS="${MY_HWOPTS} $x" + elif [ "${y}" = "no${x}" ] + then + MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`" + fi + done done - done - # Shouldnt need to sort this the following loop should figure out the duplicates and strip them out - #MY_HWOPTS=`echo ${MY_HWOPTS}| sort` - - for x in ${MY_HWOPTS} - do - FOUND=0 - for y in ${TMP_HWOPTS} + # Shouldnt need to sort this as the following loop should figure out the + # duplicates and strip them out + #MY_HWOPTS=`echo ${MY_HWOPTS}| sort` + + for x in ${MY_HWOPTS} do - if [ "${y}" = "${x}" ] - then - FOUND=1 + FOUND=0 + for y in ${TMP_HWOPTS} + do + if [ "${y}" = "${x}" ] + then + FOUND=1 + fi + done + if [ ! "${FOUND}" = '1' ] + then + TMP_HWOPTS="${TMP_HWOPTS} ${x}" fi done - if [ ! "${FOUND}" = '1' ] - then - TMP_HWOPTS="${TMP_HWOPTS} ${x}" - fi - done - MY_HWOPTS=${TMP_HWOPTS} + MY_HWOPTS=${TMP_HWOPTS} } load_modules() { - # Load modules listed in MY_HWOPTS if /lib/modules exists - - if [ -d '/lib/modules' ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules - for modules in $MY_HWOPTS - do - modules_scan $modules - eval DO_`echo $modules | sed 's/-//'`=1 - done - else - good_msg 'Skipping module load; no modules in the initrd!' - fi + # Load modules listed in MY_HWOPTS if /lib/modules exists + + if [ -d '/lib/modules' ] + then + good_msg 'Loading modules' + # Load appropriate kernel modules + for modules in $MY_HWOPTS + do + modules_scan $modules + eval DO_`echo $modules | sed 's/-//'`=1 + done + else + good_msg 'Skipping module load; no modules in the initrd!' + fi } detect_sbp2_devices() { - # http://www.linux1394.org/sbp2.php - - # /proc - # /proc/scsi/sbp2/0, /proc/scsi/sbp2/1, etc. - # - # You may manually add/remove SBP-2 devices via the procfs with add-single-device or remove-single-device , where: - # - # - # = host (starting at zero for first SCSI adapter) - # = bus (normally zero) - # = target (starting at zero for first SBP-2 device) - # - lun (normally zero) - # e.g. To manually add/detect a new SBP-2 device - # echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi - # e.g. To manually remove a SBP-2 device after it's been unplugged - # echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi - # e.g. To check to see which SBP-2/SCSI devices are currently registered - # cat /proc/scsi/scsi - - [ -e /proc/scsi/scsi ] && echo 'scsi add-single-device 0 0 0 0' > /proc/scsi/scsi + # http://www.linux1394.org/sbp2.php + + # /proc + # /proc/scsi/sbp2/0, /proc/scsi/sbp2/1, etc. + # + # You may manually add/remove SBP-2 devices via the procfs with: + # add-single-device or remove-single-device , + # where: + # + # = host (starting at zero for first SCSI adapter) + # = bus (normally zero) + # = target (starting at zero for first SBP-2 device) + # - lun (normally zero) + # e.g. To manually add/detect a new SBP-2 device + # echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi + # e.g. To manually remove a SBP-2 device after it's been unplugged + # echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi + # e.g. To check to see which SBP-2/SCSI devices are currently registered + # cat /proc/scsi/scsi + + [ -e /proc/scsi/scsi ] && echo 'scsi add-single-device 0 0 0 0' > /proc/scsi/scsi } setup_keymap() { if [ "${DO_keymap}" ] then - if [ ! -e /dev/vc/0 ] + if [ ! -e /dev/vc/0 -a ! -e /dev/tty0 ] then DEVBIND=1 mount -o bind ${NEW_ROOT}/dev /dev @@ -407,90 +416,92 @@ setup_keymap() { fi fi } + chooseKeymap() { - good_msg "Loading keymaps" - cat /lib/keymaps/keymapList - read -t 10 -p '<< Load keymap (Enter for default): ' keymap - if [ -e /lib/keymaps/${keymap}.map ] - then - good_msg "Loading the ''${keymap}'' keymap" - loadkmap < /lib/keymaps/${keymap}.map - xkeymap=${keymap} - echo ${keymap} | egrep -e "[0-9]+" >/dev/null 2>&1 - if [ "$?" -eq '0' ]; then - xkeymap=`tail -n 7 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1` + good_msg "Loading keymaps" + cat /lib/keymaps/keymapList + read -t 10 -p '<< Load keymap (Enter for default): ' keymap + if [ -e /lib/keymaps/${keymap}.map ] + then + good_msg "Loading the ''${keymap}'' keymap" + loadkmap < /lib/keymaps/${keymap}.map + xkeymap=${keymap} + echo ${keymap} | egrep -e "[0-9]+" >/dev/null 2>&1 + if [ "$?" -eq '0' ] + then + xkeymap=`tail -n 7 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1` + fi + mkdir -p /etc/sysconfig + echo "XKEYBOARD=${xkeymap}" > /etc/sysconfig/keyboard + elif [ "$keymap" = '' ] + then + echo + good_msg "Keeping default keymap" + else + bad_msg "Sorry, but keymap ''${keymap}'' is invalid!" + chooseKeymap fi - mkdir -p /etc/sysconfig - echo "XKEYBOARD=${xkeymap}" > /etc/sysconfig/keyboard - elif [ "$keymap" = '' ] - then - echo - good_msg "Keeping default keymap" - else - bad_msg "Sorry, but keymap ''${keymap}'' is invalid!" - chooseKeymap - fi } startVolumes() { - #good_msg 'Checking if volumes need to be started...' - - if [ "${USE_DMRAID_NORMAL}" -eq '1' ] - then - if [ -e '/sbin/dmraid' ] + #good_msg 'Checking if volumes need to be started...' + + if [ "${USE_DMRAID_NORMAL}" -eq '1' ] then - good_msg "Activating Device-Mapper RAID(s)" - if [ '${DMRAID_OPTS}' = '' ] - then - /sbin/dmraid -ay - else - /sbin/dmraid -ay ${DMRAID_OPTS} - fi + if [ -e '/sbin/dmraid' ] + then + good_msg "Activating Device-Mapper RAID(s)" + if [ '${DMRAID_OPTS}' = '' ] + then + /sbin/dmraid -ay + else + /sbin/dmraid -ay ${DMRAID_OPTS} + fi + fi fi - fi - if [ "${USE_LVM2_NORMAL}" -eq '1' ] - then - if [ -e '/bin/vgscan' -a -e '/bin/vgchange' ] + if [ "${USE_LVM2_NORMAL}" -eq '1' ] then - for dev in ${RAID_DEVICES} - do - setup_md_device "${dev}" - done - - good_msg "Scanning for Volume Groups" - /bin/vgscan --ignorelockingfailure --mknodes 2>/dev/null - good_msg "Activating Volume Groups" - /bin/vgchange -ay --ignorelockingfailure 2>/dev/null - - # Disable EVMS since lvm2 is activated and they dont work together. - if [ "${USE_EVMS2_NORMAL}" -eq '1' ] - then - bad_msg "Disabling EVMS Support because LVM2 started" - bad_msg "Do not add dolvm2 to the cmdline if this is not what you want" - bad_msg "LVM2 and EVMS do not work well together" - USE_EVMS2_NORMAL=0 - fi - - else - bad_msg "vgscan or vgchange not found: skipping LVM2 volume group activation!" - fi + if [ -e '/bin/vgscan' -a -e '/bin/vgchange' ] + then + for dev in ${RAID_DEVICES} + do + setup_md_device "${dev}" + done - fi + good_msg "Scanning for Volume Groups" + /bin/vgscan --ignorelockingfailure --mknodes 2>/dev/null + good_msg "Activating Volume Groups" + /bin/vgchange -ay --ignorelockingfailure 2>/dev/null - if [ "${USE_EVMS2_NORMAL}" -eq '1' ] - then - if [ -e '/sbin/evms_activate' ] + # Disable EVMS since lvm2 is activated and they dont work together. + if [ "${USE_EVMS2_NORMAL}" -eq '1' ] + then + bad_msg "Disabling EVMS Support because LVM2 started" + bad_msg "Do not add dolvm2 to the cmdline if this is not what you want" + bad_msg "LVM2 and EVMS do not work well together" + USE_EVMS2_NORMAL=0 + fi + else + bad_msg "vgscan or vgchange not found: skipping LVM2 volume group activation!" + fi + fi + + if [ "${USE_EVMS2_NORMAL}" -eq '1' ] then - good_msg "Activating EVMS" - evms_activate + if [ -e '/sbin/evms_activate' ] + then + good_msg "Activating EVMS" + evms_activate + fi fi - fi } sdelay() { - # Sleep a specific number of seconds if SDELAY is set otherwise only 1 second - if [ -n "${SDELAY}" ]; then + # Sleep a specific number of seconds if SDELAY is set otherwise only sleep + # 1 second + if [ -n "${SDELAY}" ] + then sleep ${SDELAY} else sleep 1 @@ -498,33 +509,33 @@ sdelay() { } quiet_kmsg() { - # if QUIET is set make the kernel less chatty - [ -n "$QUIET" ] && echo '0' > /proc/sys/kernel/printk + # if QUIET is set make the kernel less chatty + [ -n "$QUIET" ] && echo '0' > /proc/sys/kernel/printk } verbose_kmsg() { - # if QUIET is set make the kernel less chatty - [ -n "$QUIET" ] && echo '6' > /proc/sys/kernel/printk + # if QUIET is set make the kernel less chatty + [ -n "$QUIET" ] && echo '6' > /proc/sys/kernel/printk } cdupdate() { if [ "${CDROOT}" -eq '1' ] then - if [ -x /${NEW_ROOT}/mnt/cdrom/cdupdate.sh ] - then - good_msg "Running cdupdate.sh" + if [ -x /${NEW_ROOT}/mnt/cdrom/cdupdate.sh ] + then + good_msg "Running cdupdate.sh" ${NEW_ROOT}/mnt/cdrom/cdupdate.sh if [ "$?" != '0' ] then - splash 'verbose' - bad_msg "FAILED TO EXECUTE cdupdate.sh" - run_shell + splash 'verbose' + bad_msg "Executing cdupdate.sh failed!" + run_shell fi else - good_msg 'No cdupdate.sh script found, skipping...' - fi - fi + good_msg 'No cdupdate.sh script found, skipping...' + fi + fi } setup_md_device() { @@ -541,20 +552,21 @@ setup_md_device() { then mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 2>&1 [ "$?" -ne 0 ] && bad_msg "Creation of /dev/md${MD_NUMBER} failed..." - fi + fi mdstart ${MDPART} /dev/md${MD_NUMBER} - fi + fi } -rundebugshell(){ - if [ -n "$DEBUG" ]; then - good_msg 'Starting debug shell as requested by "debug" option.' - good_msg 'Type "exit" to continue with normal bootup.' - [ -x /bin/sh ] && /bin/sh || /bin/ash - fi +rundebugshell() { + if [ -n "$DEBUG" ] + then + good_msg 'Starting debug shell as requested by "debug" option.' + good_msg 'Type "exit" to continue with normal bootup.' + [ -x /bin/sh ] && /bin/sh || /bin/ash + fi } -setup_unionfs(){ +setup_unionfs() { if [ "${USE_UNIONFS_NORMAL}" -eq '1' -a "${CDROOT}" -eq '1' ] then # Directory used for rw changes in union mount filesystem @@ -567,7 +579,6 @@ setup_unionfs(){ CHANGES=$MEMORY/unionfs_changes/$UID fi - mkdir -p ${MEMORY} mkdir -p ${UNION} good_msg "Loading unionfs module" @@ -577,8 +588,8 @@ setup_unionfs(){ CHANGESDEV=${UNIONFS} good_msg "mounting $CHANGESDEV to $MEMORY for unionfs support" mount -t auto $CHANGESDEV $MEMORY - # mount tmpfs only in the case when changes= boot parameter was empty - # or we were not able to mount the storage device + # mount tmpfs only in the case when changes= boot parameter was + # empty or we were not able to mount the storage device ret=$? if [ "${ret}" -ne 0 ] then @@ -597,7 +608,7 @@ setup_unionfs(){ good_msg "Mounting ramdisk to $MEMORY for unionfs support..." mount -t tmpfs tmpfs $MEMORY fi - + mkdir -p $CHANGES mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} ret=$? diff --git a/generic/linuxrc b/generic/linuxrc index 0d2bdfd..73c748d 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -8,6 +8,7 @@ splash() { return 0 } + [ -e /etc/initrd.splash ] && . /etc/initrd.splash # Clean input/output @@ -34,29 +35,28 @@ mount -t proc proc /proc # Set up symlinks if [ "$0" = '/init' ] then - /bin/busybox --install -s + /bin/busybox --install -s - [ -e /linuxrc ] && rm /linuxrc - - if [ -e /sbin/udev ] - then - if [ ! -e /sbin/udevstart ] + [ -e /linuxrc ] && rm /linuxrc + + if [ -e /sbin/udev ] then - ln -s /sbin/udev /sbin/udevstart + if [ ! -e /sbin/udevstart ] + then + ln -s /sbin/udev /sbin/udevstart + fi + + if [ ! -e /sbin/udevsend ] + then + ln -s /sbin/udev /sbin/udevsend + fi fi - - if [ ! -e /sbin/udevsend ] + + if [ -e /bin/lvm ] then - ln -s /sbin/udev /sbin/udevsend + ln -s /bin/lvm /bin/vgscan + ln -s /bin/lvm /bin/vgchange fi - - fi - - if [ -e /bin/lvm ] - then - ln -s /bin/lvm /bin/vgscan - ln -s /bin/lvm /bin/vgchange - fi fi quiet_kmsg @@ -66,136 +66,126 @@ CMDLINE="`cat /proc/cmdline`" REAL_ROOT='' for x in ${CMDLINE} do - case "${x}" in - real_root\=*) - REAL_ROOT=`parse_opt "${x}"` - ;; - subdir\=*) - SUBDIR=`parse_opt "${x}"` - ;; - real_init\=*) - REAL_INIT=`parse_opt "${x}"` - ;; - - # Livecd options - cdroot) - CDROOT=1 - ;; - cdroot\=*) - CDROOT=1 - CDROOT_DEV=`parse_opt "${x}"` - ;; - - # Start livecd loop and looptype options - loop\=*) - LOOP=`parse_opt "${x}"` - ;; - looptype\=*) - LOOPTYPE=`parse_opt "${x}"` - ;; - - # Start Device Manager options - devfs) - USE_DEVFS_NORMAL=1 - USE_UDEV_NORMAL=0 - ;; - udev) - USE_DEVFS_NORMAL=0 - USE_UDEV_NORMAL=1 - ;; - unionfs) - if [ ! -x /sbin/unionctl ] - then - USE_UNIONFS_NORMAL=0 - bad_msg 'Unionctl not found: aborting use of unionfs!' - else - USE_UNIONFS_NORMAL=1 - fi - ;; - unionfs\=*) - if [ ! -x /sbin/unionctl ] - then - USE_UNIONFS_NORMAL=0 - bad_msg 'Unionctl not found: aborting use of unionfs!' - else - USE_UNIONFS_NORMAL=1 - CMD_UNIONFS=`parse_opt "${x}"` - echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1 - if [ "$?" -eq '0' ] - then - UID=`echo ${CMD_UNIONFS#*,}` - UNIONFS=`echo ${CMD_UNIONFS%,*}` - else - UNIONFS=${CMD_UNIONFS} - fi - fi - ;; - - # Start Volume manager options - dolvm2) - USE_LVM2_NORMAL=1 - ;; - dodmraid) - USE_DMRAID_NORMAL=1 - ;; - dodmraid\=*) - DMRAID_OPTS=`parse_opt "${x}"` - USE_DMRAID_NORMAL=1 - ;; - doevms2) - USE_EVMS2_NORMAL=1 - ;; - # Debug Options - debug) - DEBUG='yes' - ;; - - # Scan delay options - scandelay\=*) - SDELAY=`parse_opt "${x}"` - ;; - scandelay) - SDELAY=10 - ;; - - # Module no-loads - doload\=*) - MDOLIST=`parse_opt "${x}"` - MDOLIST="`echo ${MDOLIST} | sed -e \"s/,/ /g\"`" - ;; - nodetect) - NODETECT=1 - ;; - noload\=*) - MLIST=`parse_opt "${x}"` - MLIST="`echo ${MLIST} | sed -e \"s/,/ /g\"`" - export MLIST - ;; - - # Redirect output to a specific tty - CONSOLE\=*) - CONSOLE=`parse_opt "${x}"` - exec >${CONSOLE} <${CONSOLE} 2>&1 - ;; - - # /dev/md - lvmraid\=*) - RAID_DEVICES="`parse_opt ${x}`" - RAID_DEVICES="`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`" - ;; - - part\=*) - MDPART=`parse_opt "${x}"` - ;; - - # NFS - ip\=*) - IP=`parse_opt "${x}"` - ;; - nfsroot\=*) - NFSROOT=`parse_opt "${x}"` - ;; - esac + case "${x}" in + real_root\=*) + REAL_ROOT=`parse_opt "${x}"` + ;; + subdir\=*) + SUBDIR=`parse_opt "${x}"` + ;; + real_init\=*) + REAL_INIT=`parse_opt "${x}"` + ;; + # Livecd options + cdroot) + CDROOT=1 + ;; + cdroot\=*) + CDROOT=1 + CDROOT_DEV=`parse_opt "${x}"` + ;; + # Start livecd loop and looptype options + loop\=*) + LOOP=`parse_opt "${x}"` + ;; + looptype\=*) + LOOPTYPE=`parse_opt "${x}"` + ;; + # Start Device Manager options + devfs) + USE_DEVFS_NORMAL=1 + USE_UDEV_NORMAL=0 + ;; + udev) + USE_DEVFS_NORMAL=0 + USE_UDEV_NORMAL=1 + ;; + unionfs) + if [ ! -x /sbin/unionctl ] + then + USE_UNIONFS_NORMAL=0 + bad_msg 'Unionctl not found: aborting use of unionfs!' + else + USE_UNIONFS_NORMAL=1 + fi + ;; + unionfs\=*) + if [ ! -x /sbin/unionctl ] + then + USE_UNIONFS_NORMAL=0 + bad_msg 'Unionctl not found: aborting use of unionfs!' + else + USE_UNIONFS_NORMAL=1 + CMD_UNIONFS=`parse_opt "${x}"` + echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1 + if [ "$?" -eq '0' ] + then + UID=`echo ${CMD_UNIONFS#*,}` + UNIONFS=`echo ${CMD_UNIONFS%,*}` + else + UNIONFS=${CMD_UNIONFS} + fi + fi + ;; + # Start Volume manager options + dolvm2) + USE_LVM2_NORMAL=1 + ;; + dodmraid) + USE_DMRAID_NORMAL=1 + ;; + dodmraid\=*) + DMRAID_OPTS=`parse_opt "${x}"` + USE_DMRAID_NORMAL=1 + ;; + doevms2) + USE_EVMS2_NORMAL=1 + ;; + # Debug Options + debug) + DEBUG='yes' + ;; + # Scan delay options + scandelay\=*) + SDELAY=`parse_opt "${x}"` + ;; + scandelay) + SDELAY=10 + ;; + # Module no-loads + doload\=*) + MDOLIST=`parse_opt "${x}"` + MDOLIST="`echo ${MDOLIST} | sed -e \"s/,/ /g\"`" + ;; + nodetect) + NODETECT=1 + ;; + noload\=*) + MLIST=`parse_opt "${x}"` + MLIST="`echo ${MLIST} | sed -e \"s/,/ /g\"`" + export MLIST + ;; + # Redirect output to a specific tty + CONSOLE\=*) + CONSOLE=`parse_opt "${x}"` + exec >${CONSOLE} <${CONSOLE} 2>&1 + ;; + # /dev/md + lvmraid\=*) + RAID_DEVICES="`parse_opt ${x}`" + RAID_DEVICES="`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`" + ;; + part\=*) + MDPART=`parse_opt "${x}"` + ;; + # NFS + ip\=*) + IP=`parse_opt "${x}"` + ;; + nfsroot\=*) + NFSROOT=`parse_opt "${x}"` + ;; + esac done splash 'init' @@ -206,25 +196,24 @@ cmdline_hwopts # Load modules listed in MY_HWOPTS if /lib/modules exists if [ -d '/lib/modules' ] then - good_msg 'Loading modules' - # Load appropriate kernel modules - if [ "${NODETECT}" -ne '1' ] - then - for modules in $MY_HWOPTS - do - modules_scan $modules - eval DO_`echo $modules | sed 's/-//'`=1 - done - fi - - # Always eval doload=... - modules_load $MDOLIST + good_msg 'Loading modules' + # Load appropriate kernel modules + if [ "${NODETECT}" -ne '1' ] + then + for modules in $MY_HWOPTS + do + modules_scan $modules + eval DO_`echo $modules | sed 's/-//'`=1 + done + fi + # Always eval doload=... + modules_load $MDOLIST else - for modules in $MY_HWOPTS - do - eval DO_`echo $modules | sed 's/-//'`=1 - done - good_msg 'Skipping module load; no modules in the initrd!' + for modules in $MY_HWOPTS + do + eval DO_`echo $modules | sed 's/-//'`=1 + done + good_msg 'Skipping module load; no modules in the initrd!' fi # Mount sysfs @@ -279,10 +268,11 @@ then cp /dev/loop0 ${NEW_ROOT}/dev fi - # Required for gensplash to work. Not an issue with the initrd as this device isnt created there and is not needed. + # Required for gensplash to work. Not an issue with the initrd as this + # device isnt created there and is not needed. if [ -e /dev/tty1 ] then - cp /dev/tty1 ${NEW_ROOT}/dev + cp /dev/tty1 ${NEW_ROOT}/dev fi if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ] @@ -441,16 +431,16 @@ then if [ -e "${NEW_ROOT}/mnt/cdrom/livecd.loop" ]; then LOOP='/livecd.loop' LOOPTYPE='normal' - elif [ -e "${NEW_ROOT}/mnt/cdrom/zisofs" ]; then + elif [ -e "${NEW_ROOT}/mnt/cdrom/zisofs" ]; then LOOP='/zisofs' LOOPTYPE='zisofs' - elif [ -e "${NEW_ROOT}/mnt/cdrom/livecd.squashfs" ]; then + elif [ -e "${NEW_ROOT}/mnt/cdrom/livecd.squashfs" ]; then LOOP='/livecd.squashfs' LOOPTYPE='squashfs' - elif [ -e "${NEW_ROOT}/mnt/cdrom/livecd.gcloop" ]; then + elif [ -e "${NEW_ROOT}/mnt/cdrom/livecd.gcloop" ]; then LOOP='/livecd.gcloop' LOOPTYPE='gcloop' - else + else LOOPTYPE='noloop' fi fi @@ -637,8 +627,8 @@ cdupdate if [ "${SUBDIR}" != '' -a -e "${CHROOT}/${SUBDIR}" ] then - good_msg"Entering ${SUBDIR} to boot" - CHROOT=${CHROOT}/${SUBDIR} + good_msg"Entering ${SUBDIR} to boot" + CHROOT=${CHROOT}/${SUBDIR} fi verbose_kmsg @@ -682,7 +672,7 @@ then echo -n '.' # /usr/src/linux/Documentation/initrd.txt: - # exec chroot . /sbin/init /dev/console 2>&1 + # exec chroot . /sbin/init /dev/console 2>&1 exec dev/console 2>&1 echo '.' @@ -693,41 +683,41 @@ then EOF elif [ "$0" = '/init' ] then - [ ! -e /${CHROOT}/dev/console ] && mknod /${CHROOT}/dev/console c 5 1 - [ ! -e /${CHROOT}/dev/tty1 ] && mknod /${CHROOT}/dev/tty1 c 4 1 - echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)..." - - cd ${CHROOT} - mkdir /${CHROOT}/proc /${CHROOT}/sys 2>/dev/null - echo -n '.' - umount /dev || echo '*: Failed to unmount the initrd /dev!' - umount /sys || echo '*: Failed to unmount the initrd /sys!' - umount /proc || echo '*: Failed to unmount the initrd /proc!' - echo -n '.' - - exec <${CONSOLE} >${CONSOLE} 2>&1 - echo '.' - - # Cleanup initramfs in the background - # to reclaim initramfs tmpfs memoryspace - - - INITRAMFS_FILES=`ls /` - INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|${CHROOT#/}||g"` - - if [ -n "${MEMORY}" ] - then + [ ! -e /${CHROOT}/dev/console ] && mknod /${CHROOT}/dev/console c 5 1 + [ ! -e /${CHROOT}/dev/tty1 ] && mknod /${CHROOT}/dev/tty1 c 4 1 + echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)..." + + cd ${CHROOT} + mkdir /${CHROOT}/proc /${CHROOT}/sys 2>/dev/null + echo -n '.' + umount /dev || echo '*: Failed to unmount the initrd /dev!' + umount /sys || echo '*: Failed to unmount the initrd /sys!' + umount /proc || echo '*: Failed to unmount the initrd /proc!' + echo -n '.' + + exec <${CONSOLE} >${CONSOLE} 2>&1 + echo '.' + + # Cleanup initramfs in the background + # to reclaim initramfs tmpfs memoryspace + + + INITRAMFS_FILES=`ls /` + INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|${CHROOT#/}||g"` + + if [ -n "${MEMORY}" ] + then INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|${MEMORY#/}||g"` - fi - - if [ -n "${UNION}" ] - then - INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|${UNION#/}||g"` - fi - - INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|newroot||g"` - for i in ${INITRAMFS_FILES} - do + fi + + if [ -n "${UNION}" ] + then + INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|${UNION#/}||g"` + fi + + INITRAMFS_FILES=`echo ${INITRAMFS_FILES}|sed -e "s|newroot||g"` + for i in ${INITRAMFS_FILES} + do for j in `/bin/busybox find /$i 2>/dev/null` do if /bin/busybox [ ! -d "$j" -a "$j" != "/bin/busybox" ] @@ -742,13 +732,13 @@ then /bin/busybox rm -r "$j" fi done - done - # End initramfs cleanup + done + # End initramfs cleanup - # Start the real root init - (/bin/busybox sleep 3; /bin/busybox rm /dev -r; /bin/busybox rm /bin/busybox) & - exec /bin/busybox chroot . /bin/sh <<- EOF - exec /sbin/init ${REAL_INIT} + # Start the real root init + (/bin/busybox sleep 3; /bin/busybox rm /dev -r; /bin/busybox rm /bin/busybox) & + exec /bin/busybox chroot . /bin/sh <<- EOF + exec /sbin/init ${REAL_INIT} EOF fi diff --git a/genkernel b/genkernel index f07207b..71fd908 100755 --- a/genkernel +++ b/genkernel @@ -2,7 +2,7 @@ # Genkernel v3 PATH="/bin:/usr/bin:/sbin:/usr/sbin" -GK_V='3.3.11' +GK_V='3.3.11b' TMPDIR='/var/tmp/genkernel' TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified. diff --git a/x86/busy-config b/x86/busy-config index dd6b333..4bd7560 100644 --- a/x86/busy-config +++ b/x86/busy-config @@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_VERBOSE_USAGE is not set # CONFIG_FEATURE_INSTALLER is not set # CONFIG_LOCALE_SUPPORT is not set -CONFIG_FEATURE_DEVFS=y +# CONFIG_FEATURE_DEVFS is not set CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SUID is not set diff --git a/x86/modules_load b/x86/modules_load index 93d4f60..0f80a4b 100644 --- a/x86/modules_load +++ b/x86/modules_load @@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid" MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs" MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd" MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr" -MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr" +MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10" MODULES_DMRAID="dm-mod dm-mirror" MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma" diff --git a/x86_64/busy-config b/x86_64/busy-config index dd6b333..4bd7560 100644 --- a/x86_64/busy-config +++ b/x86_64/busy-config @@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_VERBOSE_USAGE is not set # CONFIG_FEATURE_INSTALLER is not set # CONFIG_LOCALE_SUPPORT is not set -CONFIG_FEATURE_DEVFS=y +# CONFIG_FEATURE_DEVFS is not set CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SUID is not set diff --git a/x86_64/modules_load b/x86_64/modules_load index 93d4f60..0f80a4b 100644 --- a/x86_64/modules_load +++ b/x86_64/modules_load @@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid" MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs" MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd" MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr" -MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr" +MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10" MODULES_DMRAID="dm-mod dm-mirror" MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma" diff --git a/xen0/busy-config b/xen0/busy-config index dd6b333..4bd7560 100644 --- a/xen0/busy-config +++ b/xen0/busy-config @@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_VERBOSE_USAGE is not set # CONFIG_FEATURE_INSTALLER is not set # CONFIG_LOCALE_SUPPORT is not set -CONFIG_FEATURE_DEVFS=y +# CONFIG_FEATURE_DEVFS is not set CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SUID is not set diff --git a/xen0/modules_load b/xen0/modules_load index 93d4f60..0f80a4b 100644 --- a/xen0/modules_load +++ b/xen0/modules_load @@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid" MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs" MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd" MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr" -MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr" +MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10" MODULES_DMRAID="dm-mod dm-mirror" MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma" diff --git a/xenU/busy-config b/xenU/busy-config index dd6b333..4bd7560 100644 --- a/xenU/busy-config +++ b/xenU/busy-config @@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_VERBOSE_USAGE is not set # CONFIG_FEATURE_INSTALLER is not set # CONFIG_LOCALE_SUPPORT is not set -CONFIG_FEATURE_DEVFS=y +# CONFIG_FEATURE_DEVFS is not set CONFIG_FEATURE_DEVPTS=y # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SUID is not set diff --git a/xenU/modules_load b/xenU/modules_load index 93d4f60..0f80a4b 100644 --- a/xenU/modules_load +++ b/xenU/modules_load @@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid" MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs" MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd" MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr" -MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr" +MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10" MODULES_DMRAID="dm-mod dm-mirror" MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma" -- 2.26.2