From baab5f5fc3d6cfe4821a82e5b17f0f57bef060b0 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 16 Aug 2005 13:34:37 -0400 Subject: Cleanup commit, sorry for the mess --- hooks/acpid | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 hooks/acpid (limited to 'hooks') diff --git a/hooks/acpid b/hooks/acpid new file mode 100644 index 0000000..0f3c84c --- /dev/null +++ b/hooks/acpid @@ -0,0 +1,24 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading acpi bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +for x in fan thermal; do + manual_add_modules ${x} +done -- 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 'hooks') 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 61afce26f88ffc9ee2537f16fb4f3eaa82658af7 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 1 Sep 2005 00:14:23 -0400 Subject: Add missing file --- hooks/udev | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 hooks/udev (limited to 'hooks') diff --git a/hooks/udev b/hooks/udev new file mode 100644 index 0000000..41c96fe --- /dev/null +++ b/hooks/udev @@ -0,0 +1,27 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# udev really wants to be able to do socket communications to udevd +# This means that there's a bit of a race condition as the events come +# flooding in and the kernels ability to autoload the 'unix' module. + +# We solve the problem thusly. Hopefully RIP Ubuntu# 12915 + +. /usr/share/initramfs-tools/hook-functions + +force_load unix + -- 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 'hooks') 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 402fc00b3d7c55532f6e7408d6245783b909bd77 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:11:52 +0200 Subject: new repo format v6 --- debian/rules | 0 hooks/acpid | 0 hooks/evms | 0 hooks/kernelextras | 0 hooks/udev | 0 init | 0 mkinitramfs | 0 scripts/init-premount/acpid | 0 scripts/local-premount/suspend | 0 scripts/local-top/evms | 0 scripts/local-top/lvm | 0 scripts/local-top/md | 0 12 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 debian/rules mode change 100644 => 100755 hooks/acpid mode change 100644 => 100755 hooks/evms mode change 100644 => 100755 hooks/kernelextras mode change 100644 => 100755 hooks/udev mode change 100644 => 100755 init mode change 100644 => 100755 mkinitramfs mode change 100644 => 100755 scripts/init-premount/acpid mode change 100644 => 100755 scripts/local-premount/suspend mode change 100644 => 100755 scripts/local-top/evms mode change 100644 => 100755 scripts/local-top/lvm mode change 100644 => 100755 scripts/local-top/md (limited to 'hooks') diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 diff --git a/hooks/acpid b/hooks/acpid old mode 100644 new mode 100755 diff --git a/hooks/evms b/hooks/evms old mode 100644 new mode 100755 diff --git a/hooks/kernelextras b/hooks/kernelextras old mode 100644 new mode 100755 diff --git a/hooks/udev b/hooks/udev old mode 100644 new mode 100755 diff --git a/init b/init old mode 100644 new mode 100755 diff --git a/mkinitramfs b/mkinitramfs old mode 100644 new mode 100755 diff --git a/scripts/init-premount/acpid b/scripts/init-premount/acpid old mode 100644 new mode 100755 diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend old mode 100644 new mode 100755 diff --git a/scripts/local-top/evms b/scripts/local-top/evms old mode 100644 new mode 100755 diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm old mode 100644 new mode 100755 diff --git a/scripts/local-top/md b/scripts/local-top/md old mode 100644 new mode 100755 -- cgit v1.2.3 From 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 'hooks') 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 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 'hooks') 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 'hooks') 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 5356137d364747c87b7924c5d30d5dd9b8dcbe11 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 19:03:39 +0200 Subject: document better runtime checks for lvm and mdadm. --- hooks/lvm | 1 + hooks/md | 1 + 2 files changed, 2 insertions(+) (limited to 'hooks') diff --git a/hooks/lvm b/hooks/lvm index fa4f8af..7410b26 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -14,6 +14,7 @@ prereqs) ;; esac +# FIXME: check /sys/block/dm-0/dev if [ ! -x /sbin/vgchange ]; then exit 0 fi diff --git a/hooks/md b/hooks/md index c06b46b..be8a55a 100755 --- a/hooks/md +++ b/hooks/md @@ -14,6 +14,7 @@ prereqs) ;; esac +# FIXME: check /proc/mdstat if [ ! -x /sbin/mdadm ]; then exit 0 fi -- cgit v1.2.3 From 429cd75b35cf6c08aff80aec2aee9fab40eb42a5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Oct 2005 09:22:31 +0200 Subject: Check for dir ${MODULESDIR}/initrd/, exit if it doesn't exist. --- debian/changelog | 7 ++++++- hooks/kernelextras | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index b6eddfa..2a673d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,13 @@ initramfs-tools (0.37) unstable; urgency=low * scripts/functions, scripts/local-premount/suspend: Use of "stat" which isn' any more provided by busybox (1.01-3). Thanks to Adrian Bridgett for the patch using awk. + (Closes: #335801) - -- maximilian attems Wed, 26 Oct 2005 08:43:36 +0200 + * hooks/kernelextras: Check for existence of ${MODULESDIR}/initrd/: + Exit if it doesn't exist before including current dir. + Thanks to Jean Charles Delepine (Closes: #335505) + + -- maximilian attems Wed, 26 Oct 2005 09:07:39 +0200 initramfs-tools (0.36) unstable; urgency=low diff --git a/hooks/kernelextras b/hooks/kernelextras index d1b8c34..df38884 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -19,6 +19,10 @@ esac . /usr/share/initramfs-tools/hook-functions +if [ ! -d ${MODULESDIR}/initrd ]; then + exit 0 +fi + fbcon=n for x in ${MODULESDIR}/initrd/*; do -- cgit v1.2.3 From 4e0954f5e95073cc881a138d3f649b9b0fcfb449 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Oct 2005 09:24:38 +0200 Subject: cleanup some useless FIXME's. --- debian/changelog | 5 ++++- hooks/lvm | 1 - hooks/md | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 2a673d1..1895572 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,7 +9,10 @@ initramfs-tools (0.37) unstable; urgency=low Exit if it doesn't exist before including current dir. Thanks to Jean Charles Delepine (Closes: #335505) - -- maximilian attems Wed, 26 Oct 2005 09:07:39 +0200 + * hooks/lvm, hooks/md: Remove FIXME's at second thought. You better want + to check against the binaries for your not yet created raid/lvm. + + -- maximilian attems Wed, 26 Oct 2005 09:22:58 +0200 initramfs-tools (0.36) unstable; urgency=low diff --git a/hooks/lvm b/hooks/lvm index 7410b26..fa4f8af 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -14,7 +14,6 @@ prereqs) ;; esac -# FIXME: check /sys/block/dm-0/dev if [ ! -x /sbin/vgchange ]; then exit 0 fi diff --git a/hooks/md b/hooks/md index be8a55a..c06b46b 100755 --- a/hooks/md +++ b/hooks/md @@ -14,7 +14,6 @@ prereqs) ;; esac -# FIXME: check /proc/mdstat if [ ! -x /sbin/mdadm ]; then exit 0 fi -- cgit v1.2.3 From 53cd915c489b5a5fd8be4a8cb532c2986859ba9b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Nov 2005 07:24:30 +0100 Subject: fix evms root by adding dm_mod module to the initramfs image. --- debian/changelog | 9 +++++++-- hooks/evms | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index fea4793..70ac2ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] - * initramfs.conf: Reference correct manpage. Closes: #336095 + * initramfs.conf: Reference correct manpage. (Closes: #336095) [ maximilian attems ] @@ -10,7 +10,12 @@ initramfs-tools (0.38) unstable; urgency=low by using decimal numbers. Thanks to Adrian Bridgett for the patch. (Closes: #336936) - -- maximilian attems Wed, 2 Nov 2005 07:10:45 +0100 + * hooks/evms: manual_add_module dm_mod, now we no longer pull it in by + default. Thanks to Steinar H. Gunderson + (Closes: #336617) + + + -- maximilian attems Wed, 2 Nov 2005 07:21:29 +0100 initramfs-tools (0.37) unstable; urgency=low diff --git a/hooks/evms b/hooks/evms index 456feac..21dc562 100755 --- a/hooks/evms +++ b/hooks/evms @@ -29,3 +29,7 @@ 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} done + +for x in dm_mod; do + manual_add_modules ${x} +done -- 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 'hooks') 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 ab06eb34e1a911432aa7c048927eb7e53b0571ee Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 10:45:29 +0100 Subject: fix evms hook --- debian/changelog | 6 ++++-- hooks/evms | 5 +++-- scripts/local-top/evms | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index eac527c..8c92cc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,11 +3,13 @@ initramfs-tools (0.40) unstable; urgency=high * High urgency upload as udev changed under our feet. Fix RC bugs. * Add needed bits under /lib/udev: udevsynthesize, udev_run_devd, - udev_run_hotplugd. + udev_run_hotplugd. * Pump udev dep on 0.074-3. - -- maximilian attems Wed, 23 Nov 2005 10:12:40 +0100 + * Fix evms hooks properly until they get merged into the evms itself. + + -- maximilian attems Wed, 23 Nov 2005 10:31:57 +0100 initramfs-tools (0.39) unstable; urgency=medium diff --git a/hooks/evms b/hooks/evms index 5affeef..1cbc832 100755 --- a/hooks/evms +++ b/hooks/evms @@ -21,15 +21,16 @@ if [ ! -x /sbin/evms_activate ]; then fi copy_exec /sbin/evms_activate /sbin +cp /etc/evms.conf ${DESTDIR}/etc 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 +for x in bbr bbr_seg bsd disk dos drivelink gpt lvm2 mac md multipath; do copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} done -for x in dm_mod; do +for x in dm_mod linear raid0 raid1 raid10 raid5 raid6; do manual_add_modules ${x} done diff --git a/scripts/local-top/evms b/scripts/local-top/evms index 2ee7e80..8a99549 100755 --- a/scripts/local-top/evms +++ b/scripts/local-top/evms @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="lvm" +PREREQ="" prereqs() { @@ -26,6 +26,8 @@ case ${evms} in ;; esac -modprobe -q dm-mod +for module in dm-mod linear raid0 raid1 raid10 raid5 raid6; do + modprobe -q $module +done /sbin/evms_activate -- cgit v1.2.3 From e08c3012c84eb902b108e1568528db95df4f4ac0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 22:49:12 +0100 Subject: avoid a double link copy of bbr and bbr_seg --- hooks/evms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hooks') diff --git a/hooks/evms b/hooks/evms index 1cbc832..a58b2a4 100755 --- a/hooks/evms +++ b/hooks/evms @@ -28,7 +28,7 @@ EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3 mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} for x in bbr bbr_seg bsd disk dos drivelink gpt lvm2 mac md multipath; do - copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} + copy_exec /lib/evms/${EVMS_VERSION}/${x}-*.so /lib/evms/${EVMS_VERSION} done for x in dm_mod linear raid0 raid1 raid10 raid5 raid6; do -- cgit v1.2.3 From 6da3bae23dc4843a543e02ca57ec26f2d77455a3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 22:59:56 +0100 Subject: only include needed udev bits, also move them to hooks/udev from mkinitramfs. --- debian/changelog | 4 ++-- hooks/udev | 8 ++++++++ mkinitramfs | 9 --------- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index f8f3ba1..ee6a61f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,8 @@ initramfs-tools (0.40) unstable; urgency=high * High urgency upload as udev changed under our feet. Fix RC bugs. - * Add needed bits under /lib/udev: udevsynthesize, udev_run_devd, - udev_run_hotplugd. (Closes: #340257) + * hooks/udev: Add needed bits: udevsynthesize. (Closes: #340257) + Move good bits from global mkinitramfs. * Pump udev dep on 0.074-3. diff --git a/hooks/udev b/hooks/udev index 41c96fe..4776d85 100755 --- a/hooks/udev +++ b/hooks/udev @@ -25,3 +25,11 @@ esac force_load unix +cp -a /etc/udev ${DESTDIR}/etc + +# Hack until udev is built with klibc +copy_exec /sbin/udevd /sbin +copy_exec /sbin/udevsynthesize /sbin + +mkdir "${DESTDIR}/lib/udev" +copy_exec /lib/udev/udevsynthesize /lib/udev diff --git a/mkinitramfs b/mkinitramfs index c97b575..1cba5d5 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -169,15 +169,6 @@ for f in $(cd ${CONFDIR}/scripts && \ cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done copy_exec "${CONFDIR}/initramfs.conf" /conf -cp -a /etc/udev "${DESTDIR}/etc" - -# Hack until udev is built with klibc -copy_exec /sbin/udevd /sbin -mkdir "${DESTDIR}/lib/udev" -copy_exec /lib/udev/udevsynthesize /lib/udev -cp /sbin/udevsynthesize "${DESTDIR}/sbin" -copy_exec /lib/udev/udev_run_devd /lib/udev -copy_exec /lib/udev/udev_run_hotplugd /lib/udev # Busybox rm ${DESTDIR}/bin/sh -- cgit v1.2.3 From efc90bbb5f64353714175bb4b2225422f3de86b2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Dec 2005 17:19:00 +0100 Subject: resync with latest ubuntu, split udev done by hand. --- break.txt | 4 ++ debian/changelog | 87 +++++++++++++++++++++++++++++++++++++- debian/initramfs-tools.postinst | 5 +++ hooks/acpid | 24 ----------- hooks/thermal | 28 +++++++++++++ hooks/udev | 35 ---------------- init | 69 +++++++++++-------------------- mkinitramfs | 1 + scripts/functions | 92 +++++++---------------------------------- scripts/init-premount/acpid | 19 --------- scripts/init-premount/thermal | 23 +++++++++++ scripts/local | 11 ++++- scripts/nfs | 1 - 13 files changed, 195 insertions(+), 204 deletions(-) create mode 100644 break.txt delete mode 100755 hooks/acpid create mode 100755 hooks/thermal delete mode 100755 hooks/udev delete mode 100755 scripts/init-premount/acpid create mode 100755 scripts/init-premount/thermal (limited to 'hooks') diff --git a/break.txt b/break.txt new file mode 100644 index 0000000..ff26d5b --- /dev/null +++ b/break.txt @@ -0,0 +1,4 @@ +if [ x${break} = xyes ]; then + panic "Spawning shell within the initramfs" +fi + diff --git a/debian/changelog b/debian/changelog index a76d5bd..6a95f20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,92 @@ initramfs-tools (0.42) unstable; urgency=low that use the mptscsih. Thanks dann frazier for the patch. (Closes: #341162) - -- maximilian attems Thu, 1 Dec 2005 16:42:12 +0100 + * Resync with 0.40ubuntu7. + - Do the udev split by hand as we have a different udev invocation + supporting linux < 2.6.15. Increment udev dep to the version with + initramfs hooks. + - Debian's klibc hasn't yet the nanosleep, waiting for unbroken + linux-headers. + - Don't remove resume support from /etc/mkinitramfs/initramfs.conf + even if bootloader setting is preferred. + + -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 + +initramfs-tools (0.40ubuntu7) dapper; urgency=low + + * remove "sleep 3" from the nfs script before the nfsmount command, + its a leftover from debugging in breezy and slows down thin client + booting unnecessary + + -- Oliver Grawert Fri, 2 Dec 2005 11:45:05 +0100 + +initramfs-tools (0.40ubuntu6) dapper; urgency=low + + * When panicking, fork an interactive subshell rather than execing it, so + that if the user fixes things up and exits, we continue rather than + panic the kernel. + * Call update-initramfs in postinst to regenerate the latest initramfs on + upgrades + + -- Matt Zimmerman Thu, 1 Dec 2005 22:23:09 -0800 + +initramfs-tools (0.40ubuntu5) dapper; urgency=low + + * Wait up to 10 seconds for the root device to appear before failing, + allowing SCSI and USB controllers time to settle. There's almost + certainly a more elegant way to do this generically for all mountroot + functions, but for now this will suffice. + + -- Scott James Remnant Thu, 1 Dec 2005 21:28:55 +0000 + +initramfs-tools (0.40ubuntu4) dapper; urgency=low + + * Mount /dev with mode 0755. + + -- Scott James Remnant Thu, 1 Dec 2005 19:30:06 +0000 + +initramfs-tools (0.40ubuntu3) dapper; urgency=low + + "A true friend stabs you in the front." + - Oscar Wilde + + * hooks/acpid: Rename to ... + * hooks/thermal: ... this. Add therm_pm72 for ppc64 systems. + + -- Jeff Bailey Wed, 30 Nov 2005 22:25:01 -0500 + +initramfs-tools (0.40ubuntu2) dapper; urgency=low + + * Rename scripts/init-premount/acpid to scripts/init-premount/thermal + and add therm_pm72 to avoid "vaccum cleaner mode" on ppc64 systems. + + -- Adam Conrad Thu, 1 Dec 2005 12:37:27 +1100 + +initramfs-tools (0.40ubuntu1) dapper; urgency=low + + * Use tmpfs for /dev, instead of ramfs; as tmpfs is swappable. + * Move /proc and /sys to the real filesystem, rather than unmounting them; + slightly reduces workload. + * Replace /root with ${rootmnt} in final usage of /dev/console + * Copy across modprobe blacklist as well as aliases + + * Change the panic/breaknow thing *again*. There's now a break= option + which can be any of top, modules, premount, mount, bottom, init and + causes the initramfs to break at that point. panic/breaknow is now + break=top, without an argument is equivalent to break=premount. + * Run depmod at the top of the init script, so init-top scripts can use + modprobe. + + * Remove udev-specific code: + - depend on the version of udev that includes all of these things itself + - remove udevstart from init + - remove code to move /dev to the real filesystem from init + - remove /sys-based module loading from load_modules + - remove boot_events functions from load_modules + - remove udev copy from mkinitramfs + - remove udev hook script + + -- Scott James Remnant Thu, 24 Nov 2005 21:21:12 +0000 initramfs-tools (0.41) unstable; urgency=high diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 7d4eff6..c6025e5 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -39,5 +39,10 @@ if [ ! -e /etc/mkinitramfs/modules ]; then cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ fi +# Regenerate initramfs on upgrade +if [ "$1" = "configure" -a -n "$2" ]; then + update-initramfs -u +fi + #DEBHELPER# diff --git a/hooks/acpid b/hooks/acpid deleted file mode 100755 index 0f3c84c..0000000 --- a/hooks/acpid +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# Hooks for loading acpi bits into the initramfs - -. /usr/share/initramfs-tools/hook-functions - -for x in fan thermal; do - manual_add_modules ${x} -done diff --git a/hooks/thermal b/hooks/thermal new file mode 100755 index 0000000..4426de3 --- /dev/null +++ b/hooks/thermal @@ -0,0 +1,28 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading thermal bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +# ACPI Systems +for x in fan thermal; do + manual_add_modules ${x} +done + +# PPC64 Systems +manual_add_modules therm_pm72 diff --git a/hooks/udev b/hooks/udev deleted file mode 100755 index 4776d85..0000000 --- a/hooks/udev +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# udev really wants to be able to do socket communications to udevd -# This means that there's a bit of a race condition as the events come -# flooding in and the kernels ability to autoload the 'unix' module. - -# We solve the problem thusly. Hopefully RIP Ubuntu# 12915 - -. /usr/share/initramfs-tools/hook-functions - -force_load unix - -cp -a /etc/udev ${DESTDIR}/etc - -# Hack until udev is built with klibc -copy_exec /sbin/udevd /sbin -copy_exec /sbin/udevsynthesize /sbin - -mkdir "${DESTDIR}/lib/udev" -copy_exec /lib/udev/udevsynthesize /lib/udev diff --git a/init b/init index f8853b1..1f6c732 100755 --- a/init +++ b/init @@ -6,9 +6,12 @@ mkdir /sys mkdir /proc mkdir /tmp mkdir -p /var/lock -mount -t sysfs sysfs /sys -mount -t proc proc /proc -mount -t ramfs none /dev +mount -t sysfs none /sys +mount -t proc none /proc + +# Note that this only becomes /dev on the real filesystem if udev's scripts +# are used; which they will be, but it's worth pointing out +mount -t tmpfs -o mode=0755 udev /dev touch /dev/.initramfs-tools mknod /dev/console c 5 1 mknod /dev/null c 1 3 @@ -56,74 +59,52 @@ for x in $(cat /proc/cmdline); do exec >/tmp/initramfs.debug 2>&1 set -x ;; - break) - break=yes + break=*) + break=${x#break=} ;; - breaknow) - panic "Spawning shell within the initramfs" + break) + break=premount ;; esac done +depmod -a +maybe_break top + # Don't do log messages here to avoid confusing usplash run_scripts /scripts/init-top . /scripts/${BOOT} +parse_numeric ${ROOT} -depmod -a - -# Populate /dev tree -log_begin_msg "Initializing /dev" -udevd_timeout=30 -echo > /proc/sys/kernel/hotplug -mkdir /dev/.udev /dev/.udev/db/ /dev/.udev/queue/ -udevd --daemon -udevsynthesize -while [ -d /dev/.udev/queue/ ]; do - sleep 1 - udevd_timeout=$(($udevd_timeout - 1)) - if [ $udevd_timeout -eq 0 ]; then - break - fi -done -log_end_msg - +maybe_break modules log_begin_msg "Loading modules" load_modules log_end_msg -parse_numeric ${ROOT} - -if [ x${break} = xyes ]; then - panic "Spawning shell within the initramfs" -fi - +maybe_break premount log_begin_msg "Running /scripts/init-premount" run_scripts /scripts/init-premount log_end_msg +maybe_break mount log_begin_msg "Mounting root file system" mountroot log_end_msg +maybe_break mount [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom [ "$quiet" != "y" ] && log_end_msg -# Move our /dev to the real filesystem. Do the setup that udev otherwise -# would. -killall udevd -mkdir -p /dev/.static/dev -chmod 700 /dev/.static/ -mount -n -o bind ${rootmnt}/dev /dev/.static/dev -mount -n -o move /dev ${rootmnt}/dev +# Move virtual filesystems over to the real filesystem +mount -n -o move /sys ${rootmnt}/sys +mount -n -o move /proc ${rootmnt}/proc -umount /sys -umount /proc - -if [ ! -x ${rootmnt}${init} ]; then +while [ ! -x ${rootmnt}${init} ]; do panic "Target filesystem doesn't have ${init}" -fi +done # Chain to real filesystem -exec run-init ${rootmnt} ${init} "$@" /root/dev/console +maybe_break init +exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console diff --git a/mkinitramfs b/mkinitramfs index 1cba5d5..9892a36 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -181,6 +181,7 @@ copy_exec /sbin/depmod /sbin copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" copy_exec /etc/modprobe.d/aliases /etc/modprobe.d +copy_exec /etc/modprobe.d/blacklist /etc/modprobe.d run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks diff --git a/scripts/functions b/scripts/functions index 5147009..8a49c8e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -48,7 +48,14 @@ panic() /sbin/usplash_write "QUIT" fi echo $@ - FS1='(initramfs) ' exec /bin/sh /dev/console 2>&1 + FS1='(initramfs) ' /bin/sh /dev/console 2>&1 +} + +maybe_break() +{ + if [ x$1 = x${break} ]; then + panic "Spawning shell within the initramfs" + fi } render() @@ -152,58 +159,9 @@ run_scripts() call_scripts } -ide_boot_events() { - - modprobe -q ide-generic - - [ -e /proc/ide ] || return - - for drive in /proc/ide/*; do - [ -e ${drive}/media ] || continue - # nothing to do if the device has already been took in charge - unit=${drive#/proc/ide/} - [ -d /sys/block/$unit ] && continue - - read media < $drive/media - case "$media" in - disk) MODULE=ide-disk ;; - cdrom) MODULE=ide-cd ;; - tape) MODULE=ide-tape ;; - floppy) MODULE=ide-floppy ;; - *) MODULE=ide-generic ;; - esac - - modprobe -q ${MODULE} - done -} - -scsi_boot_events() -{ - [ -e /sys/bus/scsi/devices/ ] || return - - for device in /sys/bus/scsi/devices/*; do - [ -e "${device}"/type ] || continue - read media < ${device}/type - case "$media" in - 0) modprobe -q sd_mod; - esac - - done - -} - -i2o_boot_events() -{ - [ -e /sys/bus/i2o/devices/ ] || return - - for device in /sys/bus/i2o/devices/*; do - [ -e ${device}/block ] && modprobe i2o_block - done -} - +# Load custom modules first load_modules() { - # Load custom modules first if [ -e /conf/modules ]; then cat /conf/modules | while read m; do if [ -z "$m" ] \ @@ -216,37 +174,15 @@ load_modules() fi done fi - - ide_boot_events - - scsi_boot_events - - i2o_boot_events - - # FIXME - need to start LVM here - + + # FIXME: wrong place, but it gets done ;) if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then - major_minor=$(ls -l ${resume} | \ - awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + major=$((0x$(stat -c%t ${resume}))) + minor=$((0x$(stat -c%T ${resume}))) + echo ${major}:${minor} >/sys/power/resume fi fi - - # Give the USB bus a moment to catch up - sleep 2 - - for x in /sys/bus/usb/devices/*; do - if [ -e ${x}/modalias ]; then - modprobe -q $(cat ${x}/modalias) - fi - done - - ide_boot_events - - scsi_boot_events - - i2o_boot_events } parse_numeric() { diff --git a/scripts/init-premount/acpid b/scripts/init-premount/acpid deleted file mode 100755 index 61d226a..0000000 --- a/scripts/init-premount/acpid +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -modprobe -q fan -modprobe -q thermal diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal new file mode 100755 index 0000000..e0d79c3 --- /dev/null +++ b/scripts/init-premount/thermal @@ -0,0 +1,23 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# For ACPI systems +modprobe -q fan +modprobe -q thermal + +# For ppc64 systems +modprobe -q therm_pm72 diff --git a/scripts/local b/scripts/local index aa2cbfb..df09298 100644 --- a/scripts/local +++ b/scripts/local @@ -7,10 +7,17 @@ mountroot () run_scripts /scripts/local-top [ "$quiet" != "y" ] && log_end_msg + # Wait for SCSI/USB/etc. devices for a bit + slumber=10 + while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do + /bin/sleep 1 + slumber=$(( ${slumber} - 1 )) + done + # Get the root filesystem type - if [ ! -e "${ROOT}" ]; then + while [ ! -e "${ROOT}" ]; do panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" - fi + done eval $(fstype < ${ROOT}) diff --git a/scripts/nfs b/scripts/nfs index 7166b08..a2f6c3e 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,6 @@ mountroot () roflag="-o rw" fi - sleep 3 nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" -- cgit v1.2.3 From de53fe8336d09076a1330b7d5793689e587bcd1c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Dec 2005 01:19:57 +0100 Subject: fix hooks/kernelextras not include current dir with wildcard. break out of loop on the '*' case. --- debian/changelog | 5 ++++- hooks/kernelextras | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 48fd54b..6a87941 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,10 @@ initramfs-tools (0.43) unstable; urgency=low * local-top/lvm: Activate all lvm groups for future support of lvm-crypt roots. (Closes: #339087) - -- maximilian attems Mon, 5 Dec 2005 17:49:43 +0100 + * hooks/kernelextras: Really fix #335505. + Don't expand wildcase to current dir. (Closes: #342153) + + -- maximilian attems Tue, 6 Dec 2005 01:16:41 +0100 initramfs-tools (0.42) unstable; urgency=low diff --git a/hooks/kernelextras b/hooks/kernelextras index df38884..33e6cb0 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -19,16 +19,16 @@ esac . /usr/share/initramfs-tools/hook-functions -if [ ! -d ${MODULESDIR}/initrd ]; then - exit 0 -fi - fbcon=n +set -x for x in ${MODULESDIR}/initrd/*; do x=${x##*/} x=${x%.*} case ${x} in + '*') + break + ;; *fb) fbcon=y ;; -- cgit v1.2.3 From 0734f56e32c5711ef4a046146c40efcabdfdda00 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 11:39:11 +0100 Subject: get ready for the release: remove traling whitespace in the conffile remove debugging "set -x" --- conf/initramfs.conf | 2 +- hooks/kernelextras | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'hooks') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 079fe47..38a0594 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -18,7 +18,7 @@ MODULES=most # # RESUME: [ /dev/hda2 | /dev/sdb2 ] # -# optional - set the swap partition to resume from. +# optional - set the swap partition to resume from. # "cat /proc/swaps | egrep ^/dev" should show possible candidates. # The command line of your boot loader will override this setting. diff --git a/hooks/kernelextras b/hooks/kernelextras index 33e6cb0..815dd25 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -20,7 +20,6 @@ esac . /usr/share/initramfs-tools/hook-functions fbcon=n -set -x for x in ${MODULESDIR}/initrd/*; do x=${x##*/} -- cgit v1.2.3 From bce0c73e77b777ef03894d703c727dbf4b0f4298 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 14 Jan 2006 17:34:00 +0100 Subject: evms took their own hooks. :) --- debian/changelog | 7 +++++++ hooks/evms | 36 ------------------------------------ scripts/local-top/evms | 32 -------------------------------- 3 files changed, 7 insertions(+), 68 deletions(-) delete mode 100755 hooks/evms delete mode 100755 scripts/local-top/evms (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index aee598d..79b7c9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.50) unstable; urgency=low + + * EVMS takes care of it's own hooks, rm: hooks/evms, scripts/local-top/evms. + Thanks Steinar H. Gunderson . (Closes: 340258) + + -- maximilian attems Sat, 14 Jan 2006 17:26:24 +0100 + initramfs-tools (0.49) unstable; urgency=low * Pump dephelper to 4.1.0 dependency as pointed out by linda. diff --git a/hooks/evms b/hooks/evms deleted file mode 100755 index a58b2a4..0000000 --- a/hooks/evms +++ /dev/null @@ -1,36 +0,0 @@ -#!/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 -cp /etc/evms.conf ${DESTDIR}/etc - -EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3; }') - -mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} - -for x in bbr bbr_seg bsd disk dos drivelink gpt lvm2 mac md multipath; do - copy_exec /lib/evms/${EVMS_VERSION}/${x}-*.so /lib/evms/${EVMS_VERSION} -done - -for x in dm_mod linear raid0 raid1 raid10 raid5 raid6; do - manual_add_modules ${x} -done diff --git a/scripts/local-top/evms b/scripts/local-top/evms deleted file mode 100755 index 46fca5d..0000000 --- a/scripts/local-top/evms +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -evms=${ROOT#/dev/evms/} - -case ${evms} in - /*) - exit 0 - ;; -esac - -unset evms - -for module in dm-mod linear raid0 raid1 raid10 raid5 raid6; do - modprobe -q $module -done - -/sbin/evms_activate -- 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 'hooks') 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 3776f7f89abae55a448e008cf268385e119eb9ff Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 24 Jan 2006 19:44:11 +0100 Subject: add dm_snapshot to the modules for booting on lvm snapshots --- debian/changelog | 7 +++++++ hooks/lvm | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index fb9f4ac..e783755 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.52) unstable; urgency=low + + * hooks/lvm: manual_add_modules dm_snapshot, allows to boot from a snapshot + of your root device. (ubuntu: #3842) + + -- maximilian attems Tue, 24 Jan 2006 19:40:25 +0100 + initramfs-tools (0.51) unstable; urgency=low * scripts/functions: Call panic on circular deps to get rescue shell. diff --git a/hooks/lvm b/hooks/lvm index 9022dce..63316e5 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -22,6 +22,6 @@ fi copy_exec /lib/lvm-200/vgchange /sbin -for x in dm_mod; do +for x in dm_mod dm_snapshot; do manual_add_modules ${x} done -- cgit v1.2.3 From d6bcfac2500607902f76bcead5517e8ae80f5d01 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 28 Feb 2006 17:40:38 +0100 Subject: don't stumble on lvm10 leftovers, explicitly check for lvm2 --- debian/changelog | 7 +++++++ hooks/lvm | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index b4cbb08..3ccc474 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.54) unstable; urgency=low + + * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. + (closes: #354708) + + -- maximilian attems Tue, 28 Feb 2006 17:34:14 +0100 + initramfs-tools (0.53) unstable; urgency=high * update-initramfs: set_current_version needs to check against diff --git a/hooks/lvm b/hooks/lvm index 63316e5..e29215e 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -14,7 +14,7 @@ prereqs) ;; esac -if [ ! -x /sbin/vgchange ]; then +if [ ! -x /sbin/vgchange -a ! -d /lib/lvm-200 ]; then exit 0 fi -- cgit v1.2.3 From aad10a3ce2e626e9ca66e08da5edb0ad17d9bd16 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 18 Mar 2006 09:24:43 +0100 Subject: * fix minor parsing * add linear module * manpage polishing * udev_helper needs some conf sourced --- debian/changelog | 24 ++++++++++++++++++++++++ hooks/md | 2 +- mkinitramfs.8 | 2 +- scripts/functions | 2 +- scripts/init-premount/udev_helper | 4 ++++ update-initramfs.8 | 3 ++- 6 files changed, 33 insertions(+), 4 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 3edb850..c67e009 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.56) unstable; urgency=low + + * hooks/md: Add linear module - thanks to Moshe Yudkowsky . + + * scripts/functions: Fix numerical minor parsing - thanks for the patch to + Wolfgang Weisselberg. (closes: #357332) + + * mkinitramfs.8: Correct wrong referenced filename. + + * update-initramfs.8: Define the argument 'version' - thanks to "Susan G. + Kleinmann" . (closes: #357282) + + * scripts/init-premount/udev_helper: Source the relevant definition to get + it really run. Thanks to Maurice Massar . + (closes: #354458) + + -- maximilian attems Fri, 17 Mar 2006 19:09:11 +0100 + +initramfs-tools (0.55b) unstable; urgency=low + + * Thanks to Frederik Schüler for pointing to leftovers. + + -- maximilian attems Wed, 15 Mar 2006 13:23:51 +0100 + initramfs-tools (0.55) unstable; urgency=low * scripts/init-premount/udev_helper: Fix modprobe args. diff --git a/hooks/md b/hooks/md index 64b8f9e..c020c3a 100755 --- a/hooks/md +++ b/hooks/md @@ -23,6 +23,6 @@ fi copy_exec /sbin/mdadm /sbin copy_exec /sbin/mdrun /sbin -for x in md raid0 raid1 raid5 raid6; do +for x in md linear raid0 raid1 raid5 raid6; do manual_add_modules ${x} done diff --git a/mkinitramfs.8 b/mkinitramfs.8 index b0da75e..539c4c0 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -53,7 +53,7 @@ Write the image to Override the .B ROOT setting in -.IR mkinitramfs.conf . +.IR initramfs.conf . .TP \fB\-\-supported-host-version=\fIhversion diff --git a/scripts/functions b/scripts/functions index 6825519..05b7779 100644 --- a/scripts/functions +++ b/scripts/functions @@ -202,7 +202,7 @@ parse_numeric() { major=${1%:*} ;; *) - minor=$((0x${1#??})) + minor=$((0x${1#?})) major=$((0x${1%??})) ;; esac diff --git a/scripts/init-premount/udev_helper b/scripts/init-premount/udev_helper index f2bc204..d2ef579 100755 --- a/scripts/init-premount/udev_helper +++ b/scripts/init-premount/udev_helper @@ -15,6 +15,10 @@ prereqs) ;; esac +# Source the relevant scripts for later decisions +. /conf/initramfs.conf +. /scripts/functions + # Nothing todo for nfs boot case "${BOOT}" in local) diff --git a/update-initramfs.8 b/update-initramfs.8 index 9e107e9..7ab8b3f 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -28,7 +28,8 @@ happens in this early userspace. .SH OPTIONS .TP \fB \-k \fI version -Set the kernel for whom the initramfs will be generated. +Set the kernel version for whom the initramfs will be generated. +For example the output of uname -r for your currently running kernel. .TP \fB \-c -- cgit v1.2.3 From fac756fddb6da3efbbfe99c3c9b0644346ecc695 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 26 Mar 2006 22:37:51 +0200 Subject: Resynch with 0.40ubuntu28 add raid10 module move the loop waiting code to mountroot() leaves only ide-generic from scripts/local-top/udev_helper md pre-requesites the udev one --- debian/changelog | 12 ++++- hooks/md | 2 +- scripts/init-premount/udev_helper | 107 -------------------------------------- scripts/local | 26 ++++++++- scripts/local-top/md | 2 +- scripts/local-top/udev_helper | 23 ++++++++ 6 files changed, 61 insertions(+), 111 deletions(-) delete mode 100755 scripts/init-premount/udev_helper create mode 100755 scripts/local-top/udev_helper (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index a2e8cef..93b55c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,17 @@ 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 + * Resync with 0.40ubuntu28: + - hooks/md: Add raid10 module. + - scripts/local: Move the "loop waiting for the root filesystem" code from + the udev premount script to the local mountroot() function where it truly + belongs. + - scripts/local-top/udev_helper: Leave the remaining ide-generic part + there, should be taken over by udev itself. + - make the md local-top scripts pre-requisite the udev one. + thanks Scott James Remnant + + -- maximilian attems Sun, 26 Mar 2006 22:35:15 +0200 initramfs-tools (0.58) unstable; urgency=low diff --git a/hooks/md b/hooks/md index c020c3a..becaba1 100755 --- a/hooks/md +++ b/hooks/md @@ -23,6 +23,6 @@ fi copy_exec /sbin/mdadm /sbin copy_exec /sbin/mdrun /sbin -for x in md linear raid0 raid1 raid5 raid6; do +for x in md linear raid0 raid1 raid5 raid6 raid10; do manual_add_modules ${x} done diff --git a/scripts/init-premount/udev_helper b/scripts/init-premount/udev_helper deleted file mode 100755 index d2ef579..0000000 --- a/scripts/init-premount/udev_helper +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -PREREQ="udev" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# Source the relevant scripts for later decisions -. /conf/initramfs.conf -. /scripts/functions - -# Nothing todo for nfs boot -case "${BOOT}" in -local) - ;; -*) - exit 0 - ;; -esac - -# Our job now is to make the block device for the root filesystem available. -# This is actually a bit trickier than it first appears because we first need -# to figure out which driver needs it, and to do that, we need to know what -# type of bus it's on. Fortunately we have all that information, this still -# feels like an ungodly hack though. -case "${ROOT}" in -/dev/root) - # An interesting case, this root device was specified as a - # major/minor pair. Fortunately we have that information - case "${major}" in - 3|22|33|34|56|57|88|89|90|91) - # traditional ide - root_type=ide - ;; - 80|81|82|83|84|85|86|87) - # ide on i2o - root_type=ide - ;; - 8|11|65|66|67|68|69|70|71|128|129|130|131|132|133|134|135) - # scsi - root_type=scsi - ;; - esac - ;; -/dev/hd*) - # Ahh, plain-old traditional ide - root_type=ide - ;; -/dev/sd*) - # SCSI, or an IDE controller dressed up in drag - root_type=scsi - ;; -/dev/disk/*) - # Specified by label; sadly there's no way to tell what bus - # this is on, so we'll just declare that we only support it - # for SCSI and removable devices - root_type=scsi - ;; -esac - -case "${root_type}" in -ide) - # If we're booting from IDE, it might not be a PCI controller, - # 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 - fi - ;; - -scsi) - # If we're booting from SCSI we should have done all we need, - # now it's just a matter of waiting for the devices to appear - # which could take a while... - [ -e "${ROOT}" ] || log_begin_msg "Waiting for root file system" - - if type usplash_write >/dev/null 2>&1; then - usplash_write "TIMEOUT 30" || true - fi - - slumber=300 - while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do - /bin/sleep 0.1 - slumber=$(( ${slumber} - 1 )) - done - - if type usplash_write >/dev/null 2>&1; then - usplash_write "TIMEOUT 15" || true - fi - - if [ ${slumber} -gt 0 ]; then - log_end_msg 0 - else - log_end_msg 1 || true - fi - ;; -esac diff --git a/scripts/local b/scripts/local index 917528a..dd5924d 100644 --- a/scripts/local +++ b/scripts/local @@ -7,7 +7,31 @@ mountroot () run_scripts /scripts/local-top [ "$quiet" != "y" ] && log_end_msg - # Get the root filesystem type + # If the root device hasn't shown up yet, give it a little while + # to deal with removable devices + if [ ! -e "${ROOT}" ]; then + log_begin_msg "Waiting for root file system..." + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "TIMEOUT 180" || true + fi + + slumber=1800 + while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do + /bin/sleep 0.1 + slumber=$(( ${slumber} - 1 )) + done + + if [ ${slumber} -gt 0 ]; then + 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 + + # 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 diff --git a/scripts/local-top/md b/scripts/local-top/md index c7515fe..aa48474 100755 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="" +PREREQ="udev_helper" prereqs() { diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper new file mode 100755 index 0000000..5a747ba --- /dev/null +++ b/scripts/local-top/udev_helper @@ -0,0 +1,23 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# If we're booting from IDE, it might not be a PCI controller, +# 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 +fi -- cgit v1.2.3 From 16d9f24976ebbb165e5e8aae17a17ddaeca90a8d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 24 Jun 2006 11:15:58 +0200 Subject: lvm script patch activate root and resume volume group lvm script root on lilo woraround lvm hook add dm-mirror mkinitramfs cleanup old make-kpkg args update-initramfs show what's going on --- debian/changelog | 21 +++++++++++++++++++++ hooks/lvm | 2 +- mkinitramfs | 23 +---------------------- scripts/local-top/lvm | 48 +++++++++++++++++++++++++++++++++--------------- update-initramfs | 2 +- 5 files changed, 57 insertions(+), 39 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 83c5a46..2e939e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +initramfs-tools (0.65) unstable; urgency=low + + * scripts/local-top/lvm: Activate root and resume volume group. + The initialization got refractored in an function. (closes: #374891) + Thanks for the patch to David Härdeman . + + * scripts/local-top/lvm: Be carefull to activate volume group on lilo boot + too. Although in that case we don't know the precise volume group, we + activate them all. Matches behaviour of previous hook. + + * hooks/lvm: Add dm-mirror, allows to boot from an unfinished pvmove. + (closes: #374378) + + * mkinitramfs: Remove old kernel-package supported long param. + kernel-package uses since month make-kpkg. + + * update-initramfs: Show by default which initramfs gets generated. + (closes: #364301) + + -- maximilian attems Sat, 24 Jun 2006 10:46:40 +0200 + initramfs-tools (0.64) unstable; urgency=low RELEASE o bella, ciao! bella, ciao! diff --git a/hooks/lvm b/hooks/lvm index e29215e..98c0e0a 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -22,6 +22,6 @@ fi copy_exec /lib/lvm-200/vgchange /sbin -for x in dm_mod dm_snapshot; do +for x in dm_mod dm_snapshot dm_mirror; do manual_add_modules ${x} done diff --git a/mkinitramfs b/mkinitramfs index 05800bb..5fcc1fd 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:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` +OPTIONS=`getopt -o d:ko:r:v -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -44,14 +44,6 @@ while true; do verbose="y" shift ;; - --supported-host-version) - supported_host_version="$2" - shift 2 - ;; - --supported-target-version) - supported_target_version="$2" - shift 2 - ;; --) shift break @@ -63,19 +55,6 @@ while true; do esac done -if [ -n "$supported_host_version" ] || [ -n "$supported_target_version" ]; then - if [ -n "$supported_host_version" ]; then - host_upstream_version="${supported_host_version%%-*}" - fi - if [ -n "$supported_target_version" ]; then - target_upstream_version="${supported_target_version%%-*}" - if dpkg --compare-versions "$target_upstream_version" lt "2.6.12"; then - exit 2 - fi - fi - exit 0 -fi - # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 7ac81e6..8ff3b98 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -15,23 +15,41 @@ prereqs) ;; esac -vg=${ROOT#/dev/mapper/} +activate_vg() +{ + local vg="$1" + + # Make sure that we have a non-empty argument + if [ -z "${vg}" ]; then + return 0 + fi -case ${vg} in - /dev/root) - unset vg - ;; - /*) + # Take care of lilo boot arg, risky activating of all vg + vg_lilo=${vg:0:2} + if [ "${vg_lilo}" = fe ]; then + vgchange -ay exit 0 - ;; -esac - -modprobe -q dm-mod + fi + + # Make sure that we have a d-m path + vg=${vg#/dev/mapper/} + if [ "$vg" = "$1" ]; then + return 0 + fi -# 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') + # 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} + vgchange -ay ${vg} +} + +if [ ! -e /sbin/vgchange ]; then + exit 0 +fi + +modprobe -q dm-mod +activate_vg "$ROOT" +activate_vg "$resume" diff --git a/update-initramfs b/update-initramfs index 488806f..03bf5cf 100755 --- a/update-initramfs +++ b/update-initramfs @@ -62,7 +62,7 @@ set_initramfs() generate_initramfs() { - verbose "Generating ${initramfs}" + echo "update-initramfs: Generating ${initramfs}" OPTS="-o" if [ "${verbose}" = 1 ]; then OPTS="-v $OPTS" -- cgit v1.2.3 From 42579f456b1a87627a1416b3f80c51d9f15fb09a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 27 Jun 2006 14:11:25 +0200 Subject: - fix typo on panic call - load the right i2c module for ppc g5 (windfarm needs more work) --- debian/changelog | 12 ++++++++++++ hooks/thermal | 1 + scripts/functions | 2 +- scripts/init-premount/thermal | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index c39e1b5..ed11e31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +initramfs-tools (0.66) unstable; urgency=low + + * hooks/thermal: Add i2c-powermac. + + * scripts/init-premount/thermal: Load i2c-powermac on ppc boot. + Fixes fan noises for Sven Luther + + * scripts/function: Fix typo s/FS1/PS1/ on panic call. (closes: #375624) + Thanks to Tim Phipps for the report. + + -- maximilian attems Tue, 27 Jun 2006 14:04:17 +0200 + initramfs-tools (0.65b) unstable; urgency=low * scripts/local-top/lvm: Load snapshot and mirror modules. (Closes: #375342) diff --git a/hooks/thermal b/hooks/thermal index c27c957..9bfd323 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -23,6 +23,7 @@ case "$DPKG_ARCH" in # copy the right modules powerpc|ppc64) manual_add_modules therm_pm72 + manual_add_modules i2c-powermac ;; i386|amd64|ia64) manual_add_modules fan diff --git a/scripts/functions b/scripts/functions index 35485c6..a4faaa8 100644 --- a/scripts/functions +++ b/scripts/functions @@ -62,7 +62,7 @@ panic() modprobe -q i8042 modprobe -q atkbd echo $@ - FS1='(initramfs) ' /bin/sh /dev/console 2>&1 + PS1='(initramfs) ' /bin/sh /dev/console 2>&1 } maybe_break() diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index d59af8a..3518e7c 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,7 +18,7 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) - modprobe -q i2c-keywest + modprobe -q i2c-powermac modprobe -q therm_pm72 ;; i386|amd64|ia64) -- 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 'hooks') 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 17d01b3434dac54ace5991029ed069b3d185ffd2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 16 Jul 2006 21:54:14 +0200 Subject: massif whitespace cleanup --- break.txt | 2 +- debian/NEWS | 2 +- debian/changelog | 48 +++++++++++++++++++++++++------------------ debian/copyright | 2 +- docs/example_hook | 6 +++--- docs/example_hook_cpiogz | 2 +- docs/example_script | 4 ++-- hooks/lvm | 2 +- hooks/md | 2 +- init | 2 +- initramfs-tools.8 | 18 ++++++++-------- initramfs.conf.5 | 4 ++-- mkinitramfs | 20 +++++++++--------- mkinitramfs-kpkg | 16 +++++++-------- mkinitramfs-kpkg.8 | 6 +++--- mkinitramfs.8 | 30 +++++++++++++-------------- scripts/functions | 12 +++++------ scripts/local-top/udev_helper | 2 +- update-initramfs | 6 +++--- update-initramfs.8 | 26 +++++++++++------------ 20 files changed, 110 insertions(+), 102 deletions(-) (limited to 'hooks') diff --git a/break.txt b/break.txt index ff26d5b..64ecf84 100644 --- a/break.txt +++ b/break.txt @@ -1,4 +1,4 @@ -if [ x${break} = xyes ]; then +if [ x${break} = xyes ]; then panic "Spawning shell within the initramfs" fi diff --git a/debian/NEWS b/debian/NEWS index d4647d4..a6ae4bc 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -15,7 +15,7 @@ initramfs-tools (0.10) breezy; urgency=low This means two things in particular that are important: 1) the resulting initramfs will be huge. Like 10 megs huge. - I will shrink it down once it's correct. If you're on an + I will shrink it down once it's correct. If you're on an arch that doesn't like >4mb initramfs', then this won't boot. 2) Your network drivers are loaded in the initramfs, so hotplug diff --git a/debian/changelog b/debian/changelog index 8a519b4..b48be87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,12 +8,20 @@ initramfs-tools (0.70) unstable; urgency=low 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*, + - 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 + * break.txt, debian/NEWS, debian/changelog, debian/copyright, + docs/example_hook, docs/example_hook_cpiogz, docs/example_script, + hooks/lvm, hooks/md, init, initramfs-tools.8, initramfs.conf.5, + mkinitramfs, mkinitramfs-kpkg, mkinitramfs-kpkg.8, mkinitramfs.8, + scripts/functions, scripts/local-top/udev_helper, update-initramfs, + update-initramfs.8: Whitespace policy cleanup trailing whitespace and + non tabular indents. + + -- maximilian attems Sun, 16 Jul 2006 21:50:34 +0200 initramfs-tools (0.69b) unstable; urgency=high @@ -68,7 +76,7 @@ initramfs-tools (0.69) unstable; urgency=low * update-initramfs: Add option "-b directory" to override BOOTDIR. Allows the initramfs to be created in another dir without awkward - mkinitramfs invocation. Check that the passed arg is really a dir. + mkinitramfs invocation. Check that the passed arg is really a dir. (ubuntu: 37690) Thanks Colin Watson * update-initramfs.8: Document -b switch. @@ -312,7 +320,7 @@ initramfs-tools (0.60) unstable; urgency=low initramfs-tools (0.59b) unstable; urgency=low - * mkinitramfs-kpkg: Intialialize the variables. + * mkinitramfs-kpkg: Intialialize the variables. (closes: #359355, #359620, #359613, #359666, #359681) -- maximilian attems Tue, 28 Mar 2006 16:30:59 +0200 @@ -329,7 +337,7 @@ initramfs-tools (0.59) unstable; urgency=low - scripts/local-top/udev_helper: Leave the remaining ide-generic part there, should be taken over by udev itself. - make the md local-top scripts pre-requisite the udev one. - thanks Scott James Remnant + thanks Scott James Remnant -- maximilian attems Sun, 26 Mar 2006 22:35:15 +0200 @@ -768,7 +776,7 @@ 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) + 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) @@ -854,7 +862,7 @@ initramfs-tools (0.40ubuntu8) dapper; urgency=low initramfs-tools (0.40ubuntu7) dapper; urgency=low * remove "sleep 3" from the nfs script before the nfsmount command, - its a leftover from debugging in breezy and slows down thin client + its a leftover from debugging in breezy and slows down thin client booting unnecessary -- Oliver Grawert Fri, 2 Dec 2005 11:45:05 +0100 @@ -887,7 +895,7 @@ initramfs-tools (0.40ubuntu4) dapper; urgency=low initramfs-tools (0.40ubuntu3) dapper; urgency=low "A true friend stabs you in the front." - - Oscar Wilde + - Oscar Wilde * hooks/acpid: Rename to ... * hooks/thermal: ... this. Add therm_pm72 for ppc64 systems. @@ -933,7 +941,7 @@ initramfs-tools (0.41) unstable; urgency=high * High urgency upload to cope with newer udev upstream - bonus: condition to test against when udev is ready. (Closes: #341014) - Thanks Marco d'Itri for guidance and + Thanks Marco d'Itri for guidance and Heikki Henriksen for double check. * Pump udev dep on 0.076-3. @@ -978,7 +986,7 @@ initramfs-tools (0.39) unstable; urgency=medium * Pump udev dependency. * init: Pump timeout as there is currently no way to check which udevd - processes are still running and why. + processes are still running and why. Cures hopefully breakage of missing devices on boot. * Sync with latest Ubuntu. @@ -1048,7 +1056,7 @@ initramfs-tools (0.37) unstable; urgency=low Exit if it doesn't exist before including current dir. Thanks to Jean Charles Delepine (Closes: #335505) - * hooks/lvm, hooks/md: Remove FIXME's at second thought. You better want + * hooks/lvm, hooks/md: Remove FIXME's at second thought. You better want to check against the binaries for your not yet created raid/lvm. -- maximilian attems Wed, 26 Oct 2005 09:22:58 +0200 @@ -1065,7 +1073,7 @@ initramfs-tools (0.36ubuntu1) dapper; urgency=low initramfs-tools (0.36) unstable; urgency=low "Sunny Autumn Release" - + * Minor cleanups in mkiniramfs. * Remove manpage section about return values. Needs to be rephrased. @@ -1149,7 +1157,7 @@ initramfs-tools (0.30) unstable; urgency=low [ maximilian Attems ] * Resynconise with latest upstream now we are in unstable. - + [ Jeff Bailey ] * debian/rules: Make sure hooks and scripts are chmod +x @@ -1197,7 +1205,7 @@ initramfs-tools (0.29) breezy; urgency=low initramfs-tools (0.28) breezy; urgency=low - * Run udevstart after loading block drivers - should fix resume from + * 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 @@ -1228,7 +1236,7 @@ initramfs-tools (0.27) unstable; urgency=low initramfs-tools (0.26) breezy; urgency=low "Experience is one thing you can't get for nothing." - - Oscar Wilde + - Oscar Wilde * scripts/local-top/lvm: Reduce -- to - in VG strings for feeding to vgchange. (Ubuntu: #13387) @@ -1264,7 +1272,7 @@ initramfs-tools (0.26) breezy; urgency=low * debian/dirs: Add etc/mkinitramfs/hooks, move all scripts subdirs into etc/mkinitramfs/scripts. - * mkinitramfs: Set the umask. Copy the scripts from + * 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. @@ -1441,9 +1449,9 @@ initramfs-tools (0.17) breezy; urgency=low genius." - Oscar Wilde - * debian/initramfs-tools.postinst: Get the name of the config file + * 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! + Thanks to Matthew Garrett for noticing this! -- Jeff Bailey Wed, 10 Aug 2005 11:54:07 -0400 @@ -1459,7 +1467,7 @@ initramfs-tools (0.16) breezy; urgency=low * 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 + (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. @@ -1568,7 +1576,7 @@ initramfs-tools (0.13) breezy; urgency=low 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 diff --git a/debian/copyright b/debian/copyright index 3a3bc5b..2c681c2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,7 +13,7 @@ The Debian tree is maintained with "bzr" at: http://debian.stro.at/bzr-test/initramfs-tools/ Authors: Jeff Bailey , Adam Conrad , - Scott James Remnant , + Scott James Remnant , maximilian attems Copyright: 2005 Jeff Bailey diff --git a/docs/example_hook b/docs/example_hook index de5392d..a0d015a 100644 --- a/docs/example_hook +++ b/docs/example_hook @@ -12,7 +12,7 @@ # added to the initramfs, but the linux-image it relates to has # already been installed previously? Does this happen often # enough that it needs to be handled? How can it be handled? -# +# # * Think about the 'usplash'. The initramfs will need to be # updated if a theme change or update is desired. Maybe it # should not be totally automatic, but offered on upgrade @@ -96,9 +96,9 @@ fi # if [ -n "$an_error_occured" ]; then - # + # # TODO: Do we need 'warn()', 'error()', and/or 'fatal()' for this? - # + # echo "An error occured in $0: $an_error_occured" >&2 exit 1 # diff --git a/docs/example_hook_cpiogz b/docs/example_hook_cpiogz index dcd1416..f3e44d9 100644 --- a/docs/example_hook_cpiogz +++ b/docs/example_hook_cpiogz @@ -50,7 +50,7 @@ esac # corresponding 'linux-image' package? Can it declare that, in # the case where it's an add-on that the 'linux-image' is not # aware of? This might be an apt and dpkg issue. -# +# # * Eg. an optional usplash or suspend2ui_fbsplash package. # . /etc/default/mypackage-initramfs diff --git a/docs/example_script b/docs/example_script index 221c888..d7f407f 100644 --- a/docs/example_script +++ b/docs/example_script @@ -70,12 +70,12 @@ echo "Got here!" if [ -n "$an_error_occured" ]; then - # + # # TODO: Do we need 'warn()', 'error()', and/or 'fatal()' for this? # I think we ultimately do, and that they need to be in their own # well-documented location so that an overlay can override them. # Think 'usplash' progress updates. - # + # echo "An error occured in $0: $an_error_occured" >&2 exit 1 # diff --git a/hooks/lvm b/hooks/lvm index 98c0e0a..49a8887 100755 --- a/hooks/lvm +++ b/hooks/lvm @@ -23,5 +23,5 @@ fi copy_exec /lib/lvm-200/vgchange /sbin for x in dm_mod dm_snapshot dm_mirror; do - manual_add_modules ${x} + manual_add_modules ${x} done diff --git a/hooks/md b/hooks/md index becaba1..df2abc8 100755 --- a/hooks/md +++ b/hooks/md @@ -24,5 +24,5 @@ copy_exec /sbin/mdadm /sbin copy_exec /sbin/mdrun /sbin for x in md linear raid0 raid1 raid5 raid6 raid10; do - manual_add_modules ${x} + manual_add_modules ${x} done diff --git a/init b/init index f66281c..eb14326 100755 --- a/init +++ b/init @@ -18,7 +18,7 @@ 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/console c 5 1 mknod /dev/null c 1 3 # Export the dpkg architecture diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 5d7c105..5712bdd 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -4,19 +4,19 @@ initramfs-tools \- an introduction to writing scripts for mkinitramfs .SH DESCRIPTION -initramfs-tools has one main script and two different sets of subscripts which +initramfs-tools has one main script and two different sets of subscripts which will be used during different phases of execution. Each of these will be discussed separately below with the help of an imaginary tool which performs a frobnication of a lvm partition prior to mounting the root partition. .SS Hook scripts -These are used when an initramfs image is created and not included in the +These are used when an initramfs image is created and not included in the 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 +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 @@ -40,7 +40,7 @@ the device node to mount as the rootfs. .TP \fB \fI nfsroot can be either "auto" to try to get the relevant information from DHCP or a -string of the form NFSSERVER:NFSPATH +string of the form NFSSERVER:NFSPATH .TP \fB \fI boot @@ -79,7 +79,7 @@ Hooks can be found in two places: /usr/share/initramfs-tools/hooks and /etc/initramfs-tools/hooks. They are executed during generation of the initramfs-image and are responsible for including all the necessary components in the image itself. No guarantees are made as to the order in which the -different scripts are executed unless the prereqs are setup in the script. +different scripts are executed unless the prereqs are setup in the script. .SS Header In order to support prereqs, each script should begin with the following lines: @@ -113,7 +113,7 @@ the lvm hook script is run before your custom script. /usr/share/initramfs-tools/hook-functions contains a number of functions which deal with some common tasks in a hook script: .TP -\fB \fI +\fB \fI manual_add_modules adds a module (and any modules which it depends on) to the initramfs image. .RS @@ -389,7 +389,7 @@ if [ ! -e "/dev/mapper/frobb" ]; then panic "Frobnication device not found" fi -log_begin_msg "Starting frobnication" +log_begin_msg "Starting frobnication" /sbin/frobnicate "/dev/mapper/frobb" || panic "Frobnication failed" log_end_msg @@ -398,7 +398,7 @@ exit 0 .RE .SH DEBUG -It is easy to check the generated initramfs for its content. One may need +It is easy to check the generated initramfs for its content. One may need to double-check if it contains the relevant binaries, libs or modules: .RS .nf diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 2874fdb..afd799b 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -5,7 +5,7 @@ initramfs.conf \- configuration file for mkinitramfs .SH DESCRIPTION The behaviour of -.B mkinitramfs +.B mkinitramfs can be modified by its configuration file. Each line in the file can be a configuration variable, a blank line, @@ -35,7 +35,7 @@ The default setting is \fImost\fP. .SH NFS VARIABLES .TP \fB BOOT -Allows to use an nfs drive as the root of the drive. +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. diff --git a/mkinitramfs b/mkinitramfs index 6c048df..81a859e 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -8,7 +8,7 @@ CONFDIR="/etc/initramfs-tools" verbose="n" errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" -BUSYBOXDIR="/bin" +BUSYBOXDIR="/bin" OPTIONS=`getopt -o d:ko:r:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` @@ -110,18 +110,18 @@ check_minkver ${version} ${CONFDIR}/hooks case "${version}" in /lib/modules/*/[!/]*) - ;; + ;; /lib/modules/[!/]*) - version="${version#/lib/modules/}" - version="${version%%/*}" - ;; + version="${version#/lib/modules/}" + version="${version%%/*}" + ;; esac case "${version}" in */*) - echo "$PROG: ${version} is not a valid kernel version" >&2 - exit 1 - ;; + echo "$PROG: ${version} is not a valid kernel version" >&2 + exit 1 + ;; esac if [ -d "${outfile}" ]; then @@ -157,7 +157,7 @@ export verbose export __TMPCPIOGZ for d in bin conf/conf.d etc lib modules sbin scripts; do - mkdir -p "${DESTDIR}/${d}" + mkdir -p "${DESTDIR}/${d}" done # MODULES=list case. Always honour. @@ -228,7 +228,7 @@ fi (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then - cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 + cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 fi if [ "${keep}" = "y" ]; then diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index 437b0ac..df3dc0c 100755 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -79,20 +79,20 @@ version="${1}" case "${version}" in /lib/modules/*/[!/]*) - ;; + ;; /lib/modules/[!/]*) - version="${version#/lib/modules/}" - version="${version%%/*}" - ;; + version="${version#/lib/modules/}" + version="${version%%/*}" + ;; esac case "${version}" in */*) - echo "$PROG: ${version} is not a valid kernel version" >&2 - exit 1 - ;; + echo "$PROG: ${version} is not a valid kernel version" >&2 + exit 1 + ;; esac -# linux-image installs latest version +# linux-image installs latest version mkinitramfs -o ${outfile} ${version} sha1sum "${outfile}" | sed -e 's/\.new//' > "${STATEDIR}/${version}" diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 0bdc1dc..871a0f4 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -5,8 +5,8 @@ mkinitramfs-kpkg \- generates an initramfs image for kernel-package .SH SYNOPSIS .B mkinitramfs -.RB [ \-o -.IR outfile ] +.RB [ \-o +.IR outfile ] .RI [ version ] .B mkinitramfs .RB [ \-\-supported-host-version= @@ -29,7 +29,7 @@ for an better alternative. .TP \fB \-o \fI outfile -Write the image to +Write the image to .IR outfile . .TP diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 5af552b..3dc2e2e 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -5,13 +5,13 @@ mkinitramfs \- generate an initramfs image .SH SYNOPSIS .B mkinitramfs -.RB [ \-d -.IR confdir ] -.RB [ \-k ] -.RB [ \-o -.IR outfile ] -.RB [ \-r -.IR root ] +.RB [ \-d +.IR confdir ] +.RB [ \-k ] +.RB [ \-o +.IR outfile ] +.RB [ \-r +.IR root ] .RI [ version ] .B mkinitramfs .RB [ \-\-supported-host-version= @@ -21,17 +21,17 @@ mkinitramfs \- generate an initramfs image .SH DESCRIPTION The -.B mkinitramfs +.B mkinitramfs script generates an initramfs image. The initramfs is a gzipped cpio archive. The archive can be used on a different box of the same arch with the corresponding Linux kernel. .B mkinitramfs -is meant for advanced usage. On your local box +is meant for advanced usage. On your local box .B update-initramfs should do all necessary steps. -At boot time, the kernel unpacks that archive into RAM disk, mounts and -uses it as initial root file system. All finding of the root device +At boot time, the kernel unpacks that archive into RAM disk, mounts and +uses it as initial root file system. All finding of the root device happens in this early userspace. .SH OPTIONS @@ -45,14 +45,14 @@ Keep the temporary directory used to make the image. .TP \fB \-o \fI outfile -Write the image to +Write the image to .IR outfile . .TP \fB \-r \fI root -Override the -.B ROOT -setting in +Override the +.B ROOT +setting in .IR initramfs.conf . .TP diff --git a/scripts/functions b/scripts/functions index c3a3e16..53e07ca 100644 --- a/scripts/functions +++ b/scripts/functions @@ -2,23 +2,23 @@ _log_msg() { - if [ "$quiet" = "y" ]; then return; fi - echo "$@" + if [ "$quiet" = "y" ]; then return; fi + echo "$@" } log_success_msg() { - _log_msg "Success: $@" + _log_msg "Success: $@" } log_failure_msg() { - _log_msg "Failure: $@" + _log_msg "Failure: $@" } log_warning_msg() { - _log_msg "Warning: $@" + _log_msg "Warning: $@" } log_begin_msg() @@ -190,7 +190,7 @@ load_modules() if [ -e /conf/modules ]; then cat /conf/modules | while read m; do # Skip empty lines - if [ -z "$m" ]; then + if [ -z "$m" ]; then continue fi # Skip comments - d?ash removes whitespace prefix diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 5a747ba..2d4c209 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 -q ide-generic fi diff --git a/update-initramfs b/update-initramfs index 866609e..85a5dd2 100755 --- a/update-initramfs +++ b/update-initramfs @@ -189,7 +189,7 @@ create() if version_exists "${version}"; then panic "Cannot create version ${version}: already exists" fi - + if [ -e "${initramfs}" ]; then panic "${initramfs} already exists, cannot create." fi @@ -257,7 +257,7 @@ delete() 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 @@ -291,7 +291,7 @@ takeover=0 while getopts "k:cudyvtb:h?" flag; do case "${flag}" in k) - version="${OPTARG}" + version="${OPTARG}" ;; c) mode="c" diff --git a/update-initramfs.8 b/update-initramfs.8 index 9590ca3..a36e83c 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -5,25 +5,25 @@ update-initramfs \- generate an initramfs image .SH SYNOPSIS .B update-initramfs -.RB [ \-k -.IR version ] -.RB [ \-c ] -.RB [ \-u ] -.RB [ \-t ] -.RB [ \-v ] -.RB [ \-b ] -.RB [ \-h ] +.RB [ \-k +.IR version ] +.RB [ \-c ] +.RB [ \-u ] +.RB [ \-t ] +.RB [ \-v ] +.RB [ \-b ] +.RB [ \-h ] .SH DESCRIPTION The -.B update-initramfs +.B update-initramfs script manages your initramfs images on your local box. It keeps track of the existing initramfs archives in /boot. There are three modes of operation create, update or delete. You must at least specify one of those modes. -The initramfs is a gzipped cpio archive. -At boot time, the kernel unpacks that archive into RAM disk, mounts and -uses it as initial root file system. All finding of the root device +The initramfs is a gzipped cpio archive. +At boot time, the kernel unpacks that archive into RAM disk, mounts and +uses it as initial root file system. All finding of the root device happens in this early userspace. .SH OPTIONS @@ -59,7 +59,7 @@ Set an different bootdir for the image creation. .TP \fB \-h -Print a short help page describing the available options in +Print a short help page describing the available options in .B update-initramfs. .SH AUTHOR -- cgit v1.2.3 From 475bcbc9d6eefe90de6efe424bfb5bcca999fbc7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 20 Jul 2006 17:41:31 +0200 Subject: - drop md scripts - pump klibc dep - use resume klibc-utils bin - remove some klibc binaries - use nfsmount --- debian/changelog | 26 +++++++++++++++++++++++--- debian/control | 2 +- hooks/md | 28 ---------------------------- mkinitramfs | 3 +++ scripts/local-premount/resume | 3 +-- scripts/local-top/md | 35 ----------------------------------- scripts/nfs | 2 +- 7 files changed, 29 insertions(+), 70 deletions(-) delete mode 100755 hooks/md delete mode 100755 scripts/local-top/md (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index b48be87..faaf90a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,16 @@ +initramfs-tools (0.70b) unstable; urgency=low + + * Be more careful about vi dot files, removed. + Thanks Frederik Schüler for review. + + -- maximilian attems Wed, 19 Jul 2006 16:00:47 +0200 + initramfs-tools (0.70) unstable; urgency=low + * mkinitramfs: Don't include static kinit, nor gzip. They are the biggest + klibc-utils binaries and we don't use them. Keep static gunzip, zcat and + shared kinit for now. + * Reduce diff against 0.69ubuntu3: - hook-functions: Fix kernel typo. - hooks/kernelextras: Fix comment and add vga16fb too. @@ -7,6 +18,8 @@ initramfs-tools (0.70) unstable; urgency=low - mkinitramfs: Use check_minkver instead of dpkg itself. Whitespace cleanup and add quoting. - scripts/local: Whitespace cleanup and add a comment. + - scripts/nfs: Use mount with nolock instead of nfsmount. + (closes: 359926) - update-initramfs: Add quoting + whitespace fix. - changelog: for noise reduction add 0.69ubuntu{1,2,3}, all 0.40ubuntu*, 0.36ubuntu1 and missing 0.29 + 0.28 entries. @@ -18,10 +31,17 @@ initramfs-tools (0.70) unstable; urgency=low hooks/lvm, hooks/md, init, initramfs-tools.8, initramfs.conf.5, mkinitramfs, mkinitramfs-kpkg, mkinitramfs-kpkg.8, mkinitramfs.8, scripts/functions, scripts/local-top/udev_helper, update-initramfs, - update-initramfs.8: Whitespace policy cleanup trailing whitespace and - non tabular indents. + update-initramfs.8: Cleanup trailing whitespace and non tabular indents. + + * scripts/local-premount/resume: Use new resume bin from klibc-utils. + Removes superflous stat and awk usage. + + * debian/control: Depend against newer klibc-utils 1.4.11-1. + + * hooks/md, scripts/local-top/md: Drop as mdadm > 2.5-1 features them. + (closes: #367567) - -- maximilian attems Sun, 16 Jul 2006 21:50:34 +0200 + -- maximilian attems Wed, 19 Jul 2006 11:09:52 +0200 initramfs-tools (0.69b) unstable; urgency=high diff --git a/debian/control b/debian/control index a5a1cee..53caa8f 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/hooks/md b/hooks/md deleted file mode 100755 index df2abc8..0000000 --- a/hooks/md +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -if [ ! -x /sbin/mdadm ]; then - exit 0 -fi - -. /usr/share/initramfs-tools/hook-functions - -copy_exec /sbin/mdadm /sbin -copy_exec /sbin/mdrun /sbin - -for x in md linear raid0 raid1 raid5 raid6 raid10; do - manual_add_modules ${x} -done diff --git a/mkinitramfs b/mkinitramfs index 81a859e..0f1cb58 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -183,8 +183,11 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. +# klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib +rm -f ${DESTDIR}/bin/kinit ${DESTDIR}/bin/gzip + copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd ${CONFDIR}/scripts && \ diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 0c88ccc..059e7a4 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -24,6 +24,5 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + resume ${resume} fi diff --git a/scripts/local-top/md b/scripts/local-top/md deleted file mode 100755 index aa48474..0000000 --- a/scripts/local-top/md +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -/sbin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index 89b5c20..47e9ac1 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,7 @@ mountroot () roflag="-o rw" fi - nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} + mount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom -- cgit v1.2.3 From 5d46a04527bd3023e4f34cc99029ffc281f42110 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 29 Jul 2006 14:49:39 +0200 Subject: - take care of partial mdadm/lvm Sarge upgrades this compat stuff can go once Etch is released - framebuffer stuff for usplash - don't leave modules file behind - thanks piuparts! --- debian/changelog | 38 ++++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.postrm | 1 + hooks/lvm | 27 --------------------------- mkinitramfs | 17 +++++++++++++++++ scripts/init-top/framebuffer | 41 +++++++++++++++++++++++++++++++++++++++++ scripts/local-top/lvm | 6 +++++- scripts/local-top/mdraid | 41 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 143 insertions(+), 28 deletions(-) delete mode 100755 hooks/lvm create mode 100755 scripts/init-top/framebuffer create mode 100755 scripts/local-top/mdraid (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index e6f271b..a43c6b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +initramfs-tools (0.73) unstable; urgency=high + + * debian/initramfs-tools.postrm: Don't forget to remove config file + modules on purge. Thanks piuparts verification. + + * mkinitramfs: Add sections that deals with sarge mdadm and lvm2. + Does nothing if etch package hooks are installed, will be dropped + postetch as then we upgrade from mdadm and lvm2 packages with hooks. + Taken from Dapper initramfs-tools-0.40ubuntu32. Adapt to add more + modules and no need for mdrun. + + * hooks/lvm: Remove handled by mkinitramfs itself. + + * scripts/local-top/lvm: Add prereqs lvm2 + mdraid. Exit if lvm2 hook is + present. Eases transition of lvm hooks to lvm2. + + * scripts/local-top/mdraid: Enable all raid devices. Add mdadm as prereqs. + Only run if no mdadm hook is in initramfs. (closes: 380089) + + * urgency high upload to get RC fixes into testing. + + -- maximilian attems Sat, 29 Jul 2006 13:35:43 +0200 + +initramfs-tools (0.72) unstable; urgency=low + + * Add scripts/init-top/framebuffer, reduces ubuntu diff even more. + fb is only activated with splash or vga boot param. + * Upload sponsored by Petter Reinholdtsen. + + -- maximilian attems Tue, 25 Jul 2006 09:11:18 +0200 + +initramfs-tools (0.71b) unstable; urgency=low + + * This time caught on bzr dotfiles, removed. + Thanks a lot to Frederik Schüler for review. + + -- maximilian attems Mon, 24 Jul 2006 15:06:04 +0200 + initramfs-tools (0.71) unstable; urgency=low * initramfs.conf.5, initramfs-tools.8, mkinitramfs.8, mkinitramfs-kpkg.8, diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index b2f40bd..6896636 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -2,6 +2,7 @@ if [ "x${1}" = "xpurge" ]; then rm -f /etc/initramfs-tools/conf.d/resume + rm -f /etc/initramfs-tools/modules fi #DEBHELPER# diff --git a/hooks/lvm b/hooks/lvm deleted file mode 100755 index 49a8887..0000000 --- a/hooks/lvm +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -if [ ! -x /sbin/vgchange -a ! -d /lib/lvm-200 ]; then - exit 0 -fi - -. /usr/share/initramfs-tools/hook-functions - -copy_exec /lib/lvm-200/vgchange /sbin - -for x in dm_mod dm_snapshot dm_mirror; do - manual_add_modules ${x} -done diff --git a/mkinitramfs b/mkinitramfs index 52dea45..799b77e 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -228,6 +228,23 @@ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" 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 + mdadm --examine --scan > $DESTDIR/conf/mdadm.conf + copy_exec /sbin/mdadm /sbin + for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do + manual_add_modules ${x} + done +fi + +# 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 + copy_exec /lib/lvm-200/vgchange /sbin + for x in dm_mod dm_snapshot dm_mirror; do + manual_add_modules ${x} + done +fi + # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer new file mode 100755 index 0000000..4f0ab62 --- /dev/null +++ b/scripts/init-top/framebuffer @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +SPLASH=false; +VESA=false; + +for x in $(cat /proc/cmdline); do + case $x in + splash*) + SPLASH=true; + ;; + vga=*) + VESA=true; + ;; + esac +done + +if [ $SPLASH = "true" -o $VESA = "true" ]; then + modprobe -q fbcon + if [ $VESA = "true" ]; then + modprobe -q vesafb + else + modprobe -q vga16fb + fi + 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 diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 9a45220..f9d1490 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="mdadm" +PREREQ="mdadm mdraid lvm2" prereqs() { @@ -56,6 +56,10 @@ activate_vg() vgchange -ay ${vg} } +if [ -e /scripts/local-top/lvm2 ]; then + exit 0 +fi + if [ ! -e /sbin/vgchange ]; then exit 0 fi diff --git a/scripts/local-top/mdraid b/scripts/local-top/mdraid new file mode 100755 index 0000000..2cf3b5d --- /dev/null +++ b/scripts/local-top/mdraid @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="udev_helper" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ -e /scripts/local-top/mdadm ]; then + exit 0 +fi + +unset raidlvl +gotraid=n + +# Detect raid level +for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do + if [ ! -e ${x} ]; then + continue + fi + raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi +done + +[ "${gotraid}" = y ] || exit + +# Assemble all raid devices +mkdir /dev/md +mdadm --assemble --config=/etc/mdadm.conf --scan --run --auto=yes -- cgit v1.2.3 From 849c7c5f29f3689a4879204c23a6e89e2e6c0d7e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Oct 2006 08:52:12 +0200 Subject: - add backup handling to initramfs-tools - allow conservative settings for skipping updated initramfs. - debug output to screen - parse mbr for lilo + small fixes --- conf/update-initramfs.conf | 11 ++++++ debian/changelog | 38 ++++++++++++++++++++ debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + debian/initramfs-tools.preinst | 2 +- hooks/kernelextras | 1 - init | 4 +++ initramfs-tools.8 | 9 +++-- initramfs.conf.5 | 6 ++-- mkinitramfs.8 | 6 ++-- scripts/init-top/framebuffer | 69 +++++++++++++++++++++++++++++++----- update-initramfs | 78 +++++++++++++++++++++++++++++++++++++---- update-initramfs.8 | 6 ++-- update-initramfs.conf.5 | 26 ++++++++++++++ 14 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 conf/update-initramfs.conf create mode 100644 update-initramfs.conf.5 (limited to 'hooks') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf new file mode 100644 index 0000000..36c3dde --- /dev/null +++ b/conf/update-initramfs.conf @@ -0,0 +1,11 @@ +# +# Configuration file for update-initramfs(8) +# + +# +# update_initramfs [ yes | no ] +# +# Default is yes +# If set to no disables any update to initramfs beside kernel upgrade + +update_initramfs=yes diff --git a/debian/changelog b/debian/changelog index 2990625..1eaf2f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +initramfs-tools (0.83) unstable; urgency=high + + Release "Ois was du verzapfst is a koida Kaffee" + + * update-initramfs: Keep an initramfs backup while we are running. Do also + keep the booted initramfs as .bak in /boot. First helps on power cut. + Second is a good conservative approach and demanded feature. + Thanks Thiemo Nagel for report. (closes: 387780) + + * init: When debug is invoked with an additional arg, write output to + console. Thanks Christian Aichinger for the idea. + Should ease remote debugging. + + * initramfs-tools.8: Document new debug= feature. + + * initramfs-tools.preinstall: Check for right arg. (closes: 391619) + + * update-initramfs: Try to guess harder if lilo might need to be run + if grub is also around. On old installs we get _zero_ information from + /etc/kernel.img. Parse mbr for lilo signature. (closes: 385949) + Thanks to Michael Prokop for finetuning. + + * scripts/init-top/framebuffer: Parse video bootarg and refactor script. + This add support for custom framebuffer modules. (closes: 386441) + Thanks for the patch by David Härdeman . + + * update.conf: Allow to make "update-initramfs -u" an noop. Useful for + conservative settings of a remote server. (closes: 362064) urgency high. + Thanks Manoj Srivastava for the tough testing. + + * update-initramfs.conf.5: Document the new update_initramfs variable. + + * update-initramfs: Kope with stupid mv of grub to /usr/sbin. + + * manpages: Get a banana and mark myself as author. + + -- maximilian attems Fri, 13 Oct 2006 08:12:40 +0200 + initramfs-tools (0.82) unstable; urgency=high * Merge 0.69ubuntu15, plus 0.69ubuntu14 and 0.69ubuntu11 changelog entries diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 5514c2e..5b3d8a6 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -3,6 +3,7 @@ mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/initramfs-tools +conf/update-initramfs.conf etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools conf/modules usr/share/initramfs-tools diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index f127e99..0c88045 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -3,3 +3,4 @@ mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 +update-initramfs.conf.5 diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 7b02612..fc1fd06 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -3,7 +3,7 @@ set -e case "$1" in - configure) + install) if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d diff --git a/hooks/kernelextras b/hooks/kernelextras index 6bbd6b9..714e9a9 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -42,4 +42,3 @@ manual_add_modules vga16fb if [ ${fbcon} = "y" ]; then force_load fbcon fi - diff --git a/init b/init index 85f6291..fbe32be 100755 --- a/init +++ b/init @@ -110,6 +110,10 @@ for x in $(cat /proc/cmdline); do exec >/tmp/initramfs.debug 2>&1 set -x ;; + debug=*) + debug=y + set -x + ;; break=*) break=${x#break=} ;; diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 7af09e1..4ce53d3 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/08/19" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -96,7 +96,9 @@ sets an timeout on panic. Currently only zero value supported. .TP \fB \fI debug -generates lots of output to /tmp/initramfs.debug. +generates lots of output. It writes a log to /tmp/initramfs.debug. +Instead when invoked with an arbitrary argument output is written to console. +Use for example "debug=vc". .TP \fB \fI break @@ -443,7 +445,8 @@ cpio -i -d -H newc --no-absolute-filenames .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . +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 . diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 89e9f4b..ca47a02 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/09/02 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -58,8 +58,8 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. Loosely based on mkinitrd.conf by Herbert Xu. .SH SEE ALSO diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 9041ba6..23e719f 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/08/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -95,8 +95,8 @@ it to be loaded by ACPI. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 4f0ab62..bafbe19 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -13,27 +13,78 @@ prereqs) ;; esac + +# The options part of the kernel "video=" argument (i.e. everyting +# after "video=:") has very inconsistent rules. +# +# Generally the following applies: +# 1) options are comma-separated +# 2) options can be in either of these three forms: +# =, :, . +# 3) the "mode" option has the form x[M][R][-][@][i][m] +# and may or may not start with "mode=" +# +# When the options are used with modules, they need to be space-separated +# and the following conversions are needed: +# : -> = +# -> =1 +# -> mode= +parse_video_opts() +{ + local OPTS="$1" + local IFS="," + + # Must be a line like video=:,[opt2]... + if [ "$OPTS" = "${OPTS%%:*}" ]; then + return + fi + OPTS="${OPTS#*:}" + for opt in $OPTS; do + # Already in the "=" form + if [ "$opt" != "${opt#*=}" ]; then + echo -n "$opt " + # Presumably a modevalue without the "mode=" prefix + elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + echo -n "mode=$opt " + # Presumably a boolean + else + echo -n "$opt=1 " + fi + done +} + +FB="" +OPTS="" + SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do case $x in splash*) - SPLASH=true; + FB="vga16fb"; + OPTS=""; ;; vga=*) - VESA=true; + FB="vesafb"; + OPTS=""; ;; + video=*) + FB=${x#*=} + FB="${FB%%:*}" + OPTS="$(parse_video_opts "$TMP")" esac done -if [ $SPLASH = "true" -o $VESA = "true" ]; then - modprobe -q fbcon - if [ $VESA = "true" ]; then - modprobe -q vesafb - else - modprobe -q vga16fb - fi +if [ -n "$FB" ]; then + modprobe -q $FB $OPTS +fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + mknod /dev/fb$fbno 29 $fbno + done < /proc/fb + 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 diff --git a/update-initramfs b/update-initramfs index 45d4631..4995553 100755 --- a/update-initramfs +++ b/update-initramfs @@ -2,10 +2,13 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot +CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf set -e +[ -r ${CONF} ] && . ${CONF} + usage() { if [ -n "${1}" ]; then @@ -62,6 +65,46 @@ set_initramfs() initramfs="${BOOTDIR}/initrd.img-${version}" } + +# backup initramfs while running +backup_initramfs() +{ + [ ! -r "${initramfs}" ] && return 0 + initramfs_bak="${initramfs}.dpkg-bak" + [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}" + mv -f "${initramfs}" "${initramfs_bak}" + verbose "Keeping ${initramfs_bak}" +} + +# keep booted initramfs +backup_booted_initramfs() +{ + # chroot + [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 + + # no backup yet + initramfs_bak="${initramfs}.dpkg-bak" + if [ ! -r "${initramfs}.bak" ]; then + mv -f ${initramfs_bak} "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + + + # keep booted initramfs + uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) + if [ -n "$uptime_days" ]; then + boot_initramfs=$(find "${initramfs_bak}" -mtime +${uptime_days}) + fi + if [ -n "${boot_initramfs}" ]; then + mv -f "${initramfs_bak}" "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + verbose "Removing current backup ${initramfs_bak}" + rm -f ${initramfs_bak} +} + generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" @@ -91,11 +134,27 @@ run_lilo() fi } +# check if lilo is on mbr +mbr_check() +{ + boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) + [ -z "${boot}" ] && return 0 + [ ! -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 + echo + echo "WARNING: grub and lilo installed." + echo "If you use grub as bootloader everything is fine." + echo "If you use lilo as bootloader you must run lilo!" + echo +} + # only run lilo if no grub is around # or if "do_bootloader = yes" is set run_bootloader() { - if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then + 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}") @@ -103,13 +162,10 @@ run_bootloader() || [ "${do_b}" = "YES" ]; then run_lilo return 0 + else + mbr_check + return 0 fi - - echo - echo "WARNING: grub and lilo installed." - echo "If you use grub as bootloader everything is fine." - echo "If you use lilo as bootloader you must run lilo!" - echo fi return 0 fi @@ -228,6 +284,11 @@ create() update() { + if [ "${update_initramfs}" = "no" ]; then + echo "update-initramfs: Not updating initramfs." + exit 0 + fi + if [ -z "${version}" ]; then set_linked_version fi @@ -251,10 +312,13 @@ update() altered_check + backup_initramfs + generate_initramfs run_bootloader + backup_booted_initramfs } delete() diff --git a/update-initramfs.8 b/update-initramfs.8 index 871e9a5..a562349 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/06" $" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/10/12" $" "" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image @@ -85,8 +85,8 @@ 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 Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 new file mode 100644 index 0000000..551f6c9 --- /dev/null +++ b/update-initramfs.conf.5 @@ -0,0 +1,26 @@ +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" + +.SH NAME +update-initramfs.conf \- configuration file for update-initramfs + +.SH DESCRIPTION +The configuration file allows to disable the update action from +.B update-initramfs. + +.SH GENERAL VARIABLES +.TP +\fB update_initramfs +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 +the \fBupdate_initramfs -u\fP call. + +.SH AUTHOR +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). -- 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 'hooks') 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 1541218fe148cfae9c3a4ce84e7fd6692f3d2028 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 12 Apr 2007 21:56:32 +0200 Subject: Add support for loading keymaps. (closes: 337663) --- conf/initramfs.conf | 9 ++++++++ debian/changelog | 6 +++++- hooks/keymap | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ initramfs.conf.5 | 7 +++++++ mkinitramfs | 1 + scripts/init-top/keymap | 27 ++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 1 deletion(-) create mode 100755 hooks/keymap create mode 100755 scripts/init-top/keymap (limited to 'hooks') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index b0d1dc0..0620d26 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -17,6 +17,7 @@ MODULES=most +# # BUSYBOX: [ y | n ] # # Use busybox if available. @@ -24,6 +25,14 @@ MODULES=most BUSYBOX=y +# +# KEYMAP: [ y | n ] +# +# Load a keymap during the initramfs stage. +# + +KEYMAP=n + # # NFS Section of the config. # diff --git a/debian/changelog b/debian/changelog index 0da1fed..f224405 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,14 @@ initramfs-tools (0.87) UNRELEASED; urgency=low + [ maximilian attems ] * scripts/functions: reduce_satisfied() needs to ignore the same set as set_initlist() otherwise an script having a prereqs on a non-executable boot script may cause circular panic. (closes: 418509) - -- maximilian attems Wed, 11 Apr 2007 00:07:18 +0200 + [ David Härdeman ] + * Add support for loading keymaps. (closes: 337663) + + -- David Härdeman Thu, 12 Apr 2007 21:28:45 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/hooks/keymap b/hooks/keymap new file mode 100755 index 0000000..749f24c --- /dev/null +++ b/hooks/keymap @@ -0,0 +1,55 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hook to load keymaps into the initramfs if requested by KEYMAP="y" +if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then + exit 0 +fi + +# Step 1 - Basic tools +if [ ! -x /bin/loadkeys ] || [ ! -r /etc/console/boottime.kmap.gz ]; then + exit 0 +fi + +. /usr/share/initramfs-tools/hook-functions +copy_exec /bin/loadkeys /bin +cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc + +# Step 2 - Check for UTF8 console +if [ ! -x /usr/bin/kbd_mode ]; then + exit 0 +fi + +if [ -r /etc/environment ]; then + env="/etc/environment" +elif [ -r /etc/default/locale ]; then + env="/etc/default/locale" +else + exit 0 +fi + +for var in LANG LC_ALL LC_CTYPE; do + value=$(egrep "^[^#]*${var}=" $env | tail -n1 | cut -d= -f2) + eval $var=$value +done + +charmap=$(LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap) +if [ "$charmap" = "UTF-8" ]; then + copy_exec /usr/bin/kbd_mode /bin +fi +exit 0 + diff --git a/initramfs.conf.5 b/initramfs.conf.5 index e685298..55d6629 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -40,6 +40,13 @@ If set to 'n' will build an initramfs without busybox. Beware that many boot scripts need busybox utilities. +.TP +\fB KEYMAP +If set to 'y', the console keymap will be loaded during the initramfs stage. +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. + .SH NFS VARIABLES .TP \fB BOOT diff --git a/mkinitramfs b/mkinitramfs index 17e1846..7d73ba1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -163,6 +163,7 @@ export CONFDIR export DESTDIR export DPKG_ARCH export verbose +export KEYMAP # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ diff --git a/scripts/init-top/keymap b/scripts/init-top/keymap new file mode 100755 index 0000000..f011abf --- /dev/null +++ b/scripts/init-top/keymap @@ -0,0 +1,27 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +OPTS="-q" + +# Should terminal be in UTF8 mode? +if [ -x /bin/kbd_mode ]; then + /bin/kbd_mode -u + OPTS="${OPTS} -u" +fi + +# Load custom keymap +if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then + loadkeys ${OPTS} /etc/boottime.kmap.gz +fi -- cgit v1.2.3 From f8ccffbf604d146b7fc6bab77fcf1862bbe59de8 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 21:02:50 +0200 Subject: Move legacy code from mkinitramfs to separate hooks. --- debian/changelog | 3 ++- hooks/legacy-lvm | 26 ++++++++++++++++++++++++++ hooks/legacy-mdadm | 38 ++++++++++++++++++++++++++++++++++++++ mkinitramfs | 30 ------------------------------ 4 files changed, 66 insertions(+), 31 deletions(-) create mode 100755 hooks/legacy-lvm create mode 100755 hooks/legacy-mdadm (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 1476018..a20ad86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,11 +9,12 @@ initramfs-tools (0.87) UNRELEASED; urgency=low [ David Härdeman ] * Add support for loading keymaps. (closes: 337663) + * Move legacy code from mkinitramfs to separate hooks. * 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 + -- David Härdeman Fri, 13 Apr 2007 21:01:11 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/hooks/legacy-lvm b/hooks/legacy-lvm new file mode 100755 index 0000000..ffdf038 --- /dev/null +++ b/hooks/legacy-lvm @@ -0,0 +1,26 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# FIXME: Remove this hook after Lenny releases +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} + done +fi +exit 0 diff --git a/hooks/legacy-mdadm b/hooks/legacy-mdadm new file mode 100755 index 0000000..66c6d8e --- /dev/null +++ b/hooks/legacy-mdadm @@ -0,0 +1,38 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# FIXME: Remove this hook after Etch releases +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}" > ${DESTDIR}/conf/mdrun.conf + mdadm=$(mdadm --detail "${rootraiddev}") + echo "${mdadm}" | awk ' + $1 == "Number" && $2 == "Major" { start = 1; next } + $1 == "UUID" { print "uuid=" $3; next } + !start { next } + $2 == 0 && $3 == 0 { next } + { devices = devices " " $NF } + END { print "devices='\''" devices "'\''" }' \ + >> ${DESTDIR}/conf/mdrun.conf + copy_exec /sbin/mdadm /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 +exit 0 diff --git a/mkinitramfs b/mkinitramfs index 0197937..b3514fc 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -252,36 +252,6 @@ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks -# FIXME: Remove this Raid block after Etch releases -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}" > ${DESTDIR}/conf/mdrun.conf - mdadm=$(mdadm --detail "${rootraiddev}") - echo "${mdadm}" | awk ' - $1 == "Number" && $2 == "Major" { start = 1; next } - $1 == "UUID" { print "uuid=" $3; next } - !start { next } - $2 == 0 && $3 == 0 { next } - { devices = devices " " $NF } - END { print "devices='\''" devices "'\''" }' \ - >> ${DESTDIR}/conf/mdrun.conf - copy_exec /sbin/mdadm /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 Lenny releases -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} - done -fi - # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / -- cgit v1.2.3 From f6553b9bbae01b2908401405b9ea3ca484f74d5b Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 14 Apr 2007 20:03:47 +0200 Subject: Oops, remove dashes from filenames --- hooks/legacy-lvm | 26 -------------------------- hooks/legacy-mdadm | 38 -------------------------------------- hooks/legacylvm | 26 ++++++++++++++++++++++++++ hooks/legacymdadm | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 64 deletions(-) delete mode 100755 hooks/legacy-lvm delete mode 100755 hooks/legacy-mdadm create mode 100755 hooks/legacylvm create mode 100755 hooks/legacymdadm (limited to 'hooks') diff --git a/hooks/legacy-lvm b/hooks/legacy-lvm deleted file mode 100755 index ffdf038..0000000 --- a/hooks/legacy-lvm +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# FIXME: Remove this hook after Lenny releases -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} - done -fi -exit 0 diff --git a/hooks/legacy-mdadm b/hooks/legacy-mdadm deleted file mode 100755 index 66c6d8e..0000000 --- a/hooks/legacy-mdadm +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# FIXME: Remove this hook after Etch releases -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}" > ${DESTDIR}/conf/mdrun.conf - mdadm=$(mdadm --detail "${rootraiddev}") - echo "${mdadm}" | awk ' - $1 == "Number" && $2 == "Major" { start = 1; next } - $1 == "UUID" { print "uuid=" $3; next } - !start { next } - $2 == 0 && $3 == 0 { next } - { devices = devices " " $NF } - END { print "devices='\''" devices "'\''" }' \ - >> ${DESTDIR}/conf/mdrun.conf - copy_exec /sbin/mdadm /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 -exit 0 diff --git a/hooks/legacylvm b/hooks/legacylvm new file mode 100755 index 0000000..ffdf038 --- /dev/null +++ b/hooks/legacylvm @@ -0,0 +1,26 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# FIXME: Remove this hook after Lenny releases +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} + done +fi +exit 0 diff --git a/hooks/legacymdadm b/hooks/legacymdadm new file mode 100755 index 0000000..66c6d8e --- /dev/null +++ b/hooks/legacymdadm @@ -0,0 +1,38 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# FIXME: Remove this hook after Etch releases +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}" > ${DESTDIR}/conf/mdrun.conf + mdadm=$(mdadm --detail "${rootraiddev}") + echo "${mdadm}" | awk ' + $1 == "Number" && $2 == "Major" { start = 1; next } + $1 == "UUID" { print "uuid=" $3; next } + !start { next } + $2 == 0 && $3 == 0 { next } + { devices = devices " " $NF } + END { print "devices='\''" devices "'\''" }' \ + >> ${DESTDIR}/conf/mdrun.conf + copy_exec /sbin/mdadm /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 +exit 0 -- cgit v1.2.3 From 2c12a02f54098c18b05d450d739440f05f638ab2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Apr 2007 12:03:33 +0200 Subject: release 0.87b: cleanup legacy hooks - remove legacymdadm - source hook-functions in legacylvm --- debian/changelog | 8 ++++++-- hooks/legacylvm | 2 ++ hooks/legacymdadm | 38 -------------------------------------- 3 files changed, 8 insertions(+), 40 deletions(-) delete mode 100755 hooks/legacymdadm (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 62fef53..b36c9a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,13 @@ -initramfs-tools (0.88) UNRELEASED; urgency=low +initramfs-tools (0.87b) unstable; urgency=low * scripts/init-top/framebuffer: Remove vga16fb loading on splash bootarg. Newer usplash > 0.4 no longer needs that. - -- maximilian attems Mon, 16 Apr 2007 22:05:18 +0200 + * hooks/legacymdadm: remove only needed for partial upgrades from sarge. + + * hooks/legacylvm: Source relevant functions. (closes: 419667) + + -- maximilian attems Tue, 17 Apr 2007 11:56:58 +0200 initramfs-tools (0.87) unstable; urgency=low diff --git a/hooks/legacylvm b/hooks/legacylvm index ffdf038..9121f90 100755 --- a/hooks/legacylvm +++ b/hooks/legacylvm @@ -16,6 +16,8 @@ prereqs) esac # FIXME: Remove this hook after Lenny releases +. /usr/share/initramfs-tools/hook-functions + if [ -x /sbin/vgchange ] && [ -d /lib/lvm-200 ] \ && [ ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then copy_exec /lib/lvm-200/vgchange /sbin diff --git a/hooks/legacymdadm b/hooks/legacymdadm deleted file mode 100755 index 66c6d8e..0000000 --- a/hooks/legacymdadm +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# FIXME: Remove this hook after Etch releases -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}" > ${DESTDIR}/conf/mdrun.conf - mdadm=$(mdadm --detail "${rootraiddev}") - echo "${mdadm}" | awk ' - $1 == "Number" && $2 == "Major" { start = 1; next } - $1 == "UUID" { print "uuid=" $3; next } - !start { next } - $2 == 0 && $3 == 0 { next } - { devices = devices " " $NF } - END { print "devices='\''" devices "'\''" }' \ - >> ${DESTDIR}/conf/mdrun.conf - copy_exec /sbin/mdadm /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 -exit 0 -- cgit v1.2.3 From f26697d21e617646da61bed3c88e48be1d781cf5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Aug 2007 10:10:40 +0200 Subject: mkinitramfs, hooks/keymap: add trailing slash to cp destionation just make sure we really copy into a dir and not a file. --- debian/changelog | 3 ++- hooks/keymap | 2 +- mkinitramfs | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index 1031a50..07bf916 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * mkinitramfs: Cope when no busybox is around warn on md/lvm root. * mkinitramfs: Kill kinit.shared too. * scripts/local: Quote readonly variable. (LP: #115807) + * mkinitramfs, scripts/keymap: Add trailing slash on cp destination for dir. - -- maximilian attems Sat, 25 Aug 2007 19:10:20 +0200 + -- maximilian attems Mon, 27 Aug 2007 10:09:25 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hooks/keymap b/hooks/keymap index 749f24c..a2b1b08 100755 --- a/hooks/keymap +++ b/hooks/keymap @@ -27,7 +27,7 @@ fi . /usr/share/initramfs-tools/hook-functions copy_exec /bin/loadkeys /bin -cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc +cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc/ # Step 2 - Check for UTF8 console if [ ! -x /usr/bin/kbd_mode ]; then diff --git a/mkinitramfs b/mkinitramfs index 90a7702..4ba9cd4 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -219,13 +219,13 @@ for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" cp -p "/usr/share/initramfs-tools/scripts/${b}" \ - "${DESTDIR}/scripts/$(dirname "${b}")" + "${DESTDIR}/scripts/$(dirname "${b}")/" done for b in $(cd "${CONFDIR}/scripts" && find . \ -regextype posix-extended -regex '.*/[[:alnum:]_]+$' -type f); do [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" - cp -p "${CONFDIR}/scripts/${b}" "${DESTDIR}/scripts/$(dirname "${b}")" + cp -p "${CONFDIR}/scripts/${b}" "${DESTDIR}/scripts/$(dirname "${b}")/" done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf @@ -264,11 +264,11 @@ copy_exec /sbin/modprobe /sbin copy_exec /sbin/depmod /sbin copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" -cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" +cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/" # workaround: libgcc always needed on old-abi arm if [ "$DPKG_ARCH" = arm ] || [ "$DPKG_ARCH" = armeb ]; then - cp -a /lib/libgcc_s.so.1 "${DESTDIR}/lib" + cp -a /lib/libgcc_s.so.1 "${DESTDIR}/lib/" fi run_scripts /usr/share/initramfs-tools/hooks -- cgit v1.2.3 From 89ba49b87ef14314223222d751e01373b0ec08a6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 4 Oct 2007 12:04:51 +0200 Subject: hooks/udevhelper: Adding all /lib/udev on initramfs if missing. Due to overly strict errexit usage by udev hook a lot might be missing. This is an potential Etch -> Lenny upgrade issue. (closes: 431291) fixes boot failure on UUID and LABEL root for those. it seems much better to add this stupid hook than to pump udev dep. Thanks Michael Prokop for report. --- debian/changelog | 9 +++++++++ hooks/udevhelper | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 hooks/udevhelper (limited to 'hooks') diff --git a/debian/changelog b/debian/changelog index bf48bff..2916413 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.91b) unstable; urgency=low + + * hooks/udevhelper: Adding all /lib/udev on initramfs if missing. Due to + overly strict errexit usage by udev hook functionality might be missing. + This is an potential Etch Lenny upgrade issue on UUID and LABEL roots. + Thanks Michael Prokop for report. (closes: 431291) + + -- maximilian attems Thu, 04 Oct 2007 12:00:33 +0200 + initramfs-tools (0.91a) unstable; urgency=low * init: Fix resuming with hardcoded uppercase RESUME variable. diff --git a/hooks/udevhelper b/hooks/udevhelper new file mode 100755 index 0000000..44e1d5d --- /dev/null +++ b/hooks/udevhelper @@ -0,0 +1,37 @@ +#!/bin/sh +# FIXME: kill after lenny release +# needed for UUID root and partial etch upgrades +# +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +# should never happen +if [ ! -e $DESTDIR/lib/udev/ ]; then + exit 0 +fi + +# fixed udev hook +if [ -e $DESTDIR/lib/udev/ ] && [ -e $DESTDIR/lib/udev/hotplug.functions ]; then + exit 0 +fi + +cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/ +copy_exec /lib/udev/ide.agent /lib/udev/ +for program in /lib/udev/*_id; do + copy_exec $program /lib/udev/ +done +exit 0 -- cgit v1.2.3 From 7ee28b9785f2ec6d8a36b17da60e2f1766f69708 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 7 Jul 2008 13:51:02 +0200 Subject: udevhelper: drop ide.agent. no longer exists and only needed for kernel older then Etch. --- hooks/udevhelper | 1 - 1 file changed, 1 deletion(-) (limited to 'hooks') diff --git a/hooks/udevhelper b/hooks/udevhelper index 44e1d5d..f86e4af 100755 --- a/hooks/udevhelper +++ b/hooks/udevhelper @@ -30,7 +30,6 @@ if [ -e $DESTDIR/lib/udev/ ] && [ -e $DESTDIR/lib/udev/hotplug.functions ]; then fi cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/ -copy_exec /lib/udev/ide.agent /lib/udev/ for program in /lib/udev/*_id; do copy_exec $program /lib/udev/ done -- cgit v1.2.3 From 69f3bc844364feff08f6e5ccdfc0599f9f4088cb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 19:59:17 +0100 Subject: nuke old lvm hook scripts since Lenny lvm2 ships it's own hooks scripts, no need to dup. --- hooks/legacylvm | 28 ------------------- scripts/local-top/lvm | 74 --------------------------------------------------- 2 files changed, 102 deletions(-) delete mode 100755 hooks/legacylvm delete mode 100755 scripts/local-top/lvm (limited to 'hooks') diff --git a/hooks/legacylvm b/hooks/legacylvm deleted file mode 100755 index 9121f90..0000000 --- a/hooks/legacylvm +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# FIXME: Remove this hook after Lenny releases -. /usr/share/initramfs-tools/hook-functions - -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} - done -fi -exit 0 diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm deleted file mode 100755 index 4cf48ad..0000000 --- a/scripts/local-top/lvm +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -PREREQ="mdadm mdrun lvm2" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -activate_vg() -{ - local vg="$1" - - # Make sure that we have a non-empty argument - if [ -z "${vg}" ]; then - return 1 - fi - - # Take care of lilo boot arg, risky activating of all vg - case $vg in - fe[0-9]*) - vgchange -ay - exit 0 - ;; - # FIXME: check major - /dev/root) - vgchange -ay - exit 0 - ;; - esac - - # Make sure that we have a d-m path - vg=${vg#/dev/mapper/} - if [ "$vg" = "$1" ]; then - return 1 - fi - - # Make sure that the device includes at least one dash - if [ "$(echo -n "$vg" | tr -d -)" = "$vg" ]; then - return 1 - fi - - # 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} -} - -if [ -e /scripts/local-top/lvm2 ]; then - exit 0 -fi - -if [ ! -e /sbin/vgchange ]; then - exit 0 -fi - -modprobe dm-mod -modprobe dm-snapshot -modprobe dm-mirror - -activate_vg "$ROOT" -activate_vg "$resume" - -exit 0 -- cgit v1.2.3 From af506d1ca8c8fac8fe9ca982dcdbddab8cc80f7c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 20:45:19 +0100 Subject: udevhelper: nuke as need for partial upgrades between etch/lenny. not needed anymore.. --- hooks/udevhelper | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 hooks/udevhelper (limited to 'hooks') diff --git a/hooks/udevhelper b/hooks/udevhelper deleted file mode 100755 index f86e4af..0000000 --- a/hooks/udevhelper +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# FIXME: kill after lenny release -# needed for UUID root and partial etch upgrades -# -PREREQ="udev" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions - -# should never happen -if [ ! -e $DESTDIR/lib/udev/ ]; then - exit 0 -fi - -# fixed udev hook -if [ -e $DESTDIR/lib/udev/ ] && [ -e $DESTDIR/lib/udev/hotplug.functions ]; then - exit 0 -fi - -cp /lib/udev/hotplug.functions $DESTDIR/lib/udev/ -for program in /lib/udev/*_id; do - copy_exec $program /lib/udev/ -done -exit 0 -- cgit v1.2.3 From a55e9b4865c15d3572d93132cfee1d0a53223d29 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 1 Apr 2009 17:38:38 +0200 Subject: hooks/thermal: Prevent inclusion of windfarm modules on PS3. Do not load thermal control for macintosh if the device is a PS3. fixes cosmetic issue of boot messages: FATAL: Error inserting therm_pm72 (/lib/modules/2.6.28-4-powerpc64-smp/kernel/drivers/macintosh/therm_pm72.ko): No such device FATAL: Error inserting windfarm_pm112 (/lib/modules/2.6.28-4-powerpc64-smp/kernel/drivers/macintosh/windfarm_pm112.ko): No such device (LP: #346899) this is a port of the 0.92bubuntu26 patch. Reported-by: Arnaud Jeansen --- hooks/thermal | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hooks') diff --git a/hooks/thermal b/hooks/thermal index ece7243..aa10ebf 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -22,6 +22,9 @@ esac case "$DPKG_ARCH" in # copy the right modules powerpc|ppc64) + if [ -e /sys/bus/ps3_system_bus/ ]; then + exit 0 + fi manual_add_modules therm_pm72 manual_add_modules windfarm_core manual_add_modules windfarm_cpufreq_clamp -- cgit v1.2.3 From c5e39cd1cb1dc9f6a18de07e137ef47ecc8f8cc6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:05:48 +0200 Subject: nuke thermal hooks thrive for a smaller initramfs, were loading of the modules is so fast that acpi should be loaeded by udev after init(8) call. Signed-off-by: maximilian attems --- hooks/thermal | 46 ------------------------------------------- scripts/init-premount/thermal | 44 ----------------------------------------- 2 files changed, 90 deletions(-) delete mode 100755 hooks/thermal delete mode 100755 scripts/init-premount/thermal (limited to 'hooks') diff --git a/hooks/thermal b/hooks/thermal deleted file mode 100755 index aa10ebf..0000000 --- a/hooks/thermal +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# Hooks for loading thermal bits into the initramfs - -. /usr/share/initramfs-tools/hook-functions - -case "$DPKG_ARCH" in -# copy the right modules -powerpc|ppc64) - if [ -e /sys/bus/ps3_system_bus/ ]; then - exit 0 - fi - 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) - manual_add_modules fan - manual_add_modules thermal - ;; -esac diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal deleted file mode 100755 index 0215edb..0000000 --- a/scripts/init-premount/thermal +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -case "$DPKG_ARCH" in -# load the right modules -powerpc|ppc64) - 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) - for x in $(cat /proc/cmdline); do - case ${x} in - acpi=off) - exit 0 - ;; - esac - done - modprobe fan - modprobe thermal - ;; -esac -- cgit v1.2.3 From e98b48021205f1cc21db96cdcabab909b6db5e86 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:12:39 +0200 Subject: create a klibc hook script we may soon no longer need it, so move it out to its own, so it can be more easily played with. Signed-off-by: maximilian attems --- hooks/klibc | 21 +++++++++++++++++++++ mkinitramfs | 5 ----- 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 hooks/klibc (limited to 'hooks') diff --git a/hooks/klibc b/hooks/klibc new file mode 100644 index 0000000..b563307 --- /dev/null +++ b/hooks/klibc @@ -0,0 +1,21 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# klibc +ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin +ln -s /lib/klibc-*.so ${DESTDIR}/lib +rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip diff --git a/mkinitramfs b/mkinitramfs index 19972fb..11f44f8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -199,11 +199,6 @@ esac # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -# klibc -ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /lib/klibc-*.so ${DESTDIR}/lib -rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip - cp -p /usr/share/initramfs-tools/init ${DESTDIR}/init # add existant boot scripts -- cgit v1.2.3 From 0bb01935dd103bc64462ad2f8774773b5e594098 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:45:47 +0200 Subject: nuke kernelextras hook adds fbcon vga16fb for usplash, as this not useful for default just remove it. Signed-off-by: maximilian attems --- hooks/kernelextras | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 hooks/kernelextras (limited to 'hooks') diff --git a/hooks/kernelextras b/hooks/kernelextras deleted file mode 100755 index 714e9a9..0000000 --- a/hooks/kernelextras +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# Hooks for 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 - '*') - break - ;; - *fb) - fbcon=y - ;; - esac - - 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 -- cgit v1.2.3 From a71705c44cc48a31ad57443dbbdb1fdf8815f9fb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:51:59 +0200 Subject: klibc remove zcat and gunzip not really used in initramfs. Signed-off-by: maximilian attems --- hooks/klibc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 hooks/klibc (limited to 'hooks') diff --git a/hooks/klibc b/hooks/klibc old mode 100644 new mode 100755 index b563307..c6bb75e --- a/hooks/klibc +++ b/hooks/klibc @@ -18,4 +18,4 @@ esac # klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib -rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip +rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat ${DESTDIR}/bin/gunzip -- cgit v1.2.3 From eea7e5df69e993feeb39e664105016b89e0e09e6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:57:15 +0200 Subject: move busybox addition to a hook script thus export the 2 needed busybox variables, be sure to have the klibc shell for now around. Signed-off-by: maximilian attems --- hooks/busybox | 31 +++++++++++++++++++++++++++++++ hooks/klibc | 3 +++ mkinitramfs | 18 ++---------------- 3 files changed, 36 insertions(+), 16 deletions(-) create mode 100755 hooks/busybox (limited to 'hooks') diff --git a/hooks/busybox b/hooks/busybox new file mode 100755 index 0000000..7845f58 --- /dev/null +++ b/hooks/busybox @@ -0,0 +1,31 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# busybox +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!" + fi +else + . /usr/share/initramfs-tools/hook-functions + rm -f ${DESTDIR}/bin/sh + rm -f ${DESTDIR}/bin/busybox + copy_exec ${BUSYBOXDIR}/busybox /bin/busybox + ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh +fi diff --git a/hooks/klibc b/hooks/klibc index c6bb75e..56f49ef 100755 --- a/hooks/klibc +++ b/hooks/klibc @@ -19,3 +19,6 @@ esac ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat ${DESTDIR}/bin/gunzip +if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then + mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh +fi diff --git a/mkinitramfs b/mkinitramfs index 11f44f8..f4f122c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -9,7 +9,7 @@ CONFDIR="/etc/initramfs-tools" verbose="n" errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" -BUSYBOXDIR="/bin" +export BUSYBOXDIR="/bin" OPTIONS=`getopt -o d:ko:r:v -n "$0" -- "$@"` @@ -153,6 +153,7 @@ export DPKG_ARCH export verbose export KEYMAP export MODULES +export BUSYBOX # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ @@ -231,21 +232,6 @@ if [ -n "${ROOT}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi -# Busybox -if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then - mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh - # 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!" - fi -else - rm -f ${DESTDIR}/bin/sh - rm -f ${DESTDIR}/bin/busybox - copy_exec ${BUSYBOXDIR}/busybox /bin/busybox - ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh -fi - # Modutils copy_exec /sbin/modprobe /sbin copy_exec /sbin/depmod /sbin -- cgit v1.2.3 From 0830e97339add137d56d13cdbe07282f3cdba8f6 Mon Sep 17 00:00:00 2001 From: Maximilian Gass Date: Sat, 6 Feb 2010 21:01:14 +0100 Subject: mkinitramfs: KEYMAP option fails to work due to missing keymap I have attached a patch that makes the keymap hook consider /etc/console-setup/cached.kmap.gz. I have also added gunzip to the initramfs because otherwise loadkeys complained that it was missing and failed to load the keymap. (closes: #565416) Signed-off-by: maximilian attems --- hooks/keymap | 11 +++++++++-- hooks/klibc | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'hooks') diff --git a/hooks/keymap b/hooks/keymap index a2b1b08..fa97209 100755 --- a/hooks/keymap +++ b/hooks/keymap @@ -21,13 +21,20 @@ if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then fi # Step 1 - Basic tools -if [ ! -x /bin/loadkeys ] || [ ! -r /etc/console/boottime.kmap.gz ]; then +if [ ! -x /bin/loadkeys ] || +! ( [ -r /etc/console/boottime.kmap.gz ] \ + || [ -r /etc/console-setup/cached.kmap.gz ] ); then exit 0 fi . /usr/share/initramfs-tools/hook-functions copy_exec /bin/loadkeys /bin -cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc/ + +if [ -e /etc/console-setup/cached.kmap.gz ]; then + cp /etc/console-setup/cached.kmap.gz ${DESTDIR}/etc/boottime.kmap.gz +else + cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc/ +fi # Step 2 - Check for UTF8 console if [ ! -x /usr/bin/kbd_mode ]; then diff --git a/hooks/klibc b/hooks/klibc index 56f49ef..663e22c 100755 --- a/hooks/klibc +++ b/hooks/klibc @@ -18,7 +18,7 @@ esac # klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib -rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat ${DESTDIR}/bin/gunzip +rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh fi -- cgit v1.2.3 From 26db93c6b88a5cc9147ba4dfd5f29a898fecc031 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 03:43:46 +0200 Subject: Keep acpi modules in initramfs so that udev can load them early partialy revert "nuke thermal hooks", this is needed for broken hardware. no point in us loading them, as udev will do it anyway and should soon run earlier. This reverts commit c5e39cd1cb1dc9f6a18de07e137ef47ecc8f8cc6. --- hooks/thermal | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 hooks/thermal (limited to 'hooks') diff --git a/hooks/thermal b/hooks/thermal new file mode 100755 index 0000000..aa10ebf --- /dev/null +++ b/hooks/thermal @@ -0,0 +1,46 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading thermal bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +case "$DPKG_ARCH" in +# copy the right modules +powerpc|ppc64) + if [ -e /sys/bus/ps3_system_bus/ ]; then + exit 0 + fi + 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) + manual_add_modules fan + manual_add_modules thermal + ;; +esac -- cgit v1.2.3 From 6eb4c51793fd97b397760ab2336fdfb0c42e45a1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 04:55:41 +0200 Subject: hooks/klibc: Keep gzip in initramfs merge from 0.92bubuntu1 Signed-off-by: maximilian attems --- hooks/klibc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hooks') diff --git a/hooks/klibc b/hooks/klibc index 663e22c..ad0a85d 100755 --- a/hooks/klibc +++ b/hooks/klibc @@ -18,7 +18,7 @@ esac # klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib -rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat +rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/zcat if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh fi -- 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 'hooks') 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 'hooks') 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