diff options
-rw-r--r-- | break.txt | 4 | ||||
-rw-r--r-- | debian/changelog | 87 | ||||
-rw-r--r-- | debian/initramfs-tools.postinst | 5 | ||||
-rwxr-xr-x | hooks/thermal (renamed from hooks/acpid) | 6 | ||||
-rwxr-xr-x | hooks/udev | 35 | ||||
-rwxr-xr-x | init | 69 | ||||
-rwxr-xr-x | mkinitramfs | 1 | ||||
-rw-r--r-- | scripts/functions | 92 | ||||
-rwxr-xr-x | scripts/init-premount/thermal (renamed from scripts/init-premount/acpid) | 4 | ||||
-rw-r--r-- | scripts/local | 11 | ||||
-rw-r--r-- | scripts/nfs | 1 |
11 files changed, 153 insertions, 162 deletions
diff --git a/break.txt b/break.txt new file mode 100644 index 0000000..ff26d5b --- /dev/null +++ b/break.txt @@ -0,0 +1,4 @@ +if [ x${break} = xyes ]; then + panic "Spawning shell within the initramfs" +fi + diff --git a/debian/changelog b/debian/changelog index a76d5bd..6a95f20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,92 @@ initramfs-tools (0.42) unstable; urgency=low that use the mptscsih. Thanks dann frazier <dannf@hp.com> for the patch. (Closes: #341162) - -- maximilian attems <maks@sternwelten.at> Thu, 1 Dec 2005 16:42:12 +0100 + * Resync with 0.40ubuntu7. + - Do the udev split by hand as we have a different udev invocation + supporting linux < 2.6.15. Increment udev dep to the version with + initramfs hooks. + - Debian's klibc hasn't yet the nanosleep, waiting for unbroken + linux-headers. + - Don't remove resume support from /etc/mkinitramfs/initramfs.conf + even if bootloader setting is preferred. + + -- maximilian attems <maks@sternwelten.at> Mon, 5 Dec 2005 12:59:59 +0100 + +initramfs-tools (0.40ubuntu7) dapper; urgency=low + + * remove "sleep 3" from the nfs script before the nfsmount command, + its a leftover from debugging in breezy and slows down thin client + booting unnecessary + + -- Oliver Grawert <ogra@ubuntu.com> Fri, 2 Dec 2005 11:45:05 +0100 + +initramfs-tools (0.40ubuntu6) dapper; urgency=low + + * When panicking, fork an interactive subshell rather than execing it, so + that if the user fixes things up and exits, we continue rather than + panic the kernel. + * Call update-initramfs in postinst to regenerate the latest initramfs on + upgrades + + -- Matt Zimmerman <mdz@ubuntu.com> Thu, 1 Dec 2005 22:23:09 -0800 + +initramfs-tools (0.40ubuntu5) dapper; urgency=low + + * Wait up to 10 seconds for the root device to appear before failing, + allowing SCSI and USB controllers time to settle. There's almost + certainly a more elegant way to do this generically for all mountroot + functions, but for now this will suffice. + + -- Scott James Remnant <scott@ubuntu.com> Thu, 1 Dec 2005 21:28:55 +0000 + +initramfs-tools (0.40ubuntu4) dapper; urgency=low + + * Mount /dev with mode 0755. + + -- Scott James Remnant <scott@ubuntu.com> Thu, 1 Dec 2005 19:30:06 +0000 + +initramfs-tools (0.40ubuntu3) dapper; urgency=low + + "A true friend stabs you in the front." + - Oscar Wilde + + * hooks/acpid: Rename to ... + * hooks/thermal: ... this. Add therm_pm72 for ppc64 systems. + + -- Jeff Bailey <jbailey@ubuntu.com> Wed, 30 Nov 2005 22:25:01 -0500 + +initramfs-tools (0.40ubuntu2) dapper; urgency=low + + * Rename scripts/init-premount/acpid to scripts/init-premount/thermal + and add therm_pm72 to avoid "vaccum cleaner mode" on ppc64 systems. + + -- Adam Conrad <adconrad@ubuntu.com> Thu, 1 Dec 2005 12:37:27 +1100 + +initramfs-tools (0.40ubuntu1) dapper; urgency=low + + * Use tmpfs for /dev, instead of ramfs; as tmpfs is swappable. + * Move /proc and /sys to the real filesystem, rather than unmounting them; + slightly reduces workload. + * Replace /root with ${rootmnt} in final usage of /dev/console + * Copy across modprobe blacklist as well as aliases + + * Change the panic/breaknow thing *again*. There's now a break= option + which can be any of top, modules, premount, mount, bottom, init and + causes the initramfs to break at that point. panic/breaknow is now + break=top, without an argument is equivalent to break=premount. + * Run depmod at the top of the init script, so init-top scripts can use + modprobe. + + * Remove udev-specific code: + - depend on the version of udev that includes all of these things itself + - remove udevstart from init + - remove code to move /dev to the real filesystem from init + - remove /sys-based module loading from load_modules + - remove boot_events functions from load_modules + - remove udev copy from mkinitramfs + - remove udev hook script + + -- Scott James Remnant <scott@ubuntu.com> Thu, 24 Nov 2005 21:21:12 +0000 initramfs-tools (0.41) unstable; urgency=high diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 7d4eff6..c6025e5 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -39,5 +39,10 @@ if [ ! -e /etc/mkinitramfs/modules ]; then cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ fi +# Regenerate initramfs on upgrade +if [ "$1" = "configure" -a -n "$2" ]; then + update-initramfs -u +fi + #DEBHELPER# diff --git a/hooks/acpid b/hooks/thermal index 0f3c84c..4426de3 100755 --- a/hooks/acpid +++ b/hooks/thermal @@ -15,10 +15,14 @@ prereqs) ;; esac -# Hooks for loading acpi bits into the initramfs +# Hooks for loading thermal bits into the initramfs . /usr/share/initramfs-tools/hook-functions +# ACPI Systems for x in fan thermal; do manual_add_modules ${x} done + +# PPC64 Systems +manual_add_modules therm_pm72 diff --git a/hooks/udev b/hooks/udev deleted file mode 100755 index 4776d85..0000000 --- a/hooks/udev +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# udev really wants to be able to do socket communications to udevd -# This means that there's a bit of a race condition as the events come -# flooding in and the kernels ability to autoload the 'unix' module. - -# We solve the problem thusly. Hopefully RIP Ubuntu# 12915 - -. /usr/share/initramfs-tools/hook-functions - -force_load unix - -cp -a /etc/udev ${DESTDIR}/etc - -# Hack until udev is built with klibc -copy_exec /sbin/udevd /sbin -copy_exec /sbin/udevsynthesize /sbin - -mkdir "${DESTDIR}/lib/udev" -copy_exec /lib/udev/udevsynthesize /lib/udev @@ -6,9 +6,12 @@ mkdir /sys mkdir /proc mkdir /tmp mkdir -p /var/lock -mount -t sysfs sysfs /sys -mount -t proc proc /proc -mount -t ramfs none /dev +mount -t sysfs none /sys +mount -t proc none /proc + +# Note that this only becomes /dev on the real filesystem if udev's scripts +# are used; which they will be, but it's worth pointing out +mount -t tmpfs -o mode=0755 udev /dev touch /dev/.initramfs-tools mknod /dev/console c 5 1 mknod /dev/null c 1 3 @@ -56,74 +59,52 @@ for x in $(cat /proc/cmdline); do exec >/tmp/initramfs.debug 2>&1 set -x ;; - break) - break=yes + break=*) + break=${x#break=} ;; - breaknow) - panic "Spawning shell within the initramfs" + break) + break=premount ;; esac done +depmod -a +maybe_break top + # Don't do log messages here to avoid confusing usplash run_scripts /scripts/init-top . /scripts/${BOOT} +parse_numeric ${ROOT} -depmod -a - -# Populate /dev tree -log_begin_msg "Initializing /dev" -udevd_timeout=30 -echo > /proc/sys/kernel/hotplug -mkdir /dev/.udev /dev/.udev/db/ /dev/.udev/queue/ -udevd --daemon -udevsynthesize -while [ -d /dev/.udev/queue/ ]; do - sleep 1 - udevd_timeout=$(($udevd_timeout - 1)) - if [ $udevd_timeout -eq 0 ]; then - break - fi -done -log_end_msg - +maybe_break modules log_begin_msg "Loading modules" load_modules log_end_msg -parse_numeric ${ROOT} - -if [ x${break} = xyes ]; then - panic "Spawning shell within the initramfs" -fi - +maybe_break premount log_begin_msg "Running /scripts/init-premount" run_scripts /scripts/init-premount log_end_msg +maybe_break mount log_begin_msg "Mounting root file system" mountroot log_end_msg +maybe_break mount [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom [ "$quiet" != "y" ] && log_end_msg -# Move our /dev to the real filesystem. Do the setup that udev otherwise -# would. -killall udevd -mkdir -p /dev/.static/dev -chmod 700 /dev/.static/ -mount -n -o bind ${rootmnt}/dev /dev/.static/dev -mount -n -o move /dev ${rootmnt}/dev +# Move virtual filesystems over to the real filesystem +mount -n -o move /sys ${rootmnt}/sys +mount -n -o move /proc ${rootmnt}/proc -umount /sys -umount /proc - -if [ ! -x ${rootmnt}${init} ]; then +while [ ! -x ${rootmnt}${init} ]; do panic "Target filesystem doesn't have ${init}" -fi +done # Chain to real filesystem -exec run-init ${rootmnt} ${init} "$@" </root/dev/console >/root/dev/console +maybe_break init +exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console diff --git a/mkinitramfs b/mkinitramfs index 1cba5d5..9892a36 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -181,6 +181,7 @@ copy_exec /sbin/depmod /sbin copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" copy_exec /etc/modprobe.d/aliases /etc/modprobe.d +copy_exec /etc/modprobe.d/blacklist /etc/modprobe.d run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks diff --git a/scripts/functions b/scripts/functions index 5147009..8a49c8e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -48,7 +48,14 @@ panic() /sbin/usplash_write "QUIT" fi echo $@ - FS1='(initramfs) ' exec /bin/sh </dev/console >/dev/console 2>&1 + FS1='(initramfs) ' /bin/sh </dev/console >/dev/console 2>&1 +} + +maybe_break() +{ + if [ x$1 = x${break} ]; then + panic "Spawning shell within the initramfs" + fi } render() @@ -152,58 +159,9 @@ run_scripts() call_scripts } -ide_boot_events() { - - modprobe -q ide-generic - - [ -e /proc/ide ] || return - - for drive in /proc/ide/*; do - [ -e ${drive}/media ] || continue - # nothing to do if the device has already been took in charge - unit=${drive#/proc/ide/} - [ -d /sys/block/$unit ] && continue - - read media < $drive/media - case "$media" in - disk) MODULE=ide-disk ;; - cdrom) MODULE=ide-cd ;; - tape) MODULE=ide-tape ;; - floppy) MODULE=ide-floppy ;; - *) MODULE=ide-generic ;; - esac - - modprobe -q ${MODULE} - done -} - -scsi_boot_events() -{ - [ -e /sys/bus/scsi/devices/ ] || return - - for device in /sys/bus/scsi/devices/*; do - [ -e "${device}"/type ] || continue - read media < ${device}/type - case "$media" in - 0) modprobe -q sd_mod; - esac - - done - -} - -i2o_boot_events() -{ - [ -e /sys/bus/i2o/devices/ ] || return - - for device in /sys/bus/i2o/devices/*; do - [ -e ${device}/block ] && modprobe i2o_block - done -} - +# Load custom modules first load_modules() { - # Load custom modules first if [ -e /conf/modules ]; then cat /conf/modules | while read m; do if [ -z "$m" ] \ @@ -216,37 +174,15 @@ load_modules() fi done fi - - ide_boot_events - - scsi_boot_events - - i2o_boot_events - - # FIXME - need to start LVM here - + + # FIXME: wrong place, but it gets done ;) if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then - major_minor=$(ls -l ${resume} | \ - awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + major=$((0x$(stat -c%t ${resume}))) + minor=$((0x$(stat -c%T ${resume}))) + echo ${major}:${minor} >/sys/power/resume fi fi - - # Give the USB bus a moment to catch up - sleep 2 - - for x in /sys/bus/usb/devices/*; do - if [ -e ${x}/modalias ]; then - modprobe -q $(cat ${x}/modalias) - fi - done - - ide_boot_events - - scsi_boot_events - - i2o_boot_events } parse_numeric() { diff --git a/scripts/init-premount/acpid b/scripts/init-premount/thermal index 61d226a..e0d79c3 100755 --- a/scripts/init-premount/acpid +++ b/scripts/init-premount/thermal @@ -15,5 +15,9 @@ prereqs) ;; esac +# For ACPI systems modprobe -q fan modprobe -q thermal + +# For ppc64 systems +modprobe -q therm_pm72 diff --git a/scripts/local b/scripts/local index aa2cbfb..df09298 100644 --- a/scripts/local +++ b/scripts/local @@ -7,10 +7,17 @@ mountroot () run_scripts /scripts/local-top [ "$quiet" != "y" ] && log_end_msg + # Wait for SCSI/USB/etc. devices for a bit + slumber=10 + while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do + /bin/sleep 1 + slumber=$(( ${slumber} - 1 )) + done + # Get the root filesystem type - if [ ! -e "${ROOT}" ]; then + while [ ! -e "${ROOT}" ]; do panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" - fi + done eval $(fstype < ${ROOT}) diff --git a/scripts/nfs b/scripts/nfs index 7166b08..a2f6c3e 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,6 @@ mountroot () roflag="-o rw" fi - sleep 3 nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" |