Index: ChangeLog =================================================================== --- ChangeLog (revision 580) +++ ChangeLog (working copy) @@ -2,6 +2,49 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 04 Feb 2008; Andrew Gaffney generic/initrd.scripts: + Change &>/dev/null to >/dev/null 2>&1 because busybox ash sucks + + 04 Feb 2008; Andrew Gaffney generic/initrd.scripts, + generic/linuxrc: + Switch to double quotes where we're interpolating variables, because I suck + + 03 Feb 2008; Andrew Gaffney sparc64/modules_load: + Add qla2xxx to sparc64's MODULES_SCSI + + 03 Feb 2008; Andrew Gaffney gen_cmdline.sh, + gen_determineargs.sh, gen_moddeps.sh: + Add --all-initrd-modules option to copy all kernel modules into + initrd/ramfs. This is useful for netboot images + + 03 Feb 2008; Andrew Gaffney generic/initrd.scripts, + generic/linuxrc: + Add setup_hotplug() function that runs before the modules are loaded to + setup mdev as the hotplug event handler. Add $KV to /lib/modules anywhere it + occurs to allow for an initramfs with multiple sets of modules + + 03 Feb 2008; Andrew Gaffney gen_configkernel.sh, + genkernel.conf: + Clean up OLDCONFIG logic and default to OLDCONFIG=yes. This is for bug 207895 + + 02 Feb 2008; Chris Gianelloni generic/linuxrc: + Moving the code to start resume operations so it doesn't run when booting + from CD. We also don't execute the code if there's no real_resume set on the + command line, since it will fail, anyway, without it. + + 02 Feb 2008; Andrew Gaffney alpha/modules_load, + ia64/modules_load, ppc/modules_load, ppc64/modules_load, um/modules_load, + x86/modules_load, x86_64/modules_load, xen0/modules_load, + xenU/modules_load: + add megaraid module to MODULES_SCSI for bug 206039 + + 02 Feb 2008; Andrew Gaffney generic/modprobe: + specify the kernel version when looking for a module for bug 208593 + + 02 Feb 2008; Chris Gianelloni + generic/initrd.defaults, generic/initrd.scripts: + Removed runUdev, since we no longer use it. + 11 Jan 2008; Chris Gianelloni gen_initramfs.sh, gen_initrd.sh, genkernel: Fixing a problem where we were copying the busybox binary cache into the Index: generic/initrd.scripts =================================================================== --- generic/initrd.scripts (revision 580) +++ generic/initrd.scripts (working copy) @@ -50,7 +50,7 @@ then [ -n "${DEBUG}" ] && echo -ne "${BOLD} ::${NORMAL} Checking for ${x}..." # find -name does not work since the return status is always zero - if find /lib/modules | grep /"${x}${KSUFF}" >/dev/null 2>&1 + if find /lib/modules/${KV} | grep /"${x}${KSUFF}" >/dev/null 2>&1 then echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..." modprobe ${x} -n @@ -99,7 +99,7 @@ # else # mount -r -t auto ${x} ${mntdir} &>/dev/null # fi - mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} &>/dev/null + mount -r -t ${CDROOT_TYPE} ${x} ${mntdir} >/dev/null 2>&1 if [ "$?" = '0' ] then # Check for the media @@ -269,8 +269,8 @@ else bad_msg "NFS Mounting failed. Is the path correct ?" fi - # FIXME: Need to start portmap and the other rpc daemons in order to - # FIXME: remount rw. + # FIXME: Need to start portmap and the other rpc daemons in + # order to remount rw. fi fi @@ -297,38 +297,9 @@ /bin/ash } -runUdev() { - mount -t tmpfs -o size=100k udev /dev - mkdir /dev/pts - mkdir /dev/shm - echo > /proc/sys/kernel/hotplug - /sbin/udevd --daemon - mkdir -p /dev/.udev/queue - /sbin/udevtrigger - - good_msg 'Letting udev process events' - loop=0 - while test -d /dev/.udev/queue; do - sleep 1; - test "$loop" -gt 30 && break - loop=$(($loop + 1)) - done - good_msg "Udev finished proccsing after $loop iterations" - - killall udevd > /dev/null 2>&1 - ln -snf /proc/self/fd /dev/fd - ln -snf /proc/self/fd/0 /dev/stdin - ln -snf /proc/self/fd/1 /dev/stdout - ln -snf /proc/self/fd/2 /dev/stderr - ln -snf /proc/kcore /dev/core -} - runmdev() { # busybox udev replacement mdev -s - - # catch udev hotplug events - echo /sbin/mdev > /proc/sys/kernel/hotplug } test_success() { @@ -379,7 +350,8 @@ } whereis(){ - # $1 = variable whose value is the path (examples: "REAL_ROOT", "LUKS_KEYDEV") + # $1 = variable whose value is the path (examples: "REAL_ROOT", + # "LUKS_KEYDEV") # $2 = label # $3 = optional explanations for failure @@ -416,6 +388,22 @@ mount -o bind ${NEW_ROOT}/dev /dev } +setup_hotplug() { + # Check udev is available... + if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ] + then + USE_UDEV_NORMAL=1 + else + USE_UDEV_NORMAL=0 + fi + + if [ "${USE_UDEV_NORMAL}" = '1' ] + then + # catch udev hotplug events + echo /sbin/mdev > /proc/sys/kernel/hotplug + fi +} + start_dev_mgr() { # Check udev is available... if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ] @@ -431,7 +419,6 @@ [ "${DO_slowusb}" ] && sleep 10 kill_devfsd good_msg 'Activating mdev' -# runUdev runmdev [ "${DO_slowusb}" ] && sleep 20 cd / @@ -486,9 +473,9 @@ } load_modules() { - # Load modules listed in MY_HWOPTS if /lib/modules exists + # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -d '/lib/modules' ] + if [ -d "/lib/modules/${KV}" ] then good_msg 'Loading modules' # Load appropriate kernel modules Index: generic/initrd.defaults =================================================================== --- generic/initrd.defaults (revision 580) +++ generic/initrd.defaults (working copy) @@ -52,7 +52,7 @@ KMAJOR=`echo $KV | cut -f1 -d.` KMINOR=`echo $KV | cut -f2 -d.` KVER="${KMAJOR}.${KMINOR}" -MISCOPTS='idebug detect' +MISCOPTS='debug detect' if [ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' ] then Index: generic/linuxrc =================================================================== --- generic/linuxrc (revision 580) +++ generic/linuxrc (working copy) @@ -220,8 +220,11 @@ detect_sbp2_devices cmdline_hwopts -# Load modules listed in MY_HWOPTS if /lib/modules exists -if [ -d '/lib/modules' ] +# Setup hotplugging for firmware loading +setup_hotplug + +# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel +if [ -d "/lib/modules/${KV}" ] then good_msg 'Loading modules' # Load appropriate kernel modules @@ -262,6 +265,13 @@ if [ "${CDROOT}" != 1 ] then startLUKS + if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ] + then + swsusp_resume +# suspend_resume +# suspend2_resume + tuxonice_resume + fi fi # Set up unionfs @@ -278,14 +288,6 @@ # Run debug shell if requested rundebugshell -if [ "${NORESUME}" != '1' ] -then - swsusp_resume -# suspend_resume -# suspend2_resume - tuxonice_resume -fi - if [ "${CDROOT}" = '1' ] then if [ ! "${USE_UNIONFS_NORMAL}" = '1' ] Index: generic/modprobe =================================================================== --- generic/modprobe (revision 580) +++ generic/modprobe (working copy) @@ -63,7 +63,7 @@ real_mod_path() { # Find -name is no good since the return status is always zero - find /lib/modules | grep /"${1}${KSUFF}" + find "/lib/modules/${KV}" | grep /"${1}${KSUFF}" } modprobe2() { Index: um/modules_load =================================================================== --- um/modules_load (revision 580) +++ um/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: sparc64/modules_load =================================================================== --- sparc64/modules_load (revision 580) +++ sparc64/modules_load (working copy) @@ -1,4 +1,4 @@ -MODULES_SCSI="" +MODULES_SCSI="qla2xxx" MODULES_FIREWIRE="" MODULES_ATARAID="" MODULES_PCMCIA="" Index: ppc/modules_load =================================================================== --- ppc/modules_load (revision 580) +++ ppc/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: alpha/modules_load =================================================================== --- alpha/modules_load (revision 580) +++ alpha/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: ia64/modules_load =================================================================== --- ia64/modules_load (revision 580) +++ ia64/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: gen_configkernel.sh =================================================================== --- gen_configkernel.sh (revision 580) +++ gen_configkernel.sh (working copy) @@ -44,14 +44,9 @@ print_info 1 ' Previous config backed up to .config.bak' cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!' fi - if isTrue "${CLEAN}" || isTrue "${OLDCONFIG}" + if isTrue "${OLDCONFIG}" then - if ! isTrue "${CLEAN}" - then - print_info 1 'config: >> Running oldconfig...' - else - print_info 1 ' >> Running oldconfig...' - fi + print_info 1 ' >> Running oldconfig...' yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null fi if isTrue "${CLEAN}" Index: gen_cmdline.sh =================================================================== --- gen_cmdline.sh (revision 580) +++ gen_cmdline.sh (working copy) @@ -40,6 +40,7 @@ echo " --symlink Manage symlinks in /boot for installed images" echo " --no-symlink Do not manage symlinks" echo " --no-initrdmodules Don't copy any modules to the initrd" + echo " --all-initrd-modules Copy all kernel modules to the initrd" echo " --callback=<...> Run the specified arguments after the" echo " kernel and modules have been compiled" echo " --static Build a static (monolithic kernel)." @@ -368,6 +369,10 @@ CMD_NOINITRDMODULES=1 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}" ;; + --all-initrd-modules) + CMD_ALLINITRDMODULES=1 + print_info 2 "CMD_ALLINITRDMODULES: ${CMD_ALLINITRDMODULES}" + ;; --callback=*) CMD_CALLBACK=`parse_opt "$*"` print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" Index: xenU/modules_load =================================================================== --- xenU/modules_load (revision 580) +++ xenU/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: x86/modules_load =================================================================== --- x86/modules_load (revision 580) +++ x86/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: gen_determineargs.sh =================================================================== --- gen_determineargs.sh (revision 580) +++ gen_determineargs.sh (working copy) @@ -99,6 +99,7 @@ set_config_with_override 2 MODULESPACKAGE CMD_MODULESPACKAGE set_config_with_override 2 KERNCACHE CMD_KERNCACHE set_config_with_override 1 NOINITRDMODULES CMD_NOINITRDMODULES + set_config_with_override 1 ALLINITRDMODULES CMD_ALLINITRDMODULES set_config_with_override 2 INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY set_config_with_override 1 MOUNTBOOT CMD_MOUNTBOOT set_config_with_override 1 BUILD_STATIC CMD_STATIC Index: ppc64/modules_load =================================================================== --- ppc64/modules_load (revision 580) +++ ppc64/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: gen_moddeps.sh =================================================================== --- gen_moddeps.sh (revision 580) +++ gen_moddeps.sh (working copy) @@ -1,6 +1,6 @@ #!/bin/bash -modules_dep_list() +modules_kext() { if [ "${PAT}" -gt "4" ] then @@ -8,6 +8,12 @@ else KEXT=".o" fi + echo ${KEXT} +} + +modules_dep_list() +{ + KEXT=$(modules_kext) if [ -f ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep ] then cat ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\: -f2 @@ -54,16 +60,20 @@ gen_dep_list() { - local group_modules - rm -f ${TEMP}/moddeps > /dev/null + if [ "${ALLINITRDMODULES}" = "1" ]; then + strip_mod_paths $(find "${INSTALL_MOD_PATH}/lib/modules/${KV}" -name "*$(modules_kext)") | sort + else + local group_modules + rm -f ${TEMP}/moddeps > /dev/null - for group_modules in ${!MODULES_*}; do - gen_deps ${!group_modules} - done + for group_modules in ${!MODULES_*}; do + gen_deps ${!group_modules} + done - # Only list each module once - if [ -f ${TEMP}/moddeps ] - then - cat ${TEMP}/moddeps | sort | uniq + # Only list each module once + if [ -f ${TEMP}/moddeps ] + then + cat ${TEMP}/moddeps | sort | uniq + fi fi } Index: genkernel.conf =================================================================== --- genkernel.conf (revision 580) +++ genkernel.conf (working copy) @@ -8,9 +8,7 @@ # =========Common Command Line Option Defaults========= # Run 'make oldconfig' before compiling this kernel? -# If set to "yes", also suppresses the fetch of the kernel .config file from -# /etc/kernels, thus preserving the .config file in /usr/src/linux. -# OLDCONFIG="no" +OLDCONFIG="yes" # Run 'make menuconfig' before compiling this kernel? MENUCONFIG="no" Index: x86_64/modules_load =================================================================== --- x86_64/modules_load (revision 580) +++ x86_64/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3" Index: xen0/modules_load =================================================================== --- xen0/modules_load (revision 580) +++ xen0/modules_load (working copy) @@ -26,7 +26,7 @@ seagate t128 u14-34f ultrastor wd7000 NCR53c406a sym53c8xx dmx3191d imm \ in2000 ips qla1280 sim710 sym53c416 dc395x atp870u mptbase mptscsih \ mptspi mptfc mptsas 3w-xxxx 3w-9xxx cpqarray cciss DAC960 sx8 aacraid \ -megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" +megaraid megaraid_mbox megaraid_mm megaraid_sas lpfc scsi_transport_fc scsi_wait_scan" # Hardware (Network) MODULES_NET="e1000 tg3"