From baab5f5fc3d6cfe4821a82e5b17f0f57bef060b0 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 16 Aug 2005 13:34:37 -0400 Subject: Cleanup commit, sorry for the mess --- scripts/local-premount/suspend | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/local-premount/suspend (limited to 'scripts/local-premount') diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend new file mode 100644 index 0000000..5791123 --- /dev/null +++ b/scripts/local-premount/suspend @@ -0,0 +1,30 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ "x${resume}" = "x" ]; then + exit +fi + +if [ ! -e ${resume} ]; then + exit +fi + +if [ -e /sys/power/resume ]; then + major=$((0x$(stat -c%t ${resume}))) + minor=$((0x$(stat -c%T ${resume}))) + echo ${major}:${minor} >/sys/power/resume +fi -- cgit v1.2.3 From a893fa82665ee472079292eb84a125ef81009124 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Oct 2005 02:33:30 +0200 Subject: apply all the 0.30 upstream changes. --- HACKING | 19 +++++++++++++++++++ debian/changelog | 41 ++++++++++++++++++++++++++++++++++++++++- debian/initramfs-tools.docs | 1 + debian/rules | 4 ++++ hook-functions | 2 +- init | 11 +++++++++-- scripts/functions | 19 ++++++++++++++++--- scripts/local-premount/suspend | 2 +- update-initramfs | 4 ++-- 9 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 HACKING create mode 100644 debian/initramfs-tools.docs (limited to 'scripts/local-premount') diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..2fd9136 --- /dev/null +++ b/HACKING @@ -0,0 +1,19 @@ +> I am not sure how to modify mkinitramfs to do this automatically, maybe you know? + +I need to document this more clearly, but the initramfs-tools have a collection of hooks that will solve your problem. While there's no way that Breezy could do this in the install, we could certainly include the scripts in the package (Especially if you're willing to test them to make sure they work! *g*) + +There are two phases that need to be accounted for. The first is the install phase for generating the initramfs, the second is run-time phase for actually doing the needed magic. + +To install the components you need, look at the scripts in /usr/share/initramfs-tools/hooks. evms and acpid are good choices. You can see a bunch of header stuff at the top that basically guarantees that things are run in the right order if they need to be. Two functions that will interest you: + +copy_exec copies a binary and any libraries it depends on +manual_add_modules takes bareword module names (like fan, thermal, etc) and installs those modules and any of their dependancies into the initramfs. + +The runtime phase is handled by scripts in /usr/share/initramfs-tools/scripts/ you probably want to start up at about the same point as lvm, md, and evms do, so local-top is a good directory to look in. +You can see the same sort of magic at the top of the script, although lvm and evms each require that md run first. + +I hope this helps. I'll paste this text into a HACKING file on the hopes that someone will see fit to improve it. That person will probably be me, mind you... =) + +Tks, +Jeff Bailey + diff --git a/debian/changelog b/debian/changelog index 4591d65..1ea455b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +initramfs-tools (0.30) unstable; urgency=low + + Apparition Octobre Rouge + + [ maximilian Attems ] + + * Resynconise with latest upstream now we are in unstable. + + [ Jeff Bailey ] + * debian/rules: Make sure hooks and scripts are chmod +x + + * hook-functions (auto_add_modules): Add advansys. + + * debian/init: Add "Loading, please wait..." message. + Don't log for init-top scripts to avoid usplash noise. + + * init: Add start of debug command line option. + + * scripts/functions (log_begin_msg): Call usplash if available + (log_end_msg): Call usplash if available + (panic): Close usplash if available + + * scripts/functions (load_modules): Quote resume variable. + Thanks to Christian Kellner for helping test that! + + * scripts/local-premount/suspend: Quote resume variable. + + * update-initramfs: Use basename on the link target to get the + version number. + + * HACKING: Start of some notes on how this package actually works. + * debian/initramfs-tools.docs: Install it. + + [ Matthew Garrett ] + * scripts/functions (load_modules): Run udevstart after loading block + drivers should fix resume from hibernate on non-LVM systems. + + -- maximilian attems Fri, 30 Sep 2005 19:34:55 +0200 + initramfs-tools (0.27) unstable; urgency=low * Remove unused BUSYBOX config option as we use busybox anyway. @@ -17,7 +56,7 @@ initramfs-tools (0.27) unstable; urgency=low * update-initramfs.8 New file install it. * The debian busybox-cvs-static installs into /bin/busybox: - fix pathes vis-à-vis ubuntu version. make that a variable on top. + fix pathes vis-a-vis ubuntu version. make that a variable on top. -- maximilian attems Tue, 20 Sep 2005 13:52:00 +0200 diff --git a/debian/initramfs-tools.docs b/debian/initramfs-tools.docs new file mode 100644 index 0000000..5c374b1 --- /dev/null +++ b/debian/initramfs-tools.docs @@ -0,0 +1 @@ +HACKING diff --git a/debian/rules b/debian/rules index 6b91c1f..2a5ae55 100644 --- a/debian/rules +++ b/debian/rules @@ -4,3 +4,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk pre-build:: chmod +x init mkinitramfs + chmod +x hooks/* + for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \ + chmod -R +x $$x; \ + done diff --git a/hook-functions b/hook-functions index 4371962..bc21b5f 100644 --- a/hook-functions +++ b/hook-functions @@ -144,7 +144,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules ${x} done diff --git a/init b/init index 6bf4be7..4193dcd 100644 --- a/init +++ b/init @@ -1,5 +1,7 @@ #!/bin/sh +echo "Loading, please wait..." + mkdir /sys mkdir /proc mkdir /tmp @@ -22,6 +24,7 @@ export readonly=y export ROOT= export resume=${RESUME} export rootmnt=/root +export debug= for x in $(cat /proc/cmdline); do case $x in init=*) @@ -48,15 +51,19 @@ for x in $(cat /proc/cmdline); do rw) readonly=n ;; + debug) + debug=y + exec >/tmp/initramfs.debug 2>&1 + set -x + ;; break) break=yes ;; esac done -log_begin_msg "Running /scripts/init-top" +# Don't do log messages here to avoid confusing usplash run_scripts /scripts/init-top -log_end_msg . /scripts/${BOOT} diff --git a/scripts/functions b/scripts/functions index 148dda7..de2268c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -23,12 +23,18 @@ log_warning_msg() log_begin_msg() { - _log_msg "Begin: $@ ..." + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "TEXT $@" + fi + _log_msg "Begin: $@ ..." } log_end_msg() { - _log_msg "Done." + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "SUCCESS ok" + fi + _log_msg "Done." } # update_progress() # ToDo: NOP placeholder... what else for usplash? @@ -38,6 +44,9 @@ log_end_msg() panic() { + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "QUIT" + fi echo $@ FS1='(initramfs) ' exec /bin/sh /dev/console 2>&1 } @@ -228,8 +237,12 @@ load_modules() i2o_boot_events + # FIXME - need to start LVM here + + udevstart + if [ -e /sys/power/resume ]; then - if [ -e ${resume} ]; then + if [ -e "${resume}" ]; then major=$((0x$(stat -c%t ${resume}))) minor=$((0x$(stat -c%T ${resume}))) echo ${major}:${minor} >/sys/power/resume diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 5791123..6aab596 100644 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -19,7 +19,7 @@ if [ "x${resume}" = "x" ]; then exit fi -if [ ! -e ${resume} ]; then +if [ ! -e "${resume}" ]; then exit fi diff --git a/update-initramfs b/update-initramfs index f93fc97..bd5a4ab 100644 --- a/update-initramfs +++ b/update-initramfs @@ -115,11 +115,11 @@ get_sorted_versions() set_linked_version() { if [ -L /initrd.img ]; then - linktarget=$(readlink /initrd.img) + linktarget=$(basename $(readlink /initrd.img)) fi if [ -L /boot/initrd.img ]; then - linktarget=$(readlink /boot/initrd.img) + linktarget=$(basename $(readlink /boot/initrd.img)) fi if [ -z "${linktarget}" ]; then -- cgit v1.2.3 From 402fc00b3d7c55532f6e7408d6245783b909bd77 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:11:52 +0200 Subject: new repo format v6 --- debian/rules | 0 hooks/acpid | 0 hooks/evms | 0 hooks/kernelextras | 0 hooks/udev | 0 init | 0 mkinitramfs | 0 scripts/init-premount/acpid | 0 scripts/local-premount/suspend | 0 scripts/local-top/evms | 0 scripts/local-top/lvm | 0 scripts/local-top/md | 0 12 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 debian/rules mode change 100644 => 100755 hooks/acpid mode change 100644 => 100755 hooks/evms mode change 100644 => 100755 hooks/kernelextras mode change 100644 => 100755 hooks/udev mode change 100644 => 100755 init mode change 100644 => 100755 mkinitramfs mode change 100644 => 100755 scripts/init-premount/acpid mode change 100644 => 100755 scripts/local-premount/suspend mode change 100644 => 100755 scripts/local-top/evms mode change 100644 => 100755 scripts/local-top/lvm mode change 100644 => 100755 scripts/local-top/md (limited to 'scripts/local-premount') diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 diff --git a/hooks/acpid b/hooks/acpid old mode 100644 new mode 100755 diff --git a/hooks/evms b/hooks/evms old mode 100644 new mode 100755 diff --git a/hooks/kernelextras b/hooks/kernelextras old mode 100644 new mode 100755 diff --git a/hooks/udev b/hooks/udev old mode 100644 new mode 100755 diff --git a/init b/init old mode 100644 new mode 100755 diff --git a/mkinitramfs b/mkinitramfs old mode 100644 new mode 100755 diff --git a/scripts/init-premount/acpid b/scripts/init-premount/acpid old mode 100644 new mode 100755 diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend old mode 100644 new mode 100755 diff --git a/scripts/local-top/evms b/scripts/local-top/evms old mode 100644 new mode 100755 diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm old mode 100644 new mode 100755 diff --git a/scripts/local-top/md b/scripts/local-top/md old mode 100644 new mode 100755 -- cgit v1.2.3 From a62c8eadea176cc83f83cf1eeeca4aabe59e5a95 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Oct 2005 09:05:53 +0200 Subject: fix stat usage, which is no longer available in newer busybox. use awk instead for determinig major_minor. great patch cures a hang observed on one of my laptops. :-) patch from Adrian Bridgett , #335801. --- debian/changelog | 8 ++++++++ scripts/functions | 6 +++--- scripts/local-premount/suspend | 5 ++--- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index 6a608d1..b6eddfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.37) unstable; urgency=low + + * scripts/functions, scripts/local-premount/suspend: Use of "stat" + which isn' any more provided by busybox (1.01-3). + Thanks to Adrian Bridgett for the patch using awk. + + -- maximilian attems Wed, 26 Oct 2005 08:43:36 +0200 + initramfs-tools (0.36) unstable; urgency=low "Sunny Autumn Release" diff --git a/scripts/functions b/scripts/functions index 68cfcea..8e82896 100644 --- a/scripts/functions +++ b/scripts/functions @@ -227,9 +227,9 @@ load_modules() if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then - major=$((0x$(stat -c%t ${resume}))) - minor=$((0x$(stat -c%T ${resume}))) - echo ${major}:${minor} >/sys/power/resume + major_minor=$(ls -l ${resume} | \ + awk '{printf "0x%x:0x%x", $5, $6}') + echo $major_minor >/sys/power/resume fi fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 6aab596..2e0b43f 100755 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -24,7 +24,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major=$((0x$(stat -c%t ${resume}))) - minor=$((0x$(stat -c%T ${resume}))) - echo ${major}:${minor} >/sys/power/resume + major_minor=$(ls -l ${resume} | awk '{printf "0x%x:0x%x", $5, $6}') + echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 32b804ba08c6d1bbc08491bcb0d50c6e84a75b98 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Nov 2005 07:15:49 +0100 Subject: fix suspend to disk: use decimal numbers. --- debian/changelog | 10 ++++++++-- scripts/functions | 2 +- scripts/local-premount/suspend | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index 0c4b918..fea4793 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,9 +2,15 @@ initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] - * Reference correct manpage in initramfs.conf. Closes: #336095 + * initramfs.conf: Reference correct manpage. Closes: #336095 - -- maximilian attems Wed, 2 Nov 2005 06:58:17 +0100 + [ maximilian attems ] + + * scripts/functions, scripts/local-premount/suspend: Fix suspend to disk + by using decimal numbers. Thanks to Adrian Bridgett + for the patch. (Closes: #336936) + + -- maximilian attems Wed, 2 Nov 2005 07:10:45 +0100 initramfs-tools (0.37) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index 8e82896..5147009 100644 --- a/scripts/functions +++ b/scripts/functions @@ -228,7 +228,7 @@ load_modules() if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then major_minor=$(ls -l ${resume} | \ - awk '{printf "0x%x:0x%x", $5, $6}') + awk '{printf "%d:%d", $5, $6}') echo $major_minor >/sys/power/resume fi fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 2e0b43f..0c88ccc 100755 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -24,6 +24,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "0x%x:0x%x", $5, $6}') + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 50586c0818aa8de3ba3aa1c105acbe31537a9be1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 12 Jul 2006 18:21:16 +0200 Subject: - rename suspend boot script in resume - update-initramfs add -b bootdif flag document it - check for noresume arg in init --- debian/changelog | 25 ++++++++++++++++++++++--- init | 10 ++++++++-- scripts/local-premount/resume | 29 +++++++++++++++++++++++++++++ scripts/local-premount/suspend | 29 ----------------------------- update-initramfs | 10 +++++++++- update-initramfs.8 | 5 +++++ 6 files changed, 73 insertions(+), 35 deletions(-) create mode 100755 scripts/local-premount/resume delete mode 100755 scripts/local-premount/suspend (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index bbc2944..9623ae4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,22 @@ -initramfs-tools (0.68) unstable; urgency=high +initramfs-tools (0.69) unstable; urgency=low + + * scripts/local-premount/suspend, scripts/local-premount/resume: Rename + to the later as the script resumes from resume arg. + + * init: Parse for noresume and only export resume if it is not set. + Allows boot scripts to check for it's eventual existence. + Thanks David Härdeman for the suggestion. + + * update-initramfs: Add option "-b directory" to override BOOTDIR. + Allows the initramfs to be created in another dir without awkward + mkinitramfs invocation. Check that the passed arg is really a dir. + (ubuntu: 37690) Thanks Colin Watson + + * update-initramfs.8: Document -b switch. + + -- maximilian attems Wed, 12 Jul 2006 16:51:49 +0200 + +initramfs-tools (0.68b) unstable; urgency=high * script/functions, hook-functions: Move check_minkver() to the second file as it uses dpkg and is run by mkinitramfs and not on boot. @@ -19,11 +37,12 @@ initramfs-tools (0.68) unstable; urgency=high to the one we ship. This should minimize Sarge upgrade prompting if no relevant modules where added to /etc/mkinitrd/modules. - * conf/initramfs.conf: Make it more similar to /etc/mkinitrd/modules. + * conf/modules: Make it more similar to /etc/mkinitrd/modules. * Set urgency high for RC fixes upload. + Thanks Steinar H. Gunderson for the review. - -- maximilian attems Fri, 7 Jul 2006 11:45:56 +0200 + -- maximilian attems Mon, 10 Jul 2006 00:13:52 +0200 initramfs-tools (0.67) unstable; urgency=high diff --git a/init b/init index 2c25295..427b964 100755 --- a/init +++ b/init @@ -40,7 +40,6 @@ export break= export init=/sbin/init export quiet=n export readonly=y -export resume=${RESUME} export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} @@ -77,7 +76,10 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - resume=${x#resume=} + RESUME=${x#resume=} + ;; + noresume) + NORESUME=y ;; quiet) quiet=y @@ -102,6 +104,10 @@ for x in $(cat /proc/cmdline); do esac done +if [ -n ${NORESUME} ]; then + export resume=${RESUME} +fi + depmod -a maybe_break top diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume new file mode 100755 index 0000000..0c88ccc --- /dev/null +++ b/scripts/local-premount/resume @@ -0,0 +1,29 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ "x${resume}" = "x" ]; then + exit +fi + +if [ ! -e "${resume}" ]; then + exit +fi + +if [ -e /sys/power/resume ]; then + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') + echo $major_minor >/sys/power/resume +fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend deleted file mode 100755 index 0c88ccc..0000000 --- a/scripts/local-premount/suspend +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ "x${resume}" = "x" ]; then - exit -fi - -if [ ! -e "${resume}" ]; then - exit -fi - -if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume -fi diff --git a/update-initramfs b/update-initramfs index 1826233..71cc90d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -19,6 +19,7 @@ Options: -u Update an existing initramfs -d Remove an existing initramfs -t Take over a custom initramfs with this one + -b Set alternate boot directory -v Be verbose -h This message @@ -287,7 +288,7 @@ takeover=0 ## -while getopts "k:cudyvht?" flag; do +while getopts "k:cudyvtb:h?" flag; do case "${flag}" in k) version="${OPTARG}" @@ -310,6 +311,13 @@ while getopts "k:cudyvht?" flag; do t) takeover="1" ;; + b) + BOOTDIR="${OPTARG}" + if [ ! -d $BOOTDIR ]; then + echo "Error: ${BOOTDIR} is not a directory." + exit 1 + fi + ;; h|?) usage ;; diff --git a/update-initramfs.8 b/update-initramfs.8 index 71f2500..9590ca3 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -11,6 +11,7 @@ update-initramfs \- generate an initramfs image .RB [ \-u ] .RB [ \-t ] .RB [ \-v ] +.RB [ \-b ] .RB [ \-h ] .SH DESCRIPTION The @@ -52,6 +53,10 @@ Allows to take over an custom initramfs with a newer one. This option increases the amount of information you are given during the chosen action. +.TP +\fB \-b +Set an different bootdir for the image creation. + .TP \fB \-h Print a short help page describing the available options in -- cgit v1.2.3 From 475bcbc9d6eefe90de6efe424bfb5bcca999fbc7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 20 Jul 2006 17:41:31 +0200 Subject: - drop md scripts - pump klibc dep - use resume klibc-utils bin - remove some klibc binaries - use nfsmount --- debian/changelog | 26 +++++++++++++++++++++++--- debian/control | 2 +- hooks/md | 28 ---------------------------- mkinitramfs | 3 +++ scripts/local-premount/resume | 3 +-- scripts/local-top/md | 35 ----------------------------------- scripts/nfs | 2 +- 7 files changed, 29 insertions(+), 70 deletions(-) delete mode 100755 hooks/md delete mode 100755 scripts/local-top/md (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index b48be87..faaf90a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,16 @@ +initramfs-tools (0.70b) unstable; urgency=low + + * Be more careful about vi dot files, removed. + Thanks Frederik Schüler for review. + + -- maximilian attems Wed, 19 Jul 2006 16:00:47 +0200 + initramfs-tools (0.70) unstable; urgency=low + * mkinitramfs: Don't include static kinit, nor gzip. They are the biggest + klibc-utils binaries and we don't use them. Keep static gunzip, zcat and + shared kinit for now. + * Reduce diff against 0.69ubuntu3: - hook-functions: Fix kernel typo. - hooks/kernelextras: Fix comment and add vga16fb too. @@ -7,6 +18,8 @@ initramfs-tools (0.70) unstable; urgency=low - mkinitramfs: Use check_minkver instead of dpkg itself. Whitespace cleanup and add quoting. - scripts/local: Whitespace cleanup and add a comment. + - scripts/nfs: Use mount with nolock instead of nfsmount. + (closes: 359926) - update-initramfs: Add quoting + whitespace fix. - changelog: for noise reduction add 0.69ubuntu{1,2,3}, all 0.40ubuntu*, 0.36ubuntu1 and missing 0.29 + 0.28 entries. @@ -18,10 +31,17 @@ initramfs-tools (0.70) unstable; urgency=low hooks/lvm, hooks/md, init, initramfs-tools.8, initramfs.conf.5, mkinitramfs, mkinitramfs-kpkg, mkinitramfs-kpkg.8, mkinitramfs.8, scripts/functions, scripts/local-top/udev_helper, update-initramfs, - update-initramfs.8: Whitespace policy cleanup trailing whitespace and - non tabular indents. + update-initramfs.8: Cleanup trailing whitespace and non tabular indents. + + * scripts/local-premount/resume: Use new resume bin from klibc-utils. + Removes superflous stat and awk usage. + + * debian/control: Depend against newer klibc-utils 1.4.11-1. + + * hooks/md, scripts/local-top/md: Drop as mdadm > 2.5-1 features them. + (closes: #367567) - -- maximilian attems Sun, 16 Jul 2006 21:50:34 +0200 + -- maximilian attems Wed, 19 Jul 2006 11:09:52 +0200 initramfs-tools (0.69b) unstable; urgency=high diff --git a/debian/control b/debian/control index a5a1cee..53caa8f 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/hooks/md b/hooks/md deleted file mode 100755 index df2abc8..0000000 --- a/hooks/md +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -if [ ! -x /sbin/mdadm ]; then - exit 0 -fi - -. /usr/share/initramfs-tools/hook-functions - -copy_exec /sbin/mdadm /sbin -copy_exec /sbin/mdrun /sbin - -for x in md linear raid0 raid1 raid5 raid6 raid10; do - manual_add_modules ${x} -done diff --git a/mkinitramfs b/mkinitramfs index 81a859e..0f1cb58 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -183,8 +183,11 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. +# klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib +rm -f ${DESTDIR}/bin/kinit ${DESTDIR}/bin/gzip + copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd ${CONFDIR}/scripts && \ diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 0c88ccc..059e7a4 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -24,6 +24,5 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + resume ${resume} fi diff --git a/scripts/local-top/md b/scripts/local-top/md deleted file mode 100755 index aa48474..0000000 --- a/scripts/local-top/md +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -/sbin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index 89b5c20..47e9ac1 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,7 @@ mountroot () roflag="-o rw" fi - nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} + mount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom -- cgit v1.2.3 From 8761821795732a9755d673e92fb45ac9202270df Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Jul 2006 09:13:28 +0200 Subject: - add BUSYBOX section to conf - add myri10ge, smc911x and hptiop modules - fix check_minkver() logic - escape resume variables - fix SEE ALSO section in all manpages - source /usr/share/initramfs-tools/conf.d/* - check against modules.dep before running depmod - more verbose output - open console with -i for dash interactive - fix resume param by LABEL or UUID - lvm has new prereq mdadm - update-initramfs fix -v calling - functions/scripts replace basename usage with shell expansion --- conf/initramfs.conf | 7 ++++++ debian/changelog | 50 +++++++++++++++++++++++++++++++++++++++++++ hook-functions | 17 ++++++++------- init | 4 ++-- initramfs-tools.8 | 5 +++-- initramfs.conf.5 | 16 +++++++++++--- mkinitramfs | 12 ++++++++--- mkinitramfs-kpkg.8 | 6 ++++-- mkinitramfs.8 | 9 ++++++-- scripts/functions | 8 +++++-- scripts/local-premount/resume | 9 ++++++++ scripts/local-top/lvm | 2 +- update-initramfs | 4 ++-- update-initramfs.8 | 6 ++++-- 14 files changed, 126 insertions(+), 29 deletions(-) (limited to 'scripts/local-premount') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 84d3b24..b0d1dc0 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -17,6 +17,13 @@ MODULES=most +# BUSYBOX: [ y | n ] +# +# Use busybox if available. +# + +BUSYBOX=y + # # NFS Section of the config. # diff --git a/debian/changelog b/debian/changelog index faaf90a..e6f271b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,46 @@ +initramfs-tools (0.71) unstable; urgency=low + + * initramfs.conf.5, initramfs-tools.8, mkinitramfs.8, mkinitramfs-kpkg.8, + update-initramfs.8: Fix spacing in the SEE ALSO section and have this + section everywhere as last. Fix linebreak in mkinitramfs.8 options. + Thanks Martin Michlmayr for the notice. + + * scripts/functions: Use shell parameter expansion to strip known dir + prefix instead of gratious basename call. + + * scripts/functions: On panic call open the rescue shell with -i to get + dash interactive features. ash from busybox ignores the param. + Thanks David Härdeman for the suggestion. + + * conf/initramfs.conf: Readd BUSYBOX=y section. Beware that a lot of boot + scripts need busybox and the current default image still does too. + + * initramfs.conf: Document BUSYBOX usage. + + * init: Add variable quoting around resume, NORESUME parsing and checks. + + * hook-functions: Add myri10ge and smc911x to the net section. Add hptiop to + the scsi section. + + * update-initramfs: Fix -v usage by not passing quoted ${OPTS} as one + option. Thanks Famelis George for the patch. + (closes: 379212) + + * mkinitramfs: Really source /usr/share/initramfs-tools/conf.d/ entries. + + * mkinitramfs: Check against modules.dep before invoking depmod. + + * hook-functions: check_minkver() only needs to call init_list(), + when a dir gets passed. Clean up check_minkver() logic. + + * scripts/function, mkinitramfs: Add output on verbose mode. + + * merge 0.69ubuntu4. + + * scripts/local-top/lvm: Prereqs s/md/mdadm/ for the new hooks. + + -- maximilian attems Mon, 24 Jul 2006 09:10:53 +0200 + initramfs-tools (0.70b) unstable; urgency=low * Be more careful about vi dot files, removed. @@ -61,6 +104,13 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu4) edgy; urgency=low + + * scripts/local-premount/suspend: Check for UUID= or LABEL= on the + start of $resume, and use /dev/disk/by-{uuid,label} if found. + + -- Scott James Remnant Fri, 21 Jul 2006 17:58:34 +0100 + initramfs-tools (0.69ubuntu3) edgy; urgency=low * debian/initramfs-tools.install, debian/initramfs-tools.preinst, diff --git a/hook-functions b/hook-functions index 9b1bd24..3175cba 100644 --- a/hook-functions +++ b/hook-functions @@ -149,8 +149,8 @@ auto_add_modules() net) for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ dl2k e1000 e100 epic100 eql fealnx famachi forcedeth \ - hp100 mace mv643xx_eth natsemi ne2k-pci netconsole \ - ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire \ + hp100 mace mv643xx_eth myri10ge natsemi ne2k-pci netconsole \ + ns83820 pcnet32 r8169 s2io sis900 skge slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do @@ -170,10 +170,10 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ - gdth ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ - megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ - mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 \ - qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ + gdth hptiop ibmvscsic initio ipr ips isp1020 lpfc max_scsi \ + mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc \ + mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 \ + qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ sata_nv sata_promise sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ @@ -231,7 +231,6 @@ check_minkver() { curversion=${1} initdir=${2} - set_initlist if [ -z ${initdir} ]; then DPKG_ARCH=`dpkg --print-installation-architecture` case ${DPKG_ARCH} in @@ -247,8 +246,10 @@ check_minkver() echo "W: not generating requested initramfs for kernel ${curversion}" >&2 exit 2 fi + return 0 fi - [ -z ${initdir} ] || for cm_x in ${initlist}; do + set_initlist + for cm_x in ${initlist}; do tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) if dpkg --compare-versions "${curversion}" lt "${tmp}"; then echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 diff --git a/init b/init index eb14326..69d9542 100755 --- a/init +++ b/init @@ -76,7 +76,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - RESUME=${x#resume=} + RESUME="${x#resume=}" ;; noresume) NORESUME=y @@ -104,7 +104,7 @@ for x in $(cat /proc/cmdline); do esac done -if [ -z ${NORESUME} ]; then +if [ -z "${NORESUME}" ]; then export resume=${RESUME} fi diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 5712bdd..0950b39 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -418,5 +418,6 @@ updated by Maximilian Attems . .SH SEE ALSO .BR -initramfs.conf (5), mkinitramfs (8), update-initramfs(8) - +.IR initramfs.conf (5), +.IR mkinitramfs (8), +.IR update-initramfs(8). diff --git a/initramfs.conf.5 b/initramfs.conf.5 index afd799b..8d6b621 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -32,6 +32,14 @@ The default setting is \fImost\fP. \fIlist\fP includes only modules from the additional modules list. +.TP +\fB BUSYBOX +Include busybox utilities for the boot scripts. +If set to 'n' +.B mkinitramfs +will build an initramfs whithout busybox. +Beware that many boot scripts need busybox utilities. + .SH NFS VARIABLES .TP \fB BOOT @@ -48,12 +56,14 @@ Specifies the network interface, like eth0. Defaults to \fIauto\fP in order to pick up value from DHCP server. Otherwise you need to specify \fIHOST:MOUNT\fP. -.SH SEE ALSO - -.BR initramfs-tools (8), mkinitramfs (8), update-initramfs (8) .SH AUTHOR The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . Loosely based on mkinitrd.conf by Herbert Xu. +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). diff --git a/mkinitramfs b/mkinitramfs index 0f1cb58..52dea45 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -83,11 +83,16 @@ fi . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' -for i in ${CONFDIR}/conf.d/* /usr/share/initramfs-tools/conf.d/*; do +for i in ${CONFDIR}/conf.d/*; do EXTRA_CONF="${EXTRA_CONF} $(basename $i | grep '^[a-z0-9][a-z0-9\._-]*$' | grep -v '\.dpkg-.*$')"; done for i in ${EXTRA_CONF}; do -. ${CONFDIR}/conf.d/${i} + . ${CONFDIR}/conf.d/${i} +done +for i in /usr/share/initramfs-tools/conf.d/*; do + if [ -e $i ]; then + . ${i} + fi done if [ -z "${outfile}" ]; then @@ -135,7 +140,7 @@ if [ ! -e "${MODULESDIR}" ]; then echo "Cannot find ${MODULESDIR}" exit 1 fi -if [ ! -e "${MODULESDIR}/modules.depmod" ]; then +if [ ! -e "${MODULESDIR}/modules.dep" ]; then depmod ${version} fi @@ -228,6 +233,7 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / fi +[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 871a0f4..2a3072b 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -46,5 +46,7 @@ This option queries if mkinitramfs can create ramdisks for kernel version mkinitramfs-kpkg is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR update-initramfs (8). diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 3dc2e2e..65f6203 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -13,9 +13,12 @@ mkinitramfs \- generate an initramfs image .RB [ \-r .IR root ] .RI [ version ] + .B mkinitramfs .RB [ \-\-supported-host-version= .IR hversion ] + +.B mkinitramfs .RB [ \-\-supported-target-version= .IR tversion ] @@ -90,5 +93,7 @@ The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR update-initramfs (8). diff --git a/scripts/functions b/scripts/functions index 53e07ca..9e578d7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -62,7 +62,7 @@ panic() modprobe -q i8042 modprobe -q atkbd echo $@ - PS1='(initramfs) ' /bin/sh /dev/console 2>&1 + PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } maybe_break() @@ -84,7 +84,7 @@ set_initlist() if [ ! -x ${si_x} ]; then continue fi - initlist="${initlist} $(basename ${si_x})" + initlist="${initlist} ${si_x#${initdir}/}" done } @@ -168,6 +168,10 @@ reduce_prereqs() call_scripts() { for cs_x in ${runlist}; do + # mkinitramfs verbose output + if [ "${verbose}" = "y" ]; then + echo "Calling hook ${cs_x}" + fi ${initdir}/${cs_x} # allow boot scripts to modify exported boot paramaters if [ -e /conf/param.conf ]; then diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 059e7a4..564d6f8 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -19,6 +19,15 @@ if [ "x${resume}" = "x" ]; then exit fi +case $resume in + LABEL=*) + resume="/dev/disk/by-label/${resume#LABEL=}" + ;; + UUID=*) + resume="/dev/disk/by-uuid/${resume#UUID=}" + ;; +esac + if [ ! -e "${resume}" ]; then exit fi diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 5323a7d..9a45220 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="md" +PREREQ="mdadm" prereqs() { diff --git a/update-initramfs b/update-initramfs index 85a5dd2..ea74136 100755 --- a/update-initramfs +++ b/update-initramfs @@ -66,9 +66,9 @@ generate_initramfs() echo "update-initramfs: Generating ${initramfs}" OPTS="-o" if [ "${verbose}" = 1 ]; then - OPTS="-v $OPTS" + OPTS="-v ${OPTS}" fi - if mkinitramfs "${OPTS}" "${initramfs}" "${version}"; then + if mkinitramfs ${OPTS} "${initramfs}" "${version}"; then set_sha1 else mkinitramfs_return="$?" diff --git a/update-initramfs.8 b/update-initramfs.8 index a36e83c..7cfc206 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -67,5 +67,7 @@ The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), mkinitramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR mkinitramfs (8). -- cgit v1.2.3 From 317940266751218ffa46581a44260619ade32e0a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Aug 2006 09:32:03 +0200 Subject: revert klibc-utils resume usage for now. --- debian/changelog | 8 ++++++++ debian/control | 2 +- scripts/local-premount/resume | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index 028f0e6..b613529 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.73c) unstable; urgency=low + + * scripts/local-premount/resume: Revert klibc-utils resume usage until + breakage cause is known. Thus downgrade klibc dep to 1.4.8-0. Thanks + Steinar H. Gunderson for report. (closes: #381475) + + -- maximilian attems Sat, 5 Aug 2006 09:31:16 +0200 + initramfs-tools (0.73b) unstable; urgency=high * Revert nfs change in 0.70: Debian busybox is build with CONFIG_NFSMOUNT=n. diff --git a/debian/control b/debian/control index 53caa8f..a9d0e90 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.8-0), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 564d6f8..593df78 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -33,5 +33,8 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - resume ${resume} +# FIXME: klibc-utils resume needs more tests +# resume ${resume} + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') + echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 839572386f35bf4b4404dac5f976566bc155de94 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Aug 2006 17:14:01 +0200 Subject: Release 0.74: - scripts/functions: fix debug boot param - update-initramfs: checkout /etc/kernel-img.conf if lilo and grub is installed - rename mdraid to mdrun, readd mdrun as it seems to work much better with sarge systems - add an help message for rescue shell - better package desc --- debian/changelog | 25 +++++++++++++++++++++++++ debian/control | 12 ++++++------ mkinitramfs | 1 + scripts/functions | 6 +++--- scripts/local | 2 ++ scripts/local-premount/resume | 6 ++---- scripts/local-top/mdraid | 41 ----------------------------------------- scripts/local-top/mdrun | 41 +++++++++++++++++++++++++++++++++++++++++ update-initramfs | 22 ++++++++++++++++++---- 9 files changed, 98 insertions(+), 58 deletions(-) delete mode 100755 scripts/local-top/mdraid create mode 100755 scripts/local-top/mdrun (limited to 'scripts/local-premount') diff --git a/debian/changelog b/debian/changelog index 1686466..f089fe6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,28 @@ +initramfs-tools (0.74) unstable; urgency=low + + * scripts/local-premount/resume: Reuse klibc resume, hardcode path as + uswsusp shipps too an resume binary in initramfs-tools. Thus tighten + again klibc dep to 1.4.11-1. (closes: 381535) + + * mkinitramfs: Readd mdrun when around. + + * scripts/local-top/mdrun: Rename from mdraid. Use mdrun as previously, + there is no guarantee that the sarge mdadm works and that the sarge + mdadm.conf has any sense. + + * debian/control: Better package description. + + * scripts/local: mountroot add message what to check if root is not found + in 2 straight lines to keep as much of scrolling buffer. + + * scripts/functions: Use set ``--'' to change positional paramaters without + changing any options. This is useful for the debug bootparam on d?ash. + + * update-initramfs: Respect "do_bootloader = yes" from /etc/kernel-img.conf + to call lilo if both lilo and grub are installed. (closes: 382013) + + -- maximilian attems Thu, 17 Aug 2006 16:50:51 +0200 + initramfs-tools (0.73e) unstable; urgency=high * mkinitramfs: Fix if statement for conf.d. (closes: 382740) diff --git a/debian/control b/debian/control index a9d0e90..24d1bdc 100644 --- a/debian/control +++ b/debian/control @@ -8,13 +8,13 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.8-0), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs - This package contains tools to create and boot an initramfs for prepackaged - 2.6 Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the + This package contains tools to create and boot an initramfs for packaged 2.6 + Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the kernel unpacks that archive into RAM, mounts and uses it as initial root file - system. From there on the mounting of the real root file system occurs in user - space. klibc handles the boot-time networking setup. Having the root on NFS - is also supported. + system. The mounting of the real root file system occurs in early user space. + klibc provides utilities to setup root. Having the root on EVMS, MD, LVM2, + LUKS or NFS is also supported. Any boot loader with initrd support is able to load an initramfs archive. diff --git a/mkinitramfs b/mkinitramfs index 3df30ec..67d9df0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -235,6 +235,7 @@ run_scripts "${CONFDIR}"/hooks if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then mdadm --examine --scan > $DESTDIR/conf/mdadm.conf copy_exec /sbin/mdadm /sbin + copy_exec /sbin/mdrun /sbin for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do manual_add_modules ${x} done diff --git a/scripts/functions b/scripts/functions index 9e578d7..e9d7a07 100644 --- a/scripts/functions +++ b/scripts/functions @@ -117,7 +117,7 @@ get_prereqs() count_unsatisfied() { - set - ${@} + set -- ${@} return ${#} } @@ -126,7 +126,7 @@ pop_list_item() { item=${1} shift - set - ${@} + set -- ${@} unset tmppop # Iterate for pop in ${@}; do @@ -143,7 +143,7 @@ reduce_prereqs() { unset runlist set_initlist - set - ${initlist} + set -- ${initlist} i=$# # Loop until there's no more in the queue to loop through while [ ${i} -ne 0 ]; do diff --git a/scripts/local b/scripts/local index 8510088..0b9baab 100644 --- a/scripts/local +++ b/scripts/local @@ -33,6 +33,8 @@ mountroot () # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do + echo " Check root= bootarg cat /proc/cmdline" + echo " or missing modules, devices: cat /proc/modules ls /dev" panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 593df78..881af90 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -33,8 +33,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then -# FIXME: klibc-utils resume needs more tests -# resume ${resume} - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + # hardcode path, uswsusp ships an resume binary too + /bin/resume ${resume} fi diff --git a/scripts/local-top/mdraid b/scripts/local-top/mdraid deleted file mode 100755 index 8649aa4..0000000 --- a/scripts/local-top/mdraid +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ -e /scripts/local-top/mdadm ]; then - exit 0 -fi - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -# Assemble all raid devices -mkdir /dev/md -mdadm --assemble --config=/conf/mdadm.conf --scan --run --auto=yes diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun new file mode 100755 index 0000000..1b6ca3e --- /dev/null +++ b/scripts/local-top/mdrun @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="udev_helper" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ -e /scripts/local-top/mdadm ]; then + exit 0 +fi + +unset raidlvl +gotraid=n + +# Detect raid level +for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do + if [ ! -e ${x} ]; then + continue + fi + raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi +done + +[ "${gotraid}" = y ] || exit + +# Assemble all raid devices +# FIXME: assemble root raid first due to initrd-tools compatibility +/sbin/mdrun /dev diff --git a/update-initramfs b/update-initramfs index ea74136..e7dc586 100755 --- a/update-initramfs +++ b/update-initramfs @@ -81,11 +81,28 @@ generate_initramfs() fi } +# lilo call +run_lilo() +{ + lilo -t > /dev/null + if [ $? -eq 0 ]; then + lilo + fi +} + # only run lilo if no grub is around +# or if "do_bootloader = yes" is set run_bootloader() { if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then + do_bootloader=$(awk '/bootloader/{print $2}' \ + /etc/kernel-img.conf) + if [ "${do_bootloader}" = "yes" ]; then + run_lilo + return 0 + fi + echo echo "WARNING: grub and lilo installed." echo "If you use grub as bootloader everything is fine." @@ -95,10 +112,7 @@ run_bootloader() return 0 fi if [ -e /etc/lilo.conf ]; then - lilo -t > /dev/null - if [ $? -eq 0 ]; then - lilo - fi + run_lilo fi } -- cgit v1.2.3 From e9434de886aa77f0d8019c9e8bddc8b7883c9b4a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:46:36 +0100 Subject: local-premount/resume: coding style fixes. --- scripts/local-premount/resume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/local-premount') diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 881af90..d997f81 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -15,8 +15,8 @@ prereqs) ;; esac -if [ "x${resume}" = "x" ]; then - exit +if [ -z "${resume}" ]; then + exit 0 fi case $resume in @@ -29,7 +29,7 @@ case $resume in esac if [ ! -e "${resume}" ]; then - exit + exit 0 fi if [ -e /sys/power/resume ]; then -- cgit v1.2.3 From aaf9b600c8ed9055b4e283e6cf1394b6f9f6ac8e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 7 Apr 2008 11:51:00 +0200 Subject: resume: Add support for resume_offset swap file suspend to disk. Parse cmdline for resume_offset, export it and pass it to the klibc resume binary. Based on a patch by Alan Jenkins . Bonus small codingstyle clean up of local-premount/resume. --- init | 4 ++++ scripts/local-premount/resume | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts/local-premount') diff --git a/init b/init index 3a93ef8..70f4384 100755 --- a/init +++ b/init @@ -50,6 +50,7 @@ export rootmnt=/root export debug= export panic= export blacklist= +export resume_offset= # Parse command line options for x in $(cat /proc/cmdline); do @@ -97,6 +98,9 @@ for x in $(cat /proc/cmdline); do resume=*) RESUME="${x#resume=}" ;; + resume_offset=*) + resume_offset="${x#resume_offset=}" + ;; noresume) noresume=y ;; diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index d997f81..6bf95e5 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -28,11 +28,13 @@ case $resume in ;; esac -if [ ! -e "${resume}" ]; then - exit 0 -fi +[ ! -e "${resume}" ] && exit 0 + +[ ! -e /sys/power/resume ] && exit 0 -if [ -e /sys/power/resume ]; then - # hardcode path, uswsusp ships an resume binary too +# hardcode path, uswsusp ships an resume binary too +if [ -n "${resume_offset}" ]; then + /bin/resume ${resume} ${resume_offset} +else /bin/resume ${resume} fi -- cgit v1.2.3 From 9e5ff69508479c10548e0fcf4d6f3ee043cff1fe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 18:12:56 +0100 Subject: scripts/local-premount/resume: Fix resume with LABEL containing '/'. do the same dance here, same code, just slightly renamed variables. --- scripts/local-premount/resume | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'scripts/local-premount') diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 6bf95e5..b2b0e1d 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -20,10 +20,37 @@ if [ -z "${resume}" ]; then fi case $resume in - LABEL=*) - resume="/dev/disk/by-label/${resume#LABEL=}" +LABEL=*) + resume="${resume#LABEL=}" + + # support any / in LABEL= path (escape to \x2f) + case "${resume}" in + *[/]*) + if [ -x "$(command -v sed)" ]; then + resume="$(echo ${resume} | sed 's,/,\\x2f,g')" + else + if [ "${resume}" != "${resume#/}" ]; then + resume="\x2f${resume#/}" + fi + if [ "${resume}" != "${resume%/}" ]; then + resume="${resume%/}\x2f" + fi + IFS='/' + newresume= + for s in $resume; do + if [ -z "${newresume}" ]; then + newresume="${s}" + else + newresume="${newresume}\\x2f${s}" + fi + done + unset IFS + resume="${newresume}" + fi + esac + resume="/dev/disk/by-label/${resume}" ;; - UUID=*) +UUID=*) resume="/dev/disk/by-uuid/${resume#UUID=}" ;; esac -- cgit v1.2.3 From d703b8ca26ac5230d7ffeae1891334791d8dab31 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 3 Apr 2009 14:48:44 +0200 Subject: cleanup LABEL handling code make it more concise: * use POSIX ${parameter:+word} * replace *[/]*) by just */*) * test exit code of command -v rather then running test -x on it while we are at it fix another command -v usage in scripts/functions. Reviewed-by: Colin Watson Signed-off-by: maximilian attems --- init | 10 +++------- scripts/functions | 2 +- scripts/local-premount/resume | 10 +++------- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'scripts/local-premount') diff --git a/init b/init index a149c2b..e8c97a5 100755 --- a/init +++ b/init @@ -67,8 +67,8 @@ for x in $(cat /proc/cmdline); do # support any / in LABEL= path (escape to \x2f) case "${ROOT}" in - *[/]*) - if [ -x "$(command -v sed)" ]; then + */*) + if command -v sed >/dev/null 2>&1; then ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')" else if [ "${ROOT}" != "${ROOT#/}" ]; then @@ -80,11 +80,7 @@ for x in $(cat /proc/cmdline); do IFS='/' newroot= for s in $ROOT; do - if [ -z "${newroot}" ]; then - newroot="${s}" - else - newroot="${newroot}\\x2f${s}" - fi + newroot="${newroot:+${newroot}\\x2f}${s}" done unset IFS ROOT="${newroot}" diff --git a/scripts/functions b/scripts/functions index b813529..77de8f3 100644 --- a/scripts/functions +++ b/scripts/functions @@ -304,6 +304,6 @@ configure_networking() # Wait for queued kernel/udev events wait_for_udev() { - [ -x "$(command -v udevadm)" ] || return 0 + command -v udevadm >/dev/null 2>&1 || return 0 udevadm settle ${1:+--timeout=$1} } diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index b2b0e1d..11acfc7 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -25,8 +25,8 @@ LABEL=*) # support any / in LABEL= path (escape to \x2f) case "${resume}" in - *[/]*) - if [ -x "$(command -v sed)" ]; then + */*) + if command -v sed >/dev/null 2>&1; then resume="$(echo ${resume} | sed 's,/,\\x2f,g')" else if [ "${resume}" != "${resume#/}" ]; then @@ -38,11 +38,7 @@ LABEL=*) IFS='/' newresume= for s in $resume; do - if [ -z "${newresume}" ]; then - newresume="${s}" - else - newresume="${newresume}\\x2f${s}" - fi + newresume="${newresume:+${newresume}\\x2f}${s}" done unset IFS resume="${newresume}" -- cgit v1.2.3