From 2777a4e8f7b7e7b14cbba813d3b1e30b1acb4a53 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 30 Jun 2005 00:07:32 +0000 Subject: * Use detailed logging now for debian/changelog. We have at least three people hacking now, and details would probably be useful. * debian/TODO: Update * debian/dirs: Sort and add usr/share/initramfs-tools/hooks * debian/initramfs-tools.examples: Add docs/example_hook and docs/example_hook_cpiogz * debian/initramfs-tools.install: Pretty Print. * debian/rules: Ensure that mkinitramfs is executable * docs/example_script: New file * init: Add concept of 'quiet', be verbose if not specified * mkinitramfs: Do not load script functions until needed Clear up comments / documentation Use DESTDIR instead of TMPDIR Add ability to link in extra hunks into the cpio file Cosmetic cleanups * scripts/functions: Add lsb stype log_FOO_msg functions * scripts/local: Add logging * scripts/nfs: Add logging --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 hook-functions (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions new file mode 100644 index 0000000..0d79703 --- /dev/null +++ b/hook-functions @@ -0,0 +1,6 @@ +# -*- shell-script -*- + +catenate_cpiogz() { + cat "$1" >>${__TMPCPIOGZ} +} + -- cgit v1.2.3 From 618760b004d07efb11f05e57d46ed4b5adb2823c Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 16 Aug 2005 13:34:13 -0400 Subject: Cleanup commit, sorry for the mess --- conf/initramfs.conf | 9 ++- debian/TODO | 2 + debian/changelog | 99 +++++++++++++++++++++++++++++- debian/control | 4 +- debian/dirs | 1 - debian/initramfs-tools.install | 2 + debian/initramfs-tools.postinst | 22 +++++++ debian/initramfs-tools.postrm | 2 +- debian/rules | 2 +- hook-functions | 133 ++++++++++++++++++++++++++++++++++++++++ init | 4 ++ mkinitramfs | 122 +++++------------------------------- scripts/functions | 16 ++++- scripts/local-top/md | 9 ++- 14 files changed, 307 insertions(+), 120 deletions(-) (limited to 'hook-functions') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index a056469..b4a7dba 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -7,7 +7,7 @@ # Use busybox if available. You MUST use the -static version # -BUSYBOX=n +BUSYBOX=y # # BOOT: [ local | nfs ] @@ -28,7 +28,7 @@ BOOT=local # # list - Only include modules from the 'additional modules' list # -MODULES=list +MODULES=most # # NFS Section of the config. @@ -48,3 +48,8 @@ DEVICE=eth0 NFSROOT=auto +# Hardcode partition to resume from so it doesn't have to be specified +# on the command line. The command line will override this setting. + +#RESUME= + diff --git a/debian/TODO b/debian/TODO index 7c6bc55..58f35fd 100644 --- a/debian/TODO +++ b/debian/TODO @@ -16,3 +16,5 @@ TODO o Trace lilo bug o Capture udev events and pass them to udevsend + + o Detect RESUME partition diff --git a/debian/changelog b/debian/changelog index 06f40e3..11f476c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,98 @@ +initramfs-tools (0.19) breezy; urgency=low + + "The basis of optimism is sheer terror." + - Oscar Wilde + + * mkinitramfs: Honour MODULES=list and MODULES=dep. + + * hook-functions: New function dep_add_modules. + + -- Jeff Bailey Wed, 10 Aug 2005 23:20:11 -0400 + +initramfs-tools (0.18) breezy; urgency=low + + "We are all in the gutter, but some of us are looking at the stars." + - Oscar Wilde + + * debian/initramfs-tools.postrm: Use rm -f for removing the modules + file, in case it doesn't exist for some reason. (Ubuntu #13335) + Thanks to Colin Watson for the bug report! + + * mkinitramfs.8: Correct my email address to be jbailey@ubuntu.com + Document /etc/mkinitramfs/DSDT.aml + + * debian/initramfs-tools.postinst: Attempt to inherit RESUME settings + from initrd-tools. Also copy the DSDT from /etc/mkinitrd/DSDT to + /etc/mkinitramfs/DSDT.aml + + -- Jeff Bailey Wed, 10 Aug 2005 13:09:44 -0400 + +initramfs-tools (0.17) breezy; urgency=low + + "The public is wonderfully tolerant. It forgives everything except + genius." + - Oscar Wilde + + * debian/initramfs-tools.postinst: Get the name of the config file + right when seeding RESUME=. Also fix the sed expression. + Thanks to Matthew Garrett for noticing this! + + -- Jeff Bailey Wed, 10 Aug 2005 11:54:07 -0400 + +initramfs-tools (0.16) breezy; urgency=low + + "It is through art, and through art only, that we can realise our + perfection." + - Oscar Wilde + + * mkinitramfs: Make sure all relevant ide modules are included. + Add RESUME= support. + + * scripts/functions: Be silent when adding non-detected modules. + + * conf/mkinitramfs.conf: MODULES=most by default, BUSYBOX=y + (Non-busybox isn't supported now. It's not clear that it ever + will be). Add RESUME line for resuming from suspend-to-disk. + + * scripts/local-premount/suspend: New script for suspend-to-disk. + + * debian/control: Bump depends on busybox-cvs-initramfs to + 20040623-1ubuntu19. Add dependancy on lvm2. + Bump standards version to 3.6.2.0 (no-op) + + * debian/control: + Force version depend on lvm2 (>= 2.01.04-5) to make sure newer kernels + will boot. + Thanks for Andrew Mitchell for discovering this. + + * hooks/: New directory + + * debian/dirs: Move hooks to ... + * debian/initramfs-tools.install: ... here. + + * hooks/acpid: New file. + + * scripts/init-premount/acpid: New file + Thanks for the hint from Matthew Garrett for this. + + * debian/initramfs-tools.postinst: Add RESUME support on first install. + + * debian/mkinitramfs: Move functions to ... + * debian/hook-functions: ... here. + + * debian/initramfs-tools.install: Install hook-functions + + * mkinitramfs.8: New file. + Thanks to Maximilian Attems for contributing this! + + * scripts/local-top/md: Don't try to detect raid on non-existant devices + or on whole devices. Quiet other warning messages. + + * hook-functions: When generating initramfs, don't complain about missing + modules. + + -- Jeff Bailey Tue, 9 Aug 2005 23:35:08 -0400 + initramfs-tools (0.15) breezy; urgency=low "Nothing looks so like innocence as an indiscretion." @@ -12,7 +107,9 @@ initramfs-tools (0.15) breezy; urgency=low * debian/dirs: Make the /etc version of this directory for user addons. - -- Jeff Bailey Fri, 5 Aug 2005 11:39:26 -0400 + * debian/rules: Use prebuild, rather than debian-build-arch. + + -- Jeff Bailey Tue, 9 Aug 2005 11:29:10 -0400 initramfs-tools (0.14) breezy; urgency=low diff --git a/debian/control b/debian/control index 514368c..1c1a6b2 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,11 @@ Section: utils Priority: optional Maintainer: Jeff Bailey Build-Depends-Indep: debhelper (>= 4.0.0), cdbs -Standards-Version: 3.6.1 +Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-initramfs, mdadm +Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), mdadm, lvm2 (>= 2.01.04-5) 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 an cpio archive. At boot time, the kernel diff --git a/debian/dirs b/debian/dirs index 6de384e..d35ba7c 100644 --- a/debian/dirs +++ b/debian/dirs @@ -7,5 +7,4 @@ etc/mkinitramfs/local-top etc/mkinitramfs/nfs-bottom etc/mkinitramfs/nfs-premount etc/mkinitramfs/nfs-top -usr/share/initramfs-tools/hooks usr/share/initramfs-tools/modules.d diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index a2a78f5..8702d53 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -2,3 +2,5 @@ mkinitramfs usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs +hooks usr/share/initramfs-tools +hook-functions usr/share/initramfs-tools diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 70be9f6..ea92067 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -2,6 +2,28 @@ set -e +if [ "$1" = configure ]; then + if [ x${2} = x ]; then + + # First time install. Can we autodetect the RESUME partition? + RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + + # Inhertic initrd-tools settings if possible. + if [ -e /etc/mkinitrd/mkinitrd.conf ]; then + . /etc/mkinitrd/mkinitrd.conf + fi + + if [ -e ${RESUME} ]; then + sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf + fi + + if [ -e /etc/mkinitrd/DSDT ]; then + cp /etc/mkinitrd/DSDT /etc/mkinitramfs/DSDT.aml + fi + + fi +fi + if [ ! -e /etc/mkinitramfs/modules ]; then cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ fi diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 7bea06f..2af9945 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -1,7 +1,7 @@ #!/bin/sh if [ "x${1}" = "xpurge" ]; then - rm /etc/mkinitramfs/modules + rm -f /etc/mkinitramfs/modules fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index a1b8695..6b91c1f 100644 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,5 @@ include /usr/share/cdbs/1/rules/debhelper.mk -common-build-arch:: +pre-build:: chmod +x init mkinitramfs diff --git a/hook-functions b/hook-functions index 0d79703..5db7d27 100644 --- a/hook-functions +++ b/hook-functions @@ -4,3 +4,136 @@ catenate_cpiogz() { cat "$1" >>${__TMPCPIOGZ} } +add_modules_from_file() +{ + # Sanity check + if [ ! -e ${1} ]; then + return + fi + + sed -e '/^#/d' ${1} | while read module rest; do + manual_add_modules ${module} + echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules + done +} + +manual_add_modules() +{ + for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${DESTDIR}/${mam_x} ]; then + continue + fi + + mkdir -p ${DESTDIR}/$(dirname ${mam_x}) + ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) + depmod -b ${DESTDIR} ${version} + done +} + +# $1 is source +# $2 is relative destination +copy_exec() { + ln -s ${1} ${DESTDIR}/${2} + + # Copy the dependant libraries + for x in $(ldd ${1} 2>/dev/null | sed -e ' + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + libname=$(basename ${x}) + dirname=$(dirname ${x}) + mkdir -p ${DESTDIR}/${dirname} + if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then + ln -s ${x} ${DESTDIR}/${dirname} + fi + done +} + +# Copy entire subtrees to the initramfs +copy_modules_dir() +{ + tmpdir_modbase=${DESTDIR}/lib/modules/${version} + mkdir -p $(dirname ${tmpdir_modbase}/${1}) + cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} +} + +dep_add_modules() +{ + + # Things that are too hard to autodetect. + for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + manual_add_modules ${x} + done + + for x in /sys/bus/pci/devices/*; do + if [ -e ${x}/modalias ]; then + manual_add_modules $(cat ${x}/modalias) + fi + done + + # Give the USB bus a moment to catch up + sleep 2 + + for x in /sys/bus/usb/devices/*; do + if [ -e ${x}/modalias ]; then + manual_add_modules $(cat ${x}/modalias) + fi + done + + if [ -e /proc/ide ]; then + for x in ide-generic ide-disk ide-cd; do + manual_add_modules ${x} + done + fi + + if [ -e /sys/bus/scsi/devices/ ]; then + manual_add_modules sd_mod + fi +} + + +# Modules that we always add to the initramfs +auto_add_modules() +{ + # base + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + manual_add_modules ${x} + done + + # Ethernet + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc 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 + manual_add_modules ${x} + done + + # ide + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + manual_add_modules ${x} + done + + # scsi + for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh 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 + +} + +usage() +{ + cat >&2 << EOF + +Usage: ${0} [OPTION]... <-o outfile> [version] + +Options: + -d confdir Specify an alternative configuration directory. + -k Keep temporary directory used to make the image. + -o outfile Write to outfile. + -r root Override ROOT setting in mkinitrd.conf. + +See ${0}(8) for further details. +EOF + exit 1 + +} + diff --git a/init b/init index e1fee77..38450da 100644 --- a/init +++ b/init @@ -15,6 +15,7 @@ export init=/sbin/init export quiet=n export readonly=y export ROOT= +export resume=${RESUME} export rootmnt=/root for x in $(cat /proc/cmdline); do case $x in @@ -30,6 +31,9 @@ for x in $(cat /proc/cmdline); do boot=*) BOOT=${x#boot=} ;; + resume=*) + resume=${x#resume=} + ;; quiet) quiet=y ;; diff --git a/mkinitramfs b/mkinitramfs index 8092a14..3257c94 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,112 +1,5 @@ #!/bin/sh -# Takes a file containing a list of modules to be added as an -# argument, figures out dependancies, and adds them. -# -# Input file syntax: -# -# # comment -# modprobe_module_name [args ...] -# [...] -# -add_modules_from_file() -{ - # Sanity check - if [ ! -e ${1} ]; then - return - fi - - sed -e '/^#/d' ${1} | while read module rest; do - manual_add_modules ${module} - echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules - done -} - -manual_add_modules() -{ - for mam_x in $(modprobe --set-version=${version} --show-depends ${1} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${DESTDIR}/${mam_x} ]; then - continue - fi - - mkdir -p ${DESTDIR}/$(dirname ${mam_x}) - ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) - depmod -b ${DESTDIR} ${version} - done -} - -# $1 is source -# $2 is relative destination -copy_exec() { - ln -s ${1} ${DESTDIR}/${2} - - # Copy the dependant libraries - for x in $(ldd ${1} 2>/dev/null | sed -e ' - /\//!d; - /linux-gate/d; - /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; - s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do - libname=$(basename ${x}) - dirname=$(dirname ${x}) - mkdir -p ${DESTDIR}/${dirname} - if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then - ln -s ${x} ${DESTDIR}/${dirname} - fi - done -} - -# Copy entire subtrees to the initramfs -copy_modules_dir() -{ - tmpdir_modbase=${DESTDIR}/lib/modules/${version} - mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} -} - -# Modules that we always add to the initramfs -auto_add_modules() -{ - # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} - done - - # Ethernet - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc 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 - manual_add_modules ${x} - done - - # ide - for x in ide-cd ide-disk ide-generic aec62xx cmd64x generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix sc1200 siimage slc82c105 trm290 via82cxxx; do - manual_add_modules ${x} - done - - # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips lpfc mac53c94 megaraid megaraid_mbox megaraid_mm mesh 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 - -} - -usage() -{ - cat >&2 << EOF - -Usage: ${0} [OPTION]... <-o outfile> [version] - -Options: - -d confdir Specify an alternative configuration directory. - -k Keep temporary directory used to make the image. - -o outfile Write to outfile. - -r root Override ROOT setting in mkinitrd.conf. - -See ${0}(8) for further details. -EOF - exit 1 - -} - # Defaults keep="n" CONFDIR="/etc/mkinitramfs" @@ -135,6 +28,7 @@ shift $((${OPTIND} - 1)) # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions +. /usr/share/initramfs-tools/hook-functions . ${CONFDIR}/initramfs.conf @@ -150,6 +44,11 @@ else version="${1}" fi +if dpkg --compare-versions "${version}" lt 2.6.12; then + echo "Kernel version too old. initramfs-tools requires at least 2.6.12." + exit 1 +fi + case ${version} in /lib/modules/*/[!/]*) ;; @@ -192,11 +91,18 @@ for d in bin conf etc lib modules sbin scripts; do mkdir -p ${DESTDIR}/${d} done +# MODULES=list case. Always honour. for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do add_modules_from_file ${x} done -auto_add_modules +if [ "${MODULES}" = "dep" ]; then + dep_add_modules +fi + +if [ "${MODULES}" = "most" ]; then + auto_add_modules +fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. diff --git a/scripts/functions b/scripts/functions index cf9f4a7..10918f8 100644 --- a/scripts/functions +++ b/scripts/functions @@ -194,7 +194,7 @@ load_modules() then continue; else - modprobe -v $m + modprobe -q $m fi done fi @@ -219,4 +219,18 @@ load_modules() scsi_boot_events } +parse_numeric() { + case $1 in + *:*) + minor=${1#*:} + major=${1%:*} + ;; + *) + minor=$((0x${1#??})) + major=$((0x${1%??})) + ;; + esac + + mknod /dev/root b ${major} ${minor} +} diff --git a/scripts/local-top/md b/scripts/local-top/md index 48c3ce6..055e109 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -18,9 +18,12 @@ esac unset raidlvl # Detect raid level -for x in /dev/hd* /dev/sd*; do - raidlvl=$(mdadm --examine ${x} | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - modprobe -q ${raidlvl} +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/') + modprobe -q ${raidlvl} 2>/dev/null done [ x${raidlvl} != x ] || return -- cgit v1.2.3 From 9a9de97229d09d9876575775a080a4056fcffcb5 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 17 Aug 2005 00:01:51 -0400 Subject: initramfs-tools (0.21) breezy; urgency=low "All that I desire to point out is the general principle that life imitates art far more than art imitates life." - Oscar Wilde * mkinitramfs: Define MODULESDIR and use it. * hook-functions: Use MODULESDIR (add_modules_from_file): Do not add .ko extension to file lists. Call force_load instead of twiddling conf/modules directly. (Ubuntu #13372) (force_load): New function. (copy_exec): Attempt to use non-optimsed libraries if available. (Ubuntu #13470) (auto_add_modules) Include forcedeth (Ubuntu #13448) * hooks/kernelextras: New file. (Ubuntu #13414) * debian/initramfs-tools.postinst: Preserve /etc/mkinitrd/modules if possible on new install. (Ubuntu #13372) -- Jeff Bailey Tue, 16 Aug 2005 15:56:00 -0400 --- debian/changelog | 24 ++++++++++++++++++++++++ debian/initramfs-tools.postinst | 4 ++++ hook-functions | 23 +++++++++++++++++++---- hooks/kernelextras | 39 +++++++++++++++++++++++++++++++++++++++ mkinitramfs | 7 +++++-- 5 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 hooks/kernelextras (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 445d581..aaa2dba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.21) breezy; urgency=low + + "All that I desire to point out is the general principle that + life imitates art far more than art imitates life." + - Oscar Wilde + + * mkinitramfs: Define MODULESDIR and use it. + + * hook-functions: Use MODULESDIR + (add_modules_from_file): Do not add .ko extension to file lists. + Call force_load instead of twiddling conf/modules directly. + (Ubuntu #13372) + (force_load): New function. + (copy_exec): Attempt to use non-optimsed libraries if available. + (Ubuntu #13470) + (auto_add_modules) Include forcedeth (Ubuntu #13448) + + * hooks/kernelextras: New file. (Ubuntu #13414) + + * debian/initramfs-tools.postinst: Preserve /etc/mkinitrd/modules if + possible on new install. (Ubuntu #13372) + + -- Jeff Bailey Tue, 16 Aug 2005 15:56:00 -0400 + initramfs-tools (0.20) breezy; urgency=low * Depend on cpio. diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index ea92067..fe734cf 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -13,6 +13,10 @@ if [ "$1" = configure ]; then . /etc/mkinitrd/mkinitrd.conf fi + if [ -e /etc/mkinitrd/modules ]; then + cp /etc/mkinitrd/modules /etc/mkinitramfs + fi + if [ -e ${RESUME} ]; then sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf fi diff --git a/hook-functions b/hook-functions index 5db7d27..8642af9 100644 --- a/hook-functions +++ b/hook-functions @@ -4,6 +4,12 @@ catenate_cpiogz() { cat "$1" >>${__TMPCPIOGZ} } +force_load() +{ + manual_add_modules ${module} + echo ${@} >>${DESTDIR}/conf/modules +} + add_modules_from_file() { # Sanity check @@ -12,8 +18,7 @@ add_modules_from_file() fi sed -e '/^#/d' ${1} | while read module rest; do - manual_add_modules ${module} - echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules + force_load ${module} "${rest}" done } @@ -42,8 +47,18 @@ copy_exec() { /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + + # Try to use non-optimised libraries where possible. + # We assume that all HWCAP libraries will be in tls. + nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + + if [ -e ${nonoptlib} ]; then + x=${nonoptlib} + fi + libname=$(basename ${x}) dirname=$(dirname ${x}) + mkdir -p ${DESTDIR}/${dirname} if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then ln -s ${x} ${DESTDIR}/${dirname} @@ -56,7 +71,7 @@ copy_modules_dir() { tmpdir_modbase=${DESTDIR}/lib/modules/${version} mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} + cp -a ${MODULESDIR}/${1} ${tmpdir_modbase}/${1} } dep_add_modules() @@ -103,7 +118,7 @@ auto_add_modules() done # Ethernet - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc 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 + 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 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 manual_add_modules ${x} done diff --git a/hooks/kernelextras b/hooks/kernelextras new file mode 100644 index 0000000..d1b8c34 --- /dev/null +++ b/hooks/kernelextras @@ -0,0 +1,39 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading loading extra kernel bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +fbcon=n + +for x in ${MODULESDIR}/initrd/*; do + x=${x##*/} + x=${x%.*} + case ${x} in + *fb) + fbcon=y + ;; + esac + + force_load ${x} +done + +if [ ${fbcon} = "y" ]; then + force_load fbcon +fi + diff --git a/mkinitramfs b/mkinitramfs index 3257c94..7344a03 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -70,8 +70,10 @@ if [ -d ${outfile} ]; then exit 1 fi -if [ ! -e /lib/modules/${version} ]; then - echo "Cannot find /lib/modules/${version}" +MODULESDIR="/lib/modules/${version}" + +if [ ! -e ${MODULESDIR} ]; then + echo "Cannot find ${MODULESDIR}" exit 1 fi @@ -80,6 +82,7 @@ __TMPCPIOGZ=$(mktemp -t mkinitramfs-OL_XXXXXX) || exit 1 # Export environment for hook scripts. # +export MODULESDIR export version export CONFDIR export DESTDIR -- cgit v1.2.3 From f0a04306ac01b22e80cbd1d2a7578a1a3efa6e5f Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 25 Aug 2005 16:21:19 -0400 Subject: initramfs-tools (0.23) breezy; urgency=low "This suspense is terrible. I hope it will last." - Oscar Wilde * scripts/local: Quote ${ROOT} so that an empty value causes us to drop to a shell. Thanks to Matt Zimmerman for this fix! - hook-functions (auto_add_modules): Add atiixp and opti621 to the IDE set. - hook-functions (dep_add_modules): Detect i2o and add i2o_block (auto_add_modules): Include i2o_block. - scripts/functions (i2o_boot_events): New function (load_modules): Call it. (Ubuntu# 13806) Thanks to Tollef Fog Heen for the i2o patch! - debian/control: Depend on udev. Thanks to Alexander Butenko for troubleshooting this with me. - init: Move the /dev directory to the root filesystem. Handle all the udev bind mounts as needed. Make sure input and output is associated with dev/console. - scripts/functions (parse_numeric): Exit if we're refering to a path. Otherwise override root setting to be /dev/root. - init: Call parse_numeric when setting the root variable. - scripts/local-top/lvm: When using a numeric root, call vgchange -ay Don't attempt to start LVM on regular partitions. (Ubuntu #13365, #13778, and some of #13399) - scripts/local-top/lvm: Cope with -'s in the Volume Group and logical volume names. (Ubuntu #13387) Thanks to Stephen Shirley for the patch! -- Jeff Bailey Thu, 25 Aug 2005 11:48:15 -0400 initramfs-tools (0.22) breezy; urgency=low * Fix argument handling in force_load hook-function * Add "sleep 3" to scripts/nfs as a nasty hack around bug #12942 -- Matt Zimmerman Fri, 19 Aug 2005 23:50:16 -0700 --- debian/changelog | 48 ++++++++++++++++++++++++++++++++++++++++- debian/control | 2 +- debian/initramfs-tools.postinst | 1 + hook-functions | 13 +++++++++-- init | 12 ++++++++++- scripts/functions | 15 +++++++++++++ scripts/local | 2 +- scripts/local-top/lvm | 17 ++++++++++++--- scripts/nfs | 1 + 9 files changed, 102 insertions(+), 9 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index aaa2dba..09bc345 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,49 @@ +initramfs-tools (0.23) breezy; urgency=low + + "This suspense is terrible. I hope it will last." + - Oscar Wilde + + * scripts/local: Quote ${ROOT} so that an empty value causes us + to drop to a shell. + Thanks to Matt Zimmerman for this fix! + + - hook-functions (auto_add_modules): Add atiixp and opti621 to + the IDE set. + + - hook-functions (dep_add_modules): Detect i2o and add i2o_block + (auto_add_modules): Include i2o_block. + + - scripts/functions (i2o_boot_events): New function + (load_modules): Call it. (Ubuntu# 13806) + Thanks to Tollef Fog Heen for the i2o patch! + + - debian/control: Depend on udev. + Thanks to Alexander Butenko for troubleshooting this with me. + + - init: Move the /dev directory to the root filesystem. + Handle all the udev bind mounts as needed. + Make sure input and output is associated with dev/console. + + - scripts/functions (parse_numeric): Exit if we're refering to a path. + Otherwise override root setting to be /dev/root. + - init: Call parse_numeric when setting the root variable. + - scripts/local-top/lvm: When using a numeric root, call vgchange -ay + Don't attempt to start LVM on regular partitions. + (Ubuntu #13365, #13778, and some of #13399) + + - scripts/local-top/lvm: Cope with -'s in the Volume Group and + logical volume names. (Ubuntu #13387) + Thanks to Stephen Shirley for the patch! + + -- Jeff Bailey Thu, 25 Aug 2005 11:48:15 -0400 + +initramfs-tools (0.22) breezy; urgency=low + + * Fix argument handling in force_load hook-function + * Add "sleep 3" to scripts/nfs as a nasty hack around bug #12942 + + -- Matt Zimmerman Fri, 19 Aug 2005 23:50:16 -0700 + initramfs-tools (0.21) breezy; urgency=low "All that I desire to point out is the general principle that @@ -20,7 +66,7 @@ initramfs-tools (0.21) breezy; urgency=low * debian/initramfs-tools.postinst: Preserve /etc/mkinitrd/modules if possible on new install. (Ubuntu #13372) - -- Jeff Bailey Tue, 16 Aug 2005 15:56:00 -0400 + -- Jeff Bailey Thu, 18 Aug 2005 00:20:11 -0400 initramfs-tools (0.20) breezy; urgency=low diff --git a/debian/control b/debian/control index cd47480..4120074 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5) +Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5), udev 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 an cpio archive. At boot time, the kernel diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index fe734cf..6e61803 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -15,6 +15,7 @@ if [ "$1" = configure ]; then if [ -e /etc/mkinitrd/modules ]; then cp /etc/mkinitrd/modules /etc/mkinitramfs + sed -i -e 's/mkinitrd/mkinitramfs/g' /etc/mkinitramfs/modules fi if [ -e ${RESUME} ]; then diff --git a/hook-functions b/hook-functions index 8642af9..8ff5267 100644 --- a/hook-functions +++ b/hook-functions @@ -6,7 +6,7 @@ catenate_cpiogz() { force_load() { - manual_add_modules ${module} + manual_add_modules ${@} echo ${@} >>${DESTDIR}/conf/modules } @@ -106,6 +106,10 @@ dep_add_modules() if [ -e /sys/bus/scsi/devices/ ]; then manual_add_modules sd_mod fi + + if [ -e /sys/bus/i2o/devices/ ]; then + manual_add_modules i2o_block + fi } @@ -123,7 +127,7 @@ auto_add_modules() done # ide - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do manual_add_modules ${x} done @@ -132,6 +136,11 @@ auto_add_modules() manual_add_modules ${x} done + # i2o + for x in i2o_block; do + manual_add_modules ${x} + done + } usage() diff --git a/init b/init index 38450da..f3aa221 100644 --- a/init +++ b/init @@ -61,6 +61,9 @@ log_end_msg # Populate /dev tree log_begin_msg "Initializing /dev" +mount -t ramfs none /dev +touch /dev/.initramfs-tools +parse_numeric ${ROOT} udevstart log_end_msg @@ -80,8 +83,15 @@ log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom log_end_msg +# Move our /dev to the real filesystem. Do the setup that udev otherwise +# would. +mkdir -p /dev/.static/dev +chmod 700 /dev/.static/ +mount -o bind /root/dev /dev/.static/dev +mount -o move /dev /root/dev + umount /sys umount /proc # Chain to real filesystem -exec run-init ${rootmnt} ${init} "$@" +exec run-init ${rootmnt} ${init} "$@" /root/dev/console diff --git a/scripts/functions b/scripts/functions index 10918f8..956b1c3 100644 --- a/scripts/functions +++ b/scripts/functions @@ -181,6 +181,15 @@ scsi_boot_events() } +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_modules() { depmod -a @@ -217,10 +226,15 @@ load_modules() ide_boot_events scsi_boot_events + + i2o_boot_events } parse_numeric() { case $1 in + /*) + return + ;; *:*) minor=${1#*:} major=${1%:*} @@ -232,5 +246,6 @@ parse_numeric() { esac mknod /dev/root b ${major} ${minor} + ROOT=/dev/root } diff --git a/scripts/local b/scripts/local index bcc96ad..539a2a4 100644 --- a/scripts/local +++ b/scripts/local @@ -8,7 +8,7 @@ mountroot () log_end_msg # Get the root filesystem type - if [ ! -e ${ROOT} ]; then + if [ ! -e "${ROOT}" ]; then panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" fi diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 4f199de..9307f55 100644 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -15,10 +15,21 @@ prereqs) ;; esac -vg=$(echo ${ROOT} | sed -e 's#/dev/mapper/\(.*\)-.*#\1#') - -[ x${vg} != x ] || return +vg=${ROOT#/dev/mapper/} +case ${vg} in + /dev/root) + unset vg + ;; + /*) + exit 0 + ;; +esac + modprobe -q dm-mod +# Cope with -'s in the volume group and node names. +vg=$(echo ${vg} | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') + vgchange -ay ${vg} + diff --git a/scripts/nfs b/scripts/nfs index 8149e86..10f8f1d 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -29,6 +29,7 @@ mountroot () roflag="-o rw" fi + sleep 3 nfsmount ${roflag} ${NFSROOT} ${rootmnt} log_begin_msg "Running /scripts/nfs-bottom" -- cgit v1.2.3 From 7379c1bbf48cfa9df83dc7e92d169e2db37e3bc8 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 26 Aug 2005 14:39:14 -0400 Subject: initramfs-tools (0.24) breezy; urgency=low "Experience is simply the name we give out mistakes." - Oscar Wilde * hook-functions (auto_add_modules): Add cciss (Ubuntu #14177) Thanks Fabionne! * scripts/functions (parse_numeric): Noop on empty parameter. Fixes LTSP boot failure. Thanks to Oliver Grawert for testing! * scripts/local-top/md: Don't run modprobe when raidlvl is unset. Run mdadm if raidlvl has ever been set, not just if the most recent device checked was part of the raid setup. Thanks to Jeff Waugh for the bug report! * mkinitramfs: Feed the -o argument through readlink -f to get the canonical pathname. -- Jeff Bailey Fri, 26 Aug 2005 09:35:32 -0400 --- debian/changelog | 40 +++++++++++++++++++++++++++++++--------- hook-functions | 2 +- mkinitramfs | 3 ++- scripts/functions | 4 +++- scripts/local-top/md | 8 ++++++-- 5 files changed, 43 insertions(+), 14 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 09bc345..06292ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +initramfs-tools (0.24) breezy; urgency=low + + "Experience is simply the name we give out mistakes." + - Oscar Wilde + + * hook-functions (auto_add_modules): Add cciss + (Ubuntu #14177) Thanks Fabionne! + + * scripts/functions (parse_numeric): Noop on empty parameter. + Fixes LTSP boot failure. Thanks to Oliver Grawert + for testing! + + * scripts/local-top/md: Don't run modprobe when raidlvl is unset. + Run mdadm if raidlvl has ever been set, not just if the most + recent device checked was part of the raid setup. + Thanks to Jeff Waugh for the bug report! + + * mkinitramfs: Feed the -o argument through readlink -f to + get the canonical pathname. + + -- Jeff Bailey Fri, 26 Aug 2005 09:35:32 -0400 + initramfs-tools (0.23) breezy; urgency=low "This suspense is terrible. I hope it will last." @@ -7,31 +29,31 @@ initramfs-tools (0.23) breezy; urgency=low to drop to a shell. Thanks to Matt Zimmerman for this fix! - - hook-functions (auto_add_modules): Add atiixp and opti621 to + * hook-functions (auto_add_modules): Add atiixp and opti621 to the IDE set. - - hook-functions (dep_add_modules): Detect i2o and add i2o_block + * hook-functions (dep_add_modules): Detect i2o and add i2o_block (auto_add_modules): Include i2o_block. - - scripts/functions (i2o_boot_events): New function + * scripts/functions (i2o_boot_events): New function (load_modules): Call it. (Ubuntu# 13806) Thanks to Tollef Fog Heen for the i2o patch! - - debian/control: Depend on udev. + * debian/control: Depend on udev. Thanks to Alexander Butenko for troubleshooting this with me. - - init: Move the /dev directory to the root filesystem. + * init: Move the /dev directory to the root filesystem. Handle all the udev bind mounts as needed. Make sure input and output is associated with dev/console. - - scripts/functions (parse_numeric): Exit if we're refering to a path. + * scripts/functions (parse_numeric): Exit if we're refering to a path. Otherwise override root setting to be /dev/root. - - init: Call parse_numeric when setting the root variable. - - scripts/local-top/lvm: When using a numeric root, call vgchange -ay + * init: Call parse_numeric when setting the root variable. + * scripts/local-top/lvm: When using a numeric root, call vgchange -ay Don't attempt to start LVM on regular partitions. (Ubuntu #13365, #13778, and some of #13399) - - scripts/local-top/lvm: Cope with -'s in the Volume Group and + * scripts/local-top/lvm: Cope with -'s in the Volume Group and logical volume names. (Ubuntu #13387) Thanks to Stephen Shirley for the patch! diff --git a/hook-functions b/hook-functions index 8ff5267..b189c34 100644 --- a/hook-functions +++ b/hook-functions @@ -132,7 +132,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh 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 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 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/mkinitramfs b/mkinitramfs index 7344a03..a93f97c 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -16,7 +16,8 @@ while getopts "d:ko:r:" flag; do fi ;; o) - outfile="${OPTARG}" + touch ${OPTARG} + outfile="$(readlink -f ${OPTARG})" ;; k) keep="y" diff --git a/scripts/functions b/scripts/functions index 956b1c3..4b3b7cf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -232,6 +232,9 @@ load_modules() parse_numeric() { case $1 in + "") + return + ;; /*) return ;; @@ -248,4 +251,3 @@ parse_numeric() { mknod /dev/root b ${major} ${minor} ROOT=/dev/root } - diff --git a/scripts/local-top/md b/scripts/local-top/md index 055e109..c7515fe 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -16,6 +16,7 @@ prereqs) esac unset raidlvl +gotraid=n # Detect raid level for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do @@ -23,9 +24,12 @@ for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do continue fi raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - modprobe -q ${raidlvl} 2>/dev/null + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi done -[ x${raidlvl} != x ] || return +[ "${gotraid}" = y ] || exit /sbin/mdrun /dev -- cgit v1.2.3 From 5582f19f77d283348d946dd4cafcbc2134a3186c Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Sat, 17 Sep 2005 16:45:40 -0400 Subject: initramfs-tools (0.26) breezy; urgency=low "Experience is one thing you can't get for nothing." - Oscar Wilde * scripts/local-top/lvm: Reduce -- to - in VG strings for feeding to vgchange. (Ubuntu: #13387) * update-initramfs: New file * debian/dirs: Add /var/lib/initramfs-tools * hooks/evms: New file * scripts/local-top: New file. * debian/control: Bump klibc depends to 1.0.14-1ubuntu2 for jfs support * hook-scripts (manual_add_modules): Don't do unnecessary depmod (dep_add_modules): No need for a sleep 2 here. Thanks to Matt Zimmmerman for noticing these! * scripts/functions: Attempt resume before loading USB or Network modules to avoid resume issues with USB. Thanks to Matthew Garrett for this patch! * scripts/functions (ide_boot_events): Always load ide-generic before going further. This allows us to catch any hidden IDE controllers that might not otherwise get found. * initramfs.conf.5: New file * debian/initramfs-tools.manpages: Install it. Thanks to maximilian attems for the manpage! * hook-functions (auto_add_modules): Add mptscsih (Ubuntu #15406) Thanks to Jesper Krogh for the bug report! * debian/dirs: Add etc/mkinitramfs/hooks, move all scripts subdirs into etc/mkinitramfs/scripts. * mkinitramfs: Set the umask. Copy the scripts from /etc/mkinitramfs/scripts into the image. Make sure that modules file lists is actually a regular file. * init: Use ${rootmnt} instead of hardcoded /root, use mount -n Fix typo. * hook-functions (catenate_cpiogz): Add sanity check. (add_modules_from_file): Document, quote variable, add warning. * docs/example_hook: Update Thanks to Karl Hegbloom for these previous 5 patches! * init: Create /var/lock on the initramfs Thanks to Jerry Haltom for noticing this! * debian/dirs: rename to ... * debian/initramfs-tools.dirs: ... this. * scripts/functions (scsi_boot_events): Don't attempt to look at ${device}/type if it doesn't actually exist. -- Jeff Bailey Wed, 14 Sep 2005 14:12:24 -0400 --- debian/changelog | 62 +++++++++ debian/control | 2 +- debian/dirs | 10 -- debian/initramfs-tools.dirs | 12 ++ debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + docs/example_hook | 17 ++- hook-functions | 26 +++- hooks/evms | 31 +++++ init | 7 +- initramfs.conf.5 | 62 +++++++++ mkinitramfs | 12 +- scripts/functions | 40 +++++- scripts/local-top/evms | 31 +++++ scripts/local-top/lvm | 4 +- update-initramfs | 281 ++++++++++++++++++++++++++++++++++++++++ 16 files changed, 563 insertions(+), 36 deletions(-) delete mode 100644 debian/dirs create mode 100644 debian/initramfs-tools.dirs create mode 100644 hooks/evms create mode 100644 initramfs.conf.5 create mode 100644 scripts/local-top/evms create mode 100644 update-initramfs (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 38ec69f..7232019 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,65 @@ +initramfs-tools (0.26) breezy; urgency=low + + "Experience is one thing you can't get for nothing." + - Oscar Wilde + + * scripts/local-top/lvm: Reduce -- to - in VG strings for feeding + to vgchange. (Ubuntu: #13387) + + * update-initramfs: New file + * debian/dirs: Add /var/lib/initramfs-tools + + * hooks/evms: New file + * scripts/local-top: New file. + + * debian/control: Bump klibc depends to 1.0.14-1ubuntu2 for jfs support + + * hook-scripts (manual_add_modules): Don't do unnecessary depmod + (dep_add_modules): No need for a sleep 2 here. + Thanks to Matt Zimmmerman for noticing these! + + * scripts/functions: Attempt resume before loading USB or Network + modules to avoid resume issues with USB. + Thanks to Matthew Garrett for this patch! + + * scripts/functions (ide_boot_events): Always load ide-generic + before going further. This allows us to catch any hidden + IDE controllers that might not otherwise get found. + + * initramfs.conf.5: New file + * debian/initramfs-tools.manpages: Install it. + Thanks to maximilian attems for the manpage! + + * hook-functions (auto_add_modules): Add mptscsih (Ubuntu #15406) + Thanks to Jesper Krogh for the bug report! + + * debian/dirs: Add etc/mkinitramfs/hooks, move all scripts subdirs + into etc/mkinitramfs/scripts. + + * mkinitramfs: Set the umask. Copy the scripts from + /etc/mkinitramfs/scripts into the image. + Make sure that modules file lists is actually a regular file. + + * init: Use ${rootmnt} instead of hardcoded /root, use mount -n + Fix typo. + + * hook-functions (catenate_cpiogz): Add sanity check. + (add_modules_from_file): Document, quote variable, add warning. + + * docs/example_hook: Update + Thanks to Karl Hegbloom for these previous 5 patches! + + * init: Create /var/lock on the initramfs + Thanks to Jerry Haltom for noticing this! + + * debian/dirs: rename to ... + * debian/initramfs-tools.dirs: ... this. + + * scripts/functions (scsi_boot_events): Don't attempt to look + at ${device}/type if it doesn't actually exist. + + -- Jeff Bailey Wed, 14 Sep 2005 14:12:24 -0400 + initramfs-tools (0.25) breezy; urgency=low "If there was less sympathy in the world, there would be less diff --git a/debian/control b/debian/control index 4120074..8a1aae1 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5), udev +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5), udev 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 an cpio archive. At boot time, the kernel diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index d35ba7c..0000000 --- a/debian/dirs +++ /dev/null @@ -1,10 +0,0 @@ -etc/mkinitramfs/init-bottom -etc/mkinitramfs/init-premount -etc/mkinitramfs/init-top -etc/mkinitramfs/local-bottom -etc/mkinitramfs/local-premount -etc/mkinitramfs/local-top -etc/mkinitramfs/nfs-bottom -etc/mkinitramfs/nfs-premount -etc/mkinitramfs/nfs-top -usr/share/initramfs-tools/modules.d diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs new file mode 100644 index 0000000..ba4ac4d --- /dev/null +++ b/debian/initramfs-tools.dirs @@ -0,0 +1,12 @@ +etc/mkinitramfs/scripts/init-bottom +etc/mkinitramfs/scripts/init-premount +etc/mkinitramfs/scripts/init-top +etc/mkinitramfs/scripts/local-bottom +etc/mkinitramfs/scripts/local-premount +etc/mkinitramfs/scripts/local-top +etc/mkinitramfs/scripts/nfs-bottom +etc/mkinitramfs/scripts/nfs-premount +etc/mkinitramfs/scripts/nfs-top +etc/mkinitramfs/hooks +usr/share/initramfs-tools/modules.d +/var/lib/initramfs-tools diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 8702d53..3a7a503 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -4,3 +4,4 @@ scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools +update-initramfs usr/sbin diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 61d8057..95edfac 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1 +1,2 @@ mkinitramfs.8 +initramfs.conf.5 diff --git a/docs/example_hook b/docs/example_hook index 27582a7..de5392d 100644 --- a/docs/example_hook +++ b/docs/example_hook @@ -39,6 +39,7 @@ # TODO: Decide what environment variables are meaningful and defined # in this context, then document them as part of the interface. # +# TODO: May need a version_compare function for comparison of VERSION? # @@ -66,18 +67,21 @@ esac # # Source the optional 'hook-functions' scriptlet, if you need the -# functions defined within it: +# functions defined within it. Read it to see what is available to +# you. It contains functions for copying dynamically linked program +# binaries, and kernel modules into the DESTDIR. # -# . /usr/share/initramfs-tools/hook-functions +. /usr/share/initramfs-tools/hook-functions -# If this is a conffile, it must take care to do the right thing when -# the package containing it is removed but not purged. There of +# If this hook script is a conffile (and thus stored in +# /etc/mkinitramfs/hooks), it must take care to do the right thing +# when the package containing it is removed but not purged. There of # course may be other reasons to have custom logic deciding what to -# install. +# install. The version variable may be useful for this. # if [ -x /usr/bin/myprog ]; then - install -D /usr/bin/myprog ${DESTDIR}/usr/bin + copy_exec /usr/bin/myprog usr/bin fi # To accompany this, there should usually be a script for inside the @@ -108,4 +112,3 @@ then fi exit 0 - diff --git a/hook-functions b/hook-functions index b189c34..4371962 100644 --- a/hook-functions +++ b/hook-functions @@ -1,7 +1,13 @@ # -*- shell-script -*- catenate_cpiogz() { - cat "$1" >>${__TMPCPIOGZ} + # Sanity check + if [ ! -e "${1}" ]; then + echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2 + return + fi + + cat "${1}" >>${__TMPCPIOGZ} } force_load() @@ -10,10 +16,20 @@ force_load() echo ${@} >>${DESTDIR}/conf/modules } +# Takes a file containing a list of modules to be added as an +# argument, figures out dependancies, and adds them. +# +# Input file syntax: +# +# # comment +# modprobe_module_name [args ...] +# [...] +# add_modules_from_file() { # Sanity check - if [ ! -e ${1} ]; then + if [ ! -e "${1}" ]; then + echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2 return fi @@ -32,7 +48,6 @@ manual_add_modules() mkdir -p ${DESTDIR}/$(dirname ${mam_x}) ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) - depmod -b ${DESTDIR} ${version} done } @@ -88,9 +103,6 @@ dep_add_modules() fi done - # Give the USB bus a moment to catch up - sleep 2 - for x in /sys/bus/usb/devices/*; do if [ -e ${x}/modalias ]; then manual_add_modules $(cat ${x}/modalias) @@ -132,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 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 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/hooks/evms b/hooks/evms new file mode 100644 index 0000000..0981672 --- /dev/null +++ b/hooks/evms @@ -0,0 +1,31 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +if [ ! -x /sbin/evms_activate ]; then + exit 0 +fi + +copy_exec /sbin/evms_activate /sbin + +EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3; }') + +mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} + +for x in disk lvm2 dos multipath; do + copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} +done diff --git a/init b/init index f11908d..6bf4be7 100644 --- a/init +++ b/init @@ -3,6 +3,7 @@ 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 @@ -53,7 +54,7 @@ for x in $(cat /proc/cmdline); do esac done -log_begin_msg "Running /script/init-top" +log_begin_msg "Running /scripts/init-top" run_scripts /scripts/init-top log_end_msg @@ -89,8 +90,8 @@ log_end_msg # would. mkdir -p /dev/.static/dev chmod 700 /dev/.static/ -mount -o bind /root/dev /dev/.static/dev -mount -o move /dev /root/dev +mount -n -o bind ${rootmnt}/dev /dev/.static/dev +mount -n -o move /dev ${rootmnt}/dev umount /sys umount /proc diff --git a/initramfs.conf.5 b/initramfs.conf.5 new file mode 100644 index 0000000..24cfff7 --- /dev/null +++ b/initramfs.conf.5 @@ -0,0 +1,62 @@ +.TH INITRAMFS.CONF 5 "$Date: 2005/09/13 $" "" "initramfs.conf manual" + +.SH NAME +initramfs.conf \- configuration file for mkinitramfs + +.SH DESCRIPTION +The behaviour of +.B mkinitramfs +can be modified by its configuration file. + +Each line in the file can be a configuration variable, a blank line, +or a comment. The value of an variable is assigned by an statement +of the form: \fIname\fP=[\fIvalue\fP] + +.SH GENERAL VARIABLES +.TP +\fB MODULES +Specifies the modules for the initramfs image. +The default setting is \fImost\fP. + +\fImost\fP adds all the framebuffer, acpi, file system, ide, sata, scsi and usb drivers. + +\fIdep\fP tries to guess which modules are necessary for the running box. + +\fIlist\fP includes only modules from the additional modules list. + +.TP +\fB RESUME +Optional setting of the swap partition to resume from. +The resume= passed on the command line of your boot loader +will override this setting. + +.TP +\fB BUSYBOX +If this is set to \fIy\fP then \fBbusybox\fP will be included on the +initramfs image. You MUST use the -static version. + +.SH NFS VARIABLES +.TP +\fB BOOT +Allows to use an nfs drive as the root of the drive. +The default is to boot of an \fIlocal\fP media (harddrive, USB stick). +Set to \fInfs\fP for an NFS root share. + +.TP +\fB DEVICE +Specifies the network interface, like eth0. + +.TP +\fB NFSROOT +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 mkinitramfs (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. + diff --git a/mkinitramfs b/mkinitramfs index a93f97c..8257b7f 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,7 @@ #!/bin/sh +umask 0022 + # Defaults keep="n" CONFDIR="/etc/mkinitramfs" @@ -97,7 +99,9 @@ done # MODULES=list case. Always honour. for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do - add_modules_from_file ${x} + if [ -f "${x}" ]; then + add_modules_from_file ${x} + fi done if [ "${MODULES}" = "dep" ]; then @@ -115,6 +119,12 @@ ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts +for f in $(cd /etc/mkinitramfs/scripts && \ + find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ + -o -type f -print); do + mkdir --parents ${DESTDIR}/scripts/$(dirname ${f}) +cp -p /etc/mkinitramfs/scripts/${f} ${DESTDIR}/scripts/$(dirname ${f}) +done copy_exec ${CONFDIR}/initramfs.conf /conf cp -a /etc/udev ${DESTDIR}/etc diff --git a/scripts/functions b/scripts/functions index 4b3b7cf..148dda7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -144,10 +144,11 @@ run_scripts() } ide_boot_events() { - [ -e /proc/ide ] || return 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 @@ -156,11 +157,11 @@ ide_boot_events() { 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 ;; + disk) MODULE=ide-disk ;; + cdrom) MODULE=ide-cd ;; + tape) MODULE=ide-tape ;; + floppy) MODULE=ide-floppy ;; + *) MODULE=ide-generic ;; esac modprobe -q ${MODULE} @@ -172,6 +173,7 @@ 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; @@ -208,6 +210,32 @@ load_modules() done fi + for x in /sys/bus/pci/devices/*; do + if [ -e ${x}/class ]; then + case $(cat ${x}/class) in + 0x0100*|0x0101*) + if [ -e ${x}/modalias ]; then + modprobe -q $(cat ${x}/modalias) + fi + ;; + esac + fi + done + + ide_boot_events + + scsi_boot_events + + i2o_boot_events + + 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 + fi + fi + for x in /sys/bus/pci/devices/*; do if [ -e ${x}/modalias ]; then modprobe -q $(cat ${x}/modalias) diff --git a/scripts/local-top/evms b/scripts/local-top/evms new file mode 100644 index 0000000..2ee7e80 --- /dev/null +++ b/scripts/local-top/evms @@ -0,0 +1,31 @@ +#!/bin/sh + +PREREQ="lvm" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +evms=${ROOT#/dev/evms/} + +case ${evms} in + /dev/root) + unset evms + ;; + /*) + exit 0 + ;; +esac + +modprobe -q dm-mod + +/sbin/evms_activate diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 9307f55..7ac81e6 100644 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -28,8 +28,10 @@ esac modprobe -q dm-mod -# Cope with -'s in the volume group and node names. +# Split volume group from logical volume. vg=$(echo ${vg} | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') +# Reduce padded --'s to -'s +vg=$(echo ${vg} | sed -e 's#--#-#g') vgchange -ay ${vg} diff --git a/update-initramfs b/update-initramfs new file mode 100644 index 0000000..9d7d1bc --- /dev/null +++ b/update-initramfs @@ -0,0 +1,281 @@ +#!/bin/sh + +STATEDIR=/var/lib/initramfs-tools +BOOTDIR=/boot + +set -e + +usage() +{ + if [ -n "${1}" ]; then + printf "${@}\n\n" >&2 + fi + cat >&2 << EOF +Usage: ${0} [OPTION]... + +Options: + -k [version] Specify kernel version or ALL + -c Create a new initramfs + -u Update an existing initramfs + -d Remove an existing initramfs + -t Take over a custom initramfs with this one + -v Be verbose + -h This message + +EOF + exit 1 +} + +mild_panic() +{ + if [ -n "${1}" ]; then + printf "${@}\n" >&2 + fi + exit 0 +} + +panic() +{ + if [ -n "${1}" ]; then + printf "${@}\n" >&2 + fi + exit 1 +} + +verbose() +{ + if [ "${verbose}" = 1 ]; then + printf "${@}\n" + fi +} + +version_exists() +{ + [ -e "${STATEDIR}/${1}" ] + return $? +} + +set_initramfs() +{ + initramfs="${BOOTDIR}/initrd.img-${version}" +} + +generate_initramfs() +{ + verbose "Generating ${initramfs}" + mkinitramfs -o ${initramfs} ${version} + set_sha1 +} + +compare_sha1() +{ + sha1sum ${initramfs} | diff ${STATEDIR}/${version} - >/dev/null 2>&1 + return $? +} + +# Note that this must overwrite so that updates work. +set_sha1() +{ + sha1sum ${initramfs} > ${STATEDIR}/${version} +} + +delete_sha1() +{ + rm -f ${STATEDIR}/${version} +} + +get_sorted_versions() +{ + version_list="" + + for gsv_x in ${STATEDIR}/*; do + gsv_x=$(basename ${gsv_x}) + if [ "${gsv_x}" = '*' ]; then + verbose "Nothing to do, exiting." + exit 0 + fi + worklist="" + for gsv_i in $version_list; do + if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then + worklist="${worklist} ${gsv_x} ${gsv_i}" + gsv_x="" + else + worklist="${worklist} ${gsv_i}" + fi + done + if [ "${gsv_x}" != "" ]; then + worklist="${worklist} ${gsv_x}" + fi + version_list=${worklist} + done + + verbose "Available versions: ${version_list}" +} + +set_linked_version() +{ + if [ -L /initrd.img ]; then + linktarget=$(readlink /initrd.img) + fi + + if [ -L /boot/initrd.img ]; then + linktarget=$(readlink /boot/initrd.img) + fi + + if [ -z "${linktarget}" ]; then + return + fi + + version="${linktarget##initrd.img-}" +} + +set_highest_version() +{ + get_sorted_versions + set - ${version_list} + version=${1} +} + +create() +{ + if [ -z "${version}" ]; then + usage "Create mode requires a version argument" + fi + + set_initramfs + + if [ "${takeover}" = 0 ]; then + if version_exists ${version}; then + panic "Cannot create version ${version}: already exists" + fi + + if [ -e ${initramfs} ]; then + panic "${initramfs} already exists, cannot create." + fi + fi + + generate_initramfs +} + +update() +{ + if [ -z "${version}" ]; then + set_linked_version + fi + + if [ -z "${version}" ]; then + set_highest_version + fi + + if [ "${version}" = "all" ]; then + : FIXME check for --yes, and if not ask are you sure + get_sorted_versions + for u_version in ${version_list}; do + if [ "${verbose}" = "1" ]; then + vflag="-v" + fi + # Don't stop if one version doesn't work. + set +e + ${0} ${vflag} -u -k ${u_version} + set -e + done + exit 0 + fi + + set_initramfs + + altered_check + + generate_initramfs + +} + +delete() +{ + if [ -z "${version}" ]; then + usage "Delete mode requires a version argument" + fi + + set_initramfs + + if [ ! -e ${initramfs} ]; then + panic "Cannot delete ${initramfs}, doesn't exist." + fi + + if ! version_exists ${version}; then + panic "Cannot delete version ${version}: Not created by this utility." + fi + + altered_check + + delete_sha1 + + rm -f "${initramfs}" +} + + +altered_check() +{ + if [ "${takeover}" = 0 ]; then + if ! compare_sha1; then + delete_sha1 + mild_panic "${initramfs} was been altered. Cannot update." + fi + fi +} + +# Defaults +verbose=0 +yes=0 +takeover=0 + +## + +while getopts "k:cudyvht" flag; do + case "${flag}" in + k) + version="${OPTARG}" + ;; + c) + mode="c" + ;; + d) + mode="d" + ;; + u) + mode="u" + ;; + v) + verbose="1" + ;; + y) + yes="1" + ;; + t) + takeover="1" + ;; + h) + usage + ;; + esac +done + +# Validate arguments + +if [ -z "${mode}" ]; then + usage "You must specify at least one of -c, -u, or -d." +fi + +case "${mode}" in + c) + create + ;; + d) + delete + ;; + u) + update + ;; +esac + + -- 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 'hook-functions') 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 347d6ecf62c2b0ce237deb38e7e80988b90fc078 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:24:58 +0200 Subject: waldi fixes for newer busybox --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- hook-functions | 30 ------------------------------ hooks/evms | 4 ++-- mkinitramfs | 39 +++++++++++++++++++++------------------ 5 files changed, 37 insertions(+), 51 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index a44d9a6..600d835 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +initramfs-tools (0.31) UNRELEASED; urgency=low + + [ Bastian Blank ] + * debian/control: Add mklibs-copy as dependency. + * hook-functions use mklibs-copy: Remove copy_exec. + * hooks/evms: Use cp instead of copy_exec. + * mkinitramfs + - Use cp instead of copy_exec. + - Call mklibs-copy to collect necessary libs. + + + -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 + initramfs-tools (0.31) unstable; urgency=low Quick fix for sluggish dep diff --git a/debian/control b/debian/control index 6dcbbec..68874cf 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, mdadm, lvm2 (>= 2.01.04-5), udev +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, mdadm, lvm2 (>= 2.01.04-5), udev, mklibs-copy 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 an cpio archive. At boot time, the kernel diff --git a/hook-functions b/hook-functions index bc21b5f..24be12c 100644 --- a/hook-functions +++ b/hook-functions @@ -51,36 +51,6 @@ manual_add_modules() done } -# $1 is source -# $2 is relative destination -copy_exec() { - ln -s ${1} ${DESTDIR}/${2} - - # Copy the dependant libraries - for x in $(ldd ${1} 2>/dev/null | sed -e ' - /\//!d; - /linux-gate/d; - /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; - s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do - - # Try to use non-optimised libraries where possible. - # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') - - if [ -e ${nonoptlib} ]; then - x=${nonoptlib} - fi - - libname=$(basename ${x}) - dirname=$(dirname ${x}) - - mkdir -p ${DESTDIR}/${dirname} - if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then - ln -s ${x} ${DESTDIR}/${dirname} - fi - done -} - # Copy entire subtrees to the initramfs copy_modules_dir() { diff --git a/hooks/evms b/hooks/evms index 0981672..456feac 100755 --- a/hooks/evms +++ b/hooks/evms @@ -20,12 +20,12 @@ if [ ! -x /sbin/evms_activate ]; then exit 0 fi -copy_exec /sbin/evms_activate /sbin +cp /sbin/evms_activate ${DESTDIR}/sbin EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3; }') mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} for x in disk lvm2 dos multipath; do - copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} + cp /lib/evms/${EVMS_VERSION}/${x}* ${DESTDIR}/lib/evms/${EVMS_VERSION} done diff --git a/mkinitramfs b/mkinitramfs index 3866a76..7e9481a 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -117,9 +117,7 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib -copy_exec /usr/share/initramfs-tools/init /init +cp /usr/share/initramfs-tools/init ${DESTDIR}/init cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts for f in $(cd /etc/mkinitramfs/scripts && \ find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ @@ -127,39 +125,44 @@ for f in $(cd /etc/mkinitramfs/scripts && \ mkdir --parents ${DESTDIR}/scripts/$(dirname ${f}) cp -p /etc/mkinitramfs/scripts/${f} ${DESTDIR}/scripts/$(dirname ${f}) done -copy_exec ${CONFDIR}/initramfs.conf /conf +cp ${CONFDIR}/initramfs.conf ${DESTDIR}/conf cp -a /etc/udev ${DESTDIR}/etc # Hack until udev is built with klibc -copy_exec /sbin/udev /sbin -copy_exec /sbin/udevstart /sbin +cp /sbin/udev ${DESTDIR}/sbin +cp /sbin/udevstart ${DESTDIR}/sbin # Busybox -rm ${DESTDIR}/bin/sh -ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh -# This is ugly, but needed atm to make the builtins work =( -ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox +cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox # Modutils -copy_exec /sbin/modprobe /sbin -copy_exec /sbin/depmod /sbin -copy_exec /sbin/rmmod /sbin +cp /sbin/modprobe ${DESTDIR}/sbin +cp /sbin/depmod ${DESTDIR}/sbin +cp /sbin/rmmod ${DESTDIR}/sbin mkdir -p ${DESTDIR}/etc/modprobe.d -copy_exec /etc/modprobe.d/aliases /etc/modprobe.d +cp /etc/modprobe.d/aliases ${DESTDIR}/etc/modprobe.d # Raid -copy_exec /sbin/mdadm /sbin -copy_exec /sbin/mdrun /sbin +cp /sbin/mdadm ${DESTDIR}/sbin +cp /sbin/mdrun ${DESTDIR}/sbin # LVM -copy_exec /lib/lvm-200/vgchange /sbin +cp /lib/lvm-200/vgchange ${DESTDIR}/sbin + +mklibs-small -d ${DESTDIR}/lib --root=${DESTDIR} $(find ${DESTDIR} -type f -perm +0111 -o -name '*.so') + +ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin +ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib + +rm ${DESTDIR}/bin/sh +ln -s busybox ${DESTDIR}/bin/sh run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks # Apply DSDT to initramfs if [ -e ${CONFDIR}/DSDT.aml ]; then - copy_exec ${CONFDIR}/DSDT.aml / + cp ${CONFDIR}/DSDT.aml ${DESTDIR} fi (cd ${DESTDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) -- cgit v1.2.3 From 762c80e985a461a6d37f395696204184ec1f1d64 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:35:08 +0200 Subject: waldi: add ibmvscsic module --- debian/changelog | 2 ++ hook-functions | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 832a67d..7288dcf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ initramfs-tools (0.31) UNRELEASED; urgency=low - Don't call depmod and udevstart. - Don't crawl pci devices ourself. + * hook-functions: Add ibmvscsic to list of scsi modules. + -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 24be12c..c06d3e9 100644 --- a/hook-functions +++ b/hook-functions @@ -114,7 +114,7 @@ auto_add_modules() done # scsi - 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 + 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 ibmvscsic 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 -- cgit v1.2.3 From bee1355e2c21a86751648b6f0df8a6e4e4e5a45d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:38:32 +0200 Subject: added latest upstream fixes :-) --- debian/changelog | 19 ++++++++++++++++++- hook-functions | 4 ++-- init | 4 ++-- scripts/local | 12 ++++++------ scripts/nfs | 18 +++++++++++------- 5 files changed, 39 insertions(+), 18 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 7288dcf..00643e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,7 +24,24 @@ initramfs-tools (0.31) UNRELEASED; urgency=low * hook-functions: Add ibmvscsic to list of scsi modules. - -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 + [ maximilian attems ] + * Resynchronise with latest upstream release. + + [ Jeff Bailey ] + * scripts/nfs (mountroot): New variable: NFSOPTS, default to + -o retranfs=10. (Ubuntu 12942) + This can be overridden in the initramfs.conf file. + Thanks to Oliver Grawert for testing this! + + * hook-scripts (auto_add_modules): Add jfs + (dep_add_modules): Ditto. (Ubuntu #16742) + Thanks to Colin Watson for this fix! + + [ Adam Conrad ] + * Make us a bit more silent/tidy by default, unless "quiet" isn't on + the kernel's command line (then we're just as verbose as ever) + + -- maximilian attems Sun, 16 Oct 2005 19:22:55 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index c06d3e9..cb424d4 100644 --- a/hook-functions +++ b/hook-functions @@ -63,7 +63,7 @@ dep_add_modules() { # Things that are too hard to autodetect. - for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do manual_add_modules ${x} done @@ -99,7 +99,7 @@ dep_add_modules() auto_add_modules() { # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do manual_add_modules ${x} done diff --git a/init b/init index 113a224..18d31ad 100755 --- a/init +++ b/init @@ -97,9 +97,9 @@ log_begin_msg "Mounting root file system" mountroot log_end_msg -log_begin_msg "Running /scripts/init-bottom" +[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom -log_end_msg +[ "$quiet" != "y" ] && log_end_msg # Move our /dev to the real filesystem. Do the setup that udev otherwise # would. diff --git a/scripts/local b/scripts/local index 539a2a4..aa2cbfb 100644 --- a/scripts/local +++ b/scripts/local @@ -3,9 +3,9 @@ # Parameter: Where to mount the filesystem mountroot () { - log_begin_msg "Running /scripts/local-top" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top" run_scripts /scripts/local-top - log_end_msg + [ "$quiet" != "y" ] && log_end_msg # Get the root filesystem type if [ ! -e "${ROOT}" ]; then @@ -14,9 +14,9 @@ mountroot () eval $(fstype < ${ROOT}) - log_begin_msg "Running /scripts/local-premount" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount - log_end_msg + [ "$quiet" != "y" ] && log_end_msg if [ ${readonly} = y ]; then roflag=-r @@ -31,7 +31,7 @@ mountroot () # Mount root mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} - log_begin_msg "Running /scripts/log-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom" run_scripts /scripts/local-bottom - log_end_msg + [ "$quiet" != "y" ] && log_end_msg } diff --git a/scripts/nfs b/scripts/nfs index 10f8f1d..7166b08 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -5,9 +5,9 @@ # Paramter: Where the root should be mounted mountroot () { - log_begin_msg "Running /scripts/nfs-top" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" run_scripts /scripts/nfs-top - log_end_msg + [ "$quiet" != "y" ] && log_end_msg modprobe nfs # For DHCP @@ -19,9 +19,13 @@ mountroot () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi - log_begin_msg "Running /scripts/nfs-premount" + if [ "x${NFSOPTS}" = "x" ]; then + NFSOPTS="-o retrans=10" + fi + + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount" run_scripts /scripts/nfs-premount - log_end_msg + [ "$quiet" != "y" ] && log_end_msg if [ ${readonly} = y ]; then roflag="-o ro" @@ -30,10 +34,10 @@ mountroot () fi sleep 3 - nfsmount ${roflag} ${NFSROOT} ${rootmnt} + nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} - log_begin_msg "Running /scripts/nfs-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom - log_end_msg + [ "$quiet" != "y" ] && log_end_msg } -- cgit v1.2.3 From bbf15576550507c54b3e190ae6eac63ca070e333 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:07:51 +0200 Subject: jonas: Quote variables. Use test options -n and -z. --- debian/changelog | 4 ++- hook-functions | 40 ++++++++++++------------ mkinitramfs | 92 ++++++++++++++++++++++++++++---------------------------- update-initramfs | 28 ++++++++--------- 4 files changed, 83 insertions(+), 81 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 4b75eec..96efc42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,8 +43,10 @@ initramfs-tools (0.31) UNRELEASED; urgency=low [ Jonas Smedegaard ] * Use GNU getopt (instead of bash builtin getopts) for improved handling. + * Quote variables. + * Use test options -n and -z. - -- Jonas Smedegaard Tue, 18 Oct 2005 04:03:48 +0200 + -- Jonas Smedegaard Tue, 18 Oct 2005 04:16:30 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index cb424d4..32a7e5f 100644 --- a/hook-functions +++ b/hook-functions @@ -7,13 +7,13 @@ catenate_cpiogz() { return fi - cat "${1}" >>${__TMPCPIOGZ} + cat "${1}" >>"${__TMPCPIOGZ}" } force_load() { manual_add_modules ${@} - echo ${@} >>${DESTDIR}/conf/modules + echo ${@} >>"${DESTDIR}/conf/modules" } # Takes a file containing a list of modules to be added as an @@ -34,7 +34,7 @@ add_modules_from_file() fi sed -e '/^#/d' ${1} | while read module rest; do - force_load ${module} "${rest}" + force_load "${module}" "${rest}" done } @@ -42,21 +42,21 @@ manual_add_modules() { for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do # Prune duplicates - if [ -e ${DESTDIR}/${mam_x} ]; then + if [ -e "${DESTDIR}/${mam_x}" ]; then continue fi - mkdir -p ${DESTDIR}/$(dirname ${mam_x}) - ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) + mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" + ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" done } # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase=${DESTDIR}/lib/modules/${version} - mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a ${MODULESDIR}/${1} ${tmpdir_modbase}/${1} + tmpdir_modbase="${DESTDIR}/lib/modules/${version}" + mkdir -p "$(dirname "${tmpdir_modbase}/${1}")" + cp -a "${MODULESDIR}/${1}" "${tmpdir_modbase}/${1}" } dep_add_modules() @@ -64,24 +64,24 @@ dep_add_modules() # Things that are too hard to autodetect. for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} + manual_add_modules "${x}" done for x in /sys/bus/pci/devices/*; do - if [ -e ${x}/modalias ]; then - manual_add_modules $(cat ${x}/modalias) + if [ -e "${x}/modalias" ]; then + manual_add_modules $(cat "${x}/modalias") fi done for x in /sys/bus/usb/devices/*; do - if [ -e ${x}/modalias ]; then - manual_add_modules $(cat ${x}/modalias) + if [ -e "${x}/modalias" ]; then + manual_add_modules $(cat "${x}/modalias") fi done if [ -e /proc/ide ]; then for x in ide-generic ide-disk ide-cd; do - manual_add_modules ${x} + manual_add_modules "${x}" done fi @@ -100,27 +100,27 @@ auto_add_modules() { # base for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} + manual_add_modules "${x}" done # Ethernet 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 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 - manual_add_modules ${x} + manual_add_modules "${x}" done # ide for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do - manual_add_modules ${x} + manual_add_modules "${x}" done # scsi 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 ibmvscsic 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} + manual_add_modules "${x}" done # i2o for x in i2o_block; do - manual_add_modules ${x} + manual_add_modules "${x}" done } diff --git a/mkinitramfs b/mkinitramfs index bcf640b..874d2ce 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -30,7 +30,7 @@ while true; do -o) touch $2 shift $2 - outfile="$(readlink -f $2)" + outfile="$(readlink -f "$2")" ;; -k) keep="y" @@ -55,17 +55,17 @@ done . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions -. ${CONFDIR}/initramfs.conf +. "${CONFDIR}/initramfs.conf" -if [ x${outfile} = x ]; then +if [ -z "${outfile}" ]; then usage fi # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd if [ ${#} -ne 1 ]; then - version=$(uname -r) -else + version="$(uname -r)" +else version="${1}" fi @@ -74,36 +74,36 @@ if dpkg --compare-versions "${version}" lt 2.6.12; then exit 1 fi -case ${version} in +case "${version}" in /lib/modules/*/[!/]*) ;; /lib/modules/[!/]*) - version=${version#/lib/modules/} - version=${version%%/*} + version="${version#/lib/modules/}" + version="${version%%/*}" ;; esac -case ${version} in +case "${version}" in */*) - echo $PROG: ${version} is not a valid kernel version >&2 + echo "$PROG: ${version} is not a valid kernel version" >&2 exit 1 ;; esac -if [ -d ${outfile} ]; then +if [ -d "${outfile}" ]; then echo "${outfile} is a directory" exit 1 fi MODULESDIR="/lib/modules/${version}" -if [ ! -e ${MODULESDIR} ]; then +if [ ! -e "${MODULESDIR}" ]; then echo "Cannot find ${MODULESDIR}" exit 1 fi -DESTDIR=$(mktemp -t -d mkinitramfs_XXXXXX) || exit 1 -__TMPCPIOGZ=$(mktemp -t mkinitramfs-OL_XXXXXX) || exit 1 +DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 +__TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 # Export environment for hook scripts. # @@ -116,13 +116,13 @@ export DESTDIR export __TMPCPIOGZ for d in bin conf etc lib modules sbin scripts; do - mkdir -p ${DESTDIR}/${d} + mkdir -p "${DESTDIR}/${d}" done # MODULES=list case. Always honour. -for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do +for x in "${CONFDIR}/modules" /usr/share/initramfs-tools/modules.d/*; do if [ -f "${x}" ]; then - add_modules_from_file ${x} + add_modules_from_file "${x}" fi done @@ -137,60 +137,60 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -cp /usr/share/initramfs-tools/init ${DESTDIR}/init -cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts +cp /usr/share/initramfs-tools/init "${DESTDIR}/init" +cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd /etc/mkinitramfs/scripts && \ find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ -o -type f -print); do - mkdir --parents ${DESTDIR}/scripts/$(dirname ${f}) -cp -p /etc/mkinitramfs/scripts/${f} ${DESTDIR}/scripts/$(dirname ${f}) + mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" +cp -p "/etc/mkinitramfs/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done -cp ${CONFDIR}/initramfs.conf ${DESTDIR}/conf -cp -a /etc/udev ${DESTDIR}/etc +cp "${CONFDIR}/initramfs.conf" "${DESTDIR}/conf" +cp -a /etc/udev "${DESTDIR}/etc" # udev -cp /sbin/udev ${DESTDIR}/sbin -cp /sbin/udevd ${DESTDIR}/sbin -cp /sbin/udevsynthesize ${DESTDIR}/sbin -cp -a /lib/hotplug ${DESTDIR}/lib +cp /sbin/udev "${DESTDIR}/sbin" +cp /sbin/udevd "${DESTDIR}/sbin" +cp /sbin/udevsynthesize "${DESTDIR}/sbin" +cp -a /lib/hotplug "${DESTDIR}/lib" # Busybox -cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox +cp "${BUSYBOXDIR}/busybox" "${DESTDIR}/bin/busybox" # Modutils -cp /sbin/modprobe ${DESTDIR}/sbin -cp /sbin/depmod ${DESTDIR}/sbin -cp /sbin/rmmod ${DESTDIR}/sbin -mkdir -p ${DESTDIR}/etc/modprobe.d -cp /etc/modprobe.d/aliases ${DESTDIR}/etc/modprobe.d +cp /sbin/modprobe "${DESTDIR}/sbin" +cp /sbin/depmod "${DESTDIR}/sbin" +cp /sbin/rmmod "${DESTDIR}/sbin" +mkdir -p "${DESTDIR}/etc/modprobe.d" +cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" # Raid -cp /sbin/mdadm ${DESTDIR}/sbin -cp /sbin/mdrun ${DESTDIR}/sbin +cp /sbin/mdadm "${DESTDIR}/sbin" +cp /sbin/mdrun "${DESTDIR}/sbin" # LVM -cp /lib/lvm-200/vgchange ${DESTDIR}/sbin +cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" -mklibs-copy -d ${DESTDIR}/lib --root=${DESTDIR} $(find ${DESTDIR} -type f -perm +0111 -o -name '*.so') +mklibs-copy -d "${DESTDIR}/lib" --root="${DESTDIR}" $(find "${DESTDIR}" -type f -perm +0111 -o -name '*.so') -ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +ln -s /usr/lib/klibc/bin/* "${DESTDIR}/bin" +ln -s /usr/lib/klibc/lib/* "${DESTDIR}/lib" -rm ${DESTDIR}/bin/sh -ln -s busybox ${DESTDIR}/bin/sh +rm "${DESTDIR}/bin/sh" +ln -s busybox "${DESTDIR}/bin/sh" run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks # Apply DSDT to initramfs -if [ -e ${CONFDIR}/DSDT.aml ]; then - cp ${CONFDIR}/DSDT.aml ${DESTDIR} +if [ -e "${CONFDIR}/DSDT.aml" ]; then + cp "${CONFDIR}/DSDT.aml" "${DESTDIR}" fi -(cd ${DESTDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) +(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") -if [ -s ${__TMPCPIOGZ} ]; then - cat ${__TMPCPIOGZ} >>${outfile} +if [ -s "${__TMPCPIOGZ}" ]; then + cat "${__TMPCPIOGZ}" >>"${outfile}" fi if [ "${keep}" = "y" ]; then diff --git a/update-initramfs b/update-initramfs index bd5a4ab..644a1aa 100644 --- a/update-initramfs +++ b/update-initramfs @@ -63,33 +63,33 @@ set_initramfs() generate_initramfs() { verbose "Generating ${initramfs}" - mkinitramfs -o ${initramfs} ${version} + mkinitramfs -o "${initramfs}" "${version}" set_sha1 } compare_sha1() { - sha1sum ${initramfs} | diff ${STATEDIR}/${version} - >/dev/null 2>&1 + sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1 return $? } # Note that this must overwrite so that updates work. set_sha1() { - sha1sum ${initramfs} > ${STATEDIR}/${version} + sha1sum "${initramfs}" > "${STATEDIR}/${version}" } delete_sha1() { - rm -f ${STATEDIR}/${version} + rm -f "${STATEDIR}/${version}" } get_sorted_versions() { version_list="" - for gsv_x in ${STATEDIR}/*; do - gsv_x=$(basename ${gsv_x}) + for gsv_x in "${STATEDIR}"/*; do + gsv_x="$(basename "${gsv_x}")" if [ "${gsv_x}" = '*' ]; then verbose "Nothing to do, exiting." exit 0 @@ -106,7 +106,7 @@ get_sorted_versions() if [ "${gsv_x}" != "" ]; then worklist="${worklist} ${gsv_x}" fi - version_list=${worklist} + version_list="${worklist}" done verbose "Available versions: ${version_list}" @@ -115,11 +115,11 @@ get_sorted_versions() set_linked_version() { if [ -L /initrd.img ]; then - linktarget=$(basename $(readlink /initrd.img)) + linktarget="$(basename "$(readlink /initrd.img)")" fi if [ -L /boot/initrd.img ]; then - linktarget=$(basename $(readlink /boot/initrd.img)) + linktarget="$(basename "$(readlink /boot/initrd.img)")" fi if [ -z "${linktarget}" ]; then @@ -145,11 +145,11 @@ create() set_initramfs if [ "${takeover}" = 0 ]; then - if version_exists ${version}; then + if version_exists "${version}"; then panic "Cannot create version ${version}: already exists" fi - if [ -e ${initramfs} ]; then + if [ -e "${initramfs}" ]; then panic "${initramfs} already exists, cannot create." fi fi @@ -176,7 +176,7 @@ update() fi # Don't stop if one version doesn't work. set +e - ${0} ${vflag} -u -k ${u_version} + "${0}" "${vflag}" -u -k "${u_version}" set -e done exit 0 @@ -198,11 +198,11 @@ delete() set_initramfs - if [ ! -e ${initramfs} ]; then + if [ ! -e "${initramfs}" ]; then panic "Cannot delete ${initramfs}, doesn't exist." fi - if ! version_exists ${version}; then + if ! version_exists "${version}"; then panic "Cannot delete version ${version}: Not created by this utility." fi -- cgit v1.2.3 From 2546ef6e65c7407c8352e5900cc3564b84bdb466 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:32:37 +0200 Subject: fix my bad hand merging, verified against the last debian-kernel svn tree --- hook-functions | 4 ++-- mkinitramfs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 32a7e5f..189db2e 100644 --- a/hook-functions +++ b/hook-functions @@ -13,7 +13,7 @@ catenate_cpiogz() { force_load() { manual_add_modules ${@} - echo ${@} >>"${DESTDIR}/conf/modules" + echo "${@}" >>"${DESTDIR}/conf/modules" } # Takes a file containing a list of modules to be added as an @@ -40,7 +40,7 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '{ print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue diff --git a/mkinitramfs b/mkinitramfs index 63c9b27..58d42e1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -30,7 +30,7 @@ while true; do -o) touch $2 outfile="$(readlink -f "$2")" - shift $2 + shift 2 ;; -k) keep="y" -- cgit v1.2.3 From 3c777488c38d22c88ca9ca0547e48173aeee1fa7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 09:44:04 +0200 Subject: move the lvm bits to hooks/lvm. allows to remove dependency on lvm as requested by several users. --- debian/changelog | 4 +++- hook-functions | 4 ++-- hooks/lvm | 27 +++++++++++++++++++++++++++ mkinitramfs | 3 --- 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100755 hooks/lvm (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 3c8fe88..37b3509 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,9 @@ initramfs-tools (0.35) unstable; urgency=low * Change name of virtual package that is provided into linux-initramfs-tool. - -- maximilian attems Mon, 24 Oct 2005 09:08:48 +0200 + * Add hooks/lvm, those remove dependency on lvm2. + + -- maximilian attems Mon, 24 Oct 2005 09:38:41 +0200 initramfs-tools (0.32) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 189db2e..0eab2a2 100644 --- a/hook-functions +++ b/hook-functions @@ -63,7 +63,7 @@ dep_add_modules() { # Things that are too hard to autodetect. - for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do manual_add_modules "${x}" done @@ -99,7 +99,7 @@ dep_add_modules() auto_add_modules() { # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do manual_add_modules "${x}" done diff --git a/hooks/lvm b/hooks/lvm new file mode 100755 index 0000000..fa4f8af --- /dev/null +++ b/hooks/lvm @@ -0,0 +1,27 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +if [ ! -x /sbin/vgchange ]; then + exit 0 +fi + +. /usr/share/initramfs-tools/hook-functions + +cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" + +for x in dm_mod; do + manual_add_modules ${x} +done diff --git a/mkinitramfs b/mkinitramfs index d03c346..5b48a9d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -189,9 +189,6 @@ cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" cp /sbin/mdadm "${DESTDIR}/sbin" cp /sbin/mdrun "${DESTDIR}/sbin" -# LVM -cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" - run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks -- cgit v1.2.3 From ab1f8ff4ccf955184a61d1dde6a5891c790b864e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 10:06:15 +0200 Subject: add hooks/md with the needed bits. next step will be to remove deps. --- debian/changelog | 6 ++++-- hook-functions | 4 ++-- hooks/md | 28 ++++++++++++++++++++++++++++ mkinitramfs | 4 ---- 4 files changed, 34 insertions(+), 8 deletions(-) create mode 100755 hooks/md (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 37b3509..399560d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,11 @@ initramfs-tools (0.35) unstable; urgency=low * Change name of virtual package that is provided into linux-initramfs-tool. - * Add hooks/lvm, those remove dependency on lvm2. + * Add hooks/lvm allowing to remove dependency on lvm2. - -- maximilian attems Mon, 24 Oct 2005 09:38:41 +0200 + * Add hooks/md allowing to remove dependency on mdadm. + + -- maximilian attems Mon, 24 Oct 2005 09:49:48 +0200 initramfs-tools (0.32) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 0eab2a2..d222d97 100644 --- a/hook-functions +++ b/hook-functions @@ -63,7 +63,7 @@ dep_add_modules() { # Things that are too hard to autodetect. - for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do + for x in ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do manual_add_modules "${x}" done @@ -99,7 +99,7 @@ dep_add_modules() auto_add_modules() { # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do manual_add_modules "${x}" done diff --git a/hooks/md b/hooks/md new file mode 100755 index 0000000..c06b46b --- /dev/null +++ b/hooks/md @@ -0,0 +1,28 @@ +#!/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 + +cp /sbin/mdadm "${DESTDIR}/sbin" +cp /sbin/mdrun "${DESTDIR}/sbin" + +for x in md raid0 raid1 raid5 raid6; do + manual_add_modules ${x} +done diff --git a/mkinitramfs b/mkinitramfs index 5b48a9d..41f45a7 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -185,10 +185,6 @@ cp /sbin/rmmod "${DESTDIR}/sbin" mkdir -p "${DESTDIR}/etc/modprobe.d" cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" -# Raid -cp /sbin/mdadm "${DESTDIR}/sbin" -cp /sbin/mdrun "${DESTDIR}/sbin" - run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks -- cgit v1.2.3 From aa1e3cb6e0a9ab2d8a34676b719d278caea1bc17 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Nov 2005 19:59:00 +0100 Subject: revert usage of mklibs-copy - reduces python dep. --- debian/changelog | 8 ++++++++ debian/control | 2 +- hook-functions | 30 ++++++++++++++++++++++++++++++ hooks/evms | 4 ++-- hooks/lvm | 2 +- hooks/md | 4 ++-- mkinitramfs | 37 ++++++++++++++++--------------------- 7 files changed, 60 insertions(+), 27 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 05a67bb..637e896 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.39) unstable; urgency=low + + * Revert the mklibs-small usage patch - reduces needed dependencies: + hook-fuctions: Readds copy_exec. + mkinitramfs, hooks/{evms,lvm,md}: Use copy_exec. + + -- maximilian attems Thu, 17 Nov 2005 18:43:19 +0100 + initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] diff --git a/debian/control b/debian/control index 2ff1be9..de0181f 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.070-3), mklibs-copy +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.070-3) 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/hook-functions b/hook-functions index d222d97..c715df5 100644 --- a/hook-functions +++ b/hook-functions @@ -51,6 +51,36 @@ manual_add_modules() done } +# $1 is source +# $2 is relative destination +copy_exec() { + ln -s ${1} ${DESTDIR}/${2} + + # Copy the dependant libraries + for x in $(ldd ${1} 2>/dev/null | sed -e ' + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + + # Try to use non-optimised libraries where possible. + # We assume that all HWCAP libraries will be in tls. + nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + + if [ -e ${nonoptlib} ]; then + x=${nonoptlib} + fi + + libname=$(basename ${x}) + dirname=$(dirname ${x}) + + mkdir -p ${DESTDIR}/${dirname} + if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then + ln -s ${x} ${DESTDIR}/${dirname} + fi + done +} + # Copy entire subtrees to the initramfs copy_modules_dir() { diff --git a/hooks/evms b/hooks/evms index 21dc562..5affeef 100755 --- a/hooks/evms +++ b/hooks/evms @@ -20,14 +20,14 @@ if [ ! -x /sbin/evms_activate ]; then exit 0 fi -cp /sbin/evms_activate ${DESTDIR}/sbin +copy_exec /sbin/evms_activate /sbin EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3; }') mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} for x in disk lvm2 dos multipath; do - cp /lib/evms/${EVMS_VERSION}/${x}* ${DESTDIR}/lib/evms/${EVMS_VERSION} + copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} done for x in dm_mod; do diff --git a/hooks/lvm b/hooks/lvm index fa4f8af..9022dce 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -20,7 +20,7 @@ fi . /usr/share/initramfs-tools/hook-functions -cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" +copy_exec /lib/lvm-200/vgchange /sbin for x in dm_mod; do manual_add_modules ${x} diff --git a/hooks/md b/hooks/md index c06b46b..64b8f9e 100755 --- a/hooks/md +++ b/hooks/md @@ -20,8 +20,8 @@ fi . /usr/share/initramfs-tools/hook-functions -cp /sbin/mdadm "${DESTDIR}/sbin" -cp /sbin/mdrun "${DESTDIR}/sbin" +copy_exec /sbin/mdadm /sbin +copy_exec /sbin/mdrun /sbin for x in md raid0 raid1 raid5 raid6; do manual_add_modules ${x} diff --git a/mkinitramfs b/mkinitramfs index 41f45a7..d7bc38b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -158,7 +158,9 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -cp /usr/share/initramfs-tools/init "${DESTDIR}/init" +ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin +ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd /etc/mkinitramfs/scripts && \ find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ @@ -166,39 +168,32 @@ for f in $(cd /etc/mkinitramfs/scripts && \ mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" cp -p "/etc/mkinitramfs/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done -cp "${CONFDIR}/initramfs.conf" "${DESTDIR}/conf" +copy_exec "${CONFDIR}/initramfs.conf" /conf cp -a /etc/udev "${DESTDIR}/etc" -# udev -cp /sbin/udev "${DESTDIR}/sbin" -cp /sbin/udevd "${DESTDIR}/sbin" -cp /sbin/udevsynthesize "${DESTDIR}/sbin" -cp -a /lib/hotplug "${DESTDIR}/lib" +# Hack until udev is built with klibc +copy_exec /sbin/udev /sbin +copy_exec /sbin/udevd /sbin +copy_exec /sbin/udevsynthesize /sbin # Busybox -cp "${BUSYBOXDIR}/busybox" "${DESTDIR}/bin/busybox" +rm ${DESTDIR}/bin/sh +copy_exec ${BUSYBOXDIR}/busybox /bin/busybox +ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh # Modutils -cp /sbin/modprobe "${DESTDIR}/sbin" -cp /sbin/depmod "${DESTDIR}/sbin" -cp /sbin/rmmod "${DESTDIR}/sbin" +copy_exec /sbin/modprobe /sbin +copy_exec /sbin/depmod /sbin +copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" -cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" +copy_exec /etc/modprobe.d/aliases /etc/modprobe.d run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks -mklibs-copy -d "${DESTDIR}/lib" --root="${DESTDIR}" $(find "${DESTDIR}" -type f -perm +0111 -o -name '*.so') - -ln -s /usr/lib/klibc/bin/* "${DESTDIR}/bin" -ln -s /usr/lib/klibc/lib/* "${DESTDIR}/lib" - -rm "${DESTDIR}/bin/sh" -ln -s busybox "${DESTDIR}/bin/sh" - # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then - cp "${CONFDIR}/DSDT.aml" "${DESTDIR}" + copy_exec "${CONFDIR}/DSDT.aml" / fi (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") -- cgit v1.2.3 From bfd7efb29d7e706d6378ad2b91d2be9d21f8b8ee Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 1 Dec 2005 16:54:49 +0100 Subject: add mptspi to the scsi modules list --- debian/changelog | 8 ++++++++ hook-functions | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 4becc2e..a76d5bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.42) unstable; urgency=low + + * hook-functions: The mptspi module is required for at least some machines + that use the mptscsih. Thanks dann frazier for the patch. + (Closes: #341162) + + -- maximilian attems Thu, 1 Dec 2005 16:42:12 +0100 + initramfs-tools (0.41) unstable; urgency=high "Una mattina mi sono svegliato" diff --git a/hook-functions b/hook-functions index c715df5..9d0bc29 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 advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic 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 ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi 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 -- cgit v1.2.3 From 51aeb44deb330033ad26ffcb1494136a4d0fd159 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 14 Jan 2006 17:40:23 +0100 Subject: fix MODULES=dep due to modprobe --show-depends printing not only insmod commands but also the install ones. --- debian/changelog | 8 ++++++-- hook-functions | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 79b7c9e..6b63420 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,13 @@ initramfs-tools (0.50) unstable; urgency=low - * EVMS takes care of it's own hooks, rm: hooks/evms, scripts/local-top/evms. + * hook-functions: Fix MODULES=dep as `modprobe --show-depends' prints not + only the insmod commands, but also the install ones. Thanks for the patch + to Jean Charles Delepine . (Closes: #342616) + + * hooks/evms, scripts/local-top/evms: EVMS takes care of it's own hooks, rm. Thanks Steinar H. Gunderson . (Closes: 340258) - -- maximilian attems Sat, 14 Jan 2006 17:26:24 +0100 + -- maximilian attems Sat, 14 Jan 2006 17:38:08 +0100 initramfs-tools (0.49) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 9d0bc29..d3fe0a3 100644 --- a/hook-functions +++ b/hook-functions @@ -40,7 +40,7 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '{ print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue -- cgit v1.2.3 From 5ac8871bdc5093eb2b570937dcc37167b904cb8e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 24 Jan 2006 12:27:42 +0100 Subject: sync 0.40ubuntu16 --- debian/changelog | 72 ++++++++++++++++++++++++++++++++++++++++++- debian/control | 2 +- hook-functions | 10 +++++- hooks/thermal | 17 +++++----- init | 6 ++++ mkinitramfs | 4 +++ scripts/functions | 18 ++++++++--- scripts/init-premount/thermal | 16 ++++++---- update-initramfs | 12 ++++++++ 9 files changed, 137 insertions(+), 20 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 1308f23..b82a343 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,12 @@ initramfs-tools (0.51) unstable; urgency=low * mkinitramfs: Use ${CONFDIR} everywhere. - -- maximilian attems Mon, 23 Jan 2006 21:46:45 +0100 + * Sync with 0.40ubuntu16: + - skip 0.40ubuntu15 udev gets fixed to only call update-initramfs + when /etc/mkinitramfs/initramfs.conf is there. + - 0.40ubuntu13 don't take over all initramfs images in Debian. + + -- maximilian attems Tue, 24 Jan 2006 11:12:18 +0100 initramfs-tools (0.50c) unstable; urgency=low @@ -109,6 +114,71 @@ initramfs-tools (0.42) unstable; urgency=low -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu16) dapper; urgency=low + + * Bump klibc-utils dependency to (>= 1.1.16-1), for hppa and ia64. + + -- Adam Conrad Thu, 19 Jan 2006 04:00:39 +1100 + +initramfs-tools (0.40ubuntu15) dapper; urgency=low + + * Drop the udev dependency, so we always get configured before udev. + We can get away with this now that udev hooks/scripts have been split + into the udev package proper. This should close Malone bug #28808. + + -- Adam Conrad Wed, 18 Jan 2006 22:50:27 +1100 + +initramfs-tools (0.40ubuntu14) dapper; urgency=low + + * If copy_exec is asked to copy to the same location twice, check if + we're copying the same file again. If so, do nothing and carry on, if + not, warn that we asked it for an impossibility, and don't overwrite. + + -- Adam Conrad Thu, 12 Jan 2006 18:00:12 +1100 + +initramfs-tools (0.40ubuntu13) dapper; urgency=low + + * Default to taking over other initramfs images in Ubuntu, as this is + more consistent with what our packaging expects to be able to do. + * Make "update-initramfs -u" try to find the running kernel before it + attempts to search the symbolic link list and its own sha1 list. + + -- Adam Conrad Wed, 11 Jan 2006 16:25:20 +1100 + +initramfs-tools (0.40ubuntu12) dapper; urgency=low + + * Oops, move the progress state file into the new directory too. + + -- Adam Conrad Mon, 9 Jan 2006 21:26:44 +1100 + +initramfs-tools (0.40ubuntu11) dapper; urgency=low + + * Move the state directory from /dev/initramfs to /dev/.initramfs + + -- Adam Conrad Mon, 9 Jan 2006 21:17:50 +1100 + +initramfs-tools (0.40ubuntu10) dapper; urgency=low + + * Create the /dev/initramfs directory as soon as we mount /dev, so other + packages that need a playground in /dev can do so in a uniform location. + * Update the usplash progress bar every time we are asked to output a + success or failure value from an init action, and write our progress to + /dev/initramfs for sysv-init to gather up and pick up where we left off. + * Export $DPKG_ARCH in both mkinitramfs (for use by hooks) and initramfs. + * Use $DPKG_ARCH in the thermal hook/script to divide the x86 stuff from + the powerpc stuff, not because we have to, but as an example to others. + + -- Adam Conrad Mon, 9 Jan 2006 10:51:51 +1100 + +initramfs-tools (0.40ubuntu9) dapper; urgency=low + + * Make some changes to cope with the new and improved klibc packaging: + - Add a force to the deletion of ${DESTDIR}/bin/sh, to avoid errors. + - Cope with libklibc moving from /usr/lib/klibc/lib to /lib. + - Bump dependency on klibc-utils to one new enough for the above. + + -- Adam Conrad Thu, 5 Jan 2006 15:13:15 +1100 + initramfs-tools (0.40ubuntu8) dapper; urgency=low * Call modprobe everywhere with "-Qb" to silence messages and allow user diff --git a/debian/control b/debian/control index 4e06b8e..b4124ab 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.14-2), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, udev (>= 0.076-5) 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/hook-functions b/hook-functions index d3fe0a3..000c701 100644 --- a/hook-functions +++ b/hook-functions @@ -54,7 +54,15 @@ manual_add_modules() # $1 is source # $2 is relative destination copy_exec() { - ln -s ${1} ${DESTDIR}/${2} + final_destination=${DESTDIR}/${2}/`basename ${1}` + if [ -L "$final_destination" ]; then + if ! [ `readlink ${final_destination}` = "${1}" ]; then + echo "W:copy_exec: Not copying ${1} to \$DESTDIR${2}/`basename ${1}`, which is already a copy of `readlink ${final_destination}`" >&2 + return + fi + else + ln -s ${1} ${DESTDIR}/${2} + fi # Copy the dependant libraries for x in $(ldd ${1} 2>/dev/null | sed -e ' diff --git a/hooks/thermal b/hooks/thermal index 4426de3..c27c957 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -19,10 +19,13 @@ esac . /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 +case "$DPKG_ARCH" in +# copy the right modules +powerpc|ppc64) + manual_add_modules therm_pm72 + ;; +i386|amd64|ia64) + manual_add_modules fan + manual_add_modules thermal + ;; +esac diff --git a/init b/init index db18f15..e983534 100755 --- a/init +++ b/init @@ -13,9 +13,15 @@ mount -t proc none /proc # are used; which they will be, but it's worth pointing out mount -t tmpfs -o mode=0755 udev /dev touch /dev/.initramfs-tools +mkdir /dev/.initramfs mknod /dev/console c 5 1 mknod /dev/null c 1 3 +# Export the dpkg architecture +export DPKG_ARCH= +. /conf/arch.conf + +# Bring in the main config . /conf/initramfs.conf . /scripts/functions diff --git a/mkinitramfs b/mkinitramfs index 9b9e734..d3d6504 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -126,12 +126,15 @@ fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 +DPKG_ARCH=`dpkg --print-installation-architecture` + # Export environment for hook scripts. # export MODULESDIR export version export CONFDIR export DESTDIR +export DPKG_ARCH # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ @@ -168,6 +171,7 @@ for f in $(cd ${CONFDIR}/scripts && \ mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done +echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf # Busybox diff --git a/scripts/functions b/scripts/functions index f9cad01..7f8fa3c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -35,12 +35,22 @@ log_end_msg() /sbin/usplash_write "SUCCESS ok" fi _log_msg "Done." + update_progress } -# update_progress() # ToDo: NOP placeholder... what else for usplash? -# { -# : -# } +update_progress() +{ + if [ -z "$PROGRESS_STATE" ]; then + export PROGRESS_STATE=0 + fi + + PROGRESS_STATE=$(($PROGRESS_STATE + 1)) + echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state + + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "PROGRESS $PROGRESS_STATE" + fi +} panic() { diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index e0d79c3..a41f6f3 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -15,9 +15,13 @@ prereqs) ;; esac -# For ACPI systems -modprobe -q fan -modprobe -q thermal - -# For ppc64 systems -modprobe -q therm_pm72 +case "$DPKG_ARCH" in +# load the right modules +powerpc|ppc64) + modprobe -q therm_pm72 + ;; +i386|amd64|ia64) + modprobe -q fan + modprobe -q thermal + ;; +esac diff --git a/update-initramfs b/update-initramfs index 644a1aa..0d757b1 100644 --- a/update-initramfs +++ b/update-initramfs @@ -112,6 +112,13 @@ get_sorted_versions() verbose "Available versions: ${version_list}" } +set_current_version() +{ + if [ -f /boot/vmlinu?-`uname -r` ]; then + version=`uname -r` + fi +} + set_linked_version() { if [ -L /initrd.img ]; then @@ -159,6 +166,10 @@ create() update() { + if [ -z "${version}" ]; then + set_current_version + fi + if [ -z "${version}" ]; then set_linked_version fi @@ -227,6 +238,7 @@ altered_check() # Defaults verbose=0 yes=0 +# We default to takeover=1 in Ubuntu, but not Debian takeover=0 ## -- cgit v1.2.3 From e31be60a62406ef81d949eb67ac2bc64e90bf4ad Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 24 Jan 2006 13:10:56 +0100 Subject: take care of modular atkb and i8042. seen on the Debian ppc .config!? --- debian/changelog | 7 ++++++- hook-functions | 2 +- scripts/functions | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index b82a343..9704e27 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,13 @@ initramfs-tools (0.51) unstable; urgency=low - skip 0.40ubuntu15 udev gets fixed to only call update-initramfs when /etc/mkinitramfs/initramfs.conf is there. - 0.40ubuntu13 don't take over all initramfs images in Debian. + + * hook-functions: auto_add_modules atkb and i8042. + + * scripts/functions: on panic modprobe atkb and i8042 - work around for + broken configs, where those are not build in. (Closes: #337497) - -- maximilian attems Tue, 24 Jan 2006 11:12:18 +0100 + -- maximilian attems Tue, 24 Jan 2006 13:04:40 +0100 initramfs-tools (0.50c) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 000c701..bb44d9e 100644 --- a/hook-functions +++ b/hook-functions @@ -137,7 +137,7 @@ dep_add_modules() auto_add_modules() { # base - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do manual_add_modules "${x}" done diff --git a/scripts/functions b/scripts/functions index 7f8fa3c..2113745 100644 --- a/scripts/functions +++ b/scripts/functions @@ -57,6 +57,8 @@ panic() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "QUIT" fi + modprobe -q i8042 + modprobe -q atkbd echo $@ FS1='(initramfs) ' /bin/sh /dev/console 2>&1 } -- cgit v1.2.3 From 830fd3fa51658cf0398cbb037a8485439ae4ce2d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 00:20:17 +0100 Subject: sync with ubuntu22 + some handmerges --- conf/initramfs.conf | 4 ++- debian/changelog | 63 ++++++++++++++++++++++++++++++++++++++++--- hook-functions | 59 +++++++++++++++++++++++----------------- init | 12 +++++++-- initramfs.conf.5 | 2 ++ mkinitramfs | 5 ++++ scripts/functions | 9 +++---- scripts/init-premount/thermal | 1 + scripts/nfs | 4 +-- 9 files changed, 121 insertions(+), 38 deletions(-) (limited to 'hook-functions') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 38a0594..a9cadf7 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -4,12 +4,14 @@ # # -# MODULES: [ most | dep | list ] +# MODULES: [ most | netboot | dep | list ] # # most - Add all framebuffer, acpi, filesystem, and harddrive drivers. # # dep - Try and guess which modules to load. # +# netboot - Add the base modules, network modules, but skip block devices. +# # list - Only include modules from the 'additional modules' list # diff --git a/debian/changelog b/debian/changelog index a20ff37..74facf0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,20 @@ -initramfs-tools (0.52c) unstable; urgency=high +initramfs-tools (0.53) unstable; urgency=high * update-initramfs: set_current_version needs to check against - /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. + /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. Otherwise this builds initramfs for newer handbuild trees too. - -- maximilian attems Mon, 20 Feb 2006 15:46:54 +0100 + * Resync with 0.40ubuntu22: + - mptspi already included + - keep nfsmount for now, we don't want to add further busybox deps. + * Further reduce ubuntudiff: + - scripts/functions: remove duplicate dir check. + - scripts/nfs: add quiet to modules loading. + + * Add kernel-package compat stuff, behaves like mkinitramfs, + but adds the sha1sum for update-initramfs. + + -- maximilian attems Thu, 23 Feb 2006 16:59:56 +0100 initramfs-tools (0.52b) unstable; urgency=high @@ -155,6 +165,53 @@ initramfs-tools (0.42) unstable; urgency=low even if bootloader setting is preferred. -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu22) dapper; urgency=low + + * Add mptspi to the list of SCSI modules put in the initramfs by default, + which is required for some LSI Logic controllers and for the VMware SCSI + controller in recent VMware versions (See launchpad.net/{27187,31229}) + * Fix typo of /dev/disk/by-*, which I wrote as /dev/disks/by-{uuid,label} + * Load i2c-keywest before loading therm_pm72 in the PowerPC thermal hook, + since the latter sometimes needs the former (Closes launchpad.net/27269) + + -- Adam Conrad Tue, 14 Feb 2006 23:28:35 +1100 + +initramfs-tools (0.40ubuntu21) dapper; urgency=low + + * Don't update the progress bar once udev has taken /dev away; + after all, we can't contact usplash anyway at this point. + + -- Scott James Remnant Wed, 8 Feb 2006 14:34:10 +0000 + +initramfs-tools (0.40ubuntu20) dapper; urgency=low + + * Add ... to end of strings to match main boot sequence. + + -- Scott James Remnant Tue, 7 Feb 2006 11:07:50 +0000 + +initramfs-tools (0.40ubuntu19) dapper; urgency=low + + * Change the first of many "Loading modules" to "Loading essential drivers" + to improve debugging when people say it breaks at that stage. + + -- Scott James Remnant Tue, 7 Feb 2006 11:05:15 +0000 + +initramfs-tools (0.40ubuntu18) dapper; urgency=low + + * Add support for selecting root by UUID or LABEL with syntax such as: + root=LABEL=myrootfs or root=UUID=92addf34-0f02-4a0e-bfb2-cbaa1e907b77 + + -- Adam Conrad Fri, 3 Feb 2006 15:55:01 +0000 + +initramfs-tools (0.40ubuntu17) dapper; urgency=low + + * Make auto_add_modules take an argument, so you can use it to add only + some of the auto* modules (like "net" or "ide"), and create a "netboot" + option that only includes base and net (Closes launchpad.net/26426) + * Change the nfs script to use "mount -o nolock" instead of "nfsmount", + to fix some timeouts for ltsp NFS roots (Closes launchpad.net/19196) + + -- Adam Conrad Tue, 31 Jan 2006 11:55:11 +0000 initramfs-tools (0.40ubuntu16) dapper; urgency=low diff --git a/hook-functions b/hook-functions index bb44d9e..51e0a8d 100644 --- a/hook-functions +++ b/hook-functions @@ -136,31 +136,40 @@ dep_add_modules() # Modules that we always add to the initramfs auto_add_modules() { - # base - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do - manual_add_modules "${x}" - done - - # Ethernet - 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 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 - manual_add_modules "${x}" - done - - # ide - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do - manual_add_modules "${x}" - done - - # scsi - 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 ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi 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 - - # i2o - for x in i2o_block; do - manual_add_modules "${x}" - done - + case "$1" in + base) + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + manual_add_modules "${x}" + done + ;; + 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 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 + manual_add_modules "${x}" + done + ;; + ide) + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + manual_add_modules "${x}" + done + ;; + scsi) + 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 ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi 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 + ;; + i2o) + for x in i2o_block; do + manual_add_modules "${x}" + done + ;; + *) + auto_add_modules base + auto_add_modules net + auto_add_modules ide + auto_add_modules scsi + auto_add_modules i2o + ;; + esac } usage() diff --git a/init b/init index 61a8379..f4ec157 100755 --- a/init +++ b/init @@ -41,6 +41,14 @@ for x in $(cat /proc/cmdline); do ;; root=*) ROOT=${x#root=} + case $ROOT in + LABEL=*) + ROOT="/dev/disk/by-label/${ROOT#LABEL=}" + ;; + UUID=*) + ROOT="/dev/disk/by-uuid/${ROOT#UUID=}" + ;; + esac ;; nfsroot=*) NFSROOT=${x#nfsroot=} @@ -84,7 +92,7 @@ run_scripts /scripts/init-top parse_numeric ${ROOT} maybe_break modules -log_begin_msg "Loading modules" +log_begin_msg "Loading essential drivers..." load_modules log_end_msg @@ -94,7 +102,7 @@ run_scripts /scripts/init-premount log_end_msg maybe_break mount -log_begin_msg "Mounting root file system" +log_begin_msg "Mounting root file system..." mountroot log_end_msg diff --git a/initramfs.conf.5 b/initramfs.conf.5 index a1cb341..c289ee2 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -22,6 +22,8 @@ The default setting is \fImost\fP. \fIdep\fP tries to guess which modules are necessary for the running box. +\fInetboot\fP adds the base modules, network modules, but skips block devices. + \fIlist\fP includes only modules from the additional modules list. .TP diff --git a/mkinitramfs b/mkinitramfs index d3d6504..6c2be32 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -158,6 +158,11 @@ if [ "${MODULES}" = "most" ]; then auto_add_modules fi +if [ "${MODULES}" = "netboot" ]; then + auto_add_modules base + auto_add_modules net +fi + # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. diff --git a/scripts/functions b/scripts/functions index c550123..6825519 100644 --- a/scripts/functions +++ b/scripts/functions @@ -40,15 +40,14 @@ log_end_msg() update_progress() { + [ -d /dev/.initramfs ] || return + if [ -z "$PROGRESS_STATE" ]; then export PROGRESS_STATE=0 fi - if [ -d /dev/.initramfs ]; then - PROGRESS_STATE=$(($PROGRESS_STATE + 1)) - echo "PROGRESS_STATE=${PROGRESS_STATE}" \ - > /dev/.initramfs/progress_state - fi + PROGRESS_STATE=$(($PROGRESS_STATE + 1)) + echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "PROGRESS $PROGRESS_STATE" diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index a41f6f3..d59af8a 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,6 +18,7 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) + modprobe -q i2c-keywest modprobe -q therm_pm72 ;; i386|amd64|ia64) diff --git a/scripts/nfs b/scripts/nfs index a2f6c3e..89b5c20 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -9,9 +9,9 @@ mountroot () run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe nfs + modprobe -q nfs # For DHCP - modprobe af_packet + modprobe -q af_packet ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf -- cgit v1.2.3 From b32ee94abe4682241d1b00f430858c5f1ac5d955 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 01:08:13 +0100 Subject: resync ubuntu24 aka nice conf.d --- debian/changelog | 25 +++++++++++++++++++++++-- debian/initramfs-tools.dirs | 1 + debian/initramfs-tools.postinst | 2 +- debian/initramfs-tools.postrm | 1 + debian/initramfs-tools.preinst | 14 ++++++++++++++ hook-functions | 2 +- init | 3 +++ initramfs.conf.5 | 9 ++++++++- mkinitramfs | 12 +++++++++++- 9 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 debian/initramfs-tools.preinst (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 74facf0..bef47a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,15 +4,18 @@ initramfs-tools (0.53) unstable; urgency=high /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. Otherwise this builds initramfs for newer handbuild trees too. - * Resync with 0.40ubuntu22: + * Resync with 0.40ubuntu24: - mptspi already included - keep nfsmount for now, we don't want to add further busybox deps. + - adds mptfc and mptsas modules (closes: #341930) + - adds MODULES=netboot support (closes: #352669) * Further reduce ubuntudiff: - scripts/functions: remove duplicate dir check. - scripts/nfs: add quiet to modules loading. * Add kernel-package compat stuff, behaves like mkinitramfs, - but adds the sha1sum for update-initramfs. + but adds the sha1sum for update-initramfs. Reset takeover=0. + (closes: #353809) -- maximilian attems Thu, 23 Feb 2006 16:59:56 +0100 @@ -165,6 +168,24 @@ initramfs-tools (0.42) unstable; urgency=low even if bootloader setting is preferred. -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 + +initramfs-tools (0.40ubuntu24) dapper; urgency=low + + * Add support for LSI Logic's Fusion MPT SAS and FC controllers as well. + + -- Adam Conrad Thu, 23 Feb 2006 23:27:16 +1100 + +initramfs-tools (0.40ubuntu23) dapper; urgency=low + + * Grow a conf.d directory for config snippets, and toss the RESUME option + in there, to stop editing our own conffile in our maintainer scripts. + * Add a cleverly hackish preinst that will pull the RESUME setting from + old config files, migrate it to conf.d/resume, and reset that part of the + conffile to a factory fresh state. This should fix the unwanted conffile + prompt in breezy->dapper upgrades for people who made no local changes. + + -- Adam Conrad Fri, 17 Feb 2006 15:34:53 +1100 + initramfs-tools (0.40ubuntu22) dapper; urgency=low * Add mptspi to the list of SCSI modules put in the initramfs by default, diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index ba4ac4d..9325057 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -8,5 +8,6 @@ etc/mkinitramfs/scripts/nfs-bottom etc/mkinitramfs/scripts/nfs-premount etc/mkinitramfs/scripts/nfs-top etc/mkinitramfs/hooks +etc/mkinitramfs/conf.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index c6025e5..63ceef8 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -25,7 +25,7 @@ if [ "$1" = configure ]; then fi if [ -e ${RESUME} ]; then - sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf + echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume fi if [ -e /etc/mkinitrd/DSDT ]; then diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 2af9945..0c2d39a 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -2,6 +2,7 @@ if [ "x${1}" = "xpurge" ]; then rm -f /etc/mkinitramfs/modules + rm -f /etc/mkinitramfs/conf.d/resume fi #DEBHELPER# diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst new file mode 100644 index 0000000..3582290 --- /dev/null +++ b/debian/initramfs-tools.preinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +[ -f /etc/mkinitramfs/initramfs.conf ] && . /etc/mkinitramfs/initramfs.conf +if [ -z ${RESUME} ]; then + exit 0 +else + mkdir -p /etc/mkinitramfs/conf.d + echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume + sed -i -e "s/RESUME=.*/#RESUME=/" /etc/mkinitramfs/initramfs.conf +fi + +#DEBHELPER# diff --git a/hook-functions b/hook-functions index 51e0a8d..9b0d949 100644 --- a/hook-functions +++ b/hook-functions @@ -153,7 +153,7 @@ auto_add_modules() done ;; scsi) - 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 ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi 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 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_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 f4ec157..1e4e2fd 100755 --- a/init +++ b/init @@ -23,6 +23,9 @@ export DPKG_ARCH= # Bring in the main config . /conf/initramfs.conf +for i in conf/conf.d/*; do + [ -f ${i} ] && . ${i} +done . /scripts/functions # Parse command line options diff --git a/initramfs.conf.5 b/initramfs.conf.5 index c289ee2..7fb79b1 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -12,6 +12,12 @@ Each line in the file can be a configuration variable, a blank line, or a comment. The value of an variable is assigned by an statement of the form: \fIname\fP=[\fIvalue\fP] +Configuration options can be broken out into configuration snippets and +placed in individual files in the /etc/mkinitramfs/conf.d directory. Files +in this directory are always read \fBafter\fP the main configuration file, +so you can override the settings in the main config file without editing it +directly. + .SH GENERAL VARIABLES .TP \fB MODULES @@ -30,7 +36,8 @@ The default setting is \fImost\fP. \fB RESUME Optional setting of the swap partition to resume from. The resume= passed on the command line of your boot loader -will override this setting. +will override this setting. By default, this is set in +/etc/mkinitramfs/conf.d/resume. .SH NFS VARIABLES .TP diff --git a/mkinitramfs b/mkinitramfs index 6c2be32..06e892d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -77,6 +77,13 @@ fi . /usr/share/initramfs-tools/hook-functions . "${CONFDIR}/initramfs.conf" +EXTRA_CONF='' +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} +done if [ -z "${outfile}" ]; then usage @@ -139,7 +146,7 @@ export DPKG_ARCH # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf etc lib modules sbin scripts; do +for d in bin conf/conf.d etc lib modules sbin scripts; do mkdir -p "${DESTDIR}/${d}" done @@ -178,6 +185,9 @@ cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf +for i in ${EXTRA_CONF}; do + copy_exec ${CONFDIR}/conf.d/${i} /conf/conf.d +done # Busybox rm -f ${DESTDIR}/bin/sh -- cgit v1.2.3 From 308b8323da7e00ae42953152682172e2d3ca1e08 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 09:50:19 +0100 Subject: initial ieee1394 support --- debian/changelog | 4 +++- hook-functions | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index d4858ff..8094038 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,7 +24,9 @@ initramfs-tools (0.53) unstable; urgency=high * mkinitramfs: When invoked with -r switch pass the hardcoded root device to /etc/mkinitramfs/conf.d/root inside the initramfs. - -- maximilian attems Mon, 27 Feb 2006 01:45:56 +0100 + * hook-functions: First shot at IEEE1394 support - add ohci1394 and sbp2. + + -- maximilian attems Mon, 27 Feb 2006 09:45:54 +0100 initramfs-tools (0.52b) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 9b0d949..040aea2 100644 --- a/hook-functions +++ b/hook-functions @@ -157,6 +157,11 @@ auto_add_modules() manual_add_modules "${x}" done ;; + ieee1394) + for x in ohci1394 sbp2; do + manual_add_modules "${x}" + done + ;; i2o) for x in i2o_block; do manual_add_modules "${x}" -- cgit v1.2.3 From 17ffd2765842d306dd1b7c996adf839b6a23d6ab Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 4 Mar 2006 00:06:59 +0100 Subject: add dac960 for alpha --- debian/changelog | 4 +++- hook-functions | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 7872991..1f673bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,9 @@ initramfs-tools (0.54) unstable; urgency=low * debian/copyright: Meniton current bzr archive. (closes: #352738) - -- maximilian attems Tue, 28 Feb 2006 17:43:57 +0100 + * hook-function: Add dac960 scsi driver for alpha arch. (closes: #355162) + + -- maximilian attems Sat, 4 Mar 2006 00:05:35 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 040aea2..bdb657a 100644 --- a/hook-functions +++ b/hook-functions @@ -156,6 +156,12 @@ auto_add_modules() 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 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_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 + case "${DPKG_ARCH}" in + alpha) + for x in dac960; do + manual_add_modules "${x}" + done + esac ;; ieee1394) for x in ohci1394 sbp2; do -- cgit v1.2.3 From 493677ae27c577d0a78fc23ea644a680b0968b54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 17:33:40 +0100 Subject: split up the long lines in audo_add_modules add a bunch of needed modules --- debian/changelog | 23 ++++++++++++++++++----- hook-functions | 38 +++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index e2a24de..b83cd21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,20 +1,33 @@ initramfs-tools (0.54) unstable; urgency=low - * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. + * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. (closes: #354708) * debian/copyright: Meniton current bzr archive. (closes: #352738) - * hook-function: Add dac960 scsi driver for alpha arch. (closes: #355162) + * hook-function: Add dac960 scsi driver. (closes: #355162) - * scripts/local-top/udev-helper: moved from - scripts/init-premount/udev-helper, add code by Scott James Remnant + * scripts/local-top/udev_helper: moved from + scripts/init-premount/udev_helper, add code by Scott James Remnant from the ubuntu udev hook. We now wait on scsi and usb devices to settle, load ide-generic on ide boot only if no root device appeared. The udev hook is adding ide.agent so no longer duplicate that code. - -- maximilian attems Sat, 4 Mar 2006 00:14:00 +0100 + * hook-function: auto_add_modules, split 1000 char wide lines up. + Should allow better diffing. Splitting them out in proper files with + each modules / line costs too much initramfs generation time. + Should allow easier diffing. + + * modules.d/scsi: Add sata_mv thanks Kenshi Muto . + (closes: #355486) + + * hook-function: Add dasd class to auto_add_modules and dd zfcp module. + Thanks to s390 support Bastian Blank . (closes: #355595) + + * modules.d/ide: Add it821x. (closes #352460) + + -- maximilian attems Tue, 7 Mar 2006 00:49:46 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/hook-functions b/hook-functions index bdb657a..90986cb 100644 --- a/hook-functions +++ b/hook-functions @@ -133,35 +133,50 @@ dep_add_modules() } -# Modules that we always add to the initramfs +# The modules "most" classes added per default to the initramfs auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do manual_add_modules "${x}" done ;; 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 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 + 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 \ + 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 manual_add_modules "${x}" done ;; ide) - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ + amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ + generic hpt34x hpt366 it821x ns87415 opti621 pdc202xx_new \ + pdc202xx_old piix rz1000 sc1200 serverworks siimage \ + sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do manual_add_modules "${x}" done ;; scsi) - 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 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_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 dac960 dc395x dmx3191d dpt_i2o eata fdomain \ + 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 \ + sd_mod sym53c8xx tmscsim zfcp; do manual_add_modules "${x}" done - case "${DPKG_ARCH}" in - alpha) - for x in dac960; do - manual_add_modules "${x}" - done - esac ;; ieee1394) for x in ohci1394 sbp2; do @@ -179,6 +194,7 @@ auto_add_modules() auto_add_modules ide auto_add_modules scsi auto_add_modules i2o + auto_add_modules dasd ;; esac } -- cgit v1.2.3 From f5e3b39c44184f553d750ea889fb30eb3978375c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 17:54:00 +0100 Subject: really add the dasd modules; remove superflous ';' --- hook-functions | 5 +++++ scripts/local-top/udev_helper | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 90986cb..03eb87d 100644 --- a/hook-functions +++ b/hook-functions @@ -188,6 +188,11 @@ auto_add_modules() manual_add_modules "${x}" done ;; + dasd) + for x in dasd_eckd_mod dasd_fba_mod; do + manual_add_modules "${x}" + done + ;; *) auto_add_modules base auto_add_modules net diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 8ae47d2..22cd9f7 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -92,4 +92,3 @@ scsi) fi ;; esac -;; -- cgit v1.2.3 From c4a1c8838be207397a4c676db729ed9de416bbba Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Mar 2006 10:32:48 +0100 Subject: fix firewire booting --- debian/changelog | 5 ++++- hook-functions | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index eec885d..24506a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,10 @@ initramfs-tools (0.55) unstable; urgency=low * scripts/local: Use quiet to load the fs. (closes: #339092) - -- maximilian attems Tue, 14 Mar 2006 10:20:03 +0100 + * hook-functions: Really add the ieee1394 modules. + Thanks to Michael Prokop for testing the fix. + + -- maximilian attems Tue, 14 Mar 2006 10:21:34 +0100 initramfs-tools (0.54) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 03eb87d..859f1c6 100644 --- a/hook-functions +++ b/hook-functions @@ -200,6 +200,7 @@ auto_add_modules() auto_add_modules scsi auto_add_modules i2o auto_add_modules dasd + auto_add_modules ieee1394 ;; esac } -- cgit v1.2.3 From 0318bb9b8e61f0a4c9d89ec678a75f6f7ea8c5d5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Mar 2006 12:25:50 +0100 Subject: add verbose mode for mkinitramfs, use it when calling it display which modules gets added, we might want to have even more verbose info, but that is a nice start. add cpqarray module document `-' filename restriction don't exit succesfully if root fs full --- debian/changelog | 17 +++++++++++++++++ hook-functions | 5 ++++- initramfs-tools.8 | 6 +++++- mkinitramfs | 11 ++++++++--- update-initramfs | 6 +++++- 5 files changed, 39 insertions(+), 6 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 8abea21..bfbd682 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.57) unstable; urgency=low + + * mkinitramfs, update-initramfs, hook-functions: + On verbose mode show, which modules gets added to the initramfs. + + * hook-functions: Add cpqarray to the scsi modules - thanks for the patch + to Petter Reinholdtsen . (closes: #357980) + + * initramfs-tools.8: Document that `-' is not allowed to be used in a script + filename - the filenames get used as shell variable. (closes: #355235) + + * mkinitramfs: Don't exit succesfully in a case of a full fs. Leaves the + linux-image unconfigured. Thanks martin f krafft + for pointing to that potential boot failure. (closes: #350875) + + -- maximilian attems Tue, 21 Mar 2006 11:56:29 +0100 + initramfs-tools (0.56) unstable; urgency=low * hooks/md: Add linear module - thanks to Moshe Yudkowsky . diff --git a/hook-functions b/hook-functions index 859f1c6..efce32d 100644 --- a/hook-functions +++ b/hook-functions @@ -48,6 +48,9 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" + if [ -n "${verbose}" -a "${verbose}" = "y" ]; then + echo "Adding module ${mam_x}" + fi done } @@ -166,7 +169,7 @@ auto_add_modules() scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ - cciss ch dac960 dc395x dmx3191d dpt_i2o eata fdomain \ + cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ 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 \ diff --git a/initramfs-tools.8 b/initramfs-tools.8 index a08ef1b..991cff9 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -16,7 +16,11 @@ image itself. They can however cause files to be included in the image. .SS Boot scripts These are included in the initramfs image and normally executed during kernel boot in the early user-space before the root partition has been -mounted. +mounted. + +initramfs-tools uses shell variable names for handling dependencies. +Notice that `-' is not a valid shell variable name and thus should +not be used as script filename. .SH INIT SCRIPT The script which is executed first and is in charge of running all other diff --git a/mkinitramfs b/mkinitramfs index a72865b..b7de71b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -10,7 +10,7 @@ errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" BUSYBOXDIR="/bin" -OPTIONS=`getopt -o d:ko:r: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` +OPTIONS=`getopt -o d:ko:r:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -40,6 +40,10 @@ while true; do ROOT="$2" shift 2 ;; + -v) + verbose="y" + shift + ;; --supported-host-version) supported_host_version="$2" shift 2 @@ -142,6 +146,7 @@ export version export CONFDIR export DESTDIR export DPKG_ARCH +export verbose # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ @@ -210,10 +215,10 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / fi -(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") +(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then - cat "${__TMPCPIOGZ}" >>"${outfile}" + cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 fi if [ "${keep}" = "y" ]; then diff --git a/update-initramfs b/update-initramfs index 08a2f3a..9b69981 100644 --- a/update-initramfs +++ b/update-initramfs @@ -63,7 +63,11 @@ set_initramfs() generate_initramfs() { verbose "Generating ${initramfs}" - mkinitramfs -o "${initramfs}" "${version}" + OPTS="-o" + if [ "${verbose}" = 1 ]; then + OPTS="-v $OPTS" + fi + mkinitramfs $OPTS "${initramfs}" "${version}" set_sha1 } -- cgit v1.2.3 From 4b5cc6ce7567a7075802dd8c3e47dd7cf8e84627 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 26 Mar 2006 21:09:50 +0200 Subject: fix copyright module-init-tools dep gdth lilo minor parsing fixes --- debian/changelog | 28 ++++++++++++++++++++++++++-- debian/control | 2 +- debian/copyright | 13 ++++++++++--- hook-functions | 4 ++-- mkinitramfs-kpkg | 3 ++- scripts/functions | 7 ++++++- 6 files changed, 47 insertions(+), 10 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index bfbd682..a2e8cef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,28 @@ -initramfs-tools (0.57) unstable; urgency=low +initramfs-tools (0.59) unstable; urgency=low + + * debian/copyright: Add years of copyright and authors. + + -- maximilian attems Sun, 26 Mar 2006 21:04:28 +0200 + +initramfs-tools (0.58) unstable; urgency=low + + * hook-functions: Be more carefull about the minor parsing. The fix of + #357332 works for 3 digit roots, but not for hdc6 aka root=1606. + Thanks Martijn Pieters for report + (closes: #358354, #358740). + + * hook-functions: Add gdth to the scsi modules. + + * mkinitramfs-kpkg: Use set -eu to capture full /boot. + Really (closes: #350875) + + * Add dependency on module-init-tools. (closes: #358632) + + * Don't include full path for man page reference. (closes: #358371) + + -- maximilian attems Sun, 26 Mar 2006 16:39:37 +0200 + +initramfs-tools (0.57b) unstable; urgency=low * mkinitramfs, update-initramfs, hook-functions: On verbose mode show, which modules gets added to the initramfs. @@ -7,7 +31,7 @@ initramfs-tools (0.57) unstable; urgency=low to Petter Reinholdtsen . (closes: #357980) * initramfs-tools.8: Document that `-' is not allowed to be used in a script - filename - the filenames get used as shell variable. (closes: #355235) + filename - the filenames get used as shell variable. (closes: #344639) * mkinitramfs: Don't exit succesfully in a case of a full fs. Leaves the linux-image unconfigured. Thanks martin f krafft diff --git a/debian/control b/debian/control index b4124ab..01ddf3b 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.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, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.076-5) 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/debian/copyright b/debian/copyright index d495248..3a3bc5b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,9 +1,7 @@ This package was debianized by Jeff Bailey on Thu, 27 Jan 2005 15:23:52 -0500. -Copyright: - -Author: Jeff Bailey +The current Debian maintainer is maximilian attems The source code up to 0.31 can be found by using "bzr" at: http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools @@ -14,6 +12,15 @@ http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ The Debian tree is maintained with "bzr" at: http://debian.stro.at/bzr-test/initramfs-tools/ +Authors: Jeff Bailey , Adam Conrad , + Scott James Remnant , + maximilian attems + +Copyright: 2005 Jeff Bailey + 2005 - 2006 Adam Conrad + 2005 - 2006 Scott James Remnant + 2005 - 2006 maximilian attems + License: PUBLIC DOMAIN diff --git a/hook-functions b/hook-functions index efce32d..874d55f 100644 --- a/hook-functions +++ b/hook-functions @@ -170,7 +170,7 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ - ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ + 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 \ @@ -220,7 +220,7 @@ Options: -o outfile Write to outfile. -r root Override ROOT setting in mkinitrd.conf. -See ${0}(8) for further details. +See mkinitramfs(8) for further details. EOF exit 1 diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index d36710a..8d32005 100644 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -1,4 +1,5 @@ #!/bin/sh +set -eu STATEDIR=/var/lib/initramfs-tools @@ -10,7 +11,7 @@ Usage: ${0} <-o outfile> [version] Please use update-initramfs(8): ${0} exists for compatibility by kernel-package(5) calls. -See ${0}(8) for further details. +See mkinitramfs-kpkg(8) for further details. EOF exit 1 } diff --git a/scripts/functions b/scripts/functions index 05b7779..8cf6ddc 100644 --- a/scripts/functions +++ b/scripts/functions @@ -189,6 +189,7 @@ load_modules() fi } +# lilo compatibility parse_numeric() { case $1 in "") @@ -201,10 +202,14 @@ parse_numeric() { minor=${1#*:} major=${1%:*} ;; - *) + [0-9][0-9][0-9]) minor=$((0x${1#?})) major=$((0x${1%??})) ;; + *) + minor=$((0x${1#??})) + major=$((0x${1%??})) + ;; esac mknod /dev/root b ${major} ${minor} -- cgit v1.2.3 From d471f025bf9e5ff0217cc387250be4a410a90aba Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 21 Jun 2006 09:48:23 +0200 Subject: - News entry for the confdir mv - check for doc befor copying modules - add arcmsr to scsi module - tighten udev dep --- debian/NEWS | 11 +++++++++++ debian/changelog | 16 ++++++++++++++++ debian/control | 2 +- debian/initramfs-tools.postinst | 7 ++++++- hook-functions | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/debian/NEWS b/debian/NEWS index e755806..d4647d4 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,14 @@ +initramfs-tools (0.61) unstable; urgency=low + + * This release moves the initramfs-tools confdir from /etc/mkinitramfs to + /etc/initramfs-tools. Packages are encouraged to ship files as scripts + under /usr/share/initramfs-tools. + + Local tests behaved fine, but be warned that this could potentially + cause boot troubles on upgrade. + + -- maximilian attems Wed, 21 Jun 2006 09:16:01 +0200 + initramfs-tools (0.10) breezy; urgency=low * This release includes hardware auto detection in the initramfs. diff --git a/debian/changelog b/debian/changelog index 4a02bdc..ba0fe4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +initramfs-tools (0.62) unstable; urgency=low + + * debian/control: Tighten dep on udev. udev 0.086-1 loads ide-disk. + Can't lower to sarge version anyway as no coldplugg support there. + (closes: #358360, #362816) + + * debian/initramfs-tools.postinst: Check if modules example is available + under doc before copying if not touch $CONFDIR/modules. + (closes: #368043) + + * hook-functions: Add arcmsr to the scsi modules list. + + * debian/NEWS: Add Notice about confdir mv as version 0.61. + + -- maximilian attems Wed, 21 Jun 2006 09:22:23 +0200 + initramfs-tools (0.61) unstable; urgency=low Release "O partigiano portami via" diff --git a/debian/control b/debian/control index bf022d9..6c59d5e 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.076-5) +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) 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/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 94c5c1b..f1cfcfa 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -36,7 +36,12 @@ if [ "$1" = configure ]; then fi if [ ! -e /etc/initramfs-tools/modules ]; then - cp /usr/share/doc/initramfs-tools/examples/modules /etc/initramfs-tools/ + if [ -e /usr/share/doc/initramfs-tools/examples/modules ]; then + cp /usr/share/doc/initramfs-tools/examples/modules \ + /etc/initramfs-tools/ + else + touch /etc/initramfs-tools/modules + fi fi # Regenerate initramfs on upgrade diff --git a/hook-functions b/hook-functions index 874d55f..6d41f2e 100644 --- a/hook-functions +++ b/hook-functions @@ -168,7 +168,7 @@ auto_add_modules() ;; scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ + 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 \ -- cgit v1.2.3 From af6f5f475221846f88a2bbda39a2a93d67556d07 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 2 Jul 2006 19:45:38 +0200 Subject: - move check_minkver() to hook-functions --- debian/changelog | 7 +++++++ hook-functions | 31 +++++++++++++++++++++++++++++++ scripts/functions | 31 ------------------------------- 3 files changed, 38 insertions(+), 31 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 05140ed..5035086 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.68) unstable; urgency=low + + * script/functions, hook-functions: Move check_minkver() to the second + file as it uses dpkg and is run by mkinitramfs and not on boot. + + -- maximilian attems Sun, 2 Jul 2006 19:44:45 +0200 + initramfs-tools (0.67) unstable; urgency=high Release bella, ciao, ciao, ciao! diff --git a/hook-functions b/hook-functions index 6d41f2e..fe10cfe 100644 --- a/hook-functions +++ b/hook-functions @@ -226,3 +226,34 @@ EOF } +# minimal supported kernel version +check_minkver() +{ + curversion=${1} + initdir=${2} + set_initlist + if [ -z ${initdir} ]; then + DPKG_ARCH=`dpkg --print-installation-architecture` + case ${DPKG_ARCH} in + ia64|hppa) + minversion="2.6.15" + ;; + *) + minversion="2.6.12" + ;; + esac + if dpkg --compare-versions "${curversion}" lt "${minversion}"; then + echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + fi + [ -z ${initdir} ] || 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 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + done +} diff --git a/scripts/functions b/scripts/functions index fea6956..c3a3e16 100644 --- a/scripts/functions +++ b/scripts/functions @@ -184,37 +184,6 @@ run_scripts() call_scripts } -check_minkver() -{ - curversion=${1} - initdir=${2} - set_initlist - if [ -z ${initdir} ]; then - DPKG_ARCH=`dpkg --print-installation-architecture` - case ${DPKG_ARCH} in - ia64|hppa) - minversion="2.6.15" - ;; - *) - minversion="2.6.12" - ;; - esac - if dpkg --compare-versions "${curversion}" lt "${minversion}"; then - echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 - echo "W: not generating requested initramfs for kernel ${curversion}" >&2 - exit 2 - fi - fi - [ -z ${initdir} ] || 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 - echo "W: not generating requested initramfs for kernel ${curversion}" >&2 - exit 2 - fi - done -} - # Load custom modules first load_modules() { -- cgit v1.2.3 From 8e9ecf2b5f9ced135e29d12fbe53c727a248934d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 16 Jul 2006 21:14:42 +0200 Subject: big ubuntu merge: - changelog - typos + whitespace + comments + quoting - vga16fb --- debian/changelog | 150 +++++++++++++++++++++++++++++++++++++++- debian/initramfs-tools.install | 2 +- debian/initramfs-tools.postinst | 4 ++ hook-functions | 2 +- hooks/kernelextras | 5 +- init | 8 +-- mkinitramfs | 13 ++-- scripts/local | 13 ++-- update-initramfs | 6 +- 9 files changed, 180 insertions(+), 23 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index ddecf2d..8a519b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.70) unstable; urgency=low + + * Reduce diff against 0.69ubuntu3: + - hook-functions: Fix kernel typo. + - hooks/kernelextras: Fix comment and add vga16fb too. + - init: Whitespace cleanup, add one more quiet check. + - mkinitramfs: Use check_minkver instead of dpkg itself. Whitespace + cleanup and add quoting. + - scripts/local: Whitespace cleanup and add a comment. + - 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. + - initramfs-tools.install, initramfs-tools.postinst and + initramfs-tools.preinst merge 0.69ubuntu3. + + -- maximilian attems Sun, 16 Jul 2006 20:23:41 +0200 + initramfs-tools (0.69b) unstable; urgency=high * debian/initramfs-tools.preinst: Don't depend upon shipped directories @@ -16,6 +33,30 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu3) edgy; urgency=low + + * debian/initramfs-tools.install, debian/initramfs-tools.preinst, + debian/initramfs-tools.postinst: Copy default modules file in the + postinst (when it's actually available) rather than in the preinst (when + it isn't). Copy it from /usr/share/initramfs-tools/ rather than from + /usr/share/doc/initramfs-tools/examples/, per policy. + + -- Colin Watson Thu, 13 Jul 2006 10:04:26 +0100 + +initramfs-tools (0.69ubuntu2) edgy; urgency=low + + * debian/initramfs-tools.preinst: Make sure /etc/initramfs-tools and + /etc/initramfs-tools/conf.d exist before trying to write to them. + + -- Colin Watson Thu, 13 Jul 2006 09:19:05 +0100 + +initramfs-tools (0.69ubuntu1) edgy; urgency=low + + [ Jeff Bailey ] + * Merge from debian unstable. + + -- Jeff Bailey Wed, 12 Jul 2006 19:22:22 -0400 + initramfs-tools (0.69) unstable; urgency=low * scripts/local-premount/suspend, scripts/local-premount/resume: Rename @@ -590,6 +631,84 @@ initramfs-tools (0.42) unstable; urgency=low -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu32) dapper; urgency=low + + * Revert 0.40ubuntu31. This isn't as trivial as it should be. + + -- Matt Zimmerman Sun, 21 May 2006 10:17:50 -0700 + +initramfs-tools (0.40ubuntu31) dapper; urgency=low + + * scripts/local-premount/resume: Print a message when a resume is about to + begin (LP#41137) + + -- Matt Zimmerman Fri, 19 May 2006 15:14:53 -0700 + +initramfs-tools (0.40ubuntu30) dapper; urgency=low + + * This release brought to you by Fujitsu hard drives, which have forced + me to rewrite all my most recent initramfs-tools changes from memory. + * Include arcmsr module in the scsi module list (launchpad.net/40075) + * Abstract out the kernel minversion checking stuff into the function + library, so we can reuse it to check minversion requirements for hook + scripts as well (such as udev, which requires >= 2.6.15 in dapper) + * Bump the kernel minversion to 2.6.15 on hppa and ia64, since they used + initrd-tools with their 2.6.12 kernels in breezy, not initramfs-tools. + * If mkinitramfs fails due to minversion not being met, don't bail out + of update-initramfs, but just exit 0, so upgrades don't halt on it. + * Conditionalise the use of lvm and md in mkinitramfs so it's a no-op if + you don't have those packages installed, but allows for smooth upgrades + if you have older versions that don't ship their own hooks yet. + * Make prereqs conditional on the script/hook actually existing. From + now on, this means that 'PREREQ="udev"' means "run udev first, iff it + happens to be installed". Having the files exist on the filesystem if + you have a HARD dependency should be enforced with package dependencies. + * Add ohci1394 and sbp2 to the scsi module list (launchpad.net/37479) + * Move framebuffer setup from usplash to scripts/local-top/framebuffer + so that people booting with vga=1234 but no splash will still get a + framebuffer instead of a useless black console (launchpad.net/27669) + + -- Adam Conrad Tue, 16 May 2006 19:51:08 +1000 + +initramfs-tools (0.40ubuntu29) dapper; urgency=low + + * Make "update-initramfs -u" try to find the running kernel *after* it + attempts to search the symbolic link list and its own sha1 list. + Using this as a fallback, rather than the default, should solve most + upgrade issues, where people found their initramfs was half-baked. + + -- Adam Conrad Wed, 19 Apr 2006 13:51:35 +1000 + +initramfs-tools (0.40ubuntu28) dapper; urgency=low + + * Add raid10 module to the generic module list (launchpad.net/28028) + * Add cpqarray to the scsi module list (launchpad.net/{26632,35202}) + * Unset debug before we run the real init (launchpad.net/24095) + * Add the gdth module to the default scsi list (launchpad.net/31542) + + -- Adam Conrad Fri, 24 Mar 2006 04:33:44 +1100 + +initramfs-tools (0.40ubuntu27) dapper; urgency=low + + * Drop the evms, lvm and md local-top scripts; they're all provided by + their own packages now. This makes the depdencies rather nicer. + + -- Scott James Remnant Thu, 23 Mar 2006 18:04:48 +0000 + +initramfs-tools (0.40ubuntu26) dapper; urgency=low + + * Make the md and evms local-top scripts pre-requisite the udev one. + + -- Scott James Remnant Thu, 23 Mar 2006 17:54:32 +0000 + +initramfs-tools (0.40ubuntu25) dapper; urgency=low + + * Move the "loop waiting for the root filesystem" code from the udev + premount script to the local mountroot() function where it truly + belongs. + + -- Scott James Remnant Wed, 22 Mar 2006 16:28:46 +0000 + initramfs-tools (0.40ubuntu24) dapper; urgency=low * Add support for LSI Logic's Fusion MPT SAS and FC controllers as well. @@ -879,7 +998,6 @@ initramfs-tools (0.36ubuntu5) dapper; urgency=low -- Scott James Remnant Mon, 21 Nov 2005 08:40:20 +0000 - initramfs-tools (0.36ubuntu4) dapper; urgency=low * Replace all occurances of /etc/mkinitramfs in mkinitramfs with $CONFDIR, @@ -935,6 +1053,15 @@ initramfs-tools (0.37) unstable; urgency=low -- maximilian attems Wed, 26 Oct 2005 09:22:58 +0200 +initramfs-tools (0.36ubuntu1) dapper; urgency=low + + * Forced version bump to minimise the scary until I have a chance to dig + through the ubuntu:debian diffs and do a proper merge of their changes. + * Remove the "Loading, please wait..." message from the top of init, as + we now have other fairly early visual feedback, and this is just ugly. + + -- Adam Conrad Wed, 26 Oct 2005 11:27:36 +1000 + initramfs-tools (0.36) unstable; urgency=low "Sunny Autumn Release" @@ -1054,6 +1181,27 @@ initramfs-tools (0.30) unstable; urgency=low -- maximilian attems Fri, 30 Sep 2005 19:34:55 +0200 +initramfs-tools (0.29) breezy; urgency=low + + "Beauty is a form of genius - is higher, indeed, than genius, as it + needs no explanation." + - Oscar Wilde + + * hook-functions (auto_add_modules): Add advansys. + + * debian/rules: Make sure hooks and scripts are chmod +x + + * init: Add start of debug command line option. + + -- Jeff Bailey Tue, 20 Sep 2005 15:47:42 -0400 + +initramfs-tools (0.28) breezy; urgency=low + + * Run udevstart after loading block drivers - should fix resume from + hibernate on non-LVM systems. + + -- Matthew Garrett Tue, 20 Sep 2005 01:13:31 +0100 + initramfs-tools (0.27) unstable; urgency=low * Remove unused BUSYBOX config option as we use busybox anyway. diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index add5a7f..5514c2e 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -3,8 +3,8 @@ mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/initramfs-tools -conf/modules etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools +conf/modules usr/share/initramfs-tools update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index a8df95e..5f46777 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -2,6 +2,10 @@ set -e +if [ ! -e /etc/initramfs-tools/modules ]; then + cp /usr/share/initramfs-tools/modules /etc/initramfs-tools/ +fi + # Regenerate initramfs on upgrade if [ "$1" = "configure" -a -n "$2" ]; then update-initramfs -u diff --git a/hook-functions b/hook-functions index fe10cfe..9b1bd24 100644 --- a/hook-functions +++ b/hook-functions @@ -243,7 +243,7 @@ check_minkver() ;; esac if dpkg --compare-versions "${curversion}" lt "${minversion}"; then - echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 + echo "W: kernel ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 echo "W: not generating requested initramfs for kernel ${curversion}" >&2 exit 2 fi diff --git a/hooks/kernelextras b/hooks/kernelextras index 815dd25..6bbd6b9 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -15,7 +15,7 @@ prereqs) ;; esac -# Hooks for loading loading extra kernel bits into the initramfs +# Hooks for loading extra kernel bits into the initramfs . /usr/share/initramfs-tools/hook-functions @@ -36,6 +36,9 @@ for x in ${MODULESDIR}/initrd/*; do force_load ${x} done +# And add vga16fb for usplash to use as well +manual_add_modules vga16fb + if [ ${fbcon} = "y" ]; then force_load fbcon fi diff --git a/init b/init index 2beb597..f66281c 100755 --- a/init +++ b/init @@ -31,7 +31,7 @@ export ROOT= # Bring in the main config . /conf/initramfs.conf for i in conf/conf.d/*; do - [ -f ${i} ] && . ${i} + [ -f ${i} ] && . ${i} done . /scripts/functions @@ -105,7 +105,7 @@ for x in $(cat /proc/cmdline); do done if [ -z ${NORESUME} ]; then - export resume=${RESUME} + export resume=${RESUME} fi depmod -a @@ -120,9 +120,9 @@ load_modules log_end_msg maybe_break premount -log_begin_msg "Running /scripts/init-premount" +[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount" run_scripts /scripts/init-premount -log_end_msg +[ "$quiet" != "y" ] && log_end_msg maybe_break mount log_begin_msg "Mounting root file system..." diff --git a/mkinitramfs b/mkinitramfs index a0bec9e..6c048df 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -84,7 +84,7 @@ fi . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' for i in ${CONFDIR}/conf.d/* /usr/share/initramfs-tools/conf.d/*; do - EXTRA_CONF="${EXTRA_CONF} $(basename $i | grep '^[a-z0-9][a-z0-9\._-]*$' | grep -v '\.dpkg-.*$')"; + 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} @@ -102,10 +102,11 @@ else version="${1}" fi -if dpkg --compare-versions "${version}" lt 2.6.12; then - echo "Kernel version too old. initramfs-tools requires at least 2.6.12." - exit 1 -fi +# Check that we're using a new enough kernel version, first for ourselves, +# then for each of the hooks, which can have a MINKVER variable defined +check_minkver ${version} +check_minkver ${version} /usr/share/initramfs-tools/hooks +check_minkver ${version} ${CONFDIR}/hooks case "${version}" in /lib/modules/*/[!/]*) @@ -195,7 +196,7 @@ done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf for i in ${EXTRA_CONF}; do - copy_exec ${CONFDIR}/conf.d/${i} /conf/conf.d + copy_exec "${CONFDIR}/conf.d/${i}" /conf/conf.d done echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root diff --git a/scripts/local b/scripts/local index a565885..8510088 100644 --- a/scripts/local +++ b/scripts/local @@ -25,17 +25,18 @@ mountroot () log_end_msg 0 else log_end_msg 1 || true - fi - if [ -x /sbin/usplash_write ]; then - /sbin/usplash_write "TIMEOUT 15" || true - fi - fi + fi + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "TIMEOUT 15" || true + fi + fi - # We've given up, but we'll let the user fix matters if they can + # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done + # Get the root filesystem type eval $(fstype < ${ROOT}) [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" diff --git a/update-initramfs b/update-initramfs index 71cc90d..866609e 100755 --- a/update-initramfs +++ b/update-initramfs @@ -68,7 +68,7 @@ generate_initramfs() if [ "${verbose}" = 1 ]; then OPTS="-v $OPTS" fi - if mkinitramfs $OPTS "${initramfs}" "${version}"; then + if mkinitramfs "${OPTS}" "${initramfs}" "${version}"; then set_sha1 else mkinitramfs_return="$?" @@ -312,8 +312,8 @@ while getopts "k:cudyvtb:h?" flag; do takeover="1" ;; b) - BOOTDIR="${OPTARG}" - if [ ! -d $BOOTDIR ]; then + BOOTDIR="${OPTARG}" + if [ ! -d "${BOOTDIR}" ]; then echo "Error: ${BOOTDIR} is not a directory." exit 1 fi -- 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 'hook-functions') 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 d1d6763409a1260708423e0092d7bc4182275773 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Aug 2006 15:59:40 +0200 Subject: - really add DAC960 + add megaraid_sas - update TODO - first take at the panic parsing - do_bootloader variable is not case sensitive, catch more cases - if panic is set to 0 reboot and don't open console, needs still work for all other values. --- debian/TODO | 6 +++--- debian/changelog | 20 ++++++++++++++++++++ hook-functions | 11 ++++++----- init | 4 ++++ scripts/functions | 4 ++++ update-initramfs | 5 +++-- 6 files changed, 40 insertions(+), 10 deletions(-) (limited to 'hook-functions') diff --git a/debian/TODO b/debian/TODO index 2c2edc0..7b9bf0a 100644 --- a/debian/TODO +++ b/debian/TODO @@ -5,10 +5,10 @@ TODO o Eliminate ?udev?, ?klibc?, busybox (-> glibc). - o Support list and dep options + o Better heuristics for MODULES=dep option o Default to dep for PPC - Possibly to detect newworld? - o lilo timeouts handling + o udevsettle timeouts handling - o mdadm + lvm2 hooks to their respective packages + o lvm2 hooks to their respective packages diff --git a/debian/changelog b/debian/changelog index f089fe6..995d76d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.75) unstable; urgency=high + + * hook-functions: Add megaraid_sas to the scsi list. Thanks Kenshi Muto + . + + * init: Parse for "panic=" bootarg. + + * hook-functions: Immediately call reboot in the panic function if panic=0 + to disallow any console access for secured boxes. (closes: 378455) + + * debian/TODO: Update to current state + + * update-initramfs: do_bootloader can be set mixed case or upper case. + Catch the obvious Yes and YES too. + + * hook-functions: Really include DAC960 driver. Thanks Tim Small + . (closes: 383486) 2 module fixes thus urgency high. + + -- maximilian attems Fri, 18 Aug 2006 15:35:09 +0200 + initramfs-tools (0.74) unstable; urgency=low * scripts/local-premount/resume: Reuse klibc resume, hardcode path as diff --git a/hook-functions b/hook-functions index 3175cba..08f396d 100644 --- a/hook-functions +++ b/hook-functions @@ -169,12 +169,13 @@ auto_add_modules() scsi) 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 \ + cciss ch cpqarray DAC960 dc395x dmx3191d dpt_i2o eata fdomain \ 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 \ + mac53c94 megaraid megaraid_mbox megaraid_mm megaraid_sas \ + 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 \ sd_mod sym53c8xx tmscsim zfcp; do diff --git a/init b/init index 69d9542..ab679b5 100755 --- a/init +++ b/init @@ -43,6 +43,7 @@ export readonly=y export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} +export panic for x in $(cat /proc/cmdline); do case $x in @@ -81,6 +82,9 @@ for x in $(cat /proc/cmdline); do noresume) NORESUME=y ;; + panic=*) + panic="${x#panic=}" + ;; quiet) quiet=y ;; diff --git a/scripts/functions b/scripts/functions index e9d7a07..178ad5d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -59,6 +59,10 @@ panic() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "QUIT" fi + # Disallow console access + if [ "${panic}" = 0 ]; then + reboot + fi modprobe -q i8042 modprobe -q atkbd echo $@ diff --git a/update-initramfs b/update-initramfs index e7dc586..3ce8f1f 100755 --- a/update-initramfs +++ b/update-initramfs @@ -96,9 +96,10 @@ 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}' \ + do_b=$(awk '/bootloader/{print $2}' \ /etc/kernel-img.conf) - if [ "${do_bootloader}" = "yes" ]; then + if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ + || [ "${do_b}" = "YES" ]; then run_lilo return 0 fi -- cgit v1.2.3 From 45989c9f37db0ef23e984ea559f2da784a028366 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Aug 2006 17:04:33 +0200 Subject: - fix bashism - rename mdadm.conf in mdrun.conf - retry nfsmount - harden init - fix lvm boot script prereqs --- debian/changelog | 20 ++++++++++++++++++ debian/initramfs-tools.postinst | 2 +- hook-functions | 2 +- init | 6 ++++-- mkinitramfs | 11 +++++----- scripts/local | 2 +- scripts/local-top/lvm | 2 +- scripts/local-top/mdrun | 2 +- scripts/nfs | 45 ++++++++++++++++++++++++++++++----------- update-initramfs | 2 +- 10 files changed, 69 insertions(+), 25 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index a5ac22f..bc635a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.77) unstable; urgency=medium + + * mkinitramfs, scripts/local-top/mdrun: Use mdrun.conf as config file. + Ship mdrun unconditionally if around, should help in recovery situations. + + * debian/initramfs-tools.postinst, hook-functions, mkinitramfs, + scripts/local, update-initramfs: Cleanup the "-a" and "-o" bashism. + + * scripts/nfs: Retry to mount NFS on eventual failure. (closes: 377643) + Based on a patch by Vagrant Cascadian . + + * init: Make sure there is an /dev and /root. Usually passed by the kernel. + Also /dev/null or /dev/console might already be shipped. + Based on a patch by David Härdeman . (closes: 340494) + + * scripts/local-top/lvm: Fix prereqs s/mdraid/mdrun, thus urgency medium. + Thanks Rainer Gauweiler for the notice. + + -- maximilian attems Fri, 25 Aug 2006 16:55:56 +0200 + initramfs-tools (0.76) unstable; urgency=medium * debian/control: Tighten klibc to 1.4.19-2 for fixed nuke. (closes: 383730) diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 5f46777..2f36f3f 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -7,7 +7,7 @@ if [ ! -e /etc/initramfs-tools/modules ]; then fi # Regenerate initramfs on upgrade -if [ "$1" = "configure" -a -n "$2" ]; then +if [ "$1" = "configure" ] && [ -n "$2" ]; then update-initramfs -u fi diff --git a/hook-functions b/hook-functions index 08f396d..bfbe56a 100644 --- a/hook-functions +++ b/hook-functions @@ -48,7 +48,7 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" - if [ -n "${verbose}" -a "${verbose}" = "y" ]; then + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then echo "Adding module ${mam_x}" fi done diff --git a/init b/init index 386ec37..a83dc39 100755 --- a/init +++ b/init @@ -2,6 +2,10 @@ echo "Loading, please wait..." +[ -d /dev ] || mkdir -m 0755 /dev +[ -d /root ] || mkdir --mode=0700 /root +[ -e /dev/console ] || mknod /dev/console c 5 1 +[ -e /dev/null ] || mknod /dev/null c 1 3 mkdir /sys mkdir /proc mkdir /tmp @@ -18,8 +22,6 @@ fi mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev > /dev/.initramfs-tools mkdir /dev/.initramfs -mknod /dev/console c 5 1 -mknod /dev/null c 1 3 # Export the dpkg architecture export DPKG_ARCH= diff --git a/mkinitramfs b/mkinitramfs index 759d6cb..d088efa 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -236,10 +236,10 @@ run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks # FIXME: Remove this Raid block after Etch releases -if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then +if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then # use mkinitrd magic for Sarge backwards compat rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')" - echo "rootraiddev=${rootraiddev}" > /conf/mdadm.conf + echo "rootraiddev=${rootraiddev}" > /conf/mdrun.conf mdadm=$(mdadm --detail "${rootraiddev}") echo "${mdadm}" | awk ' $1 == "Number" && $2 == "Major" { start = 1; next } @@ -248,16 +248,17 @@ if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then $2 == 0 && $3 == 0 { next } { devices = devices " " $NF } END { print "devices='\''" devices "'\''" }' \ - >> /conf/mdadm.conf + >> /conf/mdrun.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 fi +[ -x /sbin/mdrun ] && copy_exec /sbin/mdrun /sbin # FIXME: Remove this LVM block after Etch releases -if [ -x /sbin/vgchange -a -d /lib/lvm-200 -a ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then +if [ -x /sbin/vgchange ] && [ -d /lib/lvm-200 ] \ + && [ ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then copy_exec /lib/lvm-200/vgchange /sbin for x in dm_mod dm_snapshot dm_mirror; do manual_add_modules ${x} diff --git a/scripts/local b/scripts/local index 9d71a5e..e7bf23e 100644 --- a/scripts/local +++ b/scripts/local @@ -23,7 +23,7 @@ mountroot () fi slumber=$(( ${slumber} * 10 )) - while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do + while [ ${slumber} -gt 0 ] && [ ! -e "${ROOT}" ]; do /bin/sleep 0.1 slumber=$(( ${slumber} - 1 )) done diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index f9d1490..27053de 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="mdadm mdraid lvm2" +PREREQ="mdadm mdrun lvm2" prereqs() { diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun index 3ed995c..da890c5 100755 --- a/scripts/local-top/mdrun +++ b/scripts/local-top/mdrun @@ -37,7 +37,7 @@ done [ "${gotraid}" = y ] || exit # source the presumed root md and it's info -. ./conf/mdadm.conf +. ./conf/mdrun.conf # assemble root raid first due to initrd-tools compatibility mdadm -A ${rootraiddev} -R -u $uuid $devices diff --git a/scripts/nfs b/scripts/nfs index 844db70..f42ed22 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,17 +2,9 @@ # FIXME This needs error checking -# Paramter: Where the root should be mounted -mountroot () +# parse nfs bootargs + launch ipconfig and nfsmount +do_nfsmount() { - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" - run_scripts /scripts/nfs-top - [ "$quiet" != "y" ] && log_end_msg - - modprobe -q nfs - # For DHCP - modprobe -q af_packet - # support ip options see linux sources Documentation/nfsroot.txt case ${IPOPTS} in none|off) @@ -40,7 +32,7 @@ mountroot () ;; esac - # FIXME: who writes that? + # FIXME: source ipconfig output - might overwrite aboves . /tmp/net-${DEVICE}.conf # get nfs root from dhcp @@ -78,9 +70,38 @@ mountroot () fi nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} +} + +# NFS root mounting +mountroot() +{ + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" + run_scripts /scripts/nfs-top + [ "$quiet" != "y" ] && log_end_msg + + modprobe -q nfs + # For DHCP + modprobe -q af_packet + + # Default delay is around 180s + # FIXME: add usplash info + if [ -z "${ROOTDELAY}" ]; then + delay=180 + else + delay=${ROOTDELAY} + fi + + # loop until nfsmount succeds + # FIXME: another place of init bin hardcoding + while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}/sbin/init ]; do + [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" + do_nfsmount + # FIXME: ipconfig loops every min at least - better param?? + delay=$(( ${delay} - 1 )) + [ "$quiet" != "y" ] && log_end_msg + done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom [ "$quiet" != "y" ] && log_end_msg - } diff --git a/update-initramfs b/update-initramfs index 1ec8c7d..c1e42ab 100755 --- a/update-initramfs +++ b/update-initramfs @@ -95,7 +95,7 @@ run_lilo() # or if "do_bootloader = yes" is set run_bootloader() { - if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then + if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") -- cgit v1.2.3 From 681dc7a7566afa2de5fa7d1edf8aa1c25ec451a6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 19 Sep 2006 23:56:24 +0200 Subject: - more nfs work (timeout, parsing, typo) - lilo codeflow - add lasi700 scsi module --- debian/changelog | 17 +++++++++++++++-- hook-functions | 10 +++++----- scripts/nfs | 14 ++++++-------- update-initramfs | 3 ++- 4 files changed, 28 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 51987c7..d4033ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,22 @@ -initramfs-tools (0.80) unstable; urgency=low +initramfs-tools (0.80) unstable; urgency=high + + Release "O partigiano, portami via, che mi sento di morir." * update-initramfs: Test for lilo executable earlier otherwise an warning would be issued with grub installed and left over lilo config. - -- maximilian attems Tue, 12 Sep 2006 15:59:14 +0200 + * hook-functions: Add lasi700 to the scsi modules. (closes: 387909) Thanks + Nagilum . Thus urgency high. + + * scripts/nfs: Fix typo in ipconfig protocol handling, fix dhcp server + passing ser-ip as part of root-path, retry every second to not hammer + an FAI'ed nfs initramfs network. Thanks for input and patches + Vagrant Cascadian . While we are there refactor + the loop. (closes: 387841, 387808, 387809) + + * update-initramfs: Check if /proc is mounted for ro_boot_check. + + -- maximilian attems Tue, 19 Sep 2006 07:56:47 +0200 initramfs-tools (0.79) unstable; urgency=high diff --git a/hook-functions b/hook-functions index bfbe56a..9f4d890 100644 --- a/hook-functions +++ b/hook-functions @@ -170,11 +170,11 @@ 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 hptiop ibmvscsic initio ipr ips isp1020 lpfc max_scsi \ - mac53c94 megaraid megaraid_mbox megaraid_mm megaraid_sas \ - mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 \ - qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 \ - qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ + gdth hptiop ibmvscsic initio ipr ips isp1020 lasi700 lpfc \ + max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm \ + megaraid_sas 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 \ diff --git a/scripts/nfs b/scripts/nfs index c66e2a1..b3ac06f 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -16,7 +16,7 @@ do_nfsmount() # Bring up device ipconfig ${DEVICE} ;; - dhcp|bootb|rarp|both) + dhcp|bootp|rarp|both) ipconfig -c ${IPOPTS} -d ${DEVICE} ;; *) @@ -49,7 +49,7 @@ do_nfsmount() NFSOPTS="-o ${NFSROOT#*,}" fi NFSROOT=${NFSROOT%%,*} - if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then + if [ "${NFSROOT#:*}" = "$NFSROOT" ]; then NFSROOT=${ROOTSERVER}:${NFSROOT} fi fi @@ -83,7 +83,7 @@ mountroot() modprobe -q af_packet # Default delay is around 180s - # FIXME: add usplash info + # FIXME: add usplash_write info if [ -z "${ROOTDELAY}" ]; then delay=180 else @@ -91,15 +91,13 @@ mountroot() fi # loop until nfsmount succeds - while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}${init} ]; do + while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do [ ${retry_nr} -gt 0 ] && \ [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" do_nfsmount - # FIXME: ipconfig loops every min at least - better param?? - delay=$(( ${delay} - 1 )) - [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg - [ ! -e ${rootmnt}/sbin/init ] && /bin/sleep 0.1 retry_nr=$(( ${retry_nr} + 1 )) + [ ! -e ${rootmnt}${init} ] && /bin/sleep 1 + [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" diff --git a/update-initramfs b/update-initramfs index d1b7026..4a03614 100755 --- a/update-initramfs +++ b/update-initramfs @@ -113,7 +113,7 @@ run_bootloader() fi return 0 fi - if [ -e /etc/lilo.conf ]; then + if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then run_lilo fi } @@ -138,6 +138,7 @@ delete_sha1() # ro /boot is not modified ro_boot_check() { + [ -d /proc ] || return 0 boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." -- cgit v1.2.3 From b8c8f676a5f0da208b27e4d9bac71ae3814a1b97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 27 Sep 2006 16:03:30 +0200 Subject: - mkinitramfs: allow umask setting paranoid - revert an nfs changes small fixes over the place --- debian/changelog | 27 +++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 6 ++++-- hook-functions | 20 +++++++++++--------- mkinitramfs | 10 ++++++++-- scripts/nfs | 2 +- update-initramfs | 4 ++-- 6 files changed, 53 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index d4033ac..6efe40c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +initramfs-tools (0.81) unstable; urgency=low + + Release quick and happy spin j = l + s + + * update-initramfs: Really check for mounted /proc on use. (closes: 388241) + Thanks Alex Owen . While beeing in this business, + check for mounted proc in initramfs-tools.preinst too. + + * hook-functions: Add new scsi drivers aic94xx and stex. Add new net drivers + ehea, ep93xx_eth and qla3xxx. Thus urgency high. + + * update-initramfs: Use set ``--'' to change positional paramaters. Thanks + Jörg Sommer . (closes: 389726) + + * scripts/nfs: Revert to previous handling of dhcp server passing server-ip. + (closes: 387808) + + * debian/initramfs-tools.preinst: Fix comment typo, thanks + shaulka@012.net.il for the patch. (closes: 389486) + + * mkinitramfs: Allow an hook script to set an paranoid umask, considered + useful for shipping gpg keys inside of initramfs. Thanks Max Vozeler + and Lionel Elie Mamane for the + patch. (closes: 381677) + + -- maximilian attems Wed, 27 Sep 2006 15:56:46 +0200 + initramfs-tools (0.80) unstable; urgency=high Release "O partigiano, portami via, che mi sento di morir." diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index b92d393..7b02612 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -8,9 +8,11 @@ case "$1" in mkdir -p /etc/initramfs-tools/conf.d # First time install. Can we autodetect the RESUME partition? - RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + if [ -r /proc/swaps ]; then + RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + fi - # Inhertic initrd-tools settings if possible. + # Inherit initrd-tools settings if possible. if [ -e /etc/mkinitrd/mkinitrd.conf ]; then . /etc/mkinitrd/mkinitrd.conf fi diff --git a/hook-functions b/hook-functions index 9f4d890..9cb9712 100644 --- a/hook-functions +++ b/hook-functions @@ -148,9 +148,10 @@ 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 myri10ge natsemi ne2k-pci netconsole \ - ns83820 pcnet32 r8169 s2io sis900 skge slhc smc911x starfire \ + dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ + famachi forcedeth hp100 mace mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ + 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 @@ -168,17 +169,18 @@ auto_add_modules() ;; scsi) 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 hptiop ibmvscsic initio ipr ips isp1020 lasi700 lpfc \ - max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm \ - megaraid_sas mesh mptfc mptscsih mptsas mptspi nsp32 \ + aic79xx aic7xxx aic94xx arcmsr ata_piix atari_scsi \ + atp870u BusLogic cciss ch cpqarray DAC960 dc395x \ + dmx3191d dpt_i2o eata fdomain gdth hptiop ibmvscsic \ + initio ipr ips isp1020 lasi700 lpfc max_scsi mac53c94 \ + megaraid megaraid_mbox megaraid_mm megaraid_sas \ + 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 \ - sd_mod sym53c8xx tmscsim zfcp; do + sd_mod stex sym53c8xx tmscsim zfcp; do manual_add_modules "${x}" done ;; diff --git a/mkinitramfs b/mkinitramfs index 8d5911d..f667c53 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -28,8 +28,7 @@ while true; do fi ;; -o) - touch $2 - outfile="$(readlink -f "$2")" + outfile="$2" shift 2 ;; -k) @@ -94,6 +93,13 @@ for i in ${EXTRA_CONF}; do fi done +if [ -n "${UMASK}" ]; then + umask "${UMASK}" +fi + +touch $outfile +outfile="$(readlink -f "$outfile")" + if [ -z "${outfile}" ]; then usage fi diff --git a/scripts/nfs b/scripts/nfs index b3ac06f..fc869cc 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -49,7 +49,7 @@ do_nfsmount() NFSOPTS="-o ${NFSROOT#*,}" fi NFSROOT=${NFSROOT%%,*} - if [ "${NFSROOT#:*}" = "$NFSROOT" ]; then + if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then NFSROOT=${ROOTSERVER}:${NFSROOT} fi fi diff --git a/update-initramfs b/update-initramfs index 4a03614..45d4631 100755 --- a/update-initramfs +++ b/update-initramfs @@ -138,7 +138,7 @@ delete_sha1() # ro /boot is not modified ro_boot_check() { - [ -d /proc ] || return 0 + [ -r /proc/mounts ] || return 0 boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." @@ -201,7 +201,7 @@ set_linked_version() set_highest_version() { get_sorted_versions - set - ${version_list} + set -- ${version_list} version=${1} } -- cgit v1.2.3 From f49c698f4838b09794ebdd129e7eee14de2aad54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Oct 2006 16:22:08 +0200 Subject: add ide jmicron module + ubuntu changelogs add scsi qla4xxx module --- debian/changelog | 30 ++++++++++++++++++++++++++++++ hook-functions | 11 ++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 6efe40c..2990625 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.82) unstable; urgency=high + + * Merge 0.69ubuntu15, plus 0.69ubuntu14 and 0.69ubuntu11 changelog entries + as not affected or already fixed. + + * hook-initramfs: Add qla4xxx support, thus urgency high. + + -- maximilian attems Thu, 5 Oct 2006 16:12:06 +0200 + initramfs-tools (0.81) unstable; urgency=low Release quick and happy spin j = l + s @@ -388,6 +397,27 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu15) edgy; urgency=low + + * Add jmicron module to ide list. + - Malone #63085 + + -- Ben Collins Wed, 4 Oct 2006 09:21:08 -0400 + +initramfs-tools (0.69ubuntu14) edgy; urgency=low + + * Remove stray "set -x" from scripts/local-premount/suspend. + + -- Adam Conrad Wed, 20 Sep 2006 08:35:05 +1000 + +initramfs-tools (0.69ubuntu11) edgy; urgency=low + + * since we ship /usr/share/initramfs-tools/conf.d as well as + /etc/initramfs-tools/conf.d, make sure mkinitramfs also reads from both, + not only from the /etc location + + -- Oliver Grawert Sun, 10 Sep 2006 11:50:14 +0200 + initramfs-tools (0.69ubuntu4) edgy; urgency=low * scripts/local-premount/suspend: Check for UUID= or LABEL= on the diff --git a/hook-functions b/hook-functions index 9cb9712..98c88a2 100644 --- a/hook-functions +++ b/hook-functions @@ -161,9 +161,10 @@ auto_add_modules() ide) for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ - generic hpt34x hpt366 it821x ns87415 opti621 pdc202xx_new \ - pdc202xx_old piix rz1000 sc1200 serverworks siimage \ - sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + generic hpt34x hpt366 it821x jmicron ns87415 opti621 \ + pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks \ + siimage sis5513 slc82c105 slc90e66 triflex trm290 \ + via82cxxx; do manual_add_modules "${x}" done ;; @@ -176,8 +177,8 @@ auto_add_modules() megaraid megaraid_mbox megaraid_mm megaraid_sas \ 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 \ + qla4xxx 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 \ sd_mod stex sym53c8xx tmscsim zfcp; do -- cgit v1.2.3 From dc67493c8b72ebb4a360194a13c74a13d06def52 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Oct 2006 13:16:03 +0200 Subject: - improve run_bootloader (elilo, zipl) - fix preinst sed command - bunch of minor fixes --- debian/changelog | 40 ++++++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 4 +--- hook-functions | 3 ++- hooks/thermal | 11 +++++++++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 2 +- scripts/init-top/framebuffer | 2 +- scripts/local | 4 ++++ update-initramfs | 15 ++++++++++++--- 9 files changed, 74 insertions(+), 11 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 49d07a9..022e167 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +initramfs-tools (0.84) unstable; urgency=high + + Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" + + * hook-functions: Use modprobe --ignore-install arg to put all listed + modules on initramfs. Thanks Mario Izquierdo + for report. (closes: 384043) + + * update-initramfs: If elilo is around run it on initramfs update, add + zipl run. + + * scripts/local: Use vol_id too if around to set FSTYPE. Thanks for the + patch to "Alex Owen" (closes: 380004) + + * hooks/thermal: Add many of the windfarm modules for powerpc boxes. + + * initramfs-tools.preinst: merge bits of 0.69ubuntu16. (closes: 393773) + urgency high as fixes upgrade from sarge - thanks Federico Grau + . + + * scripts/init-top/framebuffer: Fix mknod call. (closes: 393543) + Thanks for the patch Kiro Zimmer . + + * mkinitramfs: Create modulesdir even on monolithic linux. (closes: 393688) + Thanks for the patch Ian Campbell . + + -- maximilian attems Wed, 18 Oct 2006 11:04:50 +0200 + initramfs-tools (0.83) unstable; urgency=high Release "Ois was du verzapfst is a koida Kaffee" @@ -438,6 +466,18 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu16) edgy; urgency=low + + * Bring in preinst fixes from Debian, including s/configure/install/ in + preinst, since preinst is never called with "configure", and checking + for /proc/swaps before we blindly try to read it to determine RESUME. + * Do away with the bogus '-n "$2"' test in preinst, since "install" can + be called without any arguments at all (and often is, on a clean setup) + * On upgrades, revert the RESUME mangling that dapper's d-i did to our + config file, avoiding spurious conffile prompts (launchpad.net/63693) + + -- Adam Conrad Mon, 16 Oct 2006 17:23:41 +1000 + initramfs-tools (0.69ubuntu15) edgy; urgency=low * Add jmicron module to ide list. diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index fc1fd06..aa8c8ca 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -4,7 +4,6 @@ set -e case "$1" in install) - if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d # First time install. Can we autodetect the RESUME partition? @@ -29,7 +28,7 @@ case "$1" in -e '/# This file should/,/one per line\./d' \ -e 's/Comments begin with.*/Syntax: module_name [args ...]/' \ -e 's/^# ext2$/# raid1/' \ - -e 's/^# wd io=0x300$/# sd_mod/' + -e 's/^# wd io=0x300$/# sd_mod/' \ -e '/^ide-generic/d' \ -e '/^ide-disk/d' \ -e '/^ext2/d' \ @@ -40,7 +39,6 @@ case "$1" in if [ -e /etc/mkinitrd/DSDT ]; then cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi - fi ;; upgrade) if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then diff --git a/hook-functions b/hook-functions index 98c88a2..8df30f2 100644 --- a/hook-functions +++ b/hook-functions @@ -40,7 +40,8 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --ignore-install \ + --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue diff --git a/hooks/thermal b/hooks/thermal index 9bfd323..ece7243 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -23,6 +23,17 @@ case "$DPKG_ARCH" in # copy the right modules powerpc|ppc64) manual_add_modules therm_pm72 + manual_add_modules windfarm_core + manual_add_modules windfarm_cpufreq_clamp + manual_add_modules windfarm_lm75_sensor + manual_add_modules windfarm_max6690_sensor + manual_add_modules windfarm_pid + manual_add_modules windfarm_pm112 + manual_add_modules windfarm_pm81 + manual_add_modules windfarm_pm91 + manual_add_modules windfarm_smu_controls + manual_add_modules windfarm_smu_sat + manual_add_modules windfarm_smu_sensors manual_add_modules i2c-powermac ;; i386|amd64|ia64) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 4ce53d3..690505f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/14" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -438,7 +438,7 @@ to double-check if it contains the relevant binaries, libs or modules: .nf mkdir tmp/initramfs cd tmp/initramfs -gunzip -c -9 /boot/initrd.img-2.6.17-2-686 | \\ +gunzip -c -9 /boot/initrd.img-2.6.18-1-686 | \\ cpio -i -d -H newc --no-absolute-filenames .fi .RE diff --git a/mkinitramfs b/mkinitramfs index f667c53..2fd0cc8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -166,7 +166,7 @@ export verbose # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf/conf.d etc lib modules sbin scripts; do +for d in bin conf/conf.d etc lib modules sbin scripts ${MODULESDIR}; do mkdir -p "${DESTDIR}/${d}" done diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index bafbe19..8382b20 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -82,7 +82,7 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno 29 $fbno + mknod /dev/fb$fbno c 29 $fbno done < /proc/fb mknod /dev/fb0 c 29 0 diff --git a/scripts/local b/scripts/local index 299fc65..f4079d5 100644 --- a/scripts/local +++ b/scripts/local @@ -51,6 +51,10 @@ mountroot () else FSTYPE=${ROOTFSTYPE} fi + if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then + FSTYPE=$(/lib/udev/vol_id -t ${ROOT}) + [ -z "$FSTYPE" ] && FSTYPE="unknown" + fi [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount diff --git a/update-initramfs b/update-initramfs index 151e47a..c112211 100755 --- a/update-initramfs +++ b/update-initramfs @@ -148,10 +148,11 @@ mbr_check() echo } -# only run lilo if no grub is around -# or if "do_bootloader = yes" is set +# Invoke bootloader run_bootloader() { + # only run lilo if no grub is around + # or if "do_bootloader = yes" is set if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then @@ -168,8 +169,16 @@ run_bootloader() fi return 0 fi - if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then + if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then run_lilo + return 0 + fi + if [ -x /sbin/elilo ]; then + elilo + return 0 + fi + if [ -r /etc/zipl.conf ]; then + zipl fi } -- cgit v1.2.3 From efa60794a8a0290ec3972aca23b3ab5f92c3175a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Nov 2006 09:30:03 +0100 Subject: - enhance mbr_check() - fix /boot ro check - create fb devices unconditionaly --- debian/changelog | 32 ++++++++++++++++++++++++++++++++ hook-functions | 2 +- scripts/init-top/framebuffer | 17 +++++++++-------- update-initramfs | 40 +++++++++++++++++++++++++++++++++------- 4 files changed, 75 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 022e167..991ff6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +initramfs-tools (0.85) unstable; urgency=high + + Release "Nichts ist getan, wenn noch etwas zu tun übrig ist." + + * update-initramfs: Fix ro /boot check to not trigger on other mounts + having a /boot string. (closes: 393906) Thanks for the patch + Olli Helenius + + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + 0.69ubuntu10 solution. Thanks Benjamin Leipold + for the report. (closes: 393890) + + * update-initramfs: Fix mbr_check() for installed lilo and used grub. Thanks + for the patch by Michel Casabona . Also be + stricter about do_bootloader match, use negative info and add check for + grub on mbr before throwing error. (closes: 394559) urgency high. + + * hook-functions: Add sata_sil24 to scsi modules. (closes: 395907) + Thanks Vadim S. Solomi" for the patch. + + * update-initramfs: Fix lilo detection in mbr_check() for rootraid. + Based on a patch by Michael Prokop . Suppress lilo warning + messages on test run. + + -- maximilian attems Mon, 30 Oct 2006 10:12:58 +0100 + initramfs-tools (0.84) unstable; urgency=high Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" @@ -499,6 +525,12 @@ initramfs-tools (0.69ubuntu11) edgy; urgency=low -- Oliver Grawert Sun, 10 Sep 2006 11:50:14 +0200 +initramfs-tools (0.69ubuntu10) edgy; urgency=low + + * Create framebuffer device nodes unconditionally + + -- Matthew Garrett Tue, 5 Sep 2006 17:50:53 +0100 + initramfs-tools (0.69ubuntu4) edgy; urgency=low * scripts/local-premount/suspend: Check for UUID= or LABEL= on the diff --git a/hook-functions b/hook-functions index 8df30f2..c6a42a6 100644 --- a/hook-functions +++ b/hook-functions @@ -179,7 +179,7 @@ auto_add_modules() mesh mptfc mptscsih mptsas mptspi nsp32 \ osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sis sata_svw \ + sata_promise sata_qstor sata_sil sata_sil24 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 stex sym53c8xx tmscsim zfcp; do diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 8382b20..1d5e375 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,17 +76,18 @@ for x in $(cat /proc/cmdline); do esac done -if [ -n "$FB" ]; then - modprobe -q $FB $OPTS -fi - if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno done < /proc/fb - +else mknod /dev/fb0 c 29 0 - for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i - done +fi +for i in 0 1 2 3 4 5 6 7 8; do + mknod /dev/tty$i c 4 $i +done + +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS fi diff --git a/update-initramfs b/update-initramfs index c112211..0fea63c 100755 --- a/update-initramfs +++ b/update-initramfs @@ -127,7 +127,8 @@ generate_initramfs() # lilo call run_lilo() { - lilo -t > /dev/null + # suppress errors on test run + lilo -t > /dev/null 2>&1 if [ $? -eq 0 ]; then lilo fi @@ -136,11 +137,33 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 + case ${boot} in + /dev/md*) + if [ -r /proc/mdstat ]; then + MD=${boot#/dev/} + boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \ + /proc/mdstat)" + fi + ;; + esac [ ! -r "${boot}" ] && return 0 - dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO - [ $? -eq 0 ] && run_lilo && return 0 + dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ + && run_lilo && return 0 + + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + + # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." echo "If you use grub as bootloader everything is fine." @@ -151,17 +174,19 @@ mbr_check() # Invoke bootloader run_bootloader() { - # only run lilo if no grub is around - # or if "do_bootloader = yes" is set + # if both lilo and grub around, figure out if lilo needs to be run if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ - do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") + do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ || [ "${do_b}" = "YES" ]; then run_lilo return 0 + elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ + || [ "${do_b}" = "NO" ]; then + return 0 else mbr_check return 0 @@ -203,7 +228,8 @@ delete_sha1() ro_boot_check() { [ -r /proc/mounts ] || return 0 - boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) + boot_opts=$(awk '/boot/{if (match($4, /ro/) && $2 == "/boot") + print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." echo "update-initramfs: Not updating ${initramfs}" -- cgit v1.2.3 From 78fe68bcad9d0850e6b9877903719cab7c73b475 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 2 Dec 2006 18:51:54 +0100 Subject: - allow to disable backup - new bzr location - functional copy_dir_modules() - modprobe a bunch of ppc windfarm modules in thermal - provide output on error --- conf/update-initramfs.conf | 8 ++++++++ debian/changelog | 42 ++++++++++++++++++++++++++++++++++++++++++ debian/copyright | 2 +- hook-functions | 18 +++++++++++++++--- mkinitramfs | 6 +++--- scripts/init-premount/thermal | 9 +++++++++ scripts/init-top/framebuffer | 10 +++++----- update-initramfs | 12 ++++++++---- 8 files changed, 91 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 36c3dde..278c51c 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -9,3 +9,11 @@ # If set to no disables any update to initramfs beside kernel upgrade update_initramfs=yes + +# +# backup_initramfs [ yes | no ] +# +# Default is yes +# If set to no leaves no .bak backup files. + +backup_initramfs=yes diff --git a/debian/changelog b/debian/changelog index f6ef12c..acfa6f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,38 @@ +initramfs-tools (0.85c) unstable; urgency=medium + + Release "Pour être heureux vraiment Faut plus d'gouvernement" + + * hook-funcions: Show on verbose mode the added binaries and libraries. + + * update-initramfs: Don't silently fail, user won't be able to reboot. + Thanks Mario Aeby for his blog entry. + + * debian/copyright: Moved to bzr.d.o repo location. + + * hook-functions: Merge 0.69ubuntu22 copy_module_dir fixes, we'll use it + too postetch. Fix the bashism. Thanks to Jurij Smakov + + * scripts/init-premount/thermal: Load blindly a bunch of thermal modules + on powerpc as they are not hotpluggable. Might be ugly, but is a safe bet. + Kernel plattform fix is scheduled for 2.6.20. Push with medium urgency. + (closes: 401269) + + -- maximilian attems Sat, 2 Dec 2006 18:06:34 +0100 + +initramfs-tools (0.85b) unstable; urgency=medium + + * mkinitramfs: Test for ${outfile} before touching anything. (closes: 381677) + + * update-initramfs.conf, update-initramfs: Allow to disable backup strategy. + While we are it fix logic of backup_booted_initramfs(). (closes: 397787) + urgency medium. + + * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, + modprobe fb before creating device. Thanks to Otavio Salvador + for patch. + + -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 + initramfs-tools (0.85a) unstable; urgency=high * On first time run backup_booted_initramfs() has nothing to back up. @@ -498,6 +533,13 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu22) feisty; urgency=low + + * For copy_module_dir, actually call manual_module for each one, so deps are + taken care of. + + -- Ben Collins Thu, 23 Nov 2006 02:10:29 -0500 + initramfs-tools (0.69ubuntu16) edgy; urgency=low * Bring in preinst fixes from Debian, including s/configure/install/ in diff --git a/debian/copyright b/debian/copyright index 2c681c2..396499f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -10,7 +10,7 @@ The current ubuntu release can be found at: http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ The Debian tree is maintained with "bzr" at: -http://debian.stro.at/bzr-test/initramfs-tools/ +http://bzr.debian.org/kernel/initramfs-tools/ Authors: Jeff Bailey , Adam Conrad , Scott James Remnant , diff --git a/hook-functions b/hook-functions index c6a42a6..b4cd58d 100644 --- a/hook-functions +++ b/hook-functions @@ -66,6 +66,9 @@ copy_exec() { fi else ln -s ${1} ${DESTDIR}/${2} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding binary ${1}" + fi fi # Copy the dependant libraries @@ -89,6 +92,9 @@ copy_exec() { mkdir -p ${DESTDIR}/${dirname} if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then ln -s ${x} ${DESTDIR}/${dirname} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding library ${x}" + fi fi done } @@ -96,9 +102,15 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase="${DESTDIR}/lib/modules/${version}" - mkdir -p "$(dirname "${tmpdir_modbase}/${1}")" - cp -a "${MODULESDIR}/${1}" "${tmpdir_modbase}/${1}" + if ! [ -d "${MODULESDIR}/${1}" ]; then + return; + fi + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Copying module directory ${1}" + fi + for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do + manual_add_modules `basename ${x_mod} .ko` + done } dep_add_modules() diff --git a/mkinitramfs b/mkinitramfs index 2fd0cc8..694f423 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -97,13 +97,13 @@ if [ -n "${UMASK}" ]; then umask "${UMASK}" fi -touch $outfile -outfile="$(readlink -f "$outfile")" - if [ -z "${outfile}" ]; then usage fi +touch "$outfile" +outfile="$(readlink -f "$outfile")" + # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd if [ ${#} -ne 1 ]; then diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index 3518e7c..bfea1fc 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -20,6 +20,15 @@ case "$DPKG_ARCH" in powerpc|ppc64) modprobe -q i2c-powermac modprobe -q therm_pm72 + modprobe -q windfarm_cpufreq_clamp + modprobe -q windfarm_lm75_sensor + modprobe -q windfarm_max6690_sensor + modprobe -q windfarm_pm112 + modprobe -q windfarm_pm81 + modprobe -q windfarm_pm91 + modprobe -q windfarm_smu_controls + modprobe -q windfarm_smu_sat + modprobe -q windfarm_smu_sensors ;; i386|amd64|ia64) modprobe -q fan diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 1d5e375..044b247 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,6 +76,11 @@ for x in $(cat /proc/cmdline); do esac done +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS +fi + if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno @@ -86,8 +91,3 @@ fi for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty$i c 4 $i done - -if [ -n "$FB" ]; then - modprobe -q fbcon - modprobe -q $FB $OPTS -fi diff --git a/update-initramfs b/update-initramfs index e694093..4b230d0 100755 --- a/update-initramfs +++ b/update-initramfs @@ -79,12 +79,16 @@ backup_initramfs() # keep booted initramfs backup_booted_initramfs() { + initramfs_bak="${initramfs}.dpkg-bak" + + # first time run thus no backup + [ ! -r "${initramfs_bak}" ] && return 0 + # chroot [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 - # first time run - initramfs_bak="${initramfs}.dpkg-bak" - [ ! -r "${initramfs_bak}" ] && return 0 + # no kept backup wanted + [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0 # no backup yet if [ ! -r "${initramfs}.bak" ]; then @@ -122,7 +126,7 @@ generate_initramfs() # minversion wasn't met, exit 0 exit 0 fi - verbose "mkinitramfs failed for ${initramfs}" + echo "update-initramfs: failed for ${initramfs}" exit $mkinitramfs_return fi } -- cgit v1.2.3 From c03e70312632212c516acac750cb5ec0ef4b33cb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 14 Dec 2006 23:16:15 +0100 Subject: - show lilo error on lilo failure - add hppa zalon module - reduce size due to keeping only 1 busybox copy - warn on update mode when no initramfs exist and takeover not specified --- debian/changelog | 22 ++++++++++++++++++++++ hook-functions | 2 +- mkinitramfs | 7 ++++++- update-initramfs | 24 ++++++++++++++---------- 4 files changed, 43 insertions(+), 12 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index acfa6f0..394179a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +initramfs-tools (0.85d) unstable; urgency=high + + Release "Le gros ventre qu'engraisse L'suffrage universel" + + * update-initramfs: run_lilo() needs to show errors of lilo -t on failure + and exit with failure message. Thanks David Anselmi + for report. (closes: 401331) Updated according to review by + Jurij Smakov . + + * hook-functions: Add hppa zalon scsi module. (closes: 401229) urgency high + + * update-initramfs: Add warning for missing initramfs on update mode without + takeover arg. Restructure altered_check, don't delete sha1sum on failure. + Thanks Jurij Smakov for noticing. + + * mkinitramfs: Reduce size of initramfs by keeping 1 busybox copy. + Thanks for the patch input to Russell Coker . + Thanks for the sed rework to Klaus Ita . + (closes: 338405) + + -- maximilian attems Thu, 14 Dec 2006 16:10:06 +0100 + initramfs-tools (0.85c) unstable; urgency=medium Release "Pour être heureux vraiment Faut plus d'gouvernement" diff --git a/hook-functions b/hook-functions index b4cd58d..67f5931 100644 --- a/hook-functions +++ b/hook-functions @@ -194,7 +194,7 @@ auto_add_modules() sata_promise sata_qstor sata_sil sata_sil24 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 stex sym53c8xx tmscsim zfcp; do + sd_mod stex sym53c8xx tmscsim zalon zfcp; do manual_add_modules "${x}" done ;; diff --git a/mkinitramfs b/mkinitramfs index 694f423..d187de0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -228,7 +228,12 @@ if [ "x${BUSYBOX}" = "xn" ]; then else rm -f ${DESTDIR}/bin/sh copy_exec ${BUSYBOXDIR}/busybox /bin/busybox - ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh + rm -f ${DESTDIR}/bin/busybox + cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox + for cmd in `busybox | sed -n '/functions:$/,$p' \ + | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do + ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd} + done fi # Modutils diff --git a/update-initramfs b/update-initramfs index 4b230d0..52e603b 100755 --- a/update-initramfs +++ b/update-initramfs @@ -134,11 +134,13 @@ generate_initramfs() # lilo call run_lilo() { - # suppress errors on test run - lilo -t > /dev/null 2>&1 - if [ $? -eq 0 ]; then - lilo + # show lilo errors on failure + if ! lilo -t > /dev/null 2>&1 ; then + echo "update-initramfs: lilo run failed for ${initramfs}:" + echo + lilo -t fi + lilo } # check if lilo is on mbr @@ -387,14 +389,16 @@ delete() rm -f "${initramfs}" } - +# Check for update mode on existing and modified initramfs altered_check() { - if [ "${takeover}" = 0 ]; then - if ! compare_sha1; then - delete_sha1 - mild_panic "${initramfs} has been altered. Cannot update." - fi + # No check on takeover + [ "${takeover}" = 1 ] && return 0 + if [ ! -e "${initramfs}" ]; then + mild_panic "${initramfs} does not exist. Cannot update." + fi + if ! compare_sha1; then + mild_panic "${initramfs} has been altered. Cannot update." fi } -- cgit v1.2.3 From d21a00a23405d1db81ab05a12342145276ef2af0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Dec 2006 10:18:28 +0100 Subject: - revert busybox hardlinking it's utitilites - add drivers/ata - rework the framebuffer boot script - small docs changes --- debian/changelog | 24 ++++++++++++++++++++++++ hook-functions | 4 ++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 8 ++------ scripts/init-top/framebuffer | 34 +++++++++++++++++++++++----------- 5 files changed, 55 insertions(+), 19 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 394179a..c292a82 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.85e) unstable; urgency=high + + Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" + + * initramfs-tools.8: Correct copy_exec() example. (closes: 403122) + Add a better dir to copy_modules_dir() example. + + * mkinitramfs: Revert the sed magic busybox hardlinking for size reduction. + Go for functionality. The klibc binaries are better tested and superior + in some cases like sleep. Fixes several boot troubles. Thanks + Benjamí Villoslada for the report. (closes: 403224) + Thanks Jurij Smakov for pinpointing the trouble. + + * hook-functions: Add all drivers/ata drivers to initramfs that exist for + uname >= 2.6.19 (closes: 403309) urgency high. + + * scripts/init-top/framebuffer: Fix syntax by closing the brackets. Handle + options of the form key:value, map kernel bootarg to module name for + matroxfb. Thanks Rob Walker for the patches + (closes: 403667, 403669). Use posix regexes according to review by + Jurij Smakov . Also protect all variables. + + -- maximilian attems Wed, 20 Dec 2006 22:29:51 +0100 + initramfs-tools (0.85d) unstable; urgency=high Release "Le gros ventre qu'engraisse L'suffrage universel" diff --git a/hook-functions b/hook-functions index 67f5931..fe5d31e 100644 --- a/hook-functions +++ b/hook-functions @@ -198,6 +198,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + ata) + copy_modules_dir kernel/drivers/ata + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -218,6 +221,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules ata auto_add_modules i2o auto_add_modules dasd auto_add_modules ieee1394 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 690505f..e280ba4 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -189,7 +189,7 @@ initramfs image. .RS .PP .B Example: -copy_modules_dir kernel/drivers/pci/foobar +copy_modules_dir kernel/drivers/ata .RE .SS Including binaries @@ -197,7 +197,7 @@ If you need to copy binaries to the initramfs module, a command like this should be used: .PP .RS -copy_exec /sbin/mdadm "${DESTDIR}/sbin" +copy_exec /sbin/mdadm /sbin .RE mkinitramfs will automatically detect which libraries the executable depends on diff --git a/mkinitramfs b/mkinitramfs index d187de0..0c278d5 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -227,13 +227,9 @@ if [ "x${BUSYBOX}" = "xn" ]; then echo "Warning: Busybox is required for successful boot!" else rm -f ${DESTDIR}/bin/sh - copy_exec ${BUSYBOXDIR}/busybox /bin/busybox rm -f ${DESTDIR}/bin/busybox - cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox - for cmd in `busybox | sed -n '/functions:$/,$p' \ - | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do - ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd} - done + copy_exec ${BUSYBOXDIR}/busybox /bin/busybox + ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh fi # Modutils diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 044b247..7c080f9 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -35,20 +35,23 @@ parse_video_opts() local IFS="," # Must be a line like video=:,[opt2]... - if [ "$OPTS" = "${OPTS%%:*}" ]; then + if [ "${OPTS}" = "${OPTS%%:*}" ]; then return fi OPTS="${OPTS#*:}" - for opt in $OPTS; do + for opt in ${OPTS}; do # Already in the "=" form - if [ "$opt" != "${opt#*=}" ]; then + if [ "${opt}" != "${opt#*=}" ]; then echo -n "$opt " + # In the ":" form + elif [ "${opt}" != "${opt#*:}" ]; then + echo -n "${opt%:*}=${opt#*:} " # Presumably a modevalue without the "mode=" prefix - elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then echo -n "mode=$opt " # Presumably a boolean else - echo -n "$opt=1 " + echo -n "${opt}=1 " fi done } @@ -60,7 +63,7 @@ SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do - case $x in + case ${x} in splash*) FB="vga16fb"; OPTS=""; @@ -72,22 +75,31 @@ for x in $(cat /proc/cmdline); do video=*) FB=${x#*=} FB="${FB%%:*}" - OPTS="$(parse_video_opts "$TMP")" + OPTS="$(parse_video_opts "${x}")" esac done -if [ -n "$FB" ]; then +# Map command line name to module name +case ${FB} in +matroxfb) + FB=matroxfb_base + ;; +*) + ;; +esac + +if [ -n "${FB}" ]; then modprobe -q fbcon - modprobe -q $FB $OPTS + modprobe -q ${FB} ${OPTS} fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno c 29 $fbno + mknod /dev/fb${fbno} c 29 ${fbno} done < /proc/fb else mknod /dev/fb0 c 29 0 fi for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i + mknod /dev/tty${i} c 4 ${i} done -- cgit v1.2.3 From c4343742b3bf028e467ac8a58ead95c9bfefc628 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 13:29:25 +0200 Subject: first prerelease 0.86 + merge 0.85f * kick mdrun script * update control for lenny + ubuntu * add _all_ ide, block and drivers * use MODPROBE_OPTIONS and kill any modprobed arg * small doc + whitespace fixes --- debian/changelog | 60 +++++++++++++++++++++++++++++++++++++++++-- debian/control | 4 +-- debian/script | 2 +- hook-functions | 28 +++++--------------- init | 13 +++++++--- initramfs.conf.5 | 6 ++--- mkinitramfs.8 | 7 ++++- scripts/functions | 8 +++--- scripts/init-premount/thermal | 26 +++++++++---------- scripts/init-top/framebuffer | 7 ++--- scripts/local | 8 +++--- scripts/local-top/lvm | 6 ++--- scripts/local-top/mdrun | 46 --------------------------------- scripts/local-top/udev_helper | 2 +- scripts/nfs | 4 +-- update-initramfs | 24 +++++++++-------- update-initramfs.conf.5 | 4 +-- 17 files changed, 130 insertions(+), 125 deletions(-) delete mode 100755 scripts/local-top/mdrun (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index c292a82..07d28d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,59 @@ +initramfs-tools (0.86) experimental; urgency=low + + * update-initramfs: Bound the mode and version variable. (closes: 403905) + Thanks "Nikita V. Youshchenko" for report. + + * init: Set once the MODPROBE_OPTIONS environment variable and export it. + Don't forget to set -b to have the modprobe.d blacklists respected. + Thus remove everywhere the -q modprobe switch. + Thanks Ben Collins for the suggestion. + + * small trailing whitespace cleanup, display full path of kernel-img.conf + in bug script. + + * debian/control: change maintainer entry to new DD mail. :) + Add busybox-initramfs as Ubuntu busybox alternative to depends. + Dropp the sarge busybox-cvs-static entry. + + * scripts/local-top/mdrun: Drop, existed for partial upgrades from sarge. + + * scripts/local: Improve panic message and printed order. (closes: 414640) + Thanks Vincent.McIntyre@csiro.au for patch. + + * scripts/functions: Check if panic is set befor using it. (closes: 406107) + Thanks martin f krafft for report. + + * hook-functions: Copy all kernel/drivers/{block,ide,scsi} subdir modules + instead of hardcoding the list of "supported" drivers. As consequence + the initramfs might be larger, but none of those should be missed. + As bonus syncs with Ubuntu. + + * init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync. + + -- maximilian attems Sat, 17 Mar 2007 21:39:13 +0100 + +initramfs-tools (0.85f) unstable; urgency=high + + Release "Au lieu d'aller voter Casse leur la margoulette" + + * update-initramfs: Grub _doesn't_ clear LILO string in mbr, but the inverse + is done. Fix mbr_check() to first check for GRUB. Fixes accidental lilo + call in the case that Grub is the used bootloader. (closes: 409820) + Thanks Michael Prokop for bringing up the case. + + * initramfs.conf.5, mkinitramfs.5: Fix typos. Document version. + (closes: 405157, 405190, 405194) + + * update-initramfs: Be more screamy about lilo error, people seem to + overlook recent lilo failures. + + * scripts/init-top/framebuffer: Remove unused variables. + + * init: Export ROOTDELAY to let udev boot script handle eventual rootdelay. + downgrades 401916 + + -- maximilian attems Wed, 7 Mar 2007 23:34:17 +0100 + initramfs-tools (0.85e) unstable; urgency=high Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" @@ -74,7 +130,7 @@ initramfs-tools (0.85b) unstable; urgency=medium urgency medium. * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, - modprobe fb before creating device. Thanks to Otavio Salvador + modprobe fb before creating device. Thanks to Otavio Salvador for patch. -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 @@ -93,7 +149,7 @@ initramfs-tools (0.85) unstable; urgency=high having a /boot string. (closes: 393906) Thanks for the patch Olli Helenius - * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the 0.69ubuntu10 solution. Thanks Benjamin Leipold for the report. (closes: 393890) diff --git a/debian/control b/debian/control index dd4c3b3..9294ee7 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilian attems +Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-initramfs, 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 packaged 2.6 diff --git a/debian/script b/debian/script index a8e3dd9..7cfac12 100755 --- a/debian/script +++ b/debian/script @@ -15,7 +15,7 @@ lsmod echo if [ -r /etc/kernel-img.conf ]; then - echo "-- kernel-img.conf" + echo "-- /etc/kernel-img.conf" cat /etc/kernel-img.conf echo fi diff --git a/hook-functions b/hook-functions index fe5d31e..f506b49 100644 --- a/hook-functions +++ b/hook-functions @@ -172,35 +172,20 @@ auto_add_modules() done ;; ide) - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ - amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ - generic hpt34x hpt366 it821x jmicron ns87415 opti621 \ - pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks \ - siimage sis5513 slc82c105 slc90e66 triflex trm290 \ - via82cxxx; do - manual_add_modules "${x}" - done + copy_modules_dir kernel/drivers/ide ;; scsi) - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx aic94xx arcmsr ata_piix atari_scsi \ - atp870u BusLogic cciss ch cpqarray DAC960 dc395x \ - dmx3191d dpt_i2o eata fdomain gdth hptiop ibmvscsic \ - initio ipr ips isp1020 lasi700 lpfc max_scsi mac53c94 \ - megaraid megaraid_mbox megaraid_mm megaraid_sas \ - mesh mptfc mptscsih mptsas mptspi nsp32 \ - osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ - qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sil24 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 stex sym53c8xx tmscsim zalon zfcp; do + copy_modules_dir kernel/drivers/scsi + for x in mptfc mptsas mptscsih mptspi; do manual_add_modules "${x}" done ;; ata) copy_modules_dir kernel/drivers/ata ;; + block) + copy_modules_dir kernel/drivers/block + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -221,6 +206,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules block auto_add_modules ata auto_add_modules i2o auto_add_modules dasd diff --git a/init b/init index fbe32be..4c09fd7 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs none /sys -mount -t proc none /proc +mount -t sysfs none /sys -o nodev, noexec, nosuid +mount -t proc none /proc -o nodev, noexec, nosuid # 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 @@ -37,7 +37,10 @@ for i in conf/conf.d/*; do done . /scripts/functions -# Parse command line options +# Set modprobe env +export MODPROBE_OPTIONS="-qb" + +# Export relevant variables export break= export init=/sbin/init export quiet=n @@ -45,8 +48,10 @@ export readonly=y export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} -export panic +export ROOTDELAY= +export panic= +# Parse command line options for x in $(cat /proc/cmdline); do case $x in init=*) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index ca47a02..e685298 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2007/01/01 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -37,14 +37,14 @@ The default setting is \fImost\fP. Include busybox utilities for the boot scripts. If set to 'n' .B mkinitramfs -will build an initramfs whithout busybox. +will build an initramfs without busybox. Beware that many boot scripts need busybox utilities. .SH NFS VARIABLES .TP \fB BOOT Allows to use an nfs drive as the root of the drive. -The default is to boot of an \fIlocal\fP media (harddrive, USB stick). +The default is to boot from \fIlocal\fP media (harddrive, USB stick). Set to \fInfs\fP for an NFS root share. .TP diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 23e719f..6d81233 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2007/01/02 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -58,6 +58,11 @@ Override the setting in .IR initramfs.conf . +.TP +\fI version +Set the kernel version of the initramfs image +(defaults to the running kernel). + .TP \fB\-\-supported-host-version=\fIhversion This option queries if mkinitramfs can create ramdisks on a running kernel of version diff --git a/scripts/functions b/scripts/functions index 7e67771..7ae9c78 100644 --- a/scripts/functions +++ b/scripts/functions @@ -60,11 +60,11 @@ panic() /sbin/usplash_write "QUIT" fi # Disallow console access - if [ "${panic}" = 0 ]; then + if [ -n "${panic}" ] && [ "${panic}" = 0 ]; then reboot fi - modprobe -q i8042 - modprobe -q atkbd + modprobe i8042 + modprobe atkbd echo $@ PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } @@ -206,7 +206,7 @@ load_modules() if [ "$com" = "#" ]; then continue fi - modprobe -q $m + modprobe $m done fi } diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index bfea1fc..aa146ec 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,20 +18,20 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) - modprobe -q i2c-powermac - modprobe -q therm_pm72 - modprobe -q windfarm_cpufreq_clamp - modprobe -q windfarm_lm75_sensor - modprobe -q windfarm_max6690_sensor - modprobe -q windfarm_pm112 - modprobe -q windfarm_pm81 - modprobe -q windfarm_pm91 - modprobe -q windfarm_smu_controls - modprobe -q windfarm_smu_sat - modprobe -q windfarm_smu_sensors + modprobe i2c-powermac + modprobe therm_pm72 + modprobe windfarm_cpufreq_clamp + modprobe windfarm_lm75_sensor + modprobe windfarm_max6690_sensor + modprobe windfarm_pm112 + modprobe windfarm_pm81 + modprobe windfarm_pm91 + modprobe windfarm_smu_controls + modprobe windfarm_smu_sat + modprobe windfarm_smu_sensors ;; i386|amd64|ia64) - modprobe -q fan - modprobe -q thermal + modprobe fan + modprobe thermal ;; esac diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 7c080f9..c680409 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -59,9 +59,6 @@ parse_video_opts() FB="" OPTS="" -SPLASH=false; -VESA=false; - for x in $(cat /proc/cmdline); do case ${x} in splash*) @@ -89,8 +86,8 @@ matroxfb) esac if [ -n "${FB}" ]; then - modprobe -q fbcon - modprobe -q ${FB} ${OPTS} + modprobe fbcon + modprobe ${FB} ${OPTS} fi if [ -e /proc/fb ]; then diff --git a/scripts/local b/scripts/local index f4079d5..4e01472 100644 --- a/scripts/local +++ b/scripts/local @@ -40,9 +40,9 @@ 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!" + echo "ALERT! ${ROOT} does not exist. Dropping to a shell!" + echo " Check your root= boot argument (cat /proc/cmdline)" + panic " Check for missing modules (cat /proc/modules), or device files (ls /dev)" done # Get the root filesystem type if not set @@ -67,7 +67,7 @@ mountroot () fi # FIXME This has no error checking - modprobe -q ${FSTYPE} + modprobe ${FSTYPE} # FIXME This has no error checking # Mount root diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 27053de..4cf48ad 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -64,9 +64,9 @@ if [ ! -e /sbin/vgchange ]; then exit 0 fi -modprobe -q dm-mod -modprobe -q dm-snapshot -modprobe -q dm-mirror +modprobe dm-mod +modprobe dm-snapshot +modprobe dm-mirror activate_vg "$ROOT" activate_vg "$resume" diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun deleted file mode 100755 index f733656..0000000 --- a/scripts/local-top/mdrun +++ /dev/null @@ -1,46 +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 - -# source the presumed root md and it's info -. ./conf/mdrun.conf - -# assemble root raid first due to initrd-tools compatibility -mdadm -A ${rootraiddev} -R -u $uuid $devices - -# assemble all raid devices -/sbin/mdrun /dev diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 2d4c209..c1694b7 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -19,5 +19,5 @@ esac # but might be an old fashioned ISA controller; in which case # we need to load ide-generic. if [ ! -e "${ROOT}" -o "${ROOT}" = "/dev/root" ]; then - modprobe -q ide-generic + modprobe ide-generic fi diff --git a/scripts/nfs b/scripts/nfs index fc869cc..5eb17bf 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -78,9 +78,9 @@ mountroot() run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe -q nfs + modprobe nfs # For DHCP - modprobe -q af_packet + modprobe af_packet # Default delay is around 180s # FIXME: add usplash_write info diff --git a/update-initramfs b/update-initramfs index 52e603b..a676fe9 100755 --- a/update-initramfs +++ b/update-initramfs @@ -4,6 +4,8 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf +mode="" +version="" set -e @@ -136,7 +138,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "update-initramfs: lilo run failed for ${initramfs}:" + echo "Error lilo fails for new ${initramfs}:" echo lilo -t fi @@ -146,6 +148,16 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 @@ -162,16 +174,6 @@ mbr_check() dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ && run_lilo && return 0 - # try to discover grub and be happy - [ -r /boot/grub/menu.lst ] \ - && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ - /boot/grub/menu.lst) - [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ - && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) - [ -n "${dev}" ] && [ -r ${dev} ] \ - && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ - | grep -q GRUB && return 0 - # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 30ef6d0..50e1f95 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/12/22 $" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -13,7 +13,7 @@ The configuration file allows to disable the update action from Default is \fIyes\fP for running the latest initramfs-tools hooks in the newest Linux image. It is possible to set it to \fIno\fP for remote servers or boxes where -conservative manners needs to be applied. This disables +conservative manners needs to be applied. This disables the \fBupdate_initramfs -u\fP call. .SH AUTHOR -- cgit v1.2.3 From 3f94f7f380f1a5fe9afd7e20d0796365c2da25c3 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 20:38:06 +0200 Subject: Add PS3 module loading functionality. --- debian/changelog | 1 + hook-functions | 8 +++++++- scripts/init-premount/ps3 | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 scripts/init-premount/ps3 (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index c0f652b..1476018 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * Add support for loading keymaps. (closes: 337663) * Ubuntu merge - Use -Qb for for module loading to honor blacklists. + - Add PS3 module loading functionality. -- David Härdeman Fri, 13 Apr 2007 20:08:26 +0200 diff --git a/hook-functions b/hook-functions index f506b49..f33d323 100644 --- a/hook-functions +++ b/hook-functions @@ -146,6 +146,12 @@ dep_add_modules() if [ -e /sys/bus/i2o/devices/ ]; then manual_add_modules i2o_block fi + + if [ -e /sys/bus/ps3_system_bus/ ]; then + for x in ps3_storage gelic_net ohci-hcd ehci-hcd; do + manual_add_modules "${x}" + done + fi } @@ -167,7 +173,7 @@ auto_add_modules() 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 + typhon via-rhine via-velocity yellowfin gelic_net; do manual_add_modules "${x}" done ;; diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 new file mode 100755 index 0000000..1fe65ae --- /dev/null +++ b/scripts/init-premount/ps3 @@ -0,0 +1,28 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +case "$DPKG_ARCH" in +powerpc|ppc64) + # For PS3's we know these devices will exist, and we'll need them + if grep -q PS3 /proc/cpuinfo; then + modprobe ps3_storage + modprobe gelic_net + modprobe ohci-hcd + modprobe ehci-hcd + fi + ;; +esac -- cgit v1.2.3 From adda784dc1289b3ceb0ce207850ef9a93102febe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 20:05:00 +0200 Subject: minor cleanups to get 0.87 ready: - add changelog entries to david changes - change to my new debian.org email adresses in manpages too - module list is alphabetic --- debian/changelog | 7 +++++-- debian/copyright | 2 +- hook-functions | 4 ++-- initramfs-tools.8 | 4 ++-- initramfs.conf.5 | 2 +- mkinitramfs-kpkg.8 | 2 +- mkinitramfs.8 | 2 +- update-initramfs.8 | 2 +- update-initramfs.conf.5 | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 838da0c..c5a5e01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,9 +11,12 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * Add support for loading keymaps. (closes: 337663) * Move legacy code from mkinitramfs to separate hooks. * Ubuntu merge - - Add PS3 module loading functionality. + - Add PS3 module loading functionality without grep usage. + * debian/copyright: Update authors info. + * Bump standards version, no changes necessary. + * debian/scripts: Print settings from initramfs.conf in reportbug script. - -- David Härdeman Sat, 14 Apr 2007 10:53:56 +0200 + -- maximilian attems Mon, 16 Apr 2007 19:54:04 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/debian/copyright b/debian/copyright index 44905db..2b3581a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -17,7 +17,7 @@ Authors: Adam Conrad , Ben Collins , David Härdeman , Jeff Bailey , - maximilian attems + maximilian attems , Scott James Remnant Copyright: 2005 - 2006 Adam Conrad diff --git a/hook-functions b/hook-functions index f33d323..a5d1f61 100644 --- a/hook-functions +++ b/hook-functions @@ -168,12 +168,12 @@ auto_add_modules() net) for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ - famachi forcedeth hp100 mace mv643xx_eth myri10ge \ + famachi forcedeth gelic_net hp100 mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ 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 gelic_net; do + typhon via-rhine via-velocity yellowfin; do manual_add_modules "${x}" done ;; diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 20b9755..fd0a83f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -449,11 +449,11 @@ cpio -i -d -H newc --no-absolute-filenames .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .PP This manual was written by David H\[:a]rdeman , -updated by Maximilian Attems . +updated by Maximilian Attems . .SH SEE ALSO .BR diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 2258cb7..c7fee03 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -65,7 +65,7 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. Loosely based on mkinitrd.conf by Herbert Xu. diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 2a3072b..2d96465 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -43,7 +43,7 @@ This option queries if mkinitramfs can create ramdisks for kernel version .IR tversion . .SH AUTHOR -mkinitramfs-kpkg is maintained by Maximilian Attems . +mkinitramfs-kpkg is maintained by Maximilian Attems . .SH SEE ALSO .BR diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 6d81233..a35a561 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -100,7 +100,7 @@ it to be loaded by ACPI. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO diff --git a/update-initramfs.8 b/update-initramfs.8 index 0db2609..4ba12de 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -85,7 +85,7 @@ Create the initramfs for a specific kernel: .B update\-initramfs -c -k 2.6.18-1-686 .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 50e1f95..302cffe 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -17,7 +17,7 @@ conservative manners needs to be applied. This disables the \fBupdate_initramfs -u\fP call. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO .BR -- cgit v1.2.3 From b71721f02b6b46fddfc624888f61aafbc2399129 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 1 May 2007 18:31:38 +0200 Subject: mkinitramfs: better heuristics for MODULES=dep * add a first shoot that survives ide, scsi boot testing nfs still needs work let's see what other testers have to say * next step is to cut on the added libs for smaller initramfs enhances boot speed due to smaller initramfs for tuning freaks, others might still be better off with safe MODULES=most setting. --- debian/TODO | 2 -- debian/changelog | 6 ++++-- hook-functions | 34 ++++++++++++++++++++++------------ 3 files changed, 26 insertions(+), 16 deletions(-) (limited to 'hook-functions') diff --git a/debian/TODO b/debian/TODO index 7ed390f..f62656f 100644 --- a/debian/TODO +++ b/debian/TODO @@ -5,8 +5,6 @@ TODO o Eliminate ?udev?, ?klibc?, busybox (-> glibc). - o Better heuristics for MODULES=dep option - o Default to dep for PPC - Possibly to detect newworld? o udevsettle timeouts handling diff --git a/debian/changelog b/debian/changelog index e604463..22b793b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ initramfs-tools (0.88) UNRELEASED; urgency=low - * Fix missing colons in closes. + * debian/changelog: Fix missing colons in closes. + * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal + initramfs on MODULES=dep. (closes: #395526) - -- maximilian attems Sun, 22 Apr 2007 19:08:40 +0200 + -- maximilian attems Tue, 01 May 2007 18:29:59 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index a5d1f61..12faeff 100644 --- a/hook-functions +++ b/hook-functions @@ -113,24 +113,34 @@ copy_modules_dir() done } +# only copy relevant modules dep_add_modules() { + # findout root block device + fstype + eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" + block=${root#/dev/} + block=${block%[0-9]*} - # Things that are too hard to autodetect. - for x in ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do - manual_add_modules "${x}" - done + # Error out if /sys lack block dev + if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then + echo "Error: missing ${block} root ${root} /sys entry" + exit 1 + fi - for x in /sys/bus/pci/devices/*; do - if [ -e "${x}/modalias" ]; then - manual_add_modules $(cat "${x}/modalias") - fi - done + # Add rootfs + force_load "${rootfs}" - for x in /sys/bus/usb/devices/*; do - if [ -e "${x}/modalias" ]; then - manual_add_modules $(cat "${x}/modalias") + # walk /sys for relevant modules + device_path=$(readlink -f /sys/block/${block}/device) + while [ "${device_path}" != "/sys" ]; do + driver_path="$(readlink -f ${device_path}/driver)" + if [ -e "$driver_path" ]; then + module="$(basename $(readlink -f $driver_path))" + if [ -n "${module}" ]; then + force_load "${module}" + fi fi + device_path="$(dirname ${device_path})" done if [ -e /proc/ide ]; then -- cgit v1.2.3 From 97463b8108d05b33a09d8847c7f4d7c1be7e41db Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 1 May 2007 19:25:27 +0200 Subject: hook-funtions: copy_exec work * Change copy_exec to use the same source and destination path if only one argument is given. * document how copy_exec determines the target path. This also fixes a minor bug, these two commands: copy_exec /some/thing /thing copy_exec /some/other/thing /thing Would previously print (note the incorrect path): W:copy_exec: Not copying /some/other/thing to $DESTDIR/thing/thing... --- debian/changelog | 7 +++--- hook-functions | 67 +++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 21 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 8932889..40363ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,18 +2,19 @@ initramfs-tools (0.88) UNRELEASED; urgency=low [ maximilian attems ] * debian/changelog: Fix missing colons in closes. - * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal initramfs on MODULES=dep. (closes: #395526) - * mkinitramfs.8: Add examples section, plus improve description of the low-level tool and how it fits with update-initramfs. [ David Härdeman ] * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts parse /proc/cmdline themselves (even in the Etch version). + * hook-functions: Change copy_exec to use the same source and + destination path if only one argument is given. + * hook-funcions: document how copy_exec determines the target path. - -- maximilian attems Tue, 01 May 2007 18:56:40 +0200 + -- maximilian attems Tue, 01 May 2007 19:23:10 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 12faeff..6c75b5f 100644 --- a/hook-functions +++ b/hook-functions @@ -55,24 +55,55 @@ manual_add_modules() done } -# $1 is source -# $2 is relative destination +# $1 is the source path (e.g. /usr/bin/time) +# $2 is the relative destination (e.g. /usr or /usr/time) +# +# The destination is interpreted in the same way "cp" would, meaning +# (assuming /bin is a directory): +# +# "copy_exec /usr/bin/time /bin" -> /bin/time +# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime +# +# If $2 is left out, the same destination path as for the source arg will +# be used and directories will be created as needed, so: +# +# "copy_exec /usr/bin/time" -> /usr/bin/time +# copy_exec() { - final_destination=${DESTDIR}/${2}/`basename ${1}` + local source target destination final_destination x nonoptlib + local libname dirname + + source="${1}" + if [ -n "${2}" ]; then + target="${2}" + else + if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then + mkdir -p "${DESTDIR}/$(dirname "${1}")" + fi + target="${1}" + fi + + if [ -d "${DESTDIR}/${target}" ]; then + destination="${target}/$(basename "${source}")" + else + destination="${target}" + fi + final_destination="${DESTDIR}/${destination}" + if [ -L "$final_destination" ]; then - if ! [ `readlink ${final_destination}` = "${1}" ]; then - echo "W:copy_exec: Not copying ${1} to \$DESTDIR${2}/`basename ${1}`, which is already a copy of `readlink ${final_destination}`" >&2 + if [ $(readlink "${final_destination}") != "${source}" ]; then + echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2 return fi else - ln -s ${1} ${DESTDIR}/${2} - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then - echo "Adding binary ${1}" + ln -s ${source} ${DESTDIR}/${destination} + if [ "${verbose}" = "y" ]; then + echo "Adding binary ${source}" fi fi # Copy the dependant libraries - for x in $(ldd ${1} 2>/dev/null | sed -e ' + for x in $(ldd ${source} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; @@ -80,19 +111,19 @@ copy_exec() { # Try to use non-optimised libraries where possible. # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + nonoptlib=$(echo "${x}" | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') - if [ -e ${nonoptlib} ]; then - x=${nonoptlib} + if [ -e "${nonoptlib}" ]; then + x="${nonoptlib}" fi - libname=$(basename ${x}) - dirname=$(dirname ${x}) + libname=$(basename "${x}") + dirname=$(dirname "${x}") - mkdir -p ${DESTDIR}/${dirname} - if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then - ln -s ${x} ${DESTDIR}/${dirname} - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + mkdir -p "${DESTDIR}/${dirname}" + if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then + ln -s "${x}" "${DESTDIR}/${dirname}" + if [ "${verbose}" = "y" ]; then echo "Adding library ${x}" fi fi -- cgit v1.2.3 From f123993d1c73c906c50bcb8484e8abb5f9dd44f1 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 3 May 2007 18:47:00 +0200 Subject: hook-functions: add firmware loading support newer modinfo outputs firmware files corresponding to the modules MODULE_FIRMWARE() field. Take care to add them automaticaly. --- debian/changelog | 6 ++++-- hook-functions | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index b436b0a..032fa85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,9 +13,11 @@ initramfs-tools (0.88) UNRELEASED; urgency=low parse /proc/cmdline themselves (even in the Etch version). * hook-functions: Change copy_exec to use the same source and destination path if only one argument is given. - * hook-funcions: document how copy_exec determines the target path. + * hook-functions: Document how copy_exec determines the target path. + * hook-functions: Add firmware loading support to manual_add_modules(). + (closes: #355881) - -- maximilian attems Tue, 01 May 2007 19:31:41 +0200 + -- maximilian attems Thu, 03 May 2007 18:43:14 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 6c75b5f..b3264ac 100644 --- a/hook-functions +++ b/hook-functions @@ -38,8 +38,11 @@ add_modules_from_file() done } +# Add dependent modules + eventual firmware manual_add_modules() { + local man_x firmwares firmware + for mam_x in $(modprobe --set-version="${version}" --ignore-install \ --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates @@ -49,9 +52,42 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + if [ "${verbose}" = "y" ]; then echo "Adding module ${mam_x}" fi + + # Add firmware files if necessary + firmwares=$(modinfo -F firmware "${mam_x}") + if [ -z "${firmwares}" ]; then + continue + fi + for firmware in $firmwares; do + if [ -e "${DESTDIR}/lib/firmware/${firmware}" ]; then + continue + fi + + # Only print warning for missing fw of loaded module + # or forced loaded module + if [ ! -e "/lib/firmware/${firmware}" ]; then + if grep -q "^$(basename "${mam_x}" .ko)" \ + /proc/modules \ + || grep -q "^$(basename "${mam_x}" .ko)" \ + "${CONFDIR}/modules"; then + echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2 + fi + continue + fi + + if [ ! -e "${DESTDIR}/lib/udev/firmware.agent" ] \ + && [ -e "/lib/udev/firmware.agent" ]; then + copy_exec /lib/udev/firmware.agent + fi + + copy_exec "/lib/firmware/${firmware}" + if [ "${verbose}" = "y" ]; then + echo "Adding firmware ${firmware}" + fi + done done } -- cgit v1.2.3 From fa78f20fc86dabbd6e89485b755cb40f3918895a Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 27 May 2007 00:57:02 +0200 Subject: hook-functions: make version check in check_minkver more robust. --- debian/changelog | 5 +++-- hook-functions | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 622b109..4c0ff66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.88) UNRELEASED; urgency=low +initramfs-tools (0.88) unstable; urgency=low [ maximilian attems ] * debian/changelog: Fix missing colons in closes. @@ -25,8 +25,9 @@ initramfs-tools (0.88) UNRELEASED; urgency=low nodes (devmapper/LVM/EVMS, mdadm) will exist before they can be safely used. Patch by Scott James Remnant . Changed to support both fstype and vol_id. + * hook-functions: make version check in check_minkver more robust. - -- maximilian attems Sun, 27 May 2007 00:41:08 +0200 + -- maximilian attems Sun, 27 May 2007 00:52:38 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index b3264ac..1b38931 100644 --- a/hook-functions +++ b/hook-functions @@ -340,9 +340,13 @@ check_minkver() fi 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 + # sed: keep last line starting with MINKVER=, + # remove MINKVER= and trailing space + minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") + if [ -z "${tmp}" ]; then + continue + elif dpkg --compare-versions "${curversion}" lt "${minver}"; then + echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2 echo "W: not generating requested initramfs for kernel ${curversion}" >&2 exit 2 fi -- cgit v1.2.3 From 728d6fc95b28254b982395e73153c5c422c81768 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Jun 2007 11:58:14 +0200 Subject: hook-functions: fix variable typo --- debian/changelog | 3 ++- hook-functions | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index e1aa7c8..6a17083 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,13 +9,14 @@ initramfs-tools (0.89) unstable; urgency=low * minitramfs: Fall back to bootable default MODULES=most if unsupported MODULES setting is passed. Thanks Henning Sprang for report. (closes: #429144) + * hook-functions: Fix variable typo. Thanks Emanuele Rocca . [ Joey Hess ] * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load it for the SJLJ exception handling on that architecture. (closes: #426395) Thanks to Aurelien Jarno for ack and review. - -- maximilian attems Thu, 21 Jun 2007 11:49:23 +0200 + -- maximilian attems Thu, 21 Jun 2007 11:57:20 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 1b38931..a133a0b 100644 --- a/hook-functions +++ b/hook-functions @@ -41,7 +41,7 @@ add_modules_from_file() # Add dependent modules + eventual firmware manual_add_modules() { - local man_x firmwares firmware + local mam_x firmwares firmware for mam_x in $(modprobe --set-version="${version}" --ignore-install \ --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do -- cgit v1.2.3 From 02b76d4d71a6e5c9cae1c0acaba281e3def583e0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jul 2007 00:49:14 +0200 Subject: hook-functions: fix Xen boot --- debian/changelog | 7 +++++++ hook-functions | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 3141edf..bf883bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.90) UNRELEASED; urgency=low + + * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) + Thanks Marco Nenciarini for patch. + + -- maximilian attems Wed, 04 Jul 2007 00:45:20 +0200 + initramfs-tools (0.89) unstable; urgency=low Release "L'électeur c'est notoire N'a pas tout' sa raison" diff --git a/hook-functions b/hook-functions index a133a0b..131f132 100644 --- a/hook-functions +++ b/hook-functions @@ -147,7 +147,7 @@ copy_exec() { # Try to use non-optimised libraries where possible. # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo "${x}" | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\).*/\(lib.*\)#/lib/\2#') if [ -e "${nonoptlib}" ]; then x="${nonoptlib}" -- cgit v1.2.3 From 494e8cf2560b3d139273513899164219c7c2ae98 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 28 Jul 2007 19:06:11 +0200 Subject: hook-functions: Protect variables with local usage bonus minor coding style cleanup --- debian/changelog | 7 +++++-- hook-functions | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index d3b579d..c37028a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,14 @@ initramfs-tools (0.90) UNRELEASED; urgency=low + [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini for patch. - * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) - -- maximilian attems Sat, 28 Jul 2007 18:56:36 +0200 + [ David Härdeman ] + * hook-functions: Protect all variable with local, plus coding style fixes. + + -- maximilian attems Sat, 28 Jul 2007 19:03:35 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 131f132..b371cbb 100644 --- a/hook-functions +++ b/hook-functions @@ -169,20 +169,24 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { + local x_mod + if ! [ -d "${MODULESDIR}/${1}" ]; then return; fi - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + if [ "${verbose}" = "y" ]; then echo "Copying module directory ${1}" fi for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do - manual_add_modules `basename ${x_mod} .ko` + manual_add_modules $(basename ${x_mod} .ko) done } # only copy relevant modules dep_add_modules() { + local x + # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" block=${root#/dev/} @@ -319,10 +323,12 @@ EOF # minimal supported kernel version check_minkver() { - curversion=${1} - initdir=${2} - if [ -z ${initdir} ]; then - DPKG_ARCH=`dpkg --print-installation-architecture` + local curversion initdir DPKG_ARCH minversion cm_x tmp + + curversion="${1}" + initdir="${2}" + if [ -z "${initdir}" ]; then + DPKG_ARCH=$(dpkg --print-installation-architecture) case ${DPKG_ARCH} in ia64|hppa) minversion="2.6.15" -- cgit v1.2.3 From ccb150b16473ce974a0fbbb236c0dd95a022ec43 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:02:16 +0200 Subject: hook-functions: fix dep_add_modules() for lvm, md and luks root a better shot and try for finding the underlying root devices in the case of MODULES=dep and /sys walk. dep_add_modules() should be splitted.. --- debian/changelog | 6 ++++-- hook-functions | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 60f216b..f0da4a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.90) UNRELEASED; urgency=low +initramfs-tools (0.90~beta1) UNRELEASED; urgency=low [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) @@ -6,11 +6,13 @@ initramfs-tools (0.90) UNRELEASED; urgency=low * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) * scripts/functions: Implement non-zero panic bootarg. Style fix for maybe_break(). + * hook-functions: dep_add_modules() fix for md, lv, luks root. + (closes: #426917, #429237, #426446) [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Tue, 07 Aug 2007 14:09:18 +0200 + -- maximilian attems Wed, 08 Aug 2007 00:50:22 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/hook-functions b/hook-functions index b371cbb..ef4a94e 100644 --- a/hook-functions +++ b/hook-functions @@ -185,16 +185,34 @@ copy_modules_dir() # only copy relevant modules dep_add_modules() { - local x + local root rootfs block minor device_path module x # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" - block=${root#/dev/} - block=${block%[0-9]*} + + # lvm luks root + if [ "${root#/dev/mapper/}" != "${root}" ]; then + minor=$((0x$(stat --format "%T" ${root}) % 256)) + block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) + if [ "${block#dm-}" != "${block}" ]; then + block=$(ls -1 /sys/block/${block}/slaves | head -n 1) + fi + block=${block%[0-9]*} + # md root + elif [ "${root#/dev/md}" != "${root}" ]; then + root=${root#/dev/} + block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ + /proc/mdstat) + # classical root device + else + block=${root#/dev/} + block=${block%[0-9]*} + fi # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "Error: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: Error use MODULES=most" exit 1 fi -- cgit v1.2.3 From 89bff5c412013a982f8c06b70cd6a80df5e2846d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:31:17 +0200 Subject: hook-functions rephrase slightly the MODULES=dep error condition goal is to get the space down for lenny. --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index ef4a94e..0f66aa2 100644 --- a/hook-functions +++ b/hook-functions @@ -212,7 +212,8 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then echo "mkinitramfs: missing ${block} root ${root} /sys entry" - echo "mkinitramfs: Error use MODULES=most" + echo "mkinitramfs: workaround is MODULES=most" + echo "mkinitramfs: Error please report the bug" exit 1 fi -- cgit v1.2.3 From 286148ccc99630bb60168e27b6aba1b14c1f737f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 16 Aug 2007 10:07:42 +0200 Subject: hook-functions factor out sys_walk_mod_add() add it as a function of it's own --- debian/changelog | 3 ++- hook-functions | 36 ++++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 34f7103..da0b63e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ initramfs-tools (0.91) unstable; urgency=low * scripts/functions: simplify panic() * mkinitramfs: Kick empty dir modules. + * hook-functions: Factor sys_walk_mod_add() out of dep_add_modules(). - -- maximilian attems Thu, 16 Aug 2007 00:25:22 +0200 + -- maximilian attems Thu, 16 Aug 2007 10:06:09 +0200 initramfs-tools (0.90) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 0f66aa2..0a50051 100644 --- a/hook-functions +++ b/hook-functions @@ -182,10 +182,28 @@ copy_modules_dir() done } -# only copy relevant modules +# walk /sys for relevant modules +sys_walk_mod_add() +{ + local driver_path module + device_path="$1" + + while [ "${device_path}" != "/sys" ]; do + driver_path="$(readlink -f ${device_path}/driver)" + if [ -e "$driver_path" ]; then + module="$(basename $(readlink -f $driver_path))" + if [ -n "${module}" ]; then + force_load "${module}" + fi + fi + device_path="$(dirname ${device_path})" + done +} + +# find and only copy root relevant modules dep_add_modules() { - local root rootfs block minor device_path module x + local block minor root rootfs root_dev_path x # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" @@ -220,18 +238,8 @@ dep_add_modules() # Add rootfs force_load "${rootfs}" - # walk /sys for relevant modules - device_path=$(readlink -f /sys/block/${block}/device) - while [ "${device_path}" != "/sys" ]; do - driver_path="$(readlink -f ${device_path}/driver)" - if [ -e "$driver_path" ]; then - module="$(basename $(readlink -f $driver_path))" - if [ -n "${module}" ]; then - force_load "${module}" - fi - fi - device_path="$(dirname ${device_path})" - done + root_dev_path=$(readlink -f /sys/block/${block}/device) + sys_walk_mod_add ${root_dev_path} if [ -e /proc/ide ]; then for x in ide-generic ide-disk ide-cd; do -- cgit v1.2.3 From b15ec51af8521331dc74814d3582fdbb492589d0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 23 Aug 2007 14:32:55 +0200 Subject: hook-functions: Add the new firewire modules. --- debian/changelog | 3 ++- hook-functions | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 5d42ec6..a60168d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ initramfs-tools (0.91) unstable; urgency=low * mkinitramfs: Kick empty dir modules. * hook-functions: Factor sys_walk_mod_add() out of dep_add_modules(). * init: Fix mount options invocation for klibc mount. + * hook-functions: Add the new firewire modules. - -- maximilian attems Tue, 21 Aug 2007 17:08:48 +0200 + -- maximilian attems Thu, 23 Aug 2007 14:31:59 +0200 initramfs-tools (0.90) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 0a50051..61af0a5 100644 --- a/hook-functions +++ b/hook-functions @@ -300,11 +300,17 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; + # FIXME: can be removed after Lenny release ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" done ;; + firewire) + for x in firewire-ohci firewire-sbp2; do + manual_add_modules "${x}" + done + ;; i2o) for x in i2o_block; do manual_add_modules "${x}" @@ -325,6 +331,7 @@ auto_add_modules() auto_add_modules i2o auto_add_modules dasd auto_add_modules ieee1394 + auto_add_modules firewire ;; esac } -- cgit v1.2.3 From 41f9c1621e502a4af2f00f063d42e0f4ac53d6c2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 7 Sep 2007 18:29:36 +0200 Subject: hook-functions: probe rootfs on auto type fix dep_add_modules(), as bonus check rootfs output so that eventual unkown rootfs get reported. --- debian/changelog | 4 +++- hook-functions | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 78a6922..6d8b335 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks Vagrant Cascadian for the patch. * update-initramfs: Don't check for ro /boot inside of a chroot. * debian/script: Fix syntax of MODULES=dep block. + * hook-functions: Add rootfs detection for the "auto" mount output. + Thanks martin f krafft for report. (closes: #441211) - -- maximilian attems Fri, 07 Sep 2007 15:10:11 +0200 + -- maximilian attems Fri, 07 Sep 2007 18:24:40 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 61af0a5..cb2c75d 100644 --- a/hook-functions +++ b/hook-functions @@ -203,10 +203,23 @@ sys_walk_mod_add() # find and only copy root relevant modules dep_add_modules() { - local block minor root rootfs root_dev_path x + local block minor root FSTYPE root_dev_path x # findout root block device + fstype - eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" + eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')" + + # find out real rootfs on auto type + if [ "${FSTYPE}" = "auto" ]; then + eval "$(/usr/lib/klibc/bin/fstype ${root})" + fi + + # check that fstype rootfs recognition + if [ "${FSTYPE}" = "unknown" ]; then + echo "mkinitramfs: unkown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "mkinitramfs: Error please report bug against klibc" + exit 1 + fi # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then @@ -236,7 +249,7 @@ dep_add_modules() fi # Add rootfs - force_load "${rootfs}" + force_load "${FSTYPE}" root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} -- cgit v1.2.3 From 4b1ed160ed49e8ba7959a4e699fdb16dcb0accc0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 21:49:42 +0200 Subject: hook-functions: reorder dep_add_modules() do fstype stuff on top. --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index cb2c75d..07e5cda 100644 --- a/hook-functions +++ b/hook-functions @@ -221,6 +221,9 @@ dep_add_modules() exit 1 fi + # Add rootfs + force_load "${FSTYPE}" + # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) @@ -248,9 +251,6 @@ dep_add_modules() exit 1 fi - # Add rootfs - force_load "${FSTYPE}" - root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} -- cgit v1.2.3 From 742bdfa1407b2b030720934ab877b84e15dbb368 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 21:56:44 +0200 Subject: hook-functions: don't force load rootfs fstype just detects fine the fs, even when running without udev. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 07e5cda..0c27755 100644 --- a/hook-functions +++ b/hook-functions @@ -222,7 +222,7 @@ dep_add_modules() fi # Add rootfs - force_load "${FSTYPE}" + manual_add_modules "${FSTYPE}" # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then -- cgit v1.2.3 From 937188e01273de536b02f7fa782a8bb4045a009c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 22:03:16 +0200 Subject: hook-functions: MODULES=dep fix I2O detection. * missing i2o_block * force_load when !udev --- debian/changelog | 3 ++- hook-functions | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index 3002e75..c7f7ea1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,8 +21,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks martin f krafft for report. (closes: #441211) * init: Disable quiet on debug bootarg. Fix new init error message. Thanks Michael Prokop for the patches. + * hook-functions: MODULES=dep fix I2O detection. - -- maximilian attems Sat, 08 Sep 2007 19:56:22 +0200 + -- maximilian attems Sat, 08 Sep 2007 22:01:15 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 0c27755..628811b 100644 --- a/hook-functions +++ b/hook-functions @@ -265,7 +265,8 @@ dep_add_modules() fi if [ -e /sys/bus/i2o/devices/ ]; then - manual_add_modules i2o_block + force_load i2o_block + force_load i2o_config fi if [ -e /sys/bus/ps3_system_bus/ ]; then -- cgit v1.2.3 From c371cfa72e473518a9ff0540b0b1d2eae83dd7aa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 22:33:12 +0200 Subject: hook-functions: Add sys_walk_modalias() for IDE instead of searching non matching sysfs modules strings PIIX_IDE != piix, just look up the modalias. modprobe likes it too ;) --- debian/changelog | 5 +++-- hook-functions | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'hook-functions') diff --git a/debian/changelog b/debian/changelog index c7f7ea1..431cf50 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,9 +21,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks martin f krafft for report. (closes: #441211) * init: Disable quiet on debug bootarg. Fix new init error message. Thanks Michael Prokop for the patches. - * hook-functions: MODULES=dep fix I2O detection. + * hook-functions: MODULES=dep fix I2O detection. Add sys_walk_modalias() + to catch old style IDE. - -- maximilian attems Sat, 08 Sep 2007 22:01:15 +0200 + -- maximilian attems Sat, 08 Sep 2007 22:29:42 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 628811b..9becfe2 100644 --- a/hook-functions +++ b/hook-functions @@ -200,6 +200,20 @@ sys_walk_mod_add() done } +# walk /sys for relevant modalias +sys_walk_modalias() +{ + local device_path modalias + + device_path="$(dirname "${1}")" + device_path="$(dirname "${device_path}")" + modalias=$(cat "${device_path}/modalias") + + if [ -n "${modalias}" ]; then + force_load "${modalias}" + fi +} + # find and only copy root relevant modules dep_add_modules() { @@ -251,13 +265,15 @@ dep_add_modules() exit 1 fi + # sys walk ATA root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} - if [ -e /proc/ide ]; then - for x in ide-generic ide-disk ide-cd; do - manual_add_modules "${x}" - done + # catch old-style IDE + if [ -e /sys/bus/ide/devices/ ]; then + sys_walk_modalias ${root_dev_path} + manual_add_modules ide-disk + manual_add_modules ide-cd fi if [ -e /sys/bus/scsi/devices/ ]; then -- cgit v1.2.3 From adeba36e5baeefa704eaa18fa6a1edb2acfc1783 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 9 Sep 2007 12:36:49 +0200 Subject: hook-functions: protect sys_walk_modalias() check that the modalias really exists, otherwise no need to add anything. --- hook-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 9becfe2..55fb342 100644 --- a/hook-functions +++ b/hook-functions @@ -207,7 +207,9 @@ sys_walk_modalias() device_path="$(dirname "${1}")" device_path="$(dirname "${device_path}")" - modalias=$(cat "${device_path}/modalias") + if [ -e "${device_path}/modalias" ]; then + modalias=$(cat "${device_path}/modalias") + fi if [ -n "${modalias}" ]; then force_load "${modalias}" -- cgit v1.2.3 From 1b59ebff6e7ea5e7ff58129362e127cf2fb81c6f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:40:50 +0100 Subject: MODULES=dep fix for new /dev/md/X naming scheme (closes: #440694). Using mkinitramfs-kpkg to build the ramdisk. awk: /^md/0/{print substr($5, 1, 3); exit} awk: ^ syntax error mkinitramfs-kpkg failed to create initrd image. Failed to create initrd image. /proc/mdstat naming unchanged, thuse use same awk parsing. --- hook-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 55fb342..f39e7e4 100644 --- a/hook-functions +++ b/hook-functions @@ -248,7 +248,12 @@ dep_add_modules() block=$(ls -1 /sys/block/${block}/slaves | head -n 1) fi block=${block%[0-9]*} - # md root + # md root new naming scheme /dev/md/X + elif [ "${root#/dev/md/}" != "${root}" ]; then + root=${root#/dev/md/} + block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \ + /proc/mdstat) + # md root /dev/mdX elif [ "${root#/dev/md}" != "${root}" ]; then root=${root#/dev/} block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ -- cgit v1.2.3 From 4843c922a862303c3212b40da160e874cbfd33c6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 11:43:38 +0200 Subject: hook-functions: Add atl1, cxgb3, e1000e, igb, ipg, niu, sky2 list of net modules added to MODULES=most the net section was missing quite a lot of the newer net driver, add them all per hand. as we can't just ship drivers/net. --- hook-functions | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index f39e7e4..4cf916a 100644 --- a/hook-functions +++ b/hook-functions @@ -311,11 +311,12 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ - dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ - famachi forcedeth gelic_net hp100 mace mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ - r8169 s2io sis900 skge slhc smc911x starfire \ + for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ + bnx2 cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \ + ep93xx_eth eql fealnx famachi forcedeth gelic_net \ + hp100 igb ipg mace mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ + r8169 s2io sis900 skge sky2 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 -- cgit v1.2.3 From bd052d092afbfd145fe5c22fcfdc407f2b9c2b84 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 16:51:02 +0200 Subject: MODULES=dep fix ps3 support Debian never shipped the PS3PF legacy plattform, only retain the relevant upstream accepted ps3 plattform drivers. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 4cf916a..1f98cba 100644 --- a/hook-functions +++ b/hook-functions @@ -293,7 +293,7 @@ dep_add_modules() fi if [ -e /sys/bus/ps3_system_bus/ ]; then - for x in ps3_storage gelic_net ohci-hcd ehci-hcd; do + for x in ps3disk ps3rom ps3-gelic; do manual_add_modules "${x}" done fi -- cgit v1.2.3 From 5eb8ef34b87581964e35bed17877085a334a8f5b Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 8 Apr 2008 16:54:56 +0200 Subject: hook-function: Add support for sunvnet and sunvdc in hook-functions. [ Ubuntu merge of better sparc support -maks ] --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 1f98cba..d271c58 100644 --- a/hook-functions +++ b/hook-functions @@ -297,6 +297,12 @@ dep_add_modules() manual_add_modules "${x}" done fi + + if [ -e /sys/bus/vio/ ]; then + for x in sunvnet sunvdc; do + manual_add_modules "${x}" + done + fi } @@ -317,7 +323,7 @@ auto_add_modules() hp100 igb ipg mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme tg3 tlan de2104x \ + sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do manual_add_modules "${x}" -- cgit v1.2.3 From 6a4e2130950d3505bf664177747a6a11220f3460 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 10 Apr 2008 13:41:40 +0200 Subject: ps3: Add ps3_sys_manager to MODULES=dep ps3 modules. "ps3_sys_manager handles system shutdown, so having it in initramfs allows the user to properly shutdown the system with the power button if the root file system can not be mounted at boot. Without it the user must do a forced poweroff." Geoff Levand --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index d271c58..b427dab 100644 --- a/hook-functions +++ b/hook-functions @@ -293,7 +293,7 @@ dep_add_modules() fi if [ -e /sys/bus/ps3_system_bus/ ]; then - for x in ps3disk ps3rom ps3-gelic; do + for x in ps3disk ps3rom ps3-gelic ps3_sys_manager; do manual_add_modules "${x}" done fi -- cgit v1.2.3 From 5133e1f923511a0fdb3665f0efd302bd32b23e42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 29 Apr 2008 20:34:09 +0200 Subject: Documentation typo fixes addition. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MODULES=list loads modules very early, when the firmware loader udev might not be there yet. thanks David Martínez Moreno for report. --- hook-functions | 2 +- initramfs.conf.5 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index b427dab..8c90d37 100644 --- a/hook-functions +++ b/hook-functions @@ -231,7 +231,7 @@ dep_add_modules() # check that fstype rootfs recognition if [ "${FSTYPE}" = "unknown" ]; then - echo "mkinitramfs: unkown fstype on root ${root}" + echo "mkinitramfs: unknown fstype on root ${root}" echo "mkinitramfs: workaround is MODULES=most" echo "mkinitramfs: Error please report bug against klibc" exit 1 diff --git a/initramfs.conf.5 b/initramfs.conf.5 index e5fcec9..8957ba6 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -30,7 +30,8 @@ The default setting is \fImost\fP. \fInetboot\fP adds the base modules, network modules, but skips block devices. -\fIlist\fP includes only modules from the additional modules list. +\fIlist\fP includes only modules from the additional modules list to load them +early. .TP \fB BUSYBOX -- cgit v1.2.3 From 40c56de6f25ad179700d38604a27844d3a770a3c Mon Sep 17 00:00:00 2001 From: Glennie Vignarajah Date: Mon, 26 May 2008 23:41:15 +0200 Subject: initramfs-tools: Fix UUID rootfs detection with 'MODULES=dep' When MODULES is set to 'dep' in /etc/initramfs-tools/initramfs.conf, update-initramfs fails to detect correctly the root filesystem(device and fs used). When called, this command fails with: ---------- mkinitramfs: missing rootfs root rootfs /sys entry mkinitramfs: workaround is MODULES=most mkinitramfs: Error please report the bug update-initramfs: failed for /boot/initrd.img-2.6.25-2-amd64 ---------- So we have 3 cases here. eval "$(mount | awk '/"... returns * an UUID when the rootfs is mounted with the 'LABEL=' or 'UUID='. The UUID is a relative symbolic link located in /dev/disk/by-uuid/ pointing to the real device. * the real disk device. * /dev/root When "root=/dev/root", we have to figure out what it is, which is done in the "if" block. Also changing the matching regex in front to catch that type. Once we got the symlink to the root device, we can use 'readlink' to get the real device. Using 'readlink' on a file which is not a symlink doesn't matters(case 2). --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8c90d37..c48416a 100644 --- a/hook-functions +++ b/hook-functions @@ -222,7 +222,11 @@ dep_add_modules() local block minor root FSTYPE root_dev_path x # findout root block device + fstype - eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')" + eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + if [ "${root}" = "/dev/root" ] ; then + root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null + fi + root="$(readlink -f ${root})" # find out real rootfs on auto type if [ "${FSTYPE}" = "auto" ]; then -- cgit v1.2.3 From 3d2a4940078b2cf041fed35233449e7cd6e57a0a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 May 2008 00:10:46 +0200 Subject: hook-functions: MODULES=dep fix error message must not be a klibc bug, initramfs-tools is first suspect. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c48416a..80db840 100644 --- a/hook-functions +++ b/hook-functions @@ -237,7 +237,7 @@ dep_add_modules() if [ "${FSTYPE}" = "unknown" ]; then echo "mkinitramfs: unknown fstype on root ${root}" echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report bug against klibc" + echo "mkinitramfs: Error please report bug on initramfs-tools" exit 1 fi -- cgit v1.2.3 From fbd70a775e50615d3d88555e96b073cba22d8fad Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 4 Jul 2008 23:44:11 +0200 Subject: MODULES=most add mmc host and card drivers this allows OLPC root, as root on mmc cards. (closes: #483431) Thanks for initial patch to Robert Millan . Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 80db840..bec5b62 100644 --- a/hook-functions +++ b/hook-functions @@ -336,6 +336,9 @@ auto_add_modules() ide) copy_modules_dir kernel/drivers/ide ;; + mmc) + copy_modules_dir kernel/drivers/mmc + ;; scsi) copy_modules_dir kernel/drivers/scsi for x in mptfc mptsas mptscsih mptspi; do @@ -380,6 +383,7 @@ auto_add_modules() auto_add_modules dasd auto_add_modules ieee1394 auto_add_modules firewire + auto_add_modules mmc ;; esac } -- cgit v1.2.3 From 7658bb55a237cee7663bdcdc452899d7ab3a23b6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 01:49:34 +0200 Subject: Add virtio_pci for MODULES=most ubuntu merge --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index bec5b62..ad7a4b2 100644 --- a/hook-functions +++ b/hook-functions @@ -316,7 +316,8 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042 \ + virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 8bba9c14e6f887ae7300250b816697aa7e3441fa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 01:52:37 +0200 Subject: Add udf for MODULES=most ubuntu merge --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index ad7a4b2..3975cd9 100644 --- a/hook-functions +++ b/hook-functions @@ -316,7 +316,7 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042 \ + ext3 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \ virtio_pci; do manual_add_modules "${x}" done -- cgit v1.2.3 From 07d29f7d0b2b4dd22213d03f6edfd2147b3f4e0f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 10:52:25 +0200 Subject: mkinitramfs: Fix usage and man outfile arg is not optional. Thanks to Jens Seidel (closes: #493238) --- hook-functions | 2 +- mkinitramfs.8 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 3975cd9..01f33c4 100644 --- a/hook-functions +++ b/hook-functions @@ -393,7 +393,7 @@ usage() { cat >&2 << EOF -Usage: ${0} [OPTION]... <-o outfile> [version] +Usage: ${0} [OPTION]... -o outfile [version] Options: -d confdir Specify an alternative configuration directory. diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 8d94a8c..abb3f39 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "2007/08/08" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2008/08/12" "" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image @@ -8,8 +8,8 @@ mkinitramfs \- low-level tool for generating an initramfs image .RB [ \-d .IR confdir ] .RB [ \-k ] -.RB [ \-o -.IR outfile ] +.RB \-o +.IR outfile .RB [ \-r .IR root ] .RB [ \-v ] -- cgit v1.2.3 From e0d242989d3ceb6cf8747c07d916e0fa854a810c Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 7 Aug 2008 22:45:40 +0300 Subject: MODULES=dep fix for Orion Thanks to Kevin Price who sent me logs from the NSLU2, I know why it works there. The difference is that on the NSLU2 USB is a PCI device whereas on my Orion machine it's not. (closes: #494027) --- hook-functions | 1 + 1 file changed, 1 insertion(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 01f33c4..7d2e6da 100644 --- a/hook-functions +++ b/hook-functions @@ -189,6 +189,7 @@ sys_walk_mod_add() device_path="$1" while [ "${device_path}" != "/sys" ]; do + sys_walk_modalias ${device_path} driver_path="$(readlink -f ${device_path}/driver)" if [ -e "$driver_path" ]; then module="$(basename $(readlink -f $driver_path))" -- cgit v1.2.3 From 08f65e23a7fb7d4c4915b1381e3251e3b7d89098 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 15 Aug 2008 18:45:51 +0200 Subject: auto_add_modules: Add ext4 and ext4dev currently ext4 is named ext4dev, doesn't matter if it doesn't exit, just list it to be future proof for the lenny release. klibc fstype has already ext4dev support (closes: #494922) --- hook-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 7d2e6da..8bbbbd4 100644 --- a/hook-functions +++ b/hook-functions @@ -317,8 +317,8 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \ - virtio_pci; do + ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ + atkbd i8042 virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From b2019d165312d6a6020086904bf37e6d3cc84388 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 8 Sep 2008 14:08:06 +0200 Subject: MODULES=dep fix for root lvm on md mkinitramfs MODULES=dep detection didn't account for lvm on md, fixes mkinitramfs: missing md root /dev/mapper/ts409-root /sys entry (closes: #498237) thanks for report to Rod Whitby --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8bbbbd4..6a5aebf 100644 --- a/hook-functions +++ b/hook-functions @@ -245,13 +245,19 @@ dep_add_modules() # Add rootfs manual_add_modules "${FSTYPE}" - # lvm luks root + # lvm or luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) + # lvm on luks or luks on lvm if [ "${block#dm-}" != "${block}" ]; then block=$(ls -1 /sys/block/${block}/slaves | head -n 1) fi + # lvm on md or luks on md + if [ "${block#md}" != "${block}" ]; then + block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ + /proc/mdstat) + fi block=${block%[0-9]*} # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then -- cgit v1.2.3 From 7c4bfab2f4aa6e627151eddcf4df07d91a4d754e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 12 Sep 2008 14:53:07 +0200 Subject: readd zfcp to auto_add_modules lives under drivers/s390/scsi and not drivers/scsi (closes: #498698) --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 6a5aebf..1c8694c 100644 --- a/hook-functions +++ b/hook-functions @@ -349,7 +349,7 @@ auto_add_modules() ;; scsi) copy_modules_dir kernel/drivers/scsi - for x in mptfc mptsas mptscsih mptspi; do + for x in mptfc mptsas mptscsih mptspi zfcp; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 37d092c66b8a45b26b88d7cad73dab65703d5c91 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 12 Sep 2008 15:37:50 +0200 Subject: add dasd_diag_mod to auto_add_modules block section found under drivers/s390/block instead drivers/block location. "allows to access disks under VM" request by s390 porter Bastian Blank --- hook-functions | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 1c8694c..e9f2368 100644 --- a/hook-functions +++ b/hook-functions @@ -358,6 +358,9 @@ auto_add_modules() ;; block) copy_modules_dir kernel/drivers/block + for x in dasd_diag_mod; do + manual_add_modules "${x}" + done ;; # FIXME: can be removed after Lenny release ieee1394) -- cgit v1.2.3 From 203f66bd11db9ab01e49cd4b496391e95d3eb34f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Sep 2008 18:08:51 +0200 Subject: auto_add_modules: add dasd_diag_mod to dasd section --- hook-functions | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index e9f2368..53867da 100644 --- a/hook-functions +++ b/hook-functions @@ -358,9 +358,6 @@ auto_add_modules() ;; block) copy_modules_dir kernel/drivers/block - for x in dasd_diag_mod; do - manual_add_modules "${x}" - done ;; # FIXME: can be removed after Lenny release ieee1394) @@ -379,7 +376,7 @@ auto_add_modules() done ;; dasd) - for x in dasd_eckd_mod dasd_fba_mod; do + for x in dasd_diag_mod dasd_eckd_mod dasd_fba_mod; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 10ac5c60e51125d45f3923edd1dd1f560ad0df1f Mon Sep 17 00:00:00 2001 From: dann frazier Date: Sun, 14 Dec 2008 19:24:11 +0100 Subject: Fix MODULES=dep for cciss devices A coworker reported a lenny install failure today. Turns out he had asked the installer to run mkinitramfs w/ MODULES=dep, which I'd never tried before: dl380g5:/home/dannf# mkinitramfs-kpkg -o /boot/initrd.img-2.6.26-1-686 2.6.26-1-686 mkinitramfs: missing cciss/c0d0p root /dev/cciss/c0d0p1 /sys entry mkinitramfs: workaround is MODULES=most mkinitramfs: Error please report the bug dep_add_modules() expects to find a /sys/block/cciss/c0d0p file, but it should be trying /sys/block/cciss!c0d0: (closes: #507619) --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 53867da..d8875b7 100644 --- a/hook-functions +++ b/hook-functions @@ -269,6 +269,10 @@ dep_add_modules() root=${root#/dev/} block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ /proc/mdstat) + # cciss device + elif [ "${root#/dev/cciss/}" != "${root}" ]; then + block=${root#/dev/cciss/*} + block="cciss!${block%p*}" # classical root device else block=${root#/dev/} -- cgit v1.2.3 From acae751d2af11ceb05deab13dbc9c111140c9f58 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 14 Dec 2008 19:26:00 +0100 Subject: MODULES=dep fix for ida devices same fix as cciss, see #507619 --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index d8875b7..0dc3e22 100644 --- a/hook-functions +++ b/hook-functions @@ -273,6 +273,10 @@ dep_add_modules() elif [ "${root#/dev/cciss/}" != "${root}" ]; then block=${root#/dev/cciss/*} block="cciss!${block%p*}" + # ida device + elif [ "${root#/dev/ida/}" != "${root}" ]; then + block=${root#/dev/ida/*} + block="ida!${block%p*}" # classical root device else block=${root#/dev/} -- cgit v1.2.3 From e950d624a7ed8584ba543b523b8ca104ce58af41 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 00:03:36 +0100 Subject: hook-functions: alphebetize net drivers, fix typhoon typo --- hook-functions | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 0dc3e22..8eb9906 100644 --- a/hook-functions +++ b/hook-functions @@ -338,14 +338,15 @@ auto_add_modules() ;; net) for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ - bnx2 cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \ + bnx2 cxgb3 de2104x de4x5 defxx dl2k dmfe \ + e100 e1000 e1000e ehea epic100 \ ep93xx_eth eql fealnx famachi forcedeth gelic_net \ hp100 igb ipg mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \ - de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ - typhon via-rhine via-velocity yellowfin; do + sundance sungem sungem_phy sunhme sunvnet tg3 tlan \ + tulip typhoon via-rhine via-velocity winbond-840 \ + xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 9c67d426a3c39ca0c9fa6e0e676c1740e9ddbf5b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 00:08:08 +0100 Subject: Add atl1e, cxgb, ixgb, ixgbe, mlx4_core, netxen_nic, sfc, tehuti to net module list closes: #503216 --- hook-functions | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8eb9906..5b6230a 100644 --- a/hook-functions +++ b/hook-functions @@ -337,14 +337,15 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ - bnx2 cxgb3 de2104x de4x5 defxx dl2k dmfe \ + for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \ + bnx2 cxgb cxgb3 de2104x de4x5 defxx dl2k dmfe \ e100 e1000 e1000e ehea epic100 \ ep93xx_eth eql fealnx famachi forcedeth gelic_net \ - hp100 igb ipg mace mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ - r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme sunvnet tg3 tlan \ + hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ + pcnet32 qla3xxx \ + r8169 s2io sfc sis900 skge sky2 slhc smc911x starfire \ + sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ tulip typhoon via-rhine via-velocity winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" -- cgit v1.2.3 From a776485a1cd51b2541877537471e4809889609ef Mon Sep 17 00:00:00 2001 From: Eugene Paskevich Date: Wed, 17 Dec 2008 12:43:46 +0100 Subject: hook-functions: Fix MODULES=dep for lvm LABEL fstab notation The root fs is located on LVM and is described in /etc/fstab with LABEL= notation, which leads to the following mount output for root filesystem: mount | grep "on / " /dev/dm-0 on / type ext3 (rw,noatime,errors=remount-ro) The /dev/dm-0 itself isn't a symlink to /dev/mapper/, therefore root var remains /dev/dm-0 after readlink -f attempt. fix the consequent root detection failure. (closes: #508906) --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 5b6230a..0863122 100644 --- a/hook-functions +++ b/hook-functions @@ -246,7 +246,8 @@ dep_add_modules() manual_add_modules "${FSTYPE}" # lvm or luks root - if [ "${root#/dev/mapper/}" != "${root}" ]; then + if [ "${root#/dev/mapper/}" != "${root}" ] \ + || [ "${root#/dev/dm-}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) # lvm on luks or luks on lvm -- cgit v1.2.3 From ce1c64736aa741df012e93ca0bae5a9399c58909 Mon Sep 17 00:00:00 2001 From: "S. Sakar" Date: Sun, 21 Sep 2008 08:55:09 +0200 Subject: hook-functions: MODULES=dep fix encrypted loop device i've set up an encrypted loop-AES device as the root partition (boot paramter dev=/dev/loopX) and update-initramfs fails with : mkinitramfs: missing loop root /dev/loop2 /sys entry --- hook-functions | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 0863122..6a68910 100644 --- a/hook-functions +++ b/hook-functions @@ -278,6 +278,11 @@ dep_add_modules() elif [ "${root#/dev/ida/}" != "${root}" ]; then block=${root#/dev/ida/*} block="ida!${block%p*}" + # loop root /dev/loopX + elif [ "${root#/dev/loop}" != "${root}" ]; then + root=${root#/dev/} + block=$(losetup -a \ + | awk "/${root}/{print substr(\$3, 7, 3); exit}") # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 75475db4e8d55fe79bc8a0e9d944a1eef493b5e2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 20:06:10 +0100 Subject: hook-functions: just ship old iee1394 if around. no need to deprecate it in initramfs-tools. Lenny ships due to userspace with it and Juju firewire not yet feature complete.. --- hook-functions | 1 - 1 file changed, 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 6a68910..f6e4814 100644 --- a/hook-functions +++ b/hook-functions @@ -375,7 +375,6 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; - # FIXME: can be removed after Lenny release ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" -- cgit v1.2.3 From 7d28901223a8f5fa47ddb0b0d39b34b04d43b8e9 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Thu, 29 Jan 2009 07:00:07 +1100 Subject: hook-functions: Add hid_* modules. since some keyboards will not be usable at the initramfs/busybox prompt without them. [ Ubuntu sync for 0.92bubuntu19 port it to Debian - maks ] --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index f6e4814..f9e5bc7 100644 --- a/hook-functions +++ b/hook-functions @@ -336,7 +336,11 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \ + hid_apple hid_belkin hid_bright hid_cherry hid_chicony \ + hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \ + hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \ + hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 06f880229b8f632cbfa699c7af9beee13d0dddea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Feb 2009 12:34:55 +0100 Subject: MODULES=dep fix for minor partitions > 9 always remove the largest possible suffix pattern on the block device. (closes: #513958) Reported-by: Nicola Canepa --- hook-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index f9e5bc7..0ddfcec 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,7 @@ dep_add_modules() block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ /proc/mdstat) fi - block=${block%[0-9]*} + block=${block%%[0-9]*} # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} @@ -286,7 +286,7 @@ dep_add_modules() # classical root device else block=${root#/dev/} - block=${block%[0-9]*} + block=${block%%[0-9]*} fi # Error out if /sys lack block dev -- cgit v1.2.3 From 8260223ae409b3ca29e27628c5c572993dbcba76 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 22 Dec 2008 09:07:42 +0000 Subject: MODULES=dep fix for Xen virtual block devices Ferenc seems to be using the xvda1=img1,xvda2=img2 scheme of Xen disks (this is what xentools gets you) rather than the whole disk with partition scheme. In the xvda1/xvda2 scheme /sys/block contains: # ls /sys/block/ ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda1 xvda2 In the whole disk scheme it contains xvda as you would expect: # ls /sys/block/ loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7 ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda I've attached a patch which takes care of this difference. [ remove largest suffix pattern, so that we don't stumble on big minors -maks ] Signed-off-by: maximilian attems --- hook-functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 0ddfcec..da6ddf9 100644 --- a/hook-functions +++ b/hook-functions @@ -283,6 +283,15 @@ dep_add_modules() root=${root#/dev/} block=$(losetup -a \ | awk "/${root}/{print substr(\$3, 7, 3); exit}") + # Xen virtual device /dev/xvdX + elif [ "${root#/dev/xvd}" != "${root}" ]; then + block=${root#/dev/} + # Xen has a mode where only the individual partitions are + # registered with the kernel as well as the usual full disk + # with partition table scheme. + if [ ! -e /sys/block/${block} ] ; then + block=${block%%[0-9]*} + fi # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 37d28de262b206d8eda37634a0bfd05062aa705b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 18:13:25 +0100 Subject: MODULES=dep: ide-disk got renamed to ide-gd_mod since 2.6.28. try to add one or the other. --- hook-functions | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index da6ddf9..038bda1 100644 --- a/hook-functions +++ b/hook-functions @@ -313,6 +313,8 @@ dep_add_modules() # catch old-style IDE if [ -e /sys/bus/ide/devices/ ]; then sys_walk_modalias ${root_dev_path} + manual_add_modules ide-gd_mod + # FIXME: remove post Squeeze manual_add_modules ide-disk manual_add_modules ide-cd fi -- cgit v1.2.3 From cbc5fd3ab5a87e142466b5f48f0646da0f4bb7df Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 18:32:14 +0100 Subject: mkinitramfs: usage() fix conffile name. woow that went unnoticed for some years now. people seem really to use update-initramfs(8). --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 038bda1..c0064e1 100644 --- a/hook-functions +++ b/hook-functions @@ -436,7 +436,7 @@ Options: -d confdir Specify an alternative configuration directory. -k Keep temporary directory used to make the image. -o outfile Write to outfile. - -r root Override ROOT setting in mkinitrd.conf. + -r root Override ROOT setting in initramfs.conf. See mkinitramfs(8) for further details. EOF -- cgit v1.2.3 From 227d20ec6946cb9aa2f2378bf7bae49575e24167 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Mar 2009 13:08:01 +0100 Subject: hook-functions: reword MODULES=dep error message seems confusing for users.. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c0064e1..353495f 100644 --- a/hook-functions +++ b/hook-functions @@ -300,7 +300,7 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "mkinitramfs: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" echo "mkinitramfs: workaround is MODULES=most" echo "mkinitramfs: Error please report the bug" exit 1 -- cgit v1.2.3 From 966fb31cdcae2bb9f47c9f5a1f39b37514a81b7b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 20 Mar 2009 22:33:30 +0100 Subject: hook-functions: MODULES=dep fix for mmc root update-initramfs: Generating /boot/initrd.img-2.6.26-1-versatile mkinitramfs: missing mmcblk root /dev/mmcblk0p3 /sys entry (closes: #520198) Tested-by: Paul Malishev --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 353495f..4b69827 100644 --- a/hook-functions +++ b/hook-functions @@ -292,6 +292,10 @@ dep_add_modules() if [ ! -e /sys/block/${block} ] ; then block=${block%%[0-9]*} fi + # mmc root /dev/mmcblkXpX + elif [ "${root#/dev/mmcblk}" != "${root}" ]; then + block=${root#/dev/} + block=${block%%p[0-9]*} # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 2a0fee1aa8aa8dabc69380f861e7d1c8d35ec5f4 Mon Sep 17 00:00:00 2001 From: François Delawarde Date: Wed, 25 Feb 2009 14:04:53 +0100 Subject: hook-functions: MODULES=dep fix for luks over cciss devices I needed to run update-initramfs w/ MODULES=dep (for some 15M BIOS size limitation w/ lilo on an HP server), turns out that I found the same bug as #507619 (please refer to it for details), except that I have a LUKS format over the cciss device. As bug #507619 describes: "dep_add_modules() expects to find a /sys/block/cciss/c0d0p file, but it should be trying /sys/block/cciss!c0d0" It also mentions: "fyi, I suspect this may also apply to old-style smart array devices, where device names are similar, but use 'ida' intead of 'cciss' - e.g. /dev/ida/c0d0p1." The following patch fixes it for me (on cciss) and should also fix it for ida devices. [ patch got checked and tested life on #debian-boot channel, see below -maks ] fixed warning: mkinitramfs: missing cciss!c0d0p2 root /dev/mapper/quakelive-root /sys entry of course, since the new value of block comes out of /sys/block/dm-${minor}/slaves, it makes sense that it would already be in sysfs syntax. Tested-by: Timothee Besset --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 4b69827..2368b8d 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,13 @@ dep_add_modules() block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ /proc/mdstat) fi - block=${block%%[0-9]*} + # luks or lvm on cciss or ida + if [ "${block#cciss}" != "${block}" ] \ + || [ "${block#ida}" != "${block}" ]; then + block="${block%p*}" + else + block=${block%%[0-9]*} + fi # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} -- cgit v1.2.3 From 198f3485f2858e882e0cc4eb449a5c471fb0b543 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 27 Mar 2009 09:59:05 +0100 Subject: hook-functions: stricter match on loaded module for firmware warning. Otherwise it likes to warn for e100 even if e1000e is in use: grep e100 /proc/modules e1000e 110896 0 - Live 0xffffffffa0028000 --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 2368b8d..d24df58 100644 --- a/hook-functions +++ b/hook-functions @@ -69,7 +69,7 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ]; then - if grep -q "^$(basename "${mam_x}" .ko)" \ + if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ "${CONFDIR}/modules"; then -- cgit v1.2.3 From d8d52f030f8efc16447cf834fabfc8923fcdf407 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 27 Mar 2009 10:35:20 +0100 Subject: hook-functions: Add firmware from versioned directories too. First see if there is a $(uname -r) versioned firmware around and if there is add it first. should make ubuntu sync easier too, as they shipp their firmware there. (closes: #521370) --- hook-functions | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index d24df58..e549c81 100644 --- a/hook-functions +++ b/hook-functions @@ -62,13 +62,15 @@ manual_add_modules() continue fi for firmware in $firmwares; do - if [ -e "${DESTDIR}/lib/firmware/${firmware}" ]; then + if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \ + || [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then continue fi # Only print warning for missing fw of loaded module # or forced loaded module - if [ ! -e "/lib/firmware/${firmware}" ]; then + if [ ! -e "/lib/firmware/${firmware}" ] \ + && [ ! -e "/lib/firmware/${version}/${firmware}" ]; then if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ @@ -83,7 +85,11 @@ manual_add_modules() copy_exec /lib/udev/firmware.agent fi - copy_exec "/lib/firmware/${firmware}" + if [ -e "/lib/firmware/${version}/${firmware}" ]; then + copy_exec "/lib/firmware/${version}/${firmware}" + else + copy_exec "/lib/firmware/${firmware}" + fi if [ "${verbose}" = "y" ]; then echo "Adding firmware ${firmware}" fi -- cgit v1.2.3 From f40e826287d2776094f48302c196652f2ba8326b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 29 Mar 2009 23:58:08 +0200 Subject: hook-functions: MODULES=most add all fb modules per default "with kernel mode setting, i'd imagine that including framebuffer drivers becomes even more important, too" -dilinger this is basedon a patch by Maik Zumstrull , but instead of hardcoding a list just copy over all fb from the relevant driver directory. first part of #416063. --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index e549c81..368924d 100644 --- a/hook-functions +++ b/hook-functions @@ -388,6 +388,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + fb) + copy_modules_dir kernel/drivers/video + ;; ide) copy_modules_dir kernel/drivers/ide ;; @@ -429,6 +432,7 @@ auto_add_modules() *) auto_add_modules base auto_add_modules net + auto_add_modules fb auto_add_modules ide auto_add_modules scsi auto_add_modules block -- cgit v1.2.3 From e0dd249ede887d762b691e90abdc3dfe4ca5ed1f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 11:48:26 +0200 Subject: hook-functions: MODULES=most fb add all available agp modules this was proposed in patch on #416063 by Maik Zumstrull but don't hardcode the list, just add all build ones: ls /lib/modules/2.6.29-1-amd64/kernel/drivers/char/agp/ intel-agp.ko sis-agp.ko via-agp.ko --- hook-functions | 1 + 1 file changed, 1 insertion(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 368924d..b869ce6 100644 --- a/hook-functions +++ b/hook-functions @@ -390,6 +390,7 @@ auto_add_modules() ;; fb) copy_modules_dir kernel/drivers/video + copy_modules_dir kernel/drivers/char/agp ;; ide) copy_modules_dir kernel/drivers/ide -- cgit v1.2.3 From 652423c6f5b636f95899254aba213d417caff158 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 13 Apr 2009 23:10:28 +0200 Subject: hook-functions: Add i915 module for kms. people still need to enable kernel mode setting, but the module should be on the initramfs by default. currently no other drm module supports kms yet. Reported-by: Yves-Alexis Perez Signed-off-by: maximilian attems --- hook-functions | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index b869ce6..96c61bf 100644 --- a/hook-functions +++ b/hook-functions @@ -389,6 +389,9 @@ auto_add_modules() done ;; fb) + for x in i915; do + manual_add_modules "${x}" + done copy_modules_dir kernel/drivers/video copy_modules_dir kernel/drivers/char/agp ;; -- cgit v1.2.3 From 4cf1ab73b5a1abdfb2fe37862b345976c8507dd1 Mon Sep 17 00:00:00 2001 From: Loic Minier Date: Tue, 14 Apr 2009 11:11:52 +0200 Subject: copy_exec: also avoid picking sse2, neon, and vfp hwcaps libs. merge 0.92bubuntu29 Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 96c61bf..295bce8 100644 --- a/hook-functions +++ b/hook-functions @@ -152,8 +152,9 @@ copy_exec() { s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do # Try to use non-optimised libraries where possible. - # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\).*/\(lib.*\)#/lib/\2#') + # We assume that all HWCAP libraries will be in tls, + # sse2, vfp or neon. + nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\2#') if [ -e "${nonoptlib}" ]; then x="${nonoptlib}" -- cgit v1.2.3 From 2d23dd1950e24ec6b64ae2405464a89b82e4cca5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Apr 2009 22:47:30 +0200 Subject: hook-functions: MODULES=dep error out if sysfs not mounted on /sys. currently we fail sylently later, make it explicit. (closes: #524179) Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 295bce8..780812a 100644 --- a/hook-functions +++ b/hook-functions @@ -229,6 +229,12 @@ dep_add_modules() { local block minor root FSTYPE root_dev_path x + # require mounted sysfs + if [ ! -d /sys/kernel/ ]; then + echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" + exit 1 + fi + # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ "${root}" = "/dev/root" ] ; then -- cgit v1.2.3 From 2fd44e5b137544829e6d1f7586519e8a92459ba7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 11 May 2009 08:54:35 +0200 Subject: hook-functions: MODULES=most fix old typo s/smc911x/smc91x/ commit 8761821795732a9755d673e92fb45ac9202270df had the error. (closes: #528094) --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 780812a..38b24e9 100644 --- a/hook-functions +++ b/hook-functions @@ -388,7 +388,7 @@ auto_add_modules() hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ pcnet32 qla3xxx \ - r8169 s2io sfc sis900 skge sky2 slhc smc911x starfire \ + r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ tulip typhoon via-rhine via-velocity winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do -- cgit v1.2.3 From 5fb8d7c356206b72c99c967ab7dde56c69393678 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 18 May 2009 14:00:01 +0200 Subject: mkinitramfs: Invoke dpkg --print-architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: > Running update-initramfs. > update-initramfs: Generating /boot/initrd.img-2.6.29-2-amd64 > dpkg : avertissement : obsolete option > '--print-installation-architecture', please use '--print-architecture' > instead. > dpkg : avertissement : obsolete option > '--print-installation-architecture', please use '--print-architecture' > instead. While we are it nuke duplicate invocation, since DPKG_ARCH is an exported variable anyway. (closes: #529222) Reported-by: Raphaël Hertzog Signed-off-by: maximilian attems --- hook-functions | 1 - mkinitramfs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 38b24e9..6b2e3e4 100644 --- a/hook-functions +++ b/hook-functions @@ -483,7 +483,6 @@ check_minkver() curversion="${1}" initdir="${2}" if [ -z "${initdir}" ]; then - DPKG_ARCH=$(dpkg --print-installation-architecture) case ${DPKG_ARCH} in ia64|hppa) minversion="2.6.15" diff --git a/mkinitramfs b/mkinitramfs index 8f8e428..19972fb 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -141,7 +141,7 @@ fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 -DPKG_ARCH=`dpkg --print-installation-architecture` +DPKG_ARCH=`dpkg --print-architecture` # Export environment for hook scripts. # -- cgit v1.2.3 From dd16e2d08faed5bc36616c62f9275f5c03527fd1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 14:09:40 +0200 Subject: hook-functions: Fix loading of entries without newline in /etc/i-t/modules don't use the overcomplicated sed to add a newline to really strip it, just use the simple /etc/init.d/module-init-tools parsing that should be well enough tested. ;) (closes: #532745) Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 6b2e3e4..f0b310f 100644 --- a/hook-functions +++ b/hook-functions @@ -33,8 +33,9 @@ add_modules_from_file() return fi - sed -e '/^#/d' ${1} | while read module rest; do - force_load "${module}" "${rest}" + grep '^[^#]' ${1} | while read module args; do + [ -n "$module" ] || continue + force_load "${module}" "${args}" done } -- cgit v1.2.3 From f3802469d03140190f824d6ef93513612f300a97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Jun 2009 20:28:55 +0200 Subject: MODULES=most: Add virtio_net to initramfs. allows boot via PXE in a KVM virtualiziation environment. (closes: #533894) Reported-by: Michael Prokop Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index f0b310f..6925e4a 100644 --- a/hook-functions +++ b/hook-functions @@ -391,7 +391,7 @@ auto_add_modules() pcnet32 qla3xxx \ r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ - tulip typhoon via-rhine via-velocity winbond-840 \ + tulip typhoon via-rhine via-velocity virtio_net winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" done -- cgit v1.2.3 From 0d74255b03b80bf8102d007feb86a941ecc35ed0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:27:19 +0200 Subject: Redefinde MODULES=most to not carry any fb driver per default. this allows for a much smaller initramfs and thus faster boot. Signed-off-by: maximilian attems --- conf/initramfs.conf | 2 +- hook-functions | 8 -------- initramfs.conf.5 | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) (limited to 'hook-functions') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index a2bd8db..23dd249 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -8,7 +8,7 @@ # # MODULES: [ most | netboot | dep | list ] # -# most - Add all framebuffer, acpi, filesystem, and harddrive drivers. +# most - Add most filesystem and all harddrive drivers. # # dep - Try and guess which modules to load. # diff --git a/hook-functions b/hook-functions index 6925e4a..03e9723 100644 --- a/hook-functions +++ b/hook-functions @@ -396,13 +396,6 @@ auto_add_modules() manual_add_modules "${x}" done ;; - fb) - for x in i915; do - manual_add_modules "${x}" - done - copy_modules_dir kernel/drivers/video - copy_modules_dir kernel/drivers/char/agp - ;; ide) copy_modules_dir kernel/drivers/ide ;; @@ -444,7 +437,6 @@ auto_add_modules() *) auto_add_modules base auto_add_modules net - auto_add_modules fb auto_add_modules ide auto_add_modules scsi auto_add_modules block diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 6f6ee06..5fa6f87 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -24,7 +24,7 @@ directly. Specifies the modules for the initramfs image. The default setting is \fImost\fP. -\fImost\fP adds all the framebuffer, acpi, file system, ide, sata, scsi and usb drivers. +\fImost\fP adds most file system, all ide, sata, scsi and usb drivers. \fIdep\fP tries to guess which modules are necessary for the running box. -- cgit v1.2.3 From 757294f86013711d94d14a674f8c13aa0e17dee6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:10:11 +0200 Subject: Revert "hook-functions: Add hid_* modules." don't support any possible usb keyboard under earth, the usbhid is default the rest should be added by the appropriate sysadmin. revert this ubuntu sync for smaller initramfs and thus faster boot. This reverts commit 7d28901223a8f5fa47ddb0b0d39b34b04d43b8e9. Signed-off-by: maximilian attems --- hook-functions | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 03e9723..bad79e1 100644 --- a/hook-functions +++ b/hook-functions @@ -371,11 +371,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \ - hid_apple hid_belkin hid_bright hid_cherry hid_chicony \ - hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \ - hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \ - hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 39252ef3dcec3041db9e4b60b7f13ba75115e764 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Aug 2009 13:52:23 +0200 Subject: hook-functions: Fix mounted /sys check for openvz container. ls -l /sys total 0 drwxr-xr-x 5 root root 0 2009-08-08 11:53 class drwxr-xr-x 2 root root 0 2009-08-08 11:53 devices --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index bad79e1..387fe60 100644 --- a/hook-functions +++ b/hook-functions @@ -231,7 +231,7 @@ dep_add_modules() local block minor root FSTYPE root_dev_path x # require mounted sysfs - if [ ! -d /sys/kernel/ ]; then + if [ ! -d /sys/devices/ ]; then echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" exit 1 fi -- cgit v1.2.3 From a2127d339d78d2ea2779b24d0f42f6203777df72 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Oct 2009 23:20:02 +0100 Subject: hook-funcitions: Only warn about missing firmware if /proc/modules exists makes no sense to look up if there are no modules. seen on a piuparts installation of linux-2.6 Signed-off-by: maximilian attems --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 387fe60..9e3eef2 100644 --- a/hook-functions +++ b/hook-functions @@ -71,7 +71,8 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ] \ - && [ ! -e "/lib/firmware/${version}/${firmware}" ]; then + && [ ! -e "/lib/firmware/${version}/${firmware}" ] \ + && [ -e /proc/modules ]; then if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ -- cgit v1.2.3 From c0d14c1245e96be8757ad4a42bf4cbfa9521dc81 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 8 Nov 2009 22:06:28 +0100 Subject: mkinitramfs: Be opportunistic when calling modprobe thus showing errors don't suppress the modprobe error output!!! this can happen when your depmod was generated by newer m-i-t then Lenny's. make deb-pkg generated images don't call yet depmod -a in postinst thus it can happend there and it was already triggered. (closes: #554873) Reported-by: Michael Prokop Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 9e3eef2..bd9e06a 100644 --- a/hook-functions +++ b/hook-functions @@ -45,7 +45,7 @@ manual_add_modules() local mam_x firmwares firmware for mam_x in $(modprobe --set-version="${version}" --ignore-install \ - --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do + --quiet --show-depends "${1}" | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue -- cgit v1.2.3 From 3d1da4511ab62173d457b78a243fdc001b648911 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Nov 2009 13:53:12 +0100 Subject: copy_exec: Check if ldd is around got report of a box with missing ldd. as the errors get seded away the user is left with no idea of the failure. Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index bd9e06a..9d59dc1 100644 --- a/hook-functions +++ b/hook-functions @@ -147,6 +147,10 @@ copy_exec() { fi # Copy the dependant libraries + if ! command -v ldd >/dev/null 2>&1 ; then + echo "WARNING: no ldd around - install libc-bin" + exit 1 + fi for x in $(ldd ${source} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; -- cgit v1.2.3 From 51de1be0a82967582b024dd554c02e457fe8e917 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 20 Feb 2010 17:01:45 +0100 Subject: hook-functions: Avoid firmware copy error. Fix a2127d33 for systems without /proc/modules because the check has the wrong logic order. (closes: #570678) Signed-off-by: maximilian attems --- hook-functions | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 9d59dc1..8376be3 100644 --- a/hook-functions +++ b/hook-functions @@ -71,8 +71,13 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ] \ - && [ ! -e "/lib/firmware/${version}/${firmware}" ] \ - && [ -e /proc/modules ]; then + && [ ! -e "/lib/firmware/${version}/${firmware}" ] ; then + # Only warn about missing firmware if + # /proc/modules exists + if [ ! -e /proc/modules ] ; then + continue + fi + if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ -- cgit v1.2.3 From 99b32f0831fe89f78144ca5a1da5c1e6a51dc667 Mon Sep 17 00:00:00 2001 From: Avi Rozen Date: Tue, 25 Aug 2009 23:19:27 +0300 Subject: mkinitramfs: add all usb storage devices USB storage device is not recognized at boot after kernel upgrade to 2.6.30. It seems that the usb-storage module has been split into several mini modules, which are not copied to the initramfs image. In my case usb-storage.ko is copied but ums-cypress.ko is not copied. I've attached a patch against hook-functions that fixes this, by using copy_modules_dir to copy all the modules in kernel/drivers/usb/storage, instead of just usb-storage. I've set the severity to important because my USB storage device also happens to be the boot device... Cheers, Avi (closes: #543568) Signed-off-by: maximilian attems --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8376be3..90092bd 100644 --- a/hook-functions +++ b/hook-functions @@ -381,7 +381,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" @@ -440,6 +440,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + usb_storage) + copy_modules_dir kernel/drivers/usb/storage + ;; *) auto_add_modules base auto_add_modules net @@ -452,6 +455,7 @@ auto_add_modules() auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc + auto_add_modules usb_storage ;; esac } -- cgit v1.2.3 From 64882f7235362129e9bae0e7c7788981328d8077 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Nov 2009 14:20:39 +0000 Subject: copy_modules_dir: Take a list of exclusions after the base directory Signed-off-by: Ben Hutchings Signed-off-by: maximilian attems --- hook-functions | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 90092bd..c40b3a4 100644 --- a/hook-functions +++ b/hook-functions @@ -188,14 +188,24 @@ copy_exec() { copy_modules_dir() { local x_mod + local exclude + local dir="$1" + shift - if ! [ -d "${MODULESDIR}/${1}" ]; then + if ! [ -d "${MODULESDIR}/${dir}" ]; then return; fi if [ "${verbose}" = "y" ]; then - echo "Copying module directory ${1}" + echo "Copying module directory ${dir}" + if [ $# -ge 1 ]; then + echo "(excluding $*)" + fi fi - for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do + while [ $# -ge 1 ]; do + exclude="$exclude -name $1 -prune -o " + shift + done + for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } -- cgit v1.2.3 From cd63438f4bfc5c400aeed74ea29010dbc0c0ef4e Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Nov 2009 14:21:49 +0000 Subject: auto_add_modules: Copy all modules from net, excluding some subdirectories This removes the need to maintain an explicit list, which always has some drivers missing. fixes #553024 partly. Signed-off-by: Ben Hutchings Signed-off-by: maximilian attems --- hook-functions | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c40b3a4..98597db 100644 --- a/hook-functions +++ b/hook-functions @@ -398,19 +398,9 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \ - bnx2 cxgb cxgb3 de2104x de4x5 defxx dl2k dmfe \ - e100 e1000 e1000e ehea epic100 \ - ep93xx_eth eql fealnx famachi forcedeth gelic_net \ - hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ - pcnet32 qla3xxx \ - r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ - sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ - tulip typhoon via-rhine via-velocity virtio_net winbond-840 \ - xircom_cb xircom_tulip_cb yellowfin; do - manual_add_modules "${x}" - done + copy_modules_dir kernel/drivers/net \ + appletalk arcnet bonding can hamradio irda pcmcia \ + tokenring usb wan wimax wireless ;; ide) copy_modules_dir kernel/drivers/ide -- cgit v1.2.3 From 3de636e6c8c578c1b74c6eca0b8660ec8b0a9d36 Mon Sep 17 00:00:00 2001 From: Piotr Lewandowski Date: Fri, 16 Oct 2009 23:25:53 +0200 Subject: update-initramfs breaks if /etc/mtab is a symlink to /proc/mounts The attached patch fixes the problem for me (udev no longer ships vol_id since 146-1). (closes: #525606) [ Fix not hardcoding blkid path ] Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 98597db..2184db5 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,7 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ "${root}" = "/dev/root" ] ; then - root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null + root="/dev/disk/by-uuid/"$(blkid -o value -s UUID ${root}) 2>/dev/null fi root="$(readlink -f ${root})" -- cgit v1.2.3 From 0108194018382b91867f966b1d0188959be1f66f Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 28 Sep 2009 11:05:32 +0100 Subject: MODULES=dep fix boot with MMC It doesn't boot with MODULES=dep because mmc_block is missing. (closes: #548711) Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 2184db5..c5c3f05 100644 --- a/hook-functions +++ b/hook-functions @@ -367,6 +367,10 @@ dep_add_modules() manual_add_modules sd_mod fi + if [ -e /sys/bus/mmc/devices/ ]; then + manual_add_modules mmc_block + fi + if [ -e /sys/bus/i2o/devices/ ]; then force_load i2o_block force_load i2o_config -- cgit v1.2.3 From 2a49aa8a48994806b96003b7ef702d8b5d3f4825 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Wed, 24 Mar 2010 04:51:49 +0100 Subject: hook-functions: let dep_add_modules() recurse into lvm slave devices When searching for the root block device, there may be multiple device mapper indirections. Fixes MODULES=dep if crypto-root fs has snapshot. (closes: 573761) Signed-off-by: Nikolaus Schulz Signed-off-by: maximilian attems --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c5c3f05..189ad78 100644 --- a/hook-functions +++ b/hook-functions @@ -284,10 +284,10 @@ dep_add_modules() || [ "${root#/dev/dm-}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) - # lvm on luks or luks on lvm - if [ "${block#dm-}" != "${block}" ]; then + # lvm on luks or luks on lvm, possibly lvm snapshots + while [ "${block#dm-}" != "${block}" ]; do block=$(ls -1 /sys/block/${block}/slaves | head -n 1) - fi + done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ -- cgit v1.2.3 From ae45b87f5f8503434a10baa0d95a4d2e5c0e9652 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 26 Mar 2010 05:46:03 +0100 Subject: MODULES=DEP Use driver/module syfs attribute I thought I'd experiment a bit with MODULES=DEP, but it seems this will not work. The atiixp module is properly installed into the initrd (I'm not sure how), but it doesn't end up in /conf/modules. Instead, the /conf/modules ends up as: radeonfb fbcon vesafb pci:v00001002d00004376sv00001462sd00000131bc01sc01i8a ide-gd ATIIXP_IDE pci:v00001002d00004376sv00001462sd00000131bc01sc01i8a unix Of these, the ide-gd and ATIIXP_IDE modules come from walking /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/. However, the module is called atiixp, not ATIIXP_IDE. The ATIIXP_IDE comes directly from sysfs, though: readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/driver /sys/bus/pci/drivers/ATIIXP_IDE Using driver/module instead of just driver is more robust: $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/driver/module /sys/module/atiixp This would also fix the ide-gd module, which really seems to be called ide-gd_mod: $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/driver /sys/bus/ide/drivers/ide-gd $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/driver/module /sys/module/ide_gd_mod $ sudo modprobe ide-gd FATAL: Module ide_gd not found. $ sudo modprobe ide-gd_mod (closes: #567189) Reported-by: Matthijs Kooijman [ checked that this already works in Lenny ] Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 189ad78..60bc2e9 100644 --- a/hook-functions +++ b/hook-functions @@ -218,7 +218,7 @@ sys_walk_mod_add() while [ "${device_path}" != "/sys" ]; do sys_walk_modalias ${device_path} - driver_path="$(readlink -f ${device_path}/driver)" + driver_path="$(readlink -f ${device_path}/driver/module)" if [ -e "$driver_path" ]; then module="$(basename $(readlink -f $driver_path))" if [ -n "${module}" ]; then -- cgit v1.2.3 From 87d45befb832480954c8c025aee823f1627b9526 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 28 Mar 2010 15:57:33 +0200 Subject: MODULES=DEP: Check superblock on initramfs block do not trust mount as this is not the thing we look at on boot. (closes: #519800) as bonus run blkid if fstype has no idea. Reported-by: Martin Michlmayr Signed-off-by: maximilian attems --- hook-functions | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 60bc2e9..cf8ea54 100644 --- a/hook-functions +++ b/hook-functions @@ -263,17 +263,18 @@ dep_add_modules() fi root="$(readlink -f ${root})" - # find out real rootfs on auto type - if [ "${FSTYPE}" = "auto" ]; then - eval "$(/usr/lib/klibc/bin/fstype ${root})" - fi + # do not trust mount, check superblock + eval "$(/usr/lib/klibc/bin/fstype ${root})" # check that fstype rootfs recognition if [ "${FSTYPE}" = "unknown" ]; then - echo "mkinitramfs: unknown fstype on root ${root}" - echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report bug on initramfs-tools" + FSTYPE=$(blkid -o value -s TYPE "${root}") + if [ -z "${FSTYPE}" ]; then + echo "mkinitramfs: unknown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "Error please report bug on initramfs-tools" exit 1 + fi fi # Add rootfs -- cgit v1.2.3 From fe7e630857d2fd1c9b7af48f33d46e626ac6509e Mon Sep 17 00:00:00 2001 From: Bert Schulze Date: Sun, 4 Apr 2010 17:43:48 +0200 Subject: mkinitramfs: -c compression support / commandline override fixed the commandline argument to select the compressor. also your test with "command" needed to be negated otherwise the fallback to gzip would take place everytime. -- frohe ostern Bert Schulze [ nuked trailing whitespace, and add comment for usage() ] Signed-off-by: maximilian attems --- hook-functions | 10 ++++++---- mkinitramfs | 15 ++++++++++++--- mkinitramfs.8 | 9 +++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index cf8ea54..ab2f486 100644 --- a/hook-functions +++ b/hook-functions @@ -465,6 +465,7 @@ auto_add_modules() esac } +# mkinitramfs help message usage() { cat >&2 << EOF @@ -472,10 +473,11 @@ usage() Usage: ${0} [OPTION]... -o outfile [version] Options: - -d confdir Specify an alternative configuration directory. - -k Keep temporary directory used to make the image. - -o outfile Write to outfile. - -r root Override ROOT setting in initramfs.conf. + -c compress Override COMPRESS setting in initramfs.conf. + -d confdir Specify an alternative configuration directory. + -k Keep temporary directory used to make the image. + -o outfile Write to outfile. + -r root Override ROOT setting in initramfs.conf. See mkinitramfs(8) for further details. EOF diff --git a/mkinitramfs b/mkinitramfs index 33ef99b..110aca8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -11,7 +11,7 @@ errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" export BUSYBOXDIR="/bin" -OPTIONS=`getopt -o d:ko:r:v -n "$0" -- "$@"` +OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -20,6 +20,10 @@ eval set -- "$OPTIONS" while true; do case "$1" in + -c) + compress="$2" + shift 2 + ;; -d) CONFDIR="$2" shift 2 @@ -124,8 +128,13 @@ case "${version}" in esac # Check userspace and kernel support for compressed initramfs images -compress=${COMPRESS} -if command -v ${compress} >/dev/null 2>&1; then +if [ -z "${compress}" ]; then + compress=${COMPRESS} +else + COMPRESS=${compress} +fi + +if ! command -v ${compress} >/dev/null 2>&1; then compress=gzip [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" diff --git a/mkinitramfs.8 b/mkinitramfs.8 index d999957..7fdeefb 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -5,6 +5,8 @@ mkinitramfs \- low-level tool for generating an initramfs image .SH SYNOPSIS .B mkinitramfs +.RB [ \-c +.IR compress ] .RB [ \-d .IR confdir ] .RB [ \-k ] @@ -44,6 +46,13 @@ uses it as initial root file system. All finding of the root device happens in this early userspace. .SH OPTIONS +.TP +\fB \-c \fI compress +Override the +.B COMPRESS +setting in +.IR initramfs.conf . + .TP \fB \-d \fI confdir Set an alternate configuration directory. -- cgit v1.2.3 From 553aa3742ca43b4ba4e87b2dea2c5d31cc43a124 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Wed, 16 Dec 2009 17:47:49 +0000 Subject: mkinitramfs: generate pre-cached boot order file if tsort is available, use it instead of custom sorting code if a pre-cached order file is available, use that instead [ move cache_run_scripts from scripts/functions to hook-scripts as only used on mkinitramfs build and not on boot ] Signed-off-by: maximilian attems --- hook-functions | 16 ++++++++++++++++ mkinitramfs | 5 +++++ scripts/functions | 27 ++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index ab2f486..cf41e42 100644 --- a/hook-functions +++ b/hook-functions @@ -485,6 +485,22 @@ EOF } +# cache boot scripts order +cache_run_scripts() +{ + DESTDIR=${1} + scriptdir=${2} + initdir=${DESTDIR}${scriptdir} + [ ! -d ${initdir} ] && return + + runlist=$(get_prereq_pairs | tsort) + for crs_x in ${runlist}; do + [ -f ${initdir}/${crs_x} ] || continue + echo "${scriptdir}/${crs_x}" >> ${initdir}/ORDER + echo "[ -e /conf/param.conf ] && . /conf/param.conf" >> ${initdir}/ORDER + done +} + # minimal supported kernel version check_minkver() { diff --git a/mkinitramfs b/mkinitramfs index f7e484d..6eed876 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -269,6 +269,11 @@ fi run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks +# cache boot run order +for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do + cache_run_scripts "${DESTDIR}" "/scripts/${b#./}" +done + # generate module deps depmod -a -b "${DESTDIR}" ${version} rm "${DESTDIR}/lib/modules/${version}"/modules.*map diff --git a/scripts/functions b/scripts/functions index 9b864ae..7b68255 100644 --- a/scripts/functions +++ b/scripts/functions @@ -186,9 +186,22 @@ reduce_prereqs() done } +get_prereq_pairs() +{ + set_initlist + for gp_x in ${initlist}; do + echo ${gp_x} ${gp_x} + prereqs=$(${initdir}/${gp_x} prereqs) + for prereq in ${prereqs}; do + echo ${prereq} ${gp_x} + done + done +} + call_scripts() { for cs_x in ${runlist}; do + [ -f ${initdir}/${cs_x} ] || continue # mkinitramfs verbose output if [ "${verbose}" = "y" ]; then echo "Calling hook ${cs_x}" @@ -205,9 +218,17 @@ run_scripts() { initdir=${1} [ ! -d ${initdir} ] && return - get_prereqs - reduce_prereqs - call_scripts + + if [ -f ${initdir}/ORDER ]; then + . ${initdir}/ORDER + elif command -v tsort >/dev/null 2>&1; then + runlist=$(get_prereq_pairs | tsort) + call_scripts $2 + else + get_prereqs + reduce_prereqs + call_scripts + fi } # Load custom modules first -- cgit v1.2.3 From 18afe4934f72eeec551b7a42fa8dc200f80ded42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 04:43:48 +0200 Subject: hook-functions: Add btrfs to base modules seems lots of people fancy it so lets add it. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index cf41e42..b7c816c 100644 --- a/hook-functions +++ b/hook-functions @@ -396,7 +396,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 5de4f2d88e47343f080884213919ddadb0efc7a7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 08:46:05 +0200 Subject: hook-functions: refactor copy_exec try to have an easier logic flow, also: * fail if wanted source does not exist * do not overwrite, no point in warning this add FIXME's to point missing /lib64 symlink parts. Signed-off-by: maximilian attems --- hook-functions | 61 ++++++++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 42 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index b7c816c..dddf3b1 100644 --- a/hook-functions +++ b/hook-functions @@ -104,59 +104,37 @@ manual_add_modules() done } -# $1 is the source path (e.g. /usr/bin/time) -# $2 is the relative destination (e.g. /usr or /usr/time) -# -# The destination is interpreted in the same way "cp" would, meaning -# (assuming /bin is a directory): -# -# "copy_exec /usr/bin/time /bin" -> /bin/time -# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime -# -# If $2 is left out, the same destination path as for the source arg will -# be used and directories will be created as needed, so: -# -# "copy_exec /usr/bin/time" -> /usr/bin/time -# +# $1 = file to copy to ramdisk +# $2 (optional) Name for the file on the ramdisk +# Location of the image dir is assumed to be $DESTDIR +# We never overwrite the target if it exists. copy_exec() { - local source target destination final_destination x nonoptlib + local src target x nonoptlib local libname dirname - source="${1}" - if [ -n "${2}" ]; then - target="${2}" - else - if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then - mkdir -p "${DESTDIR}/$(dirname "${1}")" - fi - target="${1}" - fi + src="${1}" + target="${2:-$1}" + + [ -f "${src}" ] || return 1 if [ -d "${DESTDIR}/${target}" ]; then - destination="${target}/$(basename "${source}")" + # check if already copied + [ -e "${DESTDIR}/$target/${src##*/}" ] && return 0 else - destination="${target}" + [ -e "${DESTDIR}/$target" ] && return 0 + #FIXME: inst_dir + mkdir -p "${DESTDIR}/${target%/*}" fi - final_destination="${DESTDIR}/${destination}" - if [ -L "$final_destination" ]; then - if [ $(readlink "${final_destination}") != "${source}" ]; then - echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2 - return - fi - else - ln -s ${source} ${DESTDIR}/${destination} - if [ "${verbose}" = "y" ]; then - echo "Adding binary ${source}" - fi - fi + [ "${verbose}" = "y" ] && echo "Adding binary ${src}" + ln -s "${src}" "${DESTDIR}/${target}" # Copy the dependant libraries if ! command -v ldd >/dev/null 2>&1 ; then echo "WARNING: no ldd around - install libc-bin" exit 1 fi - for x in $(ldd ${source} 2>/dev/null | sed -e ' + for x in $(ldd ${src} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; @@ -174,12 +152,11 @@ copy_exec() { libname=$(basename "${x}") dirname=$(dirname "${x}") + # FIXME inst_lib mkdir -p "${DESTDIR}/${dirname}" if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then ln -s "${x}" "${DESTDIR}/${dirname}" - if [ "${verbose}" = "y" ]; then - echo "Adding library ${x}" - fi + [ "${verbose}" = "y" ] && echo "Adding library ${x}" fi done } -- cgit v1.2.3 From a2a786f8bad3e1e3ed089c3c68addd9619c4c1ca Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 08:55:15 +0200 Subject: mkinitramfs: check only once for existing ldd no point to recheck on every copy_exec. now copy_exec starts to get redable.. Signed-off-by: maximilian attems --- hook-functions | 4 ---- mkinitramfs | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index dddf3b1..5f00f17 100644 --- a/hook-functions +++ b/hook-functions @@ -130,10 +130,6 @@ copy_exec() { ln -s "${src}" "${DESTDIR}/${target}" # Copy the dependant libraries - if ! command -v ldd >/dev/null 2>&1 ; then - echo "WARNING: no ldd around - install libc-bin" - exit 1 - fi for x in $(ldd ${src} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; diff --git a/mkinitramfs b/mkinitramfs index 2f9ac59..d71ada3 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -256,6 +256,11 @@ if [ -n "${ROOT}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi +if ! command -v ldd >/dev/null 2>&1 ; then + echo "WARNING: no ldd around - install libc-bin" + exit 1 +fi + # module-init-tools copy_exec /sbin/modprobe /sbin copy_exec /sbin/rmmod /sbin -- cgit v1.2.3 From f9db3f7bcbad79bdb1817aa53eb27a46b5951381 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 07:24:19 +0200 Subject: mkinitramfs: Fix several unbound variables might not be all, but a first go in stricter mkinitramfs. as bonus remove old amusing unused varialbe from day 2.. Signed-off-by: maximilian attems --- hook-functions | 14 +++++++------- mkinitramfs | 7 +++---- scripts/functions | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 5f00f17..76cbba9 100644 --- a/hook-functions +++ b/hook-functions @@ -175,10 +175,10 @@ copy_modules_dir() fi fi while [ $# -ge 1 ]; do - exclude="$exclude -name $1 -prune -o " + exclude="${exclude:-} -name $1 -prune -o " shift done - for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -print); do + for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } @@ -367,7 +367,7 @@ dep_add_modules() # The modules "most" classes added per default to the initramfs auto_add_modules() { - case "$1" in + case "${1:-}" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ @@ -479,10 +479,10 @@ check_minkver() { local curversion initdir DPKG_ARCH minversion cm_x tmp - curversion="${1}" - initdir="${2}" + curversion="${1:-}" + initdir="${2:-}" if [ -z "${initdir}" ]; then - case ${DPKG_ARCH} in + case ${DPKG_ARCH:-} in ia64|hppa) minversion="2.6.15" ;; @@ -498,7 +498,7 @@ check_minkver() return 0 fi set_initlist - for cm_x in ${initlist}; do + for cm_x in ${initlist:-}; do # sed: keep last line starting with MINKVER=, # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") diff --git a/mkinitramfs b/mkinitramfs index be983cf..045e73d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -7,7 +7,6 @@ export PATH='/usr/bin:/sbin:/bin' keep="n" CONFDIR="/etc/initramfs-tools" verbose="n" -errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" export BUSYBOXDIR="/bin" @@ -86,7 +85,7 @@ for i in /usr/share/initramfs-tools/conf-hooks.d/*; do fi done -if [ -n "${UMASK}" ]; then +if [ -n "${UMASK:-}" ]; then umask "${UMASK}" fi @@ -128,7 +127,7 @@ case "${version}" in esac # Check userspace and kernel support for compressed initramfs images -if [ -z "${compress}" ]; then +if [ -z "${compress:-}" ]; then compress=${COMPRESS} else COMPRESS=${compress} @@ -252,7 +251,7 @@ for i in ${EXTRA_CONF}; do done # ROOT hardcoding -if [ -n "${ROOT}" ]; then +if [ -n "${ROOT:-}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi diff --git a/scripts/functions b/scripts/functions index 7b68255..ec8a44b 100644 --- a/scripts/functions +++ b/scripts/functions @@ -189,7 +189,7 @@ reduce_prereqs() get_prereq_pairs() { set_initlist - for gp_x in ${initlist}; do + for gp_x in ${initlist:-}; do echo ${gp_x} ${gp_x} prereqs=$(${initdir}/${gp_x} prereqs) for prereq in ${prereqs}; do @@ -223,7 +223,7 @@ run_scripts() . ${initdir}/ORDER elif command -v tsort >/dev/null 2>&1; then runlist=$(get_prereq_pairs | tsort) - call_scripts $2 + call_scripts ${2:-} else get_prereqs reduce_prereqs -- cgit v1.2.3 From 7a26a4d17fe230055966ab8e1e5476e35fe9791a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 08:47:52 +0200 Subject: hook-functions: manual_add_modules simplify use meaningful variable s/mam_x/kmod/ loop directly on the modinfo output. Signed-off-by: maximilian attems --- hook-functions | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 76cbba9..3ba08c5 100644 --- a/hook-functions +++ b/hook-functions @@ -42,27 +42,23 @@ add_modules_from_file() # Add dependent modules + eventual firmware manual_add_modules() { - local mam_x firmwares firmware + local kmod firmware - for mam_x in $(modprobe --set-version="${version}" --ignore-install \ + for kmod in $(modprobe --set-version="${version}" --ignore-install \ --quiet --show-depends "${1}" | awk '/^insmod/ { print $2 }'); do # Prune duplicates - if [ -e "${DESTDIR}/${mam_x}" ]; then + if [ -e "${DESTDIR}/${kmod}" ]; then continue fi - mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" - ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" + mkdir -p "${DESTDIR}/$(dirname "${kmod}")" + ln -s "${kmod}" "${DESTDIR}/$(dirname "${kmod}")" if [ "${verbose}" = "y" ]; then - echo "Adding module ${mam_x}" + echo "Adding module ${kmod}" fi - # Add firmware files if necessary - firmwares=$(modinfo -F firmware "${mam_x}") - if [ -z "${firmwares}" ]; then - continue - fi - for firmware in $firmwares; do + # Add required firmware + for firmware in $(modinfo -F firmware "${kmod}"); do if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \ || [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then continue @@ -78,11 +74,11 @@ manual_add_modules() continue fi - if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ + if grep -q "^$(basename "${kmod}" .ko)[[:space:]]" \ /proc/modules \ - || grep -q "^$(basename "${mam_x}" .ko)" \ + || grep -q "^$(basename "${kmod}" .ko)" \ "${CONFDIR}/modules"; then - echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2 + echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${kmod} .ko)" >&2 fi continue fi -- cgit v1.2.3 From ad301da1f90013d372772f9de0a3f518b9b24717 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 08:53:50 +0200 Subject: hook-functions: copy_modules_dir() small simplifications use meaningful variable name. Signed-off-by: maximilian attems --- hook-functions | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 3ba08c5..86d4afa 100644 --- a/hook-functions +++ b/hook-functions @@ -156,8 +156,7 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { - local x_mod - local exclude + local kmod exclude local dir="$1" shift @@ -174,7 +173,7 @@ copy_modules_dir() exclude="${exclude:-} -name $1 -prune -o " shift done - for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do + for kmod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } -- cgit v1.2.3 From b4305bf8d52ee8498262d256993a7c5e9941ba50 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 11 Apr 2010 06:56:53 +0200 Subject: hook-functions: add hid-apple got axed while reverting the include any hid commit. Closes: #577253 Signed-off-by: maximilian attems --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 86d4afa..2f6580b 100644 --- a/hook-functions +++ b/hook-functions @@ -364,9 +364,9 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ - ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ - atkbd i8042 virtio_pci; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid-apple btrfs \ + ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ + af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 6ac7ec30d81bee53674c3bf6a19750126bac4554 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 19 May 2010 16:59:24 +0200 Subject: Support booting from USB 3 xHCI-based controllers using kernel driver xhci. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 2f6580b..b486439 100644 --- a/hook-functions +++ b/hook-functions @@ -364,7 +364,7 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid-apple btrfs \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple btrfs \ ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 9e7cebc5bc94634987b35bf08e150c179bd927c4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 16:34:07 -0700 Subject: hook-functions: re-add hid-microsoft people use it and thus complain.. Closes: 577253 Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index b486439..c7308b8 100644 --- a/hook-functions +++ b/hook-functions @@ -364,8 +364,9 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple btrfs \ - ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ + hid-microsoft \ + btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" done -- cgit v1.2.3 From 81606da78671a6f2b4d54bb2b2e8dbd586ef9c61 Mon Sep 17 00:00:00 2001 From: Claus Herwig Date: Fri, 30 Apr 2010 02:27:55 +0200 Subject: mkinitramfs: fix MODULES=dep on mylex raid devices (DAC960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mkinitramfs fails to generate a initrd file for root filesystems on an old mylex raid controller (kernel module DAC960). In my case this breaks installation for lenny (5.0.3) on a FJS Primergy server - as this bug is not only in the mentioned version but also in 0.92 which ships on the lenny install cd: The installer can boot, as the old kernel module is still present. But the base install step fails when it tries to generate the initrd. The error in detail, when invoking mkinitramfs manually with -x ----------- (...) + manual_add_modules ext2 + local mam_x firmwares firmware ++ modprobe --set-version=2.6.29.6-vs2.3.0.36.14-beng --ignore-install --quiet --show-depends ext2 ++ awk '/^insmod/ { print $2 }' + for mam_x in '$(modprobe --set-version="${version}" --ignore-install --quiet --show-depends "${1}" | awk '\''/^insmod/ { print $2 }'\'')' + '[' -e /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko ']' ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + mkdir -p /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + ln -s /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs + '[' n = y ']' ++ modinfo -F firmware /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + firmwares= + '[' -z '' ']' + continue + for mam_x in '$(modprobe --set-version="${version}" --ignore-install --quiet --show-depends "${1}" | awk '\''/^insmod/ { print $2 }'\'')' + '[' -e /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko ']' ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + mkdir -p /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2 ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + ln -s /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2 + '[' n = y ']' ++ modinfo -F firmware /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + firmwares= + '[' -z '' ']' + continue + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + block=rd/c0d0p1 + block=rd/c + '[' -z rd/c ']' + '[' '!' -e /sys/block/rd/c ']' + echo 'mkinitramfs: for root /dev/rd/c0d0p1 missing rd/c /sys/block/ entry' mkinitramfs: for root /dev/rd/c0d0p1 missing rd/c /sys/block/ entry + echo 'mkinitramfs: workaround is MODULES=most' mkinitramfs: workaround is MODULES=most + echo 'mkinitramfs: Error please report the bug' mkinitramfs: Error please report the bug + exit 1 ------------- So the reason is that mkinitramfs fails to derive the correct block device notation from the root device as the DAC960 driver uses a strange format for it. Once figured out, this is easily corrected. Please find a short patch for /usr/share/initramfs-tools/hook-functions attached. Thank you, Claus Herwig -- CHECON EDV-Consulting und Redaktion Claus Herwig * Barer Straße 70 * 80799 München +49 89 27826981 * Fax 27826982 * c.herwig@checon.de Closes: #579702 [ whitespace cleanups -maks ] Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c7308b8..744fc91 100644 --- a/hook-functions +++ b/hook-functions @@ -305,6 +305,12 @@ dep_add_modules() elif [ "${root#/dev/mmcblk}" != "${root}" ]; then block=${root#/dev/} block=${block%%p[0-9]*} + + # DAC960 - good old mylex raid - root dev format /dev/rd/cXdXpX + elif [ "${root#/dev/rd/c}" != "${root}" ]; then + block="rd!c${root#/dev/rd/c}" + block=${block%%p[0-9]*} + # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 81da804d1cd8deba5d2eb4d7180c060a01969368 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 17:15:59 -0700 Subject: hook-functions: Fix copy_modules_dir() overseen variable renaming. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 744fc91..213a48a 100644 --- a/hook-functions +++ b/hook-functions @@ -174,7 +174,7 @@ copy_modules_dir() shift done for kmod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do - manual_add_modules $(basename ${x_mod} .ko) + manual_add_modules $(basename ${kmod} .ko) done } -- cgit v1.2.3 From bacdb4b82667bfba079617a0d26eaffffc7df038 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 00:34:06 +0200 Subject: Make sure copy_exec hook function does not exit with a non-zero return value in non-verbose mode. [Closes: #584520] Reported-by: Gerrit Keller Signed-off-by: Michael Prokop --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 213a48a..86dc905 100644 --- a/hook-functions +++ b/hook-functions @@ -148,7 +148,7 @@ copy_exec() { mkdir -p "${DESTDIR}/${dirname}" if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then ln -s "${x}" "${DESTDIR}/${dirname}" - [ "${verbose}" = "y" ] && echo "Adding library ${x}" + [ "${verbose}" = "y" ] && echo "Adding library ${x}" || true fi done } -- cgit v1.2.3 From b1c242ffc5762fea6c15fe880e352008a5c34c43 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 03:02:08 +0200 Subject: hook-functions: make device name handling for /proc/mdstat more flexible for MODULES=dep We can't assume it's always [hs]dX# in /proc/mdstat. It can be e.g. also [hs]dX (raw device) or dm-## as well. So don't statically calculate the string based on string length but instead try to be as smart as possible. Also add support for handling additional arguments in the /proc/mdstat output like "(auto-read-only)". This affects MODULES=dep only. [Closes: #584520] + [Closes: #514756] Reported-by: Simon Richter Reported-by: Martin Michlmayr Signed-off-by: Michael Prokop --- hook-functions | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 86dc905..8bebdea 100644 --- a/hook-functions +++ b/hook-functions @@ -259,8 +259,9 @@ dep_add_modules() done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then - block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ - /proc/mdstat) + block=$(grep "^${block}" /proc/mdstat | \ + awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" fi # luks or lvm on cciss or ida if [ "${block#cciss}" != "${block}" ] \ @@ -272,13 +273,28 @@ dep_add_modules() # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} - block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \ - /proc/mdstat) + block=$(grep "^md${root}" /proc/mdstat | \ + awk "{gsub(/^md${root} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" + # drop the partition number only for sdX and hdX devices + # and keep it for other devices like loop#, dm-# devices + case "$block" in + sd*) block=${block%%[0-9]*};; + hd*) block=${block%%[0-9]*};; + esac # md root /dev/mdX elif [ "${root#/dev/md}" != "${root}" ]; then - root=${root#/dev/} - block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ - /proc/mdstat) + root=${root#/dev/md} + block=$(grep "^md${root}" /proc/mdstat | \ + awk "{gsub(/^md${root} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" + # drop the partition number only for sdX and hdX devices + # and keep it for other devices like loop#, dm-# devices + case "$block" in + sd*) block=${block%%[0-9]*};; + hd*) block=${block%%[0-9]*};; + esac + # cciss device elif [ "${root#/dev/cciss/}" != "${root}" ]; then block=${root#/dev/cciss/*} -- cgit v1.2.3 From 66522c9547575495d2d36ee0f3d030ef502aeba6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 11:18:12 +0200 Subject: dep_add_modules(): handle ubifs and return since ubifs root is a char device Add additional check to handle ubifs and return since ubifs root is a char device but most of the following commands in dep_add_modules() only work with block devices. Patch by Martin Michlmayr [Closes: #582858] Signed-off-by: Michael Prokop --- hook-functions | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8bebdea..6a6e233 100644 --- a/hook-functions +++ b/hook-functions @@ -226,6 +226,14 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + + # handle ubifs and return since ubifs root is a char device but + # most of the commands below only work with block devices. + if [ "${FSTYPE}" = "ubifs" ]; then + manual_add_modules "${FSTYPE}" + return + fi + if [ "${root}" = "/dev/root" ] ; then root="/dev/disk/by-uuid/"$(blkid -o value -s UUID ${root}) 2>/dev/null fi -- cgit v1.2.3 From e65ee485d9d6f257e70231669a13e05cc45acbb3 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 8 Jun 2010 21:43:08 +0200 Subject: Produce an error when root cannot be determined with MODULES=dep A lot of code in dep_add_modules() uses $root. Therefore, produce an error message if we cannot determine the root device. [ error out on this condtion too. -maks ] Signed-off-by: Martin Michlmayr Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 6a6e233..0a6c9b7 100644 --- a/hook-functions +++ b/hook-functions @@ -226,6 +226,12 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + if [ -z "$root" ]; then + echo "mkinitramfs: failed to determine root device" + echo "mkinitramfs: workaround is MODULES=most" + echo "Error please report bug on initramfs-tools and include the output of 'mount'" + exit 1 + fi # handle ubifs and return since ubifs root is a char device but # most of the commands below only work with block devices. -- cgit v1.2.3 From 2a8c9907b1095015e1d669d3cd895657936f6247 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 11:11:42 +0200 Subject: hook-functions/mkinitramfs/update-initramfs: consequently output error messages to stderr Signed-off-by: Michael Prokop --- hook-functions | 22 +++++++++++----------- mkinitramfs | 4 ++-- update-initramfs | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 0a6c9b7..f5da1c4 100644 --- a/hook-functions +++ b/hook-functions @@ -220,16 +220,16 @@ dep_add_modules() # require mounted sysfs if [ ! -d /sys/devices/ ]; then - echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" + echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" >&2 exit 1 fi # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ -z "$root" ]; then - echo "mkinitramfs: failed to determine root device" - echo "mkinitramfs: workaround is MODULES=most" - echo "Error please report bug on initramfs-tools and include the output of 'mount'" + echo "mkinitramfs: failed to determine root device" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "Error please report bug on initramfs-tools and include the output of 'mount'" >&2 exit 1 fi @@ -252,10 +252,10 @@ dep_add_modules() if [ "${FSTYPE}" = "unknown" ]; then FSTYPE=$(blkid -o value -s TYPE "${root}") if [ -z "${FSTYPE}" ]; then - echo "mkinitramfs: unknown fstype on root ${root}" - echo "mkinitramfs: workaround is MODULES=most" - echo "Error please report bug on initramfs-tools" - exit 1 + echo "mkinitramfs: unknown fstype on root ${root}" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "Error please report bug on initramfs-tools" >&2 + exit 1 fi fi @@ -349,9 +349,9 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" - echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report the bug" + echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "mkinitramfs: Error please report the bug" >&2 exit 1 fi diff --git a/mkinitramfs b/mkinitramfs index baf69dd..58e4c11 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -148,7 +148,7 @@ fi [ "${compress}" = lzop ] && compress="lzop -9" if [ -d "${outfile}" ]; then - echo "${outfile} is a directory" + echo "${outfile} is a directory" >&2 exit 1 fi @@ -266,7 +266,7 @@ if [ -n "${ROOT:-}" ]; then fi if ! command -v ldd >/dev/null 2>&1 ; then - echo "WARNING: no ldd around - install libc-bin" + echo "WARNING: no ldd around - install libc-bin" >&2 exit 1 fi diff --git a/update-initramfs b/update-initramfs index f8408e6..53ebed2 100755 --- a/update-initramfs +++ b/update-initramfs @@ -170,7 +170,7 @@ generate_initramfs() # minversion wasn't met, exit 0 exit 0 fi - echo "update-initramfs: failed for ${initramfs}" + echo "update-initramfs: failed for ${initramfs}" >&2 exit $mkinitramfs_return fi } @@ -180,7 +180,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "ERROR lilo fails for new ${initramfs}:" + echo "ERROR lilo fails for new ${initramfs}:" >&2 echo lilo -t fi @@ -460,7 +460,7 @@ while getopts "k:cudyvtb:h?" flag; do b) BOOTDIR="${OPTARG}" if [ ! -d "${BOOTDIR}" ]; then - echo "Error: ${BOOTDIR} is not a directory." + echo "Error: ${BOOTDIR} is not a directory." >&2 exit 1 fi ;; @@ -473,7 +473,7 @@ done shift $((${OPTIND} - 1)) if [ $# -ne 0 ]; then - echo "Invalid argument for option -k." + echo "Invalid argument for option -k." >&2 usage fi -- cgit v1.2.3 From 60afd2a944cf36a5bce6ca3b4c07a422e98efeba Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:10:28 +0200 Subject: code cleanup: drop trailing whitespaces. Signed-off-by: Michael Prokop --- conf/update-initramfs.conf | 2 +- debian/changelog | 6 +++--- debian/copyright | 2 +- docs/example_hook | 2 +- hook-functions | 2 +- init | 6 +++--- initramfs.conf.5 | 12 ++++++------ mkinitramfs | 2 +- scripts/functions | 2 +- scripts/local | 2 +- scripts/nfs | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) (limited to 'hook-functions') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 3c27473..31823e2 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -1,4 +1,4 @@ -# +# # Configuration file for update-initramfs(8) # diff --git a/debian/changelog b/debian/changelog index b3ae973..901222a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -247,7 +247,7 @@ initramfs-tools (0.93.4) unstable; urgency=medium * initramfs-tools.8: Convert hyphen to minus sign. * control: bump versioned dep on debhelper. * control: bump standards version without changes. - * hook-functions: Fix loading of entries without newline in + * hook-functions: Fix loading of entries without newline in /etc/initramfs-tools/modules. (closes: #532745) * MODULES=most: Add virtio_net to initramfs. (closes: #533894) @@ -537,7 +537,7 @@ initramfs-tools (0.92d) unstable; urgency=low each message. - initramfs-tools.preinst: Try to use UUID for resume device. - add boot script loading ide-generic on all_generic_ide cmdline. - Thanks Frans Pop for report. (closes: #485786) + Thanks Frans Pop for report. (closes: #485786) * init: add possible mountroot break (closes: #488963) * initramfs-tools.8: document UUID usage for root and all_generic_ide. (closes: #489186) @@ -744,7 +744,7 @@ initramfs-tools (0.90) unstable; urgency=low -- maximilian attems Thu, 09 Aug 2007 21:30:29 +0200 initramfs-tools (0.89) unstable; urgency=low - + Release "L'\xE9lecteur c'est notoire N'a pas tout' sa raison" [ Joey Hess ] diff --git a/debian/copyright b/debian/copyright index f84910d..9fe89c8 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,7 +13,7 @@ http://git.debian.org/?p=kernel/initramfs-tools.git;a=shortlog Authors: Adam Conrad , Ben Collins , David Härdeman , - Jeff Bailey , + Jeff Bailey , maximilian attems , Scott James Remnant diff --git a/docs/example_hook b/docs/example_hook index 683ddad..1f35352 100644 --- a/docs/example_hook +++ b/docs/example_hook @@ -12,7 +12,7 @@ # command line. # # DESTDIR -- The staging directory where we are building the image. -# +# # see initramfs-tools(8) # diff --git a/hook-functions b/hook-functions index f5da1c4..8b6a89c 100644 --- a/hook-functions +++ b/hook-functions @@ -183,7 +183,7 @@ sys_walk_mod_add() { local driver_path module device_path="$1" - + while [ "${device_path}" != "/sys" ]; do sys_walk_modalias ${device_path} driver_path="$(readlink -f ${device_path}/driver/module)" diff --git a/init b/init index 142eb14..a614d89 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs -o nodev,noexec,nosuid none /sys -mount -t proc -o nodev,noexec,nosuid none /proc +mount -t sysfs -o nodev,noexec,nosuid none /sys +mount -t proc -o nodev,noexec,nosuid 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 @@ -184,7 +184,7 @@ done if [ -n "${noresume}" ]; then export noresume unset resume -else +else resume=${RESUME:-} fi diff --git a/initramfs.conf.5 b/initramfs.conf.5 index bb01f58..92c3a6d 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -48,12 +48,12 @@ The keymap will anyway be loaded by the initscripts later, and the packages that might need input will normally set this variable automatically, so there should normally be no need to set this. -.TP -\fB COMPRESS -Specifies the compression method used for the initramfs image. -.B mkinitramfs -will default to gzip if the kernel lacks support (CONFIG_RD) or the -corresponding userspace utility is not present. +.TP +\fB COMPRESS +Specifies the compression method used for the initramfs image. +.B mkinitramfs +will default to gzip if the kernel lacks support (CONFIG_RD) or the +corresponding userspace utility is not present. .TP \fB UMASK diff --git a/mkinitramfs b/mkinitramfs index 58e4c11..70e5c13 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -315,7 +315,7 @@ exec 3>&1 eval ` # http://cfaj.freeshell.org/shell/cus-faq-2.html exec 4>&1 >&3 3>&- - cd "${DESTDIR}" + cd "${DESTDIR}" { find . 4>&-; echo "ec1=$?;" >&4 } | { diff --git a/scripts/functions b/scripts/functions index 8730d52..685642e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -218,7 +218,7 @@ run_scripts() { initdir=${1} [ ! -d ${initdir} ] && return - + if [ -f ${initdir}/ORDER ]; then . ${initdir}/ORDER elif command -v tsort >/dev/null 2>&1; then diff --git a/scripts/local b/scripts/local index cca5e8d..98464f9 100644 --- a/scripts/local +++ b/scripts/local @@ -50,7 +50,7 @@ pre_mountroot() # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do # give hint about renamed root - case "${ROOT}" in + case "${ROOT}" in /dev/hd*) suffix="${ROOT#/dev/hd}" major="${suffix%[[:digit:]]}" diff --git a/scripts/nfs b/scripts/nfs index 435d2d0..5c41573 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -4,7 +4,7 @@ retry_nr=0 -# parse nfs bootargs and mount nfs +# parse nfs bootargs and mount nfs do_nfsmount() { -- cgit v1.2.3 From ab28c77261267a14cc7308e8c4d7a0b48a8ac2ab Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:15:07 +0200 Subject: code cleanup: consequently replace spaces in indentions with tabs to unify coding stile Signed-off-by: Michael Prokop --- hook-functions | 18 +++++++++--------- hooks/busybox | 8 ++++---- hooks/klibc | 8 ++++---- mkinitramfs | 22 +++++++++++----------- update-initramfs | 16 ++++++++-------- 5 files changed, 36 insertions(+), 36 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 8b6a89c..c456c5d 100644 --- a/hook-functions +++ b/hook-functions @@ -72,7 +72,7 @@ manual_add_modules() # /proc/modules exists if [ ! -e /proc/modules ] ; then continue - fi + fi if grep -q "^$(basename "${kmod}" .ko)[[:space:]]" \ /proc/modules \ @@ -127,10 +127,10 @@ copy_exec() { # Copy the dependant libraries for x in $(ldd ${src} 2>/dev/null | sed -e ' - /\//!d; - /linux-gate/d; - /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; - s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do # Try to use non-optimised libraries where possible. # We assume that all HWCAP libraries will be in tls, @@ -166,7 +166,7 @@ copy_modules_dir() if [ "${verbose}" = "y" ]; then echo "Copying module directory ${dir}" if [ $# -ge 1 ]; then - echo "(excluding $*)" + echo "(excluding $*)" fi fi while [ $# -ge 1 ]; do @@ -274,7 +274,7 @@ dep_add_modules() # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then block=$(grep "^${block}" /proc/mdstat | \ - awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") block="${block%%\[*}" fi # luks or lvm on cciss or ida @@ -531,8 +531,8 @@ check_minkver() fi set_initlist for cm_x in ${initlist:-}; do - # sed: keep last line starting with MINKVER=, - # remove MINKVER= and trailing space + # sed: keep last line starting with MINKVER=, + # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") if [ -z "${tmp}" ]; then continue diff --git a/hooks/busybox b/hooks/busybox index 7845f58..a2e57ae 100755 --- a/hooks/busybox +++ b/hooks/busybox @@ -4,15 +4,15 @@ PREREQ="" prereqs() { - echo "$PREREQ" + echo "$PREREQ" } case $1 in # get pre-requisites prereqs) - prereqs - exit 0 - ;; + prereqs + exit 0 + ;; esac # busybox diff --git a/hooks/klibc b/hooks/klibc index ad0a85d..e41c631 100755 --- a/hooks/klibc +++ b/hooks/klibc @@ -4,15 +4,15 @@ PREREQ="" prereqs() { - echo "$PREREQ" + echo "$PREREQ" } case $1 in # get pre-requisites prereqs) - prereqs - exit 0 - ;; + prereqs + exit 0 + ;; esac # klibc diff --git a/mkinitramfs b/mkinitramfs index 70e5c13..a854f02 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -69,7 +69,7 @@ for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/conf.d/*; do | grep '^[[:alnum:]][[:alnum:]\._-]*$' | grep -v '\.dpkg-.*$')"; done # FIXME: deprecated those settings on mkinitramfs run -# these conf dirs are for boot scripts and land on initramfs +# these conf dirs are for boot scripts and land on initramfs for i in ${EXTRA_CONF}; do if [ -e ${CONFDIR}/conf.d/${i} ]; then . ${CONFDIR}/conf.d/${i} @@ -198,7 +198,7 @@ done # Copy the modules.order file in if [ -f "${MODULESDIR}/modules.order" ]; then cp -p "${MODULESDIR}/modules.order" \ - "${DESTDIR}${MODULESDIR}/modules.order" + "${DESTDIR}${MODULESDIR}/modules.order" fi # MODULES=list case. Always honour. @@ -313,15 +313,15 @@ find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ # cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" || exit 1 exec 3>&1 eval ` - # http://cfaj.freeshell.org/shell/cus-faq-2.html - exec 4>&1 >&3 3>&- - cd "${DESTDIR}" - { - find . 4>&-; echo "ec1=$?;" >&4 - } | { - cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | ${compress} >"${outfile}" - echo "ec3=$?;" >&4 + # http://cfaj.freeshell.org/shell/cus-faq-2.html + exec 4>&1 >&3 3>&- + cd "${DESTDIR}" + { + find . 4>&-; echo "ec1=$?;" >&4 + } | { + cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 + } | ${compress} >"${outfile}" + echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi diff --git a/update-initramfs b/update-initramfs index 53ebed2..f4323b7 100755 --- a/update-initramfs +++ b/update-initramfs @@ -51,14 +51,14 @@ EOF # chroot check chrooted() { - # borrowed from udev's postinst - if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then - # the devicenumber/inode pair of / is the same as that of - # /sbin/init's root, so we're *not* in a chroot and hence - # return false. - return 1 - fi - return 0 + # borrowed from udev's postinst + if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then + # the devicenumber/inode pair of / is the same as that of + # /sbin/init's root, so we're *not* in a chroot and hence + # return false. + return 1 + fi +return 0 } mild_panic() -- cgit v1.2.3 From 3a02c6f37d4c331b347692a0200941c4c59b3ea3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:17:51 +0200 Subject: code cleanup: consequently use "W:" for warnings. The only exception is log_warning_msg() inside scripts/functions which is/can be used by external scripts. Signed-off-by: Michael Prokop --- hook-functions | 4 ++-- hooks/busybox | 2 +- mkinitramfs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index c456c5d..ffb6a67 100644 --- a/hook-functions +++ b/hook-functions @@ -3,7 +3,7 @@ catenate_cpiogz() { # Sanity check if [ ! -e "${1}" ]; then - echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2 + echo "W: catenate_cpiogz: arg1='${1}' does not exist." >&2 return fi @@ -29,7 +29,7 @@ add_modules_from_file() { # Sanity check if [ ! -e "${1}" ]; then - echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2 + echo "W: add_modules_from_file: arg1='${1}' does not exist." >&2 return fi diff --git a/hooks/busybox b/hooks/busybox index a2e57ae..1a275b7 100755 --- a/hooks/busybox +++ b/hooks/busybox @@ -20,7 +20,7 @@ if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then # those root need busybox eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')" if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then - echo "Warning: Busybox is required for successful boot!" + echo "W: Busybox is required for successful boot!" fi else . /usr/share/initramfs-tools/hook-functions diff --git a/mkinitramfs b/mkinitramfs index a854f02..1c6ad28 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -224,8 +224,8 @@ list) # nothing to add ;; *) - echo "mkinitramfs: Warning unsupported MODULES setting: ${MODULES}." - echo "mkinitramfs: Falling back to MODULES=most." + echo "W: mkinitramfs: unsupported MODULES setting: ${MODULES}." + echo "W: mkinitramfs: Falling back to MODULES=most." auto_add_modules ;; esac @@ -286,7 +286,7 @@ run_scripts "${CONFDIR}"/hooks # cache boot run order if [ -n "$NOEXEC" ]; then - echo "Warning: TMPDIR is mounted noexec, will not cache run scripts." + echo "W: TMPDIR is mounted noexec, will not cache run scripts." else for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do cache_run_scripts "${DESTDIR}" "/scripts/${b#./}" -- cgit v1.2.3 From 5697c3b7e4ece610e71117f1dddb2cc8637f8420 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 15 Jun 2010 18:16:37 +0200 Subject: hook-functions: replace awk calls with sed in dep_add_modules() If mawk is installed as default awk version it won't handle [:digit:], instead let's replace the grep/awk/shell version with one single sed invocation. Closes: #585991 Thanks: Thorsten Glaser Signed-off-by: Michael Prokop --- hook-functions | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index ffb6a67..1a0e097 100644 --- a/hook-functions +++ b/hook-functions @@ -273,9 +273,7 @@ dep_add_modules() done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then - block=$(grep "^${block}" /proc/mdstat | \ - awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") - block="${block%%\[*}" + block=$(sed -ne 's/multipath/[/' -e 's/linear/[/' -e 's/raid[0-9][0-9]*/[/' -e 's/\([hs]d[a-z][a-z]*\)[0-9][0-9]*/\1/g' -e '/^'${block}' :/s/^[^[]*\[ \([^\[]*\)\[.*$/\1/p' Date: Sun, 13 Jun 2010 17:23:14 +0100 Subject: hook-functions/init/scripts/local: add support for ubifs. MODULES=dep fails when / is ubifs. This patch adds support for something like root=ubi0:rootfs when ubi is modular. Quoting Martin: It essentially does three things: - adds the correct modules to the ramdisk (for MODULES=dep and MODULES=most) - reads ubi.mtd= from the command line - loads ubi with the ubi.mtd info and ignores the "Waiting for root" check I've successfully tested this with a kernel with modular ubi and with the following boot variants: console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs console=ttyS0,115200 ubi.mtd=2 root=ubi0_0 rootfstype=ubifs With console=ttyS0,115200 ubi.mtd=2 root=/dev/ubi0_0 rootfstype=ubifs I get an error that it cannot mount root but I suspect this is an ubifs error and has nothing to do with i-t (since at this point I can manually mount it with -t ubifs ubi0_0 whereas the /dev/ variant doesn't work). Tested with MODULES=dep and MODULES=most as well as with a kernel that has ubifs built in. Closes: #582858 Thanks: Martin Michlmayr Signed-off-by: Martin Michlmayr Reviewed-by: Michael Prokop --- hook-functions | 10 ++++++++++ init | 5 +++++ scripts/local | 7 +++++++ 3 files changed, 22 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 1a0e097..3ce081d 100644 --- a/hook-functions +++ b/hook-functions @@ -237,6 +237,10 @@ dep_add_modules() # most of the commands below only work with block devices. if [ "${FSTYPE}" = "ubifs" ]; then manual_add_modules "${FSTYPE}" + # add some modules required by ubifs on which it doesn's depend + manual_add_modules deflate + manual_add_modules zlib + manual_add_modules lzo return fi @@ -415,6 +419,11 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; + ubi) + for x in deflate zlib lzo ubi ubifs; do + manual_add_modules "${x}" + done + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -447,6 +456,7 @@ auto_add_modules() auto_add_modules ata auto_add_modules i2o auto_add_modules dasd + auto_add_modules ubi auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc diff --git a/init b/init index 397a8c2..467a562 100755 --- a/init +++ b/init @@ -43,6 +43,7 @@ export ROOTFSTYPE= export IP= export BOOT= export BOOTIF= +export UBIMTD= export break= export init=/sbin/init export quiet=n @@ -127,6 +128,9 @@ for x in $(cat /proc/cmdline); do boot=*) BOOT=${x#boot=} ;; + ubi.mtd=*) + UBIMTD=${x#ubi.mtd=} + ;; resume=*) RESUME="${x#resume=}" ;; @@ -258,6 +262,7 @@ unset ROOT unset IP unset BOOT unset BOOTIF +unset UBIMTD unset blacklist unset break unset noresume diff --git a/scripts/local b/scripts/local index 98464f9..9b51174 100644 --- a/scripts/local +++ b/scripts/local @@ -8,6 +8,13 @@ pre_mountroot() wait_for_udev 10 + # Load ubi with the correct MTD partition and return since fstype + # doesn't work with a char device like ubi. + if [ -n "$UBIMTD" ]; then + modprobe ubi mtd=$UBIMTD + return + fi + # Don't wait for a root device that doesn't have a corresponding # device in /dev (ie, mtd0) if [ "${ROOT#/dev}" = "${ROOT}" ]; then -- cgit v1.2.3 From 528ba7842a4079526118ba6edda25ed926d550ea Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Jun 2010 10:36:29 +0200 Subject: hook-functions: do not install ubi module by default via auto_add_modules() d-i does not support UBI/UBIFS yet and adding ubi.ko it by default to initrd when MODULES=most is set doesn't provide any benefits yet. Therefore don't waste ~125kb disk space by default, instead leave the installation of ubi to d-i through a hook. Signed-off-by: Michael Prokop --- hook-functions | 1 - 1 file changed, 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 3ce081d..ded7887 100644 --- a/hook-functions +++ b/hook-functions @@ -456,7 +456,6 @@ auto_add_modules() auto_add_modules ata auto_add_modules i2o auto_add_modules dasd - auto_add_modules ubi auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc -- cgit v1.2.3 From 91f5947c08560feecb5f05d85efa6a2669486de3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 01:58:31 +0200 Subject: hook-functions: install virtio_pci module if /sys/bus/virtio is present and using modules=dep Thanks: Vincent Danjean Closes: #585992 Signed-off-by: Michael Prokop --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index ded7887..d860bc7 100644 --- a/hook-functions +++ b/hook-functions @@ -365,6 +365,10 @@ dep_add_modules() manual_add_modules mmc_block fi + if [ -e /sys/bus/virtio ] ; then + manual_add_modules virtio_pci + fi + if [ -e /sys/bus/i2o/devices/ ]; then force_load i2o_block force_load i2o_config -- cgit v1.2.3 From 837f2614f79e8ea66385e6dcb2a6072ddb5ec186 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 19 Jun 2010 18:08:15 +0200 Subject: mkinitramfs: set nounset and errexit Better catch both early than stupid mistakes cropping in. Signed-off-by: maximilian attems --- hook-functions | 2 +- mkinitramfs | 2 ++ scripts/functions | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index d860bc7..9d63d58 100644 --- a/hook-functions +++ b/hook-functions @@ -532,7 +532,7 @@ check_minkver() # sed: keep last line starting with MINKVER=, # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") - if [ -z "${tmp}" ]; then + if [ -z "${tmp:-}" ]; then continue elif dpkg --compare-versions "${curversion}" lt "${minver}"; then echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2 diff --git a/mkinitramfs b/mkinitramfs index e49e01c..bccdbed 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + umask 0022 export PATH='/usr/bin:/sbin:/bin' diff --git a/scripts/functions b/scripts/functions index 068e901..364cc27 100644 --- a/scripts/functions +++ b/scripts/functions @@ -107,7 +107,7 @@ set_initlist() continue fi - initlist="${initlist} ${si_x#${initdir}/}" + initlist="${initlist:-} ${si_x#${initdir}/}" done } -- cgit v1.2.3 From 97f20c507233a2a2fb419b90a5839097a631cb44 Mon Sep 17 00:00:00 2001 From: Eckhart Wörner Date: Tue, 7 Sep 2010 01:01:04 +0200 Subject: initramfs-tools: Add hid-cherry and hid-logitech to initramfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both a Cherry and a Logitech keyboard I own cannot be used at early boot time unless one also adds the hid-cherry / the hid-logitech module to the initramfs. The attached patch adds those two modules to hook-functions. For the Cherry keyboard, kernels up to 2.6.32-3 are not affected, from 2.6.32-5 (squeeze default) onwards all tested kernels were affected. Didn't do detailed checks for the Logitech keyboard. The used devices that exhibit this problem are: ID 046d:c30a Logitech, Inc. iTouch Composite ID 046a:0023 Cherry GmbH CyMotion Master Linux Keyboard Severity level important, since this makes booting with encrypted root partition impossible using those keyboards. Closes: #595827 Reported-by: Eckhart Wörner Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 9d63d58..0684296 100644 --- a/hook-functions +++ b/hook-functions @@ -394,7 +394,7 @@ auto_add_modules() case "${1:-}" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ - hid-microsoft \ + hid-cherry hid-logitech hid-microsoft \ btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3