From de9c780f57ae626f05ec1c971c56648250cba03c Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 8 Jun 2005 21:13:41 +0000 Subject: Initial checkin --- conf/initramfs.conf | 50 +++++++++++ conf/modules | 7 ++ debian/README | 12 +++ debian/TODO | 8 ++ debian/changelog | 64 ++++++++++++++ debian/compat | 1 + debian/control | 12 +++ debian/copyright | 10 +++ debian/files | 1 + debian/initramfs-tools.examples | 1 + debian/initramfs-tools.install | 4 + debian/initramfs-tools.postinst | 10 +++ debian/initramfs-tools.postrm | 8 ++ debian/initramfs-tools/DEBIAN/conffiles | 1 + debian/initramfs-tools/DEBIAN/control | 10 +++ debian/initramfs-tools/DEBIAN/md5sums | 9 ++ debian/initramfs-tools/DEBIAN/postinst | 10 +++ debian/initramfs-tools/DEBIAN/postrm | 8 ++ .../initramfs-tools/etc/mkinitramfs/initramfs.conf | 50 +++++++++++ debian/initramfs-tools/usr/sbin/mkinitramfs | 93 +++++++++++++++++++++ .../usr/share/doc/initramfs-tools/TODO | 8 ++ .../usr/share/doc/initramfs-tools/changelog.gz | Bin 0 -> 784 bytes .../usr/share/doc/initramfs-tools/copyright | 10 +++ .../usr/share/doc/initramfs-tools/examples/modules | 7 ++ .../initramfs-tools/usr/share/initramfs-tools/init | 64 ++++++++++++++ .../usr/share/initramfs-tools/scripts/functions | 9 ++ .../usr/share/initramfs-tools/scripts/local | 15 ++++ .../usr/share/initramfs-tools/scripts/nfs | 11 +++ debian/rules | 6 ++ init | 64 ++++++++++++++ mkinitramfs | 93 +++++++++++++++++++++ scripts/functions | 9 ++ scripts/local | 15 ++++ scripts/nfs | 11 +++ 34 files changed, 691 insertions(+) create mode 100644 conf/initramfs.conf create mode 100644 conf/modules create mode 100644 debian/README create mode 100644 debian/TODO create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/files create mode 100644 debian/initramfs-tools.examples create mode 100644 debian/initramfs-tools.install create mode 100644 debian/initramfs-tools.postinst create mode 100644 debian/initramfs-tools.postrm create mode 100644 debian/initramfs-tools/DEBIAN/conffiles create mode 100644 debian/initramfs-tools/DEBIAN/control create mode 100644 debian/initramfs-tools/DEBIAN/md5sums create mode 100644 debian/initramfs-tools/DEBIAN/postinst create mode 100644 debian/initramfs-tools/DEBIAN/postrm create mode 100644 debian/initramfs-tools/etc/mkinitramfs/initramfs.conf create mode 100644 debian/initramfs-tools/usr/sbin/mkinitramfs create mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO create mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz create mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright create mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules create mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/init create mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions create mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/local create mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs create mode 100644 debian/rules create mode 100644 init create mode 100644 mkinitramfs create mode 100644 scripts/functions create mode 100644 scripts/local create mode 100644 scripts/nfs diff --git a/conf/initramfs.conf b/conf/initramfs.conf new file mode 100644 index 0000000..a056469 --- /dev/null +++ b/conf/initramfs.conf @@ -0,0 +1,50 @@ +# +# initramfs.conf +# + +# BUSYBOX: [ y | n ] +# +# Use busybox if available. You MUST use the -static version +# + +BUSYBOX=n + +# +# BOOT: [ local | nfs ] +# +# local - Boot off of local media (harddrive, USB stick). +# +# nfs - Boot using an NFS drive as the root of the drive. +# + +BOOT=local + +# +# MODULES: [ most | dep | list ] +# +# most - Add all framebuffer, acpi, filesystem, and harddrive drivers. +# +# dep - Try and guess which modules to load. +# +# list - Only include modules from the 'additional modules' list +# +MODULES=list + +# +# NFS Section of the config. +# + +# +# DEVICE: ... +# +# Specify the network device, like eth0 +# + +DEVICE=eth0 + +# +# NFSROOT: [ auto | HOST:MOUNT ] +# + +NFSROOT=auto + diff --git a/conf/modules b/conf/modules new file mode 100644 index 0000000..ee1310a --- /dev/null +++ b/conf/modules @@ -0,0 +1,7 @@ +# List of modules that you want to include in your initramfs. +# This might be good choices: +# +#ide-disk +#ide-generic +#ext2 +#ext3 diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..dc85c9b --- /dev/null +++ b/debian/README @@ -0,0 +1,12 @@ +initramfs-tools +=============== + +This package is a work in progress towards the replacement of the initrd +system with an initramfs system. + +The goals include using klibc for all earlyspace tools, an integrated udev +and an integrated hotplug. + +See the TODO file for a current status. + +Jeff Bailey - 2005-04-24 diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..bf7e07d --- /dev/null +++ b/debian/TODO @@ -0,0 +1,8 @@ +TODO +==== + + o Get udev compiled against klibc + + o Integrate hotplug-ng + + o Add option to make-kpkg to use mkinitramfs diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8a999a1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,64 @@ +initramfs-tools (0.6) breezy; urgency=low + + The "Sweep! .... Off!" release. + + * Source in the net-${DEVICE}.conf file to get IP address information. + + * Add commandline parameters for NFSROOT and BOOT. + + * Moving loading of boot functions to after commandline parsing. + + * Allow NFSROOT variable to be set to auto to pick up value from DHCP + Server. + + -- Jeff Bailey Wed, 1 Jun 2005 12:02:40 -0400 + +initramfs-tools (0.5) breezy; urgency=low + + The "Climbing to the horizons" release. + + * Update for newer udev, call "udevstart" rather than "udev udevstart" + + * /etc/mkinitramfs/modules should not be a conffile. + + * Support busybox. + + * Fix bug where -k would delete the tmp files, and otherwise it would keep + them. + + * Handle # for comments in the modules file. + + * arch:all, not arch:any + + -- Jeff Bailey Tue, 31 May 2005 15:17:56 -0400 + +initramfs-tools (0.4) breezy; urgency=low + + * First upload to Ubuntu. + + * Handle glibc compiled udev for now. + + -- Jeff Bailey Tue, 24 May 2005 14:30:07 +0000 + +initramfs-tools (0.3) unstable; urgency=low + + * Fix init and root variables + + -- Jeff Bailey Sat, 29 Jan 2005 17:49:08 -0500 + +initramfs-tools (0.2) unstable; urgency=low + + * Include the modules in the initrd + * Drop the .ko ending from the module loads. + * Actually chain to the sub scripts. + * kilbc is now named properly + * First cut of an NFS root implementation + + -- Jeff Bailey Fri, 28 Jan 2005 16:50:53 -0500 + +initramfs-tools (0.1) unstable; urgency=low + + * Initial Release. + + -- Jeff Bailey Thu, 27 Jan 2005 15:23:52 -0500 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..fe8d332 --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: initramfs-tools +Section: utils +Priority: optional +Maintainer: Jeff Bailey +Build-Depends-Indep: debhelper (>= 4.0.0), cdbs, busybox-cvs-static +Standards-Version: 3.6.1 + +Package: initramfs-tools +Architecture: all +Depends: klibc-utils +Description: tools for generting an Ubuntu-style initramfs + This package generates an initramfs for an Ubuntu system. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cdc2919 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,10 @@ +This package was debianized by Jeff Bailey on +Thu, 27 Jan 2005 15:23:52 -0500. + +Copyright: + +Author: Jeff Bailey, with some pieces for initrd-tools + +License: + +PUBLIC DOMAIN diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..b9277fc --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +initramfs-tools_0.6_all.deb utils optional diff --git a/debian/initramfs-tools.examples b/debian/initramfs-tools.examples new file mode 100644 index 0000000..35ca94c --- /dev/null +++ b/debian/initramfs-tools.examples @@ -0,0 +1 @@ +conf/modules diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install new file mode 100644 index 0000000..e76186f --- /dev/null +++ b/debian/initramfs-tools.install @@ -0,0 +1,4 @@ +mkinitramfs usr/sbin +init usr/share/initramfs-tools +scripts usr/share/initramfs-tools +conf/initramfs.conf etc/mkinitramfs diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst new file mode 100644 index 0000000..70be9f6 --- /dev/null +++ b/debian/initramfs-tools.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ ! -e /etc/mkinitramfs/modules ]; then + cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ +fi + +#DEBHELPER# + diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm new file mode 100644 index 0000000..7bea06f --- /dev/null +++ b/debian/initramfs-tools.postrm @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "x${1}" = "xpurge" ]; then + rm /etc/mkinitramfs/modules +fi + +#DEBHELPER# + diff --git a/debian/initramfs-tools/DEBIAN/conffiles b/debian/initramfs-tools/DEBIAN/conffiles new file mode 100644 index 0000000..cd2afc0 --- /dev/null +++ b/debian/initramfs-tools/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/mkinitramfs/initramfs.conf diff --git a/debian/initramfs-tools/DEBIAN/control b/debian/initramfs-tools/DEBIAN/control new file mode 100644 index 0000000..9192ae1 --- /dev/null +++ b/debian/initramfs-tools/DEBIAN/control @@ -0,0 +1,10 @@ +Package: initramfs-tools +Version: 0.6 +Section: utils +Priority: optional +Architecture: all +Depends: klibc-utils +Installed-Size: 100 +Maintainer: Jeff Bailey +Description: tools for generting an Ubuntu-style initramfs + This package generates an initramfs for an Ubuntu system. diff --git a/debian/initramfs-tools/DEBIAN/md5sums b/debian/initramfs-tools/DEBIAN/md5sums new file mode 100644 index 0000000..420e544 --- /dev/null +++ b/debian/initramfs-tools/DEBIAN/md5sums @@ -0,0 +1,9 @@ +741626a7104d48b15ee4f7f0f8973deb usr/share/doc/initramfs-tools/TODO +ed79de81154495c4c23a93b32471cb19 usr/share/doc/initramfs-tools/copyright +12933b9f50570c11cf0f384eee619ee9 usr/share/doc/initramfs-tools/examples/modules +35c556b7165396ffbb9daf1e33f75e80 usr/share/doc/initramfs-tools/changelog.gz +614dec8a64e5f9798d4e0eb42219d96d usr/share/initramfs-tools/init +f18121fe1135572dbbea347371e8d730 usr/share/initramfs-tools/scripts/nfs +9d5014b1fbc092a32526ffa52549193c usr/share/initramfs-tools/scripts/local +6ebc6e800720aab93d022fe8ef5063d5 usr/share/initramfs-tools/scripts/functions +fd7c4a390d50d181203e0ca2007254e2 usr/sbin/mkinitramfs diff --git a/debian/initramfs-tools/DEBIAN/postinst b/debian/initramfs-tools/DEBIAN/postinst new file mode 100644 index 0000000..36f508d --- /dev/null +++ b/debian/initramfs-tools/DEBIAN/postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ ! -e /etc/mkinitramfs/modules ]; then + cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ +fi + + + diff --git a/debian/initramfs-tools/DEBIAN/postrm b/debian/initramfs-tools/DEBIAN/postrm new file mode 100644 index 0000000..84bff36 --- /dev/null +++ b/debian/initramfs-tools/DEBIAN/postrm @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "x${1}" = "xpurge" ]; then + rm /etc/mkinitramfs/modules +fi + + + diff --git a/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf b/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf new file mode 100644 index 0000000..a056469 --- /dev/null +++ b/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf @@ -0,0 +1,50 @@ +# +# initramfs.conf +# + +# BUSYBOX: [ y | n ] +# +# Use busybox if available. You MUST use the -static version +# + +BUSYBOX=n + +# +# BOOT: [ local | nfs ] +# +# local - Boot off of local media (harddrive, USB stick). +# +# nfs - Boot using an NFS drive as the root of the drive. +# + +BOOT=local + +# +# MODULES: [ most | dep | list ] +# +# most - Add all framebuffer, acpi, filesystem, and harddrive drivers. +# +# dep - Try and guess which modules to load. +# +# list - Only include modules from the 'additional modules' list +# +MODULES=list + +# +# NFS Section of the config. +# + +# +# DEVICE: ... +# +# Specify the network device, like eth0 +# + +DEVICE=eth0 + +# +# NFSROOT: [ auto | HOST:MOUNT ] +# + +NFSROOT=auto + diff --git a/debian/initramfs-tools/usr/sbin/mkinitramfs b/debian/initramfs-tools/usr/sbin/mkinitramfs new file mode 100644 index 0000000..593c69e --- /dev/null +++ b/debian/initramfs-tools/usr/sbin/mkinitramfs @@ -0,0 +1,93 @@ +#!/bin/sh + +. /etc/mkinitramfs/initramfs.conf + +usage() +{ + echo "-o Output" + echo "-v version" + echo "-k Keep temp files" + exit 1 +} + +# Defaults +keep="n" + +while getopts "ko:v:" flag; do + case $flag in + o) + outfile="${OPTARG}" + ;; + v) + version="${OPTARG}" + ;; + k) + keep="y" + ;; + esac +done + +if [ x${outfile} = x ]; then + usage +fi + +if [ -d ${outfile} ]; then + echo "${outfile} is a directory" + exit 1 +fi + +if [ ! -e /lib/modules/${version} ]; then + echo "Cannot find /lib/modules/${version}" + exit 1 +fi + +TMPDIR=$(mktemp -d) || exit 1 +mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc +mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts + +for x in $(sed -e '/^#/d' /etc/mkinitramfs/modules); do + for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then + continue + fi + + ln -s ${y} ${TMPDIR}/modules + echo $(basename ${y}) >>${TMPDIR}/conf/modules + done +done + +# Have to do each file, because cpio --dereference doesn't recurse down +# symlinks. + +ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin +ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib +ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init +ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts +ln -s /etc/mkinitramfs/initramfs.conf ${TMPDIR}/conf +ln -s /etc/udev ${TMPDIR}/etc + +# Hack until udev is built with klibc +ln -s /sbin/udev ${TMPDIR}/bin +ln -s /sbin/udevstart ${TMPDIR}/bin +ln -s /lib/libc.so.* ${TMPDIR}/lib +ln -s /lib/ld*.so.* ${TMPDIR}/lib +rm ${TMPDIR}/lib/*lsb* + +# Busybox +if [ "x${BUSYBOX}" = "xy" ]; then + rm ${TMPDIR}/bin/sh + ln -s /bin/busybox ${TMPDIR}/bin/sh +fi + +# Raid +ln -s /sbin/mdadm ${TMPDIR}/bin +ln -s /sbin/mdrun ${TMPDIR}/bin + +(cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) + +if [ "${keep}" = "y" ]; then + echo "Working files in ${TMPDIR}" +else + rm -rf "${TMPDIR}" +fi diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO b/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO new file mode 100644 index 0000000..bf7e07d --- /dev/null +++ b/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO @@ -0,0 +1,8 @@ +TODO +==== + + o Get udev compiled against klibc + + o Integrate hotplug-ng + + o Add option to make-kpkg to use mkinitramfs diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz b/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz new file mode 100644 index 0000000..c89e14f Binary files /dev/null and b/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz differ diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright b/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright new file mode 100644 index 0000000..cdc2919 --- /dev/null +++ b/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright @@ -0,0 +1,10 @@ +This package was debianized by Jeff Bailey on +Thu, 27 Jan 2005 15:23:52 -0500. + +Copyright: + +Author: Jeff Bailey, with some pieces for initrd-tools + +License: + +PUBLIC DOMAIN diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules b/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules new file mode 100644 index 0000000..ee1310a --- /dev/null +++ b/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules @@ -0,0 +1,7 @@ +# List of modules that you want to include in your initramfs. +# This might be good choices: +# +#ide-disk +#ide-generic +#ext2 +#ext3 diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/init b/debian/initramfs-tools/usr/share/initramfs-tools/init new file mode 100644 index 0000000..c3e4887 --- /dev/null +++ b/debian/initramfs-tools/usr/share/initramfs-tools/init @@ -0,0 +1,64 @@ +#!/bin/sh -x +mkdir /sys +mkdir /proc +mkdir /tmp +mount -t sysfs sysfs /sys +mount -t proc proc /proc + +. /conf/initramfs.conf +. /scripts/functions + +# Parse command line options +init=/sbin/init +root= +ro=-r +break= +rootmnt=/root +for x in $(cat /proc/cmdline); do + case $x in + init=*) + INIT=${x#init=} + ;; + root=*) + ROOT=${x#root=} + ;; + nfsroot=*) + NFSROOT=${x#nfsroot=} + ;; + boot=*) + BOOT=${x#boot=} + ;; + ro) + ro=-r + ;; + rw) + ro=-w + ;; + break) + break=yes + ;; + esac +done + +. /scripts/${BOOT} + +# Load the modules +# FIXME - do module options here +for x in $(cat /conf/modules); do + insmod /modules/$x +done + +# Populate /dev tree +udevstart + +if [ x${break} = xyes ]; then + panic "Spawning shell within the initramfs" +fi + +mountroot + +umount /sys +umount /proc + +# Chain to real filesystem +exec run-init ${rootmnt} ${init} "$@" diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions new file mode 100644 index 0000000..19560ba --- /dev/null +++ b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions @@ -0,0 +1,9 @@ +panic() +{ + echo $@ + if [ -e /bin/busybox ]; then + FS1='(initramfs) ' exec /bin/busybox sh + else + FS1='(initramfs) ' exec /bin/sh + fi +} diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local new file mode 100644 index 0000000..572f185 --- /dev/null +++ b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local @@ -0,0 +1,15 @@ +# Local filesystem mounting + +# Parameter: Where to mount the filesystem +mountroot () +{ + # Get the root filesystem type + if [ ! -e ${ROOT} ]; then + panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" + fi + + eval $(fstype < ${ROOT}) + + # Mount root + mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} +} diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs new file mode 100644 index 0000000..1225c4d --- /dev/null +++ b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs @@ -0,0 +1,11 @@ + +# Paramter: Where the root should be mounted +mountroot () +{ + ipconfig ${DEVICE} + . /tmp/net-${DEVICE}.conf + if [ "x${NFSROOT}" = "xauto" ]; then + NFSROOT=${ROOTSERVER}:${ROOTPATH} + fi + nfsmount ${NFSROOT} ${rootmnt} +} diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..0a1575f --- /dev/null +++ b/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk + +common-build-arch:: + chmod +x init diff --git a/init b/init new file mode 100644 index 0000000..c3e4887 --- /dev/null +++ b/init @@ -0,0 +1,64 @@ +#!/bin/sh -x +mkdir /sys +mkdir /proc +mkdir /tmp +mount -t sysfs sysfs /sys +mount -t proc proc /proc + +. /conf/initramfs.conf +. /scripts/functions + +# Parse command line options +init=/sbin/init +root= +ro=-r +break= +rootmnt=/root +for x in $(cat /proc/cmdline); do + case $x in + init=*) + INIT=${x#init=} + ;; + root=*) + ROOT=${x#root=} + ;; + nfsroot=*) + NFSROOT=${x#nfsroot=} + ;; + boot=*) + BOOT=${x#boot=} + ;; + ro) + ro=-r + ;; + rw) + ro=-w + ;; + break) + break=yes + ;; + esac +done + +. /scripts/${BOOT} + +# Load the modules +# FIXME - do module options here +for x in $(cat /conf/modules); do + insmod /modules/$x +done + +# Populate /dev tree +udevstart + +if [ x${break} = xyes ]; then + panic "Spawning shell within the initramfs" +fi + +mountroot + +umount /sys +umount /proc + +# Chain to real filesystem +exec run-init ${rootmnt} ${init} "$@" diff --git a/mkinitramfs b/mkinitramfs new file mode 100644 index 0000000..593c69e --- /dev/null +++ b/mkinitramfs @@ -0,0 +1,93 @@ +#!/bin/sh + +. /etc/mkinitramfs/initramfs.conf + +usage() +{ + echo "-o Output" + echo "-v version" + echo "-k Keep temp files" + exit 1 +} + +# Defaults +keep="n" + +while getopts "ko:v:" flag; do + case $flag in + o) + outfile="${OPTARG}" + ;; + v) + version="${OPTARG}" + ;; + k) + keep="y" + ;; + esac +done + +if [ x${outfile} = x ]; then + usage +fi + +if [ -d ${outfile} ]; then + echo "${outfile} is a directory" + exit 1 +fi + +if [ ! -e /lib/modules/${version} ]; then + echo "Cannot find /lib/modules/${version}" + exit 1 +fi + +TMPDIR=$(mktemp -d) || exit 1 +mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc +mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts + +for x in $(sed -e '/^#/d' /etc/mkinitramfs/modules); do + for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then + continue + fi + + ln -s ${y} ${TMPDIR}/modules + echo $(basename ${y}) >>${TMPDIR}/conf/modules + done +done + +# Have to do each file, because cpio --dereference doesn't recurse down +# symlinks. + +ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin +ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib +ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init +ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts +ln -s /etc/mkinitramfs/initramfs.conf ${TMPDIR}/conf +ln -s /etc/udev ${TMPDIR}/etc + +# Hack until udev is built with klibc +ln -s /sbin/udev ${TMPDIR}/bin +ln -s /sbin/udevstart ${TMPDIR}/bin +ln -s /lib/libc.so.* ${TMPDIR}/lib +ln -s /lib/ld*.so.* ${TMPDIR}/lib +rm ${TMPDIR}/lib/*lsb* + +# Busybox +if [ "x${BUSYBOX}" = "xy" ]; then + rm ${TMPDIR}/bin/sh + ln -s /bin/busybox ${TMPDIR}/bin/sh +fi + +# Raid +ln -s /sbin/mdadm ${TMPDIR}/bin +ln -s /sbin/mdrun ${TMPDIR}/bin + +(cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) + +if [ "${keep}" = "y" ]; then + echo "Working files in ${TMPDIR}" +else + rm -rf "${TMPDIR}" +fi diff --git a/scripts/functions b/scripts/functions new file mode 100644 index 0000000..19560ba --- /dev/null +++ b/scripts/functions @@ -0,0 +1,9 @@ +panic() +{ + echo $@ + if [ -e /bin/busybox ]; then + FS1='(initramfs) ' exec /bin/busybox sh + else + FS1='(initramfs) ' exec /bin/sh + fi +} diff --git a/scripts/local b/scripts/local new file mode 100644 index 0000000..572f185 --- /dev/null +++ b/scripts/local @@ -0,0 +1,15 @@ +# Local filesystem mounting + +# Parameter: Where to mount the filesystem +mountroot () +{ + # Get the root filesystem type + if [ ! -e ${ROOT} ]; then + panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" + fi + + eval $(fstype < ${ROOT}) + + # Mount root + mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} +} diff --git a/scripts/nfs b/scripts/nfs new file mode 100644 index 0000000..1225c4d --- /dev/null +++ b/scripts/nfs @@ -0,0 +1,11 @@ + +# Paramter: Where the root should be mounted +mountroot () +{ + ipconfig ${DEVICE} + . /tmp/net-${DEVICE}.conf + if [ "x${NFSROOT}" = "xauto" ]; then + NFSROOT=${ROOTSERVER}:${ROOTPATH} + fi + nfsmount ${NFSROOT} ${rootmnt} +} -- cgit v1.2.3 From c7df22010dcd9b237952e5135fea8b670039f547 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 14:31:21 +0000 Subject: Use commandline args from mkinitrd --- debian/changelog | 12 ++++++++++++ mkinitramfs | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8a999a1..1973e74 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +initramfs-tools (0.7) breezy; urgency=low + + The "CONFORM!" release. + + * Make command line arguments almost match mkinitrd. The -m argument + doesn't make any sense, so it's not supported. Add support for + overriding the confdir, and specifying version no longer expects -v. + + + + -- Jeff Bailey Thu, 9 Jun 2005 14:30:18 +0000 + initramfs-tools (0.6) breezy; urgency=low The "Sweep! .... Off!" release. diff --git a/mkinitramfs b/mkinitramfs index 593c69e..d2036fd 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,20 +1,36 @@ #!/bin/sh -. /etc/mkinitramfs/initramfs.conf - usage() { - echo "-o Output" - echo "-v version" - echo "-k Keep temp files" + cat >&2 << EOF + +Usage: ${0} [OPTION]... <-o outfile> [version] + +Options: + -d confdir Specify an alternative configuration directory. + -k Keep temporary directory used to make the image. + -o outfile Write to outfile. + -r root Override ROOT setting in mkinitrd.conf. + +See ${0}(8) for further details. +EOF exit 1 + } # Defaults keep="n" +CONFDIR="/etc/mkinitramfs" -while getopts "ko:v:" flag; do +while getopts "d:ko:r:" flag; do case $flag in + d) + CONFDIR="${OPTAGS}" + if [ ! d "${CONFDIR}" ]; then + echo "${0}: ${CONFDIR}: Not a directory" >&2 + exit 1 + fi + ;; o) outfile="${OPTARG}" ;; @@ -27,7 +43,11 @@ while getopts "ko:v:" flag; do esac done -if [ x${outfile} = x ]; then +shift $((${OPTIND} - 1)) + +. ${CONFDIR}/initramfs.conf + +if [ x${outfile} = x ] || [ ${#} -ne 1 ]; then usage fi @@ -45,7 +65,7 @@ TMPDIR=$(mktemp -d) || exit 1 mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts -for x in $(sed -e '/^#/d' /etc/mkinitramfs/modules); do +for x in $(sed -e '/^#/d' ${CONFDIR}/modules); do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then @@ -64,7 +84,7 @@ ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts -ln -s /etc/mkinitramfs/initramfs.conf ${TMPDIR}/conf +ln -s ${CONFDIR}/initramfs.conf ${TMPDIR}/conf ln -s /etc/udev ${TMPDIR}/etc # Hack until udev is built with klibc -- cgit v1.2.3 From 8cfdec86dd2e4662a09d6384ab9042d32636560d Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 15:16:40 +0000 Subject: Add hookscript directories --- debian/changelog | 7 ++++++- debian/dirs | 6 ++++++ mkinitramfs | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 debian/dirs diff --git a/debian/changelog b/debian/changelog index 1973e74..787f5fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,9 +6,14 @@ initramfs-tools (0.7) breezy; urgency=low doesn't make any sense, so it's not supported. Add support for overriding the confdir, and specifying version no longer expects -v. + * Add sed and grep to the initramfs for now. Will prune these + eventually, but for now mdrun needs them. + * Add mdadm and mdrun to the initramfs. - -- Jeff Bailey Thu, 9 Jun 2005 14:30:18 +0000 + * Add hookscript directories. + + -- Jeff Bailey Thu, 9 Jun 2005 15:16:15 +0000 initramfs-tools (0.6) breezy; urgency=low diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..fd55804 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,6 @@ +etc/mkiniramfs/init-bottom +etc/mkiniramfs/init-top +etc/mkiniramfs/local-premount +etc/mkiniramfs/local-top +etc/mkiniramfs/nfs-premount +etc/mkiniramfs/nfs-top diff --git a/mkinitramfs b/mkinitramfs index d2036fd..7b6af66 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -103,6 +103,8 @@ fi # Raid ln -s /sbin/mdadm ${TMPDIR}/bin ln -s /sbin/mdrun ${TMPDIR}/bin +ln -s /bin/grep ${TMPDIR}/bin +ln -s /bin/sed ${TMPDIR}/bin (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) -- cgit v1.2.3 From ac222142f849ed340c3b7a0300a57cc3153e0436 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 17:23:35 +0000 Subject: Add hookscripts --- debian/changelog | 7 ++- debian/initramfs-tools.examples | 1 + docs/example_script | 21 +++++++ init | 4 ++ scripts/functions | 121 ++++++++++++++++++++++++++++++++++++++++ scripts/init-top/test | 18 ++++++ scripts/local | 6 ++ scripts/nfs | 8 +++ 8 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 docs/example_script create mode 100644 scripts/init-top/test diff --git a/debian/changelog b/debian/changelog index 787f5fa..41f15e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,12 @@ initramfs-tools (0.7) breezy; urgency=low * Add hookscript directories. - -- Jeff Bailey Thu, 9 Jun 2005 15:16:15 +0000 + * Call hookscripts + + Thanks to David Weinhall for the dependancy-based + hookscripts. + + -- Jeff Bailey Thu, 9 Jun 2005 17:08:01 +0000 initramfs-tools (0.6) breezy; urgency=low diff --git a/debian/initramfs-tools.examples b/debian/initramfs-tools.examples index 35ca94c..0e8472b 100644 --- a/debian/initramfs-tools.examples +++ b/debian/initramfs-tools.examples @@ -1 +1,2 @@ conf/modules +docs/example_script diff --git a/docs/example_script b/docs/example_script new file mode 100644 index 0000000..111b0d8 --- /dev/null +++ b/docs/example_script @@ -0,0 +1,21 @@ +#!/bin/sh + +# List the soft prerequisites here. So if there's something you know +# should be run first iff it exists. +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Do the work here. +echo "Got here!" diff --git a/init b/init index c3e4887..c09074f 100644 --- a/init +++ b/init @@ -40,6 +40,8 @@ for x in $(cat /proc/cmdline); do esac done +run_scripts /scripts/init_top + . /scripts/${BOOT} # Load the modules @@ -57,6 +59,8 @@ fi mountroot +run_scripts /scripts/init_bottom + umount /sys umount /proc diff --git a/scripts/functions b/scripts/functions index 19560ba..586c82f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -7,3 +7,124 @@ panic() FS1='(initramfs) ' exec /bin/sh fi } + +# this function finds scripts with empty depends and adds them +# to the ordered list +dep_reduce() +{ + i=0 + j=0 + unset neworder + + for entry in "${array[@]}"; do + set - ${entry} + + if [ "$#" -eq "0" ]; then + continue + elif [ "$#" -eq "1" ]; then + if [ $end -eq 0 ] || + [ x"${order[$((end-1))]}" != x"$1" ]; then + order[$((end))]=$1 + end=$((end+1)) + neworder[$((j))]=$1 + j=$((j+1)) + fi + + array[$((i))]= + fi + + i=$((i+1)) + done +} + +dep_remove() +{ + i=0 + + # for each row in the array + for entry in "${array[@]}"; do + unset newentry + + set - ${entry} + + # for each dependency of the script + for dep in "$@"; do + new=1 + + # for each new dependency + for tmp in "${order[@]}"; do + if [ x"$dep" = x"$tmp" ]; then + new=0 + fi + done + + if [ x"$new" = x"1" ]; then + newentry="$newentry $dep" + fi + done + + array[$((i))]="$newentry" + i=$((i+1)) + done +} + +run_scripts() +{ + initdir=${1} + scripts=$(ls ${initdir}) + order= + end=0 + array= + + # FIXME: New algorithm + # array of strings: "$file $prereqs" + # iterate over all strings; find empty strings (just $file) + # add to order, delete from all strings and zero out entry + # repeat until all strings are empty + + i=0 + for file in $scripts; do + # if it's not a regular file, or if it's not executable, skip it + if ! [ -f ${initdir}/${file} ] || ! [ -x ${initdir}/${file} ]; then + continue + fi + + array[$((i))]="$file $(${initdir}/${file} prereqs)" + i=$((i+1)) + done + + # No scripts in directory, bail. + if [ ${i} -eq 0 ]; then + return 0 + fi + + while /bin/true; do + set - ${array[@]} + + if [ "$#" -eq "0" ]; then + break + fi + + dep_reduce + + dep_remove + + if [ "${#neworder}" -eq "0" ]; then + for x in "${array[@]}"; do + if [ x"$x" != x"" ]; then + printf "could not reduce further; " + printf "circular dependencies\n" + return 1 + fi + done + + # we're done! + break + fi + done + + # run the initscripts + for script in "${order[@]}"; do + ${initdir}/${script} + done +} diff --git a/scripts/init-top/test b/scripts/init-top/test new file mode 100644 index 0000000..e4d59fb --- /dev/null +++ b/scripts/init-top/test @@ -0,0 +1,18 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +echo "Got here!" diff --git a/scripts/local b/scripts/local index 572f185..ffbd230 100644 --- a/scripts/local +++ b/scripts/local @@ -3,6 +3,8 @@ # Parameter: Where to mount the filesystem mountroot () { + run_scripts /scripts/local_top + # Get the root filesystem type if [ ! -e ${ROOT} ]; then panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" @@ -10,6 +12,10 @@ mountroot () eval $(fstype < ${ROOT}) + run_scripts /scripts/local_premount + # Mount root mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} + + run_scripts /scripts/local_bottom } diff --git a/scripts/nfs b/scripts/nfs index 1225c4d..d0f1600 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,10 +2,18 @@ # Paramter: Where the root should be mounted mountroot () { + run_scripts /scripts/nfs_top + ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf if [ "x${NFSROOT}" = "xauto" ]; then NFSROOT=${ROOTSERVER}:${ROOTPATH} fi + + run_scripts /scripts/nfs_premount + nfsmount ${NFSROOT} ${rootmnt} + + run_scripts /scripts/nfs_bottom + } -- cgit v1.2.3 From d49e80ad3723c35714bf44b21545090da62f558e Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 20:08:12 +0000 Subject: Hookscripts, prunce extras --- debian/dirs | 13 +-- debian/files | 2 +- debian/initramfs-tools/DEBIAN/conffiles | 1 - debian/initramfs-tools/DEBIAN/control | 10 --- debian/initramfs-tools/DEBIAN/md5sums | 9 -- debian/initramfs-tools/DEBIAN/postinst | 10 --- debian/initramfs-tools/DEBIAN/postrm | 8 -- .../initramfs-tools/etc/mkinitramfs/initramfs.conf | 50 ----------- debian/initramfs-tools/usr/sbin/mkinitramfs | 93 --------------------- .../usr/share/doc/initramfs-tools/TODO | 8 -- .../usr/share/doc/initramfs-tools/changelog.gz | Bin 784 -> 0 bytes .../usr/share/doc/initramfs-tools/copyright | 10 --- .../usr/share/doc/initramfs-tools/examples/modules | 7 -- .../initramfs-tools/usr/share/initramfs-tools/init | 64 -------------- .../usr/share/initramfs-tools/scripts/functions | 9 -- .../usr/share/initramfs-tools/scripts/local | 15 ---- .../usr/share/initramfs-tools/scripts/nfs | 11 --- mkinitramfs | 36 +++++--- scripts/functions | 1 + 19 files changed, 35 insertions(+), 322 deletions(-) delete mode 100644 debian/initramfs-tools/DEBIAN/conffiles delete mode 100644 debian/initramfs-tools/DEBIAN/control delete mode 100644 debian/initramfs-tools/DEBIAN/md5sums delete mode 100644 debian/initramfs-tools/DEBIAN/postinst delete mode 100644 debian/initramfs-tools/DEBIAN/postrm delete mode 100644 debian/initramfs-tools/etc/mkinitramfs/initramfs.conf delete mode 100644 debian/initramfs-tools/usr/sbin/mkinitramfs delete mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO delete mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz delete mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright delete mode 100644 debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules delete mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/init delete mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions delete mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/local delete mode 100644 debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs diff --git a/debian/dirs b/debian/dirs index fd55804..ef40692 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,6 +1,7 @@ -etc/mkiniramfs/init-bottom -etc/mkiniramfs/init-top -etc/mkiniramfs/local-premount -etc/mkiniramfs/local-top -etc/mkiniramfs/nfs-premount -etc/mkiniramfs/nfs-top +etc/mkinitramfs/init-bottom +etc/mkinitramfs/init-top +etc/mkinitramfs/local-premount +etc/mkinitramfs/local-top +etc/mkinitramfs/nfs-premount +etc/mkinitramfs/nfs-top +usr/share/initramfs-tools/modules.d diff --git a/debian/files b/debian/files index b9277fc..47aa909 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -initramfs-tools_0.6_all.deb utils optional +initramfs-tools_0.7_all.deb utils optional diff --git a/debian/initramfs-tools/DEBIAN/conffiles b/debian/initramfs-tools/DEBIAN/conffiles deleted file mode 100644 index cd2afc0..0000000 --- a/debian/initramfs-tools/DEBIAN/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/mkinitramfs/initramfs.conf diff --git a/debian/initramfs-tools/DEBIAN/control b/debian/initramfs-tools/DEBIAN/control deleted file mode 100644 index 9192ae1..0000000 --- a/debian/initramfs-tools/DEBIAN/control +++ /dev/null @@ -1,10 +0,0 @@ -Package: initramfs-tools -Version: 0.6 -Section: utils -Priority: optional -Architecture: all -Depends: klibc-utils -Installed-Size: 100 -Maintainer: Jeff Bailey -Description: tools for generting an Ubuntu-style initramfs - This package generates an initramfs for an Ubuntu system. diff --git a/debian/initramfs-tools/DEBIAN/md5sums b/debian/initramfs-tools/DEBIAN/md5sums deleted file mode 100644 index 420e544..0000000 --- a/debian/initramfs-tools/DEBIAN/md5sums +++ /dev/null @@ -1,9 +0,0 @@ -741626a7104d48b15ee4f7f0f8973deb usr/share/doc/initramfs-tools/TODO -ed79de81154495c4c23a93b32471cb19 usr/share/doc/initramfs-tools/copyright -12933b9f50570c11cf0f384eee619ee9 usr/share/doc/initramfs-tools/examples/modules -35c556b7165396ffbb9daf1e33f75e80 usr/share/doc/initramfs-tools/changelog.gz -614dec8a64e5f9798d4e0eb42219d96d usr/share/initramfs-tools/init -f18121fe1135572dbbea347371e8d730 usr/share/initramfs-tools/scripts/nfs -9d5014b1fbc092a32526ffa52549193c usr/share/initramfs-tools/scripts/local -6ebc6e800720aab93d022fe8ef5063d5 usr/share/initramfs-tools/scripts/functions -fd7c4a390d50d181203e0ca2007254e2 usr/sbin/mkinitramfs diff --git a/debian/initramfs-tools/DEBIAN/postinst b/debian/initramfs-tools/DEBIAN/postinst deleted file mode 100644 index 36f508d..0000000 --- a/debian/initramfs-tools/DEBIAN/postinst +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -if [ ! -e /etc/mkinitramfs/modules ]; then - cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ -fi - - - diff --git a/debian/initramfs-tools/DEBIAN/postrm b/debian/initramfs-tools/DEBIAN/postrm deleted file mode 100644 index 84bff36..0000000 --- a/debian/initramfs-tools/DEBIAN/postrm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "x${1}" = "xpurge" ]; then - rm /etc/mkinitramfs/modules -fi - - - diff --git a/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf b/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf deleted file mode 100644 index a056469..0000000 --- a/debian/initramfs-tools/etc/mkinitramfs/initramfs.conf +++ /dev/null @@ -1,50 +0,0 @@ -# -# initramfs.conf -# - -# BUSYBOX: [ y | n ] -# -# Use busybox if available. You MUST use the -static version -# - -BUSYBOX=n - -# -# BOOT: [ local | nfs ] -# -# local - Boot off of local media (harddrive, USB stick). -# -# nfs - Boot using an NFS drive as the root of the drive. -# - -BOOT=local - -# -# MODULES: [ most | dep | list ] -# -# most - Add all framebuffer, acpi, filesystem, and harddrive drivers. -# -# dep - Try and guess which modules to load. -# -# list - Only include modules from the 'additional modules' list -# -MODULES=list - -# -# NFS Section of the config. -# - -# -# DEVICE: ... -# -# Specify the network device, like eth0 -# - -DEVICE=eth0 - -# -# NFSROOT: [ auto | HOST:MOUNT ] -# - -NFSROOT=auto - diff --git a/debian/initramfs-tools/usr/sbin/mkinitramfs b/debian/initramfs-tools/usr/sbin/mkinitramfs deleted file mode 100644 index 593c69e..0000000 --- a/debian/initramfs-tools/usr/sbin/mkinitramfs +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -. /etc/mkinitramfs/initramfs.conf - -usage() -{ - echo "-o Output" - echo "-v version" - echo "-k Keep temp files" - exit 1 -} - -# Defaults -keep="n" - -while getopts "ko:v:" flag; do - case $flag in - o) - outfile="${OPTARG}" - ;; - v) - version="${OPTARG}" - ;; - k) - keep="y" - ;; - esac -done - -if [ x${outfile} = x ]; then - usage -fi - -if [ -d ${outfile} ]; then - echo "${outfile} is a directory" - exit 1 -fi - -if [ ! -e /lib/modules/${version} ]; then - echo "Cannot find /lib/modules/${version}" - exit 1 -fi - -TMPDIR=$(mktemp -d) || exit 1 -mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc -mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts - -for x in $(sed -e '/^#/d' /etc/mkinitramfs/modules); do - for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then - continue - fi - - ln -s ${y} ${TMPDIR}/modules - echo $(basename ${y}) >>${TMPDIR}/conf/modules - done -done - -# Have to do each file, because cpio --dereference doesn't recurse down -# symlinks. - -ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin -ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib -ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init -ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts -ln -s /etc/mkinitramfs/initramfs.conf ${TMPDIR}/conf -ln -s /etc/udev ${TMPDIR}/etc - -# Hack until udev is built with klibc -ln -s /sbin/udev ${TMPDIR}/bin -ln -s /sbin/udevstart ${TMPDIR}/bin -ln -s /lib/libc.so.* ${TMPDIR}/lib -ln -s /lib/ld*.so.* ${TMPDIR}/lib -rm ${TMPDIR}/lib/*lsb* - -# Busybox -if [ "x${BUSYBOX}" = "xy" ]; then - rm ${TMPDIR}/bin/sh - ln -s /bin/busybox ${TMPDIR}/bin/sh -fi - -# Raid -ln -s /sbin/mdadm ${TMPDIR}/bin -ln -s /sbin/mdrun ${TMPDIR}/bin - -(cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) - -if [ "${keep}" = "y" ]; then - echo "Working files in ${TMPDIR}" -else - rm -rf "${TMPDIR}" -fi diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO b/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO deleted file mode 100644 index bf7e07d..0000000 --- a/debian/initramfs-tools/usr/share/doc/initramfs-tools/TODO +++ /dev/null @@ -1,8 +0,0 @@ -TODO -==== - - o Get udev compiled against klibc - - o Integrate hotplug-ng - - o Add option to make-kpkg to use mkinitramfs diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz b/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz deleted file mode 100644 index c89e14f..0000000 Binary files a/debian/initramfs-tools/usr/share/doc/initramfs-tools/changelog.gz and /dev/null differ diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright b/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright deleted file mode 100644 index cdc2919..0000000 --- a/debian/initramfs-tools/usr/share/doc/initramfs-tools/copyright +++ /dev/null @@ -1,10 +0,0 @@ -This package was debianized by Jeff Bailey on -Thu, 27 Jan 2005 15:23:52 -0500. - -Copyright: - -Author: Jeff Bailey, with some pieces for initrd-tools - -License: - -PUBLIC DOMAIN diff --git a/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules b/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules deleted file mode 100644 index ee1310a..0000000 --- a/debian/initramfs-tools/usr/share/doc/initramfs-tools/examples/modules +++ /dev/null @@ -1,7 +0,0 @@ -# List of modules that you want to include in your initramfs. -# This might be good choices: -# -#ide-disk -#ide-generic -#ext2 -#ext3 diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/init b/debian/initramfs-tools/usr/share/initramfs-tools/init deleted file mode 100644 index c3e4887..0000000 --- a/debian/initramfs-tools/usr/share/initramfs-tools/init +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -x -mkdir /sys -mkdir /proc -mkdir /tmp -mount -t sysfs sysfs /sys -mount -t proc proc /proc - -. /conf/initramfs.conf -. /scripts/functions - -# Parse command line options -init=/sbin/init -root= -ro=-r -break= -rootmnt=/root -for x in $(cat /proc/cmdline); do - case $x in - init=*) - INIT=${x#init=} - ;; - root=*) - ROOT=${x#root=} - ;; - nfsroot=*) - NFSROOT=${x#nfsroot=} - ;; - boot=*) - BOOT=${x#boot=} - ;; - ro) - ro=-r - ;; - rw) - ro=-w - ;; - break) - break=yes - ;; - esac -done - -. /scripts/${BOOT} - -# Load the modules -# FIXME - do module options here -for x in $(cat /conf/modules); do - insmod /modules/$x -done - -# Populate /dev tree -udevstart - -if [ x${break} = xyes ]; then - panic "Spawning shell within the initramfs" -fi - -mountroot - -umount /sys -umount /proc - -# Chain to real filesystem -exec run-init ${rootmnt} ${init} "$@" diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions deleted file mode 100644 index 19560ba..0000000 --- a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/functions +++ /dev/null @@ -1,9 +0,0 @@ -panic() -{ - echo $@ - if [ -e /bin/busybox ]; then - FS1='(initramfs) ' exec /bin/busybox sh - else - FS1='(initramfs) ' exec /bin/sh - fi -} diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local deleted file mode 100644 index 572f185..0000000 --- a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/local +++ /dev/null @@ -1,15 +0,0 @@ -# Local filesystem mounting - -# Parameter: Where to mount the filesystem -mountroot () -{ - # Get the root filesystem type - if [ ! -e ${ROOT} ]; then - panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" - fi - - eval $(fstype < ${ROOT}) - - # Mount root - mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} -} diff --git a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs b/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs deleted file mode 100644 index 1225c4d..0000000 --- a/debian/initramfs-tools/usr/share/initramfs-tools/scripts/nfs +++ /dev/null @@ -1,11 +0,0 @@ - -# Paramter: Where the root should be mounted -mountroot () -{ - ipconfig ${DEVICE} - . /tmp/net-${DEVICE}.conf - if [ "x${NFSROOT}" = "xauto" ]; then - NFSROOT=${ROOTSERVER}:${ROOTPATH} - fi - nfsmount ${NFSROOT} ${rootmnt} -} diff --git a/mkinitramfs b/mkinitramfs index 7b6af66..2134a2d 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,27 @@ #!/bin/sh +# Takes a file containing a list of modules to be added as an argument +# Figures out dependancies and adds it in. +manual_add_modules() +{ + # Sanity check + if [ ! -e ${1} ]; then + return + fi + + for x in $(sed -e '/^#/d' ${1}); do + for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then + continue + fi + + ln -s ${y} ${TMPDIR}/modules + echo $(basename ${y}) >>${TMPDIR}/conf/modules + done + done +} + usage() { cat >&2 << EOF @@ -51,6 +73,8 @@ if [ x${outfile} = x ] || [ ${#} -ne 1 ]; then usage fi +version=${1} + if [ -d ${outfile} ]; then echo "${outfile} is a directory" exit 1 @@ -65,16 +89,8 @@ TMPDIR=$(mktemp -d) || exit 1 mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts -for x in $(sed -e '/^#/d' ${CONFDIR}/modules); do - for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then - continue - fi - - ln -s ${y} ${TMPDIR}/modules - echo $(basename ${y}) >>${TMPDIR}/conf/modules - done +for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do + manual_add_modules ${x} done # Have to do each file, because cpio --dereference doesn't recurse down diff --git a/scripts/functions b/scripts/functions index 586c82f..4a92011 100644 --- a/scripts/functions +++ b/scripts/functions @@ -128,3 +128,4 @@ run_scripts() ${initdir}/${script} done } + -- cgit v1.2.3 From 76840aa0b07eeb0fc7a3ae96e0419aa39af53c9d Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 20:08:55 +0000 Subject: Remove more generated files --- debian/files | 1 - 1 file changed, 1 deletion(-) delete mode 100644 debian/files diff --git a/debian/files b/debian/files deleted file mode 100644 index 47aa909..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -initramfs-tools_0.7_all.deb utils optional -- cgit v1.2.3 From b1efb2876bac0e27aac5ff55200a4a7cc83042a0 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 20:19:50 +0000 Subject: Remove accidental commit, don't replace /bin/sh with busybox. It's not a posix shell --- mkinitramfs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 2134a2d..359ecd2 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -112,8 +112,7 @@ rm ${TMPDIR}/lib/*lsb* # Busybox if [ "x${BUSYBOX}" = "xy" ]; then - rm ${TMPDIR}/bin/sh - ln -s /bin/busybox ${TMPDIR}/bin/sh + ln -s /bin/busybox ${TMPDIR}/bin fi # Raid -- cgit v1.2.3 From 8d503582491ccf26b6925e5eb7cf77d9158fc65b Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 13 Jun 2005 01:40:55 +0000 Subject: Update with new dependancy based init system, call the right script directories, always use busybox now, sigh. --- debian/control | 4 +- init | 14 +++- mkinitramfs | 8 ++- scripts/functions | 178 ++++++++++++++++++++++---------------------------- scripts/init-top/test | 18 ----- scripts/local | 6 +- scripts/local-top/md | 18 +++++ scripts/nfs | 6 +- 8 files changed, 122 insertions(+), 130 deletions(-) delete mode 100644 scripts/init-top/test create mode 100644 scripts/local-top/md diff --git a/debian/control b/debian/control index fe8d332..89c37e4 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,11 @@ Source: initramfs-tools Section: utils Priority: optional Maintainer: Jeff Bailey -Build-Depends-Indep: debhelper (>= 4.0.0), cdbs, busybox-cvs-static +Build-Depends-Indep: debhelper (>= 4.0.0), cdbs Standards-Version: 3.6.1 Package: initramfs-tools Architecture: all -Depends: klibc-utils +Depends: klibc-utils, busybox-cvs-static Description: tools for generting an Ubuntu-style initramfs This package generates an initramfs for an Ubuntu system. diff --git a/init b/init index c09074f..733e7fd 100644 --- a/init +++ b/init @@ -1,4 +1,14 @@ #!/bin/sh -x + +/bin/busybox ln -s /bin/busybox /bin/[ +/bin/busybox ln -s /bin/busybox /bin/basename +/bin/busybox ln -s /bin/busybox /bin/mount +/bin/busybox ln -s /bin/busybox /bin/mkdir +/bin/busybox ln -s /bin/busybox /bin/umount +/bin/busybox ln -s /bin/busybox /bin/sed +/bin/busybox ln -s /bin/busybox /bin/grep +/bin/busybox ln -s /bin/busybox /bin/cat + mkdir /sys mkdir /proc mkdir /tmp @@ -40,7 +50,7 @@ for x in $(cat /proc/cmdline); do esac done -run_scripts /scripts/init_top +run_scripts /scripts/init-top . /scripts/${BOOT} @@ -59,7 +69,7 @@ fi mountroot -run_scripts /scripts/init_bottom +run_scripts /scripts/init-bottom umount /sys umount /proc diff --git a/mkinitramfs b/mkinitramfs index 359ecd2..e1c9a6b 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -99,7 +99,7 @@ done ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init -ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts +cp -a /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts ln -s ${CONFDIR}/initramfs.conf ${TMPDIR}/conf ln -s /etc/udev ${TMPDIR}/etc @@ -112,14 +112,16 @@ rm ${TMPDIR}/lib/*lsb* # Busybox if [ "x${BUSYBOX}" = "xy" ]; then + rm ${TMPDIR}/bin/sh ln -s /bin/busybox ${TMPDIR}/bin + ln -s /bin/busybox ${TMPDIR}/bin/sh fi # Raid ln -s /sbin/mdadm ${TMPDIR}/bin ln -s /sbin/mdrun ${TMPDIR}/bin -ln -s /bin/grep ${TMPDIR}/bin -ln -s /bin/sed ${TMPDIR}/bin +#ln -s /bin/grep ${TMPDIR}/bin +#ln -s /bin/sed ${TMPDIR}/bin (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) diff --git a/scripts/functions b/scripts/functions index 4a92011..a2ffd54 100644 --- a/scripts/functions +++ b/scripts/functions @@ -8,124 +8,104 @@ panic() fi } -# this function finds scripts with empty depends and adds them -# to the ordered list -dep_reduce() +render() { - i=0 - j=0 - unset neworder - - for entry in "${array[@]}"; do - set - ${entry} + eval "echo -n \${$@}" +} - if [ "$#" -eq "0" ]; then +set_initlist() +{ + unset initlist + for si_x in ${initdir}/*; do + if [ ! -x ${si_x} ]; then continue - elif [ "$#" -eq "1" ]; then - if [ $end -eq 0 ] || - [ x"${order[$((end-1))]}" != x"$1" ]; then - order[$((end))]=$1 - end=$((end+1)) - neworder[$((j))]=$1 - j=$((j+1)) - fi - - array[$((i))]= fi - - i=$((i+1)) + initlist="${initlist} $(basename ${si_x})" done } -dep_remove() +reduce_satisfied() { - i=0 - - # for each row in the array - for entry in "${array[@]}"; do - unset newentry - - set - ${entry} - - # for each dependency of the script - for dep in "$@"; do - new=1 - - # for each new dependency - for tmp in "${order[@]}"; do - if [ x"$dep" = x"$tmp" ]; then - new=0 - fi - done - - if [ x"$new" = x"1" ]; then - newentry="$newentry $dep" - fi - done + deplist="$(render array_${1})" + for rs_x in ${runlist}; do + pop_list_item ${rs_x} ${deplist} + deplist=${tmppop} + done + eval array_${1}=\"${deplist}\" +} - array[$((i))]="$newentry" - i=$((i+1)) +get_prereqs() +{ + set_initlist + for gp_x in ${initlist}; do + tmp=$(${initdir}/${gp_x} prereqs) + eval array_${gp_x}=\"${tmp}\" done } -run_scripts() +count_unsatisfied() { - initdir=${1} - scripts=$(ls ${initdir}) - order= - end=0 - array= + set - ${@} + return ${#} +} - # FIXME: New algorithm - # array of strings: "$file $prereqs" - # iterate over all strings; find empty strings (just $file) - # add to order, delete from all strings and zero out entry - # repeat until all strings are empty - - i=0 - for file in $scripts; do - # if it's not a regular file, or if it's not executable, skip it - if ! [ -f ${initdir}/${file} ] || ! [ -x ${initdir}/${file} ]; then +# Removes $1 from initlist +pop_list_item() +{ + item=${1} + shift + set - ${@} + unset tmppop + # Iterate + for pop in ${@}; do + if [ ${pop} = ${item} ]; then continue fi - - array[$((i))]="$file $(${initdir}/${file} prereqs)" - i=$((i+1)) + tmppop="${tmppop} ${pop}" done - # No scripts in directory, bail. - if [ ${i} -eq 0 ]; then - return 0 - fi - - while /bin/true; do - set - ${array[@]} - - if [ "$#" -eq "0" ]; then - break - fi - - dep_reduce - - dep_remove - - if [ "${#neworder}" -eq "0" ]; then - for x in "${array[@]}"; do - if [ x"$x" != x"" ]; then - printf "could not reduce further; " - printf "circular dependencies\n" - return 1 - fi - done - - # we're done! - break +} + +# This function generates the runlist, so we clear it first. +reduce_prereqs() +{ + unset runlist + set_initlist + set - ${initlist} + i=$# + # Loop until there's no more in the queue to loop through + while [ ${i} -ne 0 ]; do + oldi=${i} + for rp_x in ${initlist}; do + reduce_satisfied ${rp_x} + count_unsatisfied $(render array_${rp_x}) + cnt=${?} + if [ ${cnt} -eq 0 ]; then + runlist="${runlist} ${rp_x}" + pop_list_item ${rp_x} ${initlist} + initlist=${tmppop} + i=$((${i} - 1)) + fi + done + if [ ${i} -eq ${oldi} ]; then + echo "PANIC: Circular dependancy. Exiting." >&2 + exit 1 fi done - - # run the initscripts - for script in "${order[@]}"; do - ${initdir}/${script} +} + +call_scripts() +{ + echo ${runlist} + for cs_x in ${runlist}; do + ${initdir}/${cs_x} done -} +} +run_scripts() +{ + initdir=${1} + get_prereqs + reduce_prereqs + call_scripts +} diff --git a/scripts/init-top/test b/scripts/init-top/test deleted file mode 100644 index e4d59fb..0000000 --- a/scripts/init-top/test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -echo "Got here!" diff --git a/scripts/local b/scripts/local index ffbd230..b322f09 100644 --- a/scripts/local +++ b/scripts/local @@ -3,7 +3,7 @@ # Parameter: Where to mount the filesystem mountroot () { - run_scripts /scripts/local_top + run_scripts /scripts/local-top # Get the root filesystem type if [ ! -e ${ROOT} ]; then @@ -12,10 +12,10 @@ mountroot () eval $(fstype < ${ROOT}) - run_scripts /scripts/local_premount + run_scripts /scripts/local-premount # Mount root mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} - run_scripts /scripts/local_bottom + run_scripts /scripts/local-bottom } diff --git a/scripts/local-top/md b/scripts/local-top/md new file mode 100644 index 0000000..d6f7e94 --- /dev/null +++ b/scripts/local-top/md @@ -0,0 +1,18 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +/bin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index d0f1600..9860ea7 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,7 +2,7 @@ # Paramter: Where the root should be mounted mountroot () { - run_scripts /scripts/nfs_top + run_scripts /scripts/nfs-top ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf @@ -10,10 +10,10 @@ mountroot () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi - run_scripts /scripts/nfs_premount + run_scripts /scripts/nfs-premount nfsmount ${NFSROOT} ${rootmnt} - run_scripts /scripts/nfs_bottom + run_scripts /scripts/nfs-bottom } -- cgit v1.2.3 From 74a75c2b53b50aeadc939d14aa174505a93271b1 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 13 Jun 2005 01:52:43 +0000 Subject: Depend on mdadm --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 89c37e4..e2c4dbb 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.6.1 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-static +Depends: klibc-utils, busybox-cvs-static, mdadm Description: tools for generting an Ubuntu-style initramfs This package generates an initramfs for an Ubuntu system. -- cgit v1.2.3 From 433e18f414f120c3c28568114ea6854167fe7c74 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 13 Jun 2005 02:03:37 +0000 Subject: Bump version to 0.8 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 41f15e5..7f0053e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.8) UNRELEASED; urgency=low + + + + * + + -- Jeff Bailey Mon, 13 Jun 2005 01:53:01 +0000 + initramfs-tools (0.7) breezy; urgency=low The "CONFORM!" release. -- cgit v1.2.3 From 43528be821f50d8676ba29d7e51be6915d74cfae Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 14 Jun 2005 21:39:18 +0000 Subject: export command line parameters to run scripts. honour commandline readonly/readwrite parameters for nfs. Release initramfs 0.8 --- debian/changelog | 11 +++++++---- init | 14 +++++++------- scripts/local | 8 +++++++- scripts/nfs | 8 +++++++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7f0053e..b96929f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,13 @@ -initramfs-tools (0.8) UNRELEASED; urgency=low +initramfs-tools (0.8) breezy; urgency=low - + The "We are one in the spirit..." release - * + * Export the command line variables so that the various scripts + can see them. - -- Jeff Bailey Mon, 13 Jun 2005 01:53:01 +0000 + * Honour command line 'ro' or 'rw' settings for nfs. + + -- Jeff Bailey Tue, 14 Jun 2005 21:35:14 +0000 initramfs-tools (0.7) breezy; urgency=low diff --git a/init b/init index 733e7fd..31a16c0 100644 --- a/init +++ b/init @@ -19,11 +19,11 @@ mount -t proc proc /proc . /scripts/functions # Parse command line options -init=/sbin/init -root= -ro=-r -break= -rootmnt=/root +export init=/sbin/init +export root= +export readonly=y +export break= +export rootmnt=/root for x in $(cat /proc/cmdline); do case $x in init=*) @@ -39,10 +39,10 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; ro) - ro=-r + readonly=yes ;; rw) - ro=-w + readonly=no ;; break) break=yes diff --git a/scripts/local b/scripts/local index b322f09..cf9e331 100644 --- a/scripts/local +++ b/scripts/local @@ -14,8 +14,14 @@ mountroot () run_scripts /scripts/local-premount + if [ ${readonly} = y ]; then + roflag=-r + else + roflag=-w + fi + # Mount root - mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} + mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} run_scripts /scripts/local-bottom } diff --git a/scripts/nfs b/scripts/nfs index 9860ea7..d8a259a 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -12,7 +12,13 @@ mountroot () run_scripts /scripts/nfs-premount - nfsmount ${NFSROOT} ${rootmnt} + if [ ${readonly} = y ]; then + roflag="-o ro" + else + roflag="-o rw" + fi + + nfsmount ${roflag} ${NFSROOT} ${rootmnt} run_scripts /scripts/nfs-bottom -- cgit v1.2.3 From 333765e767ca14365b8078598aee55bfb5a4db32 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 16 Jun 2005 19:41:14 +0000 Subject: Require busybox-cvs-initramfs, include modprobe bits --- debian/changelog | 8 ++++++++ debian/control | 2 +- init | 9 --------- mkinitramfs | 13 ++++++------- scripts/functions | 6 +----- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/debian/changelog b/debian/changelog index b96929f..88abe0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.9) breezy; urgency=low + + * Unconditionally require busybox. Might revert this eventually + but it's too much of a pain right now do this without + a reasonably environment. + + -- Jeff Bailey Thu, 16 Jun 2005 02:23:50 +0000 + initramfs-tools (0.8) breezy; urgency=low The "We are one in the spirit..." release diff --git a/debian/control b/debian/control index e2c4dbb..7222e98 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.6.1 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-static, mdadm +Depends: klibc-utils, busybox-cvs-initramfs, mdadm Description: tools for generting an Ubuntu-style initramfs This package generates an initramfs for an Ubuntu system. diff --git a/init b/init index 31a16c0..a338889 100644 --- a/init +++ b/init @@ -1,14 +1,5 @@ #!/bin/sh -x -/bin/busybox ln -s /bin/busybox /bin/[ -/bin/busybox ln -s /bin/busybox /bin/basename -/bin/busybox ln -s /bin/busybox /bin/mount -/bin/busybox ln -s /bin/busybox /bin/mkdir -/bin/busybox ln -s /bin/busybox /bin/umount -/bin/busybox ln -s /bin/busybox /bin/sed -/bin/busybox ln -s /bin/busybox /bin/grep -/bin/busybox ln -s /bin/busybox /bin/cat - mkdir /sys mkdir /proc mkdir /tmp diff --git a/mkinitramfs b/mkinitramfs index e1c9a6b..94cf4c5 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -111,17 +111,16 @@ ln -s /lib/ld*.so.* ${TMPDIR}/lib rm ${TMPDIR}/lib/*lsb* # Busybox -if [ "x${BUSYBOX}" = "xy" ]; then - rm ${TMPDIR}/bin/sh - ln -s /bin/busybox ${TMPDIR}/bin - ln -s /bin/busybox ${TMPDIR}/bin/sh -fi +rm ${TMPDIR}/bin/sh +ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/sh + +# Modutils +ln -s /sbin/insmod ${TMPDIR}/bin +ln -s /sbin/modprobe ${TMPDIR}/bin # Raid ln -s /sbin/mdadm ${TMPDIR}/bin ln -s /sbin/mdrun ${TMPDIR}/bin -#ln -s /bin/grep ${TMPDIR}/bin -#ln -s /bin/sed ${TMPDIR}/bin (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) diff --git a/scripts/functions b/scripts/functions index a2ffd54..717418f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1,11 +1,7 @@ panic() { echo $@ - if [ -e /bin/busybox ]; then - FS1='(initramfs) ' exec /bin/busybox sh - else - FS1='(initramfs) ' exec /bin/sh - fi + FS1='(initramfs) ' exec /bin/sh } render() -- cgit v1.2.3 From 9c603dd111d019e87d0135459d3b15c996565e14 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 16 Jun 2005 20:26:16 +0000 Subject: Use modprobe instead of insmod --- init | 2 +- mkinitramfs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/init b/init index a338889..73981a5 100644 --- a/init +++ b/init @@ -48,7 +48,7 @@ run_scripts /scripts/init-top # Load the modules # FIXME - do module options here for x in $(cat /conf/modules); do - insmod /modules/$x + modprobe $x done # Populate /dev tree diff --git a/mkinitramfs b/mkinitramfs index 94cf4c5..bfb0007 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -12,11 +12,13 @@ manual_add_modules() for x in $(sed -e '/^#/d' ${1}); do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates - if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then + if [ -e ${TMPDIR}/${y} ]; then continue fi - ln -s ${y} ${TMPDIR}/modules + mkdir -p ${TMPDIR}/$(dirname ${y}) + ln -s ${y} ${TMPDIR}/$(dirname ${y}) + depmod -b ${TMPDIR} ${version} echo $(basename ${y}) >>${TMPDIR}/conf/modules done done @@ -113,9 +115,10 @@ rm ${TMPDIR}/lib/*lsb* # Busybox rm ${TMPDIR}/bin/sh ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/sh +# This is ugly, but needed atm to make the builtins work =( +ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox # Modutils -ln -s /sbin/insmod ${TMPDIR}/bin ln -s /sbin/modprobe ${TMPDIR}/bin # Raid -- cgit v1.2.3 From bf8d6100fb13127151c309d842185b3a250ecfff Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 17 Jun 2005 12:17:42 +0000 Subject: Integrate Matt Zimmerman's changes to initramfs --- debian/changelog | 15 +++++++++++++-- init | 10 +++------- mkinitramfs | 25 +++++++++++++++++++++++-- scripts/functions | 20 ++++++++++++++++++++ scripts/local | 2 ++ 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 88abe0c..5cd9969 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,22 @@ -initramfs-tools (0.9) breezy; urgency=low +initramfs-tools (0.10) breezy; urgency=low * Unconditionally require busybox. Might revert this eventually but it's too much of a pain right now do this without - a reasonably environment. + a reasonably environment + + * Use modprobe to load modules + + * Iterate through /sys/bus/pci and /sys/bus/usb and load drivers + based on their modalias -- Jeff Bailey Thu, 16 Jun 2005 02:23:50 +0000 +initramfs-tools (0.9) breezy; urgency=low + + * Be consistent about y/n vs. yes/no values for the readonly variable + + -- Matt Zimmerman Thu, 16 Jun 2005 15:22:30 -0700 + initramfs-tools (0.8) breezy; urgency=low The "We are one in the spirit..." release diff --git a/init b/init index 73981a5..52e10bd 100644 --- a/init +++ b/init @@ -30,10 +30,10 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; ro) - readonly=yes + readonly=y ;; rw) - readonly=no + readonly=n ;; break) break=yes @@ -45,11 +45,7 @@ run_scripts /scripts/init-top . /scripts/${BOOT} -# Load the modules -# FIXME - do module options here -for x in $(cat /conf/modules); do - modprobe $x -done +load_modules # Populate /dev tree udevstart diff --git a/mkinitramfs b/mkinitramfs index bfb0007..c3e98a3 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -19,7 +19,24 @@ manual_add_modules() mkdir -p ${TMPDIR}/$(dirname ${y}) ln -s ${y} ${TMPDIR}/$(dirname ${y}) depmod -b ${TMPDIR} ${version} - echo $(basename ${y}) >>${TMPDIR}/conf/modules + echo $(basename ${y} .ko) >>${TMPDIR}/conf/modules + done + done +} + +# Modules that we always add to the initramfs +auto_add_modules() +{ + for x in ext3 ext2 raid1 md sd_mod sata_svw usbhid ohci_hcd ehci_hcd; do + for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${TMPDIR}/${y} ]; then + continue + fi + + mkdir -p ${TMPDIR}/$(dirname ${y}) + ln -s ${y} ${TMPDIR}/$(dirname ${y}) + depmod -b ${TMPDIR} ${version} done done } @@ -90,11 +107,14 @@ fi TMPDIR=$(mktemp -d) || exit 1 mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts +mkdir -p ${TMPDIR}/sbin for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do manual_add_modules ${x} done +auto_add_modules + # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. @@ -119,7 +139,8 @@ ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/sh ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox # Modutils -ln -s /sbin/modprobe ${TMPDIR}/bin +ln -s /sbin/modprobe ${TMPDIR}/sbin +ln -s /sbin/rmmod ${TMPDIR}/bin # Raid ln -s /sbin/mdadm ${TMPDIR}/bin diff --git a/scripts/functions b/scripts/functions index 717418f..7e8c725 100644 --- a/scripts/functions +++ b/scripts/functions @@ -105,3 +105,23 @@ run_scripts() reduce_prereqs call_scripts } + +load_modules() +{ + for x in /sys/bus/pci/devices/*; do + modprobe -q $(cat ${x}/modalias) + done + + # Give the USB bus a moment to catch up + sleep 2 + + for x in /sys/bus/usb/devices/*; do + modprobe -q $(cat ${x}/modalias) + done + + # Load the modules + # FIXME - do module options here + for x in $(cat /conf/modules); do + modprobe -v $x + done +} diff --git a/scripts/local b/scripts/local index cf9e331..99eea77 100644 --- a/scripts/local +++ b/scripts/local @@ -20,6 +20,8 @@ mountroot () roflag=-w fi + modprobe ${FSTYPE} + # Mount root mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} -- cgit v1.2.3 From 287dcae1407c303ee929d2bff0a49c1e721b05ae Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 17 Jun 2005 15:57:54 +0000 Subject: Use /sbin, do depmod at boot time, copy all the interesting hardware drivers onto the initramfs --- conf/modules | 6 ++---- debian/NEWS | 15 +++++++++++++++ debian/changelog | 11 ++++++++++- mkinitramfs | 35 ++++++++++++++++++++++++++++++----- scripts/functions | 2 ++ scripts/local-top/md | 2 +- 6 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 debian/NEWS diff --git a/conf/modules b/conf/modules index ee1310a..8f12189 100644 --- a/conf/modules +++ b/conf/modules @@ -1,7 +1,5 @@ # List of modules that you want to include in your initramfs. # This might be good choices: # -#ide-disk -#ide-generic -#ext2 -#ext3 +# raid1 +# sd_mod diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 0000000..e755806 --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,15 @@ +initramfs-tools (0.10) breezy; urgency=low + + * This release includes hardware auto detection in the initramfs. + 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 + arch that doesn't like >4mb initramfs', then this won't boot. + + 2) Your network drivers are loaded in the initramfs, so hotplug + won't see a network event, so ifup won't be run. This will + be fixed shortly in hotplug. + + -- Jeff Bailey Fri, 17 Jun 2005 15:17:06 +0000 + diff --git a/debian/changelog b/debian/changelog index 5cd9969..ca4efc1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ initramfs-tools (0.10) breezy; urgency=low + The "I can see you!" release. + * Unconditionally require busybox. Might revert this eventually but it's too much of a pain right now do this without a reasonably environment @@ -9,7 +11,14 @@ initramfs-tools (0.10) breezy; urgency=low * Iterate through /sys/bus/pci and /sys/bus/usb and load drivers based on their modalias - -- Jeff Bailey Thu, 16 Jun 2005 02:23:50 +0000 + * Start to use /sbin for things + + * Include depmod in the image. Use it at boot time. + + * Edit config example to show the modules that do need to be included + manually for this build. + + -- Jeff Bailey Fri, 17 Jun 2005 12:45:07 +0000 initramfs-tools (0.9) breezy; urgency=low diff --git a/mkinitramfs b/mkinitramfs index c3e98a3..078346f 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -18,16 +18,40 @@ manual_add_modules() mkdir -p ${TMPDIR}/$(dirname ${y}) ln -s ${y} ${TMPDIR}/$(dirname ${y}) - depmod -b ${TMPDIR} ${version} echo $(basename ${y} .ko) >>${TMPDIR}/conf/modules done done } +# Copy entire subtrees to the initramfs +copy_modules_dir() +{ + tmpdir_modbase=${TMPDIR}/lib/modules/${version} + mkdir -p $(dirname ${tmpdir_modbase}/${1}) + cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} +} + # Modules that we always add to the initramfs auto_add_modules() { - for x in ext3 ext2 raid1 md sd_mod sata_svw usbhid ohci_hcd ehci_hcd; do + copy_modules_dir kernel/drivers/net + copy_modules_dir kernel/drivers/scsi + copy_modules_dir kernel/drivers/ide + copy_modules_dir kernel/drivers/md + copy_modules_dir kernel/drivers/usb + copy_modules_dir kernel/drivers/block + copy_modules_dir kernel/drivers/input + copy_modules_dir kernel/fs/ext2 + copy_modules_dir kernel/fs/ext3 + copy_modules_dir kernel/fs/isofs + copy_modules_dir kernel/fs/jbd + copy_modules_dir kernel/fs/jfs + copy_modules_dir kernel/fs/nfs + copy_modules_dir kernel/fs/reiserfs + copy_modules_dir kernel/fs/xfs + + # These aren't caught by the above but really need to be there: + for x in mbcache; do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/${y} ]; then @@ -140,11 +164,12 @@ ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox # Modutils ln -s /sbin/modprobe ${TMPDIR}/sbin -ln -s /sbin/rmmod ${TMPDIR}/bin +ln -s /sbin/depmod ${TMPDIR}/sbin +ln -s /sbin/rmmod ${TMPDIR}/sbin # Raid -ln -s /sbin/mdadm ${TMPDIR}/bin -ln -s /sbin/mdrun ${TMPDIR}/bin +ln -s /sbin/mdadm ${TMPDIR}/sbin +ln -s /sbin/mdrun ${TMPDIR}/sbin (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) diff --git a/scripts/functions b/scripts/functions index 7e8c725..d5d1035 100644 --- a/scripts/functions +++ b/scripts/functions @@ -108,6 +108,8 @@ run_scripts() load_modules() { + depmod + for x in /sys/bus/pci/devices/*; do modprobe -q $(cat ${x}/modalias) done diff --git a/scripts/local-top/md b/scripts/local-top/md index d6f7e94..864ffe4 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -15,4 +15,4 @@ prereqs) ;; esac -/bin/mdrun /dev +/sbin/mdrun /dev -- cgit v1.2.3 From b22f2c7fc49c9874eb8f2df1d8b1fabec540cfb0 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 17 Jun 2005 21:24:55 +0000 Subject: Make quieter, match mkinitrd interface, pull in dependencies for nfs and dhcp, document upstream repository location --- debian/changelog | 17 +++++++++++++++++ debian/copyright | 7 +++++-- init | 2 +- mkinitramfs | 22 +++++++++++++++++++++- scripts/functions | 8 ++++++-- scripts/nfs | 4 ++++ 6 files changed, 54 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index ca4efc1..dfdbc50 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.11) breezy; urgency=low + + "Illusion is the first of all pleasures" - Oscar Wilde + + * Make the init much less noisy + + * Pull in all the dependancies for nfs and af_packet + + * Be compatible with misdocumented mkinitrd interface + + Thanks to Matt Zimmerman for the bug reports and testing! + + * Update debian/copyright to have the location of the bzr + archive + + -- Jeff Bailey Fri, 17 Jun 2005 21:23:25 +0000 + initramfs-tools (0.10) breezy; urgency=low The "I can see you!" release. diff --git a/debian/copyright b/debian/copyright index cdc2919..a40b722 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,9 +1,12 @@ -This package was debianized by Jeff Bailey on +This package was debianized by Jeff Bailey on Thu, 27 Jan 2005 15:23:52 -0500. Copyright: -Author: Jeff Bailey, with some pieces for initrd-tools +Author: Jeff Bailey + +The source code can be found by using "bzr" at: +http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools License: diff --git a/init b/init index 52e10bd..8c5c53e 100644 --- a/init +++ b/init @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh mkdir /sys mkdir /proc diff --git a/mkinitramfs b/mkinitramfs index 078346f..8ef22c4 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -51,7 +51,7 @@ auto_add_modules() copy_modules_dir kernel/fs/xfs # These aren't caught by the above but really need to be there: - for x in mbcache; do + for x in mbcache nfs af_packet; do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/${y} ]; then @@ -116,7 +116,27 @@ if [ x${outfile} = x ] || [ ${#} -ne 1 ]; then usage fi +# And by "version" we really mean path to kernel modules +# This is braindead, and exists to preserve the interface with mkinitrd version=${1} +[ $# -gt 0 ] || unset version +case ${version} in +/lib/modules/*/[!/]*) + ;; +/lib/modules/[!/]*) + version=${version#/lib/modules/} + version=${version%%/*} + ;; +esac + +case ${version} in +*/*) + echo $PROG: ${version} is not a valid kernel version >&2 + exit 1 + ;; +esac + +version="${version-$(uname -r)}" if [ -d ${outfile} ]; then echo "${outfile} is a directory" diff --git a/scripts/functions b/scripts/functions index d5d1035..ab23352 100644 --- a/scripts/functions +++ b/scripts/functions @@ -111,14 +111,18 @@ load_modules() depmod for x in /sys/bus/pci/devices/*; do - modprobe -q $(cat ${x}/modalias) + if [ -e ${x}/modalias ]; then + modprobe -q $(cat ${x}/modalias) + fi done # Give the USB bus a moment to catch up sleep 2 for x in /sys/bus/usb/devices/*; do - modprobe -q $(cat ${x}/modalias) + if [ -e ${x}/modalias ]; then + modprobe -q $(cat ${x}/modalias) + fi done # Load the modules diff --git a/scripts/nfs b/scripts/nfs index d8a259a..11c61f8 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -4,6 +4,10 @@ mountroot () { run_scripts /scripts/nfs-top + modprobe nfs + # For DHCP + modprobe af_packet + ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf if [ "x${NFSROOT}" = "xauto" ]; then -- cgit v1.2.3 From a137627150b76d48d96ef72d26915005a1ce8538 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 20 Jun 2005 23:05:53 +0000 Subject: * Don't complain if /etc/mkinitramfs/modules doesn't exist. * Make sure that raid1 is pulled in. * Include /etc/modprobe.d/aliases in the initramfs --- debian/changelog | 10 ++++++++++ mkinitramfs | 4 +++- scripts/functions | 8 +++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index dfdbc50..07d6a4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +initramfs-tools (0.12) breezy; urgency=low + + * Don't complain if /etc/mkinitramfs/modules doesn't exist. + + * Make sure that raid1 is pulled in. + + * Include /etc/modprobe.d/aliases in the initramfs + + -- Jeff Bailey Mon, 20 Jun 2005 23:05:04 +0000 + initramfs-tools (0.11) breezy; urgency=low "Illusion is the first of all pleasures" - Oscar Wilde diff --git a/mkinitramfs b/mkinitramfs index 8ef22c4..f06811e 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -51,7 +51,7 @@ auto_add_modules() copy_modules_dir kernel/fs/xfs # These aren't caught by the above but really need to be there: - for x in mbcache nfs af_packet; do + for x in mbcache nfs af_packet raid1; do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/${y} ]; then @@ -186,6 +186,8 @@ ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox ln -s /sbin/modprobe ${TMPDIR}/sbin ln -s /sbin/depmod ${TMPDIR}/sbin ln -s /sbin/rmmod ${TMPDIR}/sbin +mkdir -p ${TMPDIR}/etc/modprobe.d +ln -s /etc/modprobe.d/aliases ${TMPDIR}/etc/modprobe.d # Raid ln -s /sbin/mdadm ${TMPDIR}/sbin diff --git a/scripts/functions b/scripts/functions index ab23352..73b773a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -127,7 +127,9 @@ load_modules() # Load the modules # FIXME - do module options here - for x in $(cat /conf/modules); do - modprobe -v $x - done + if [ -e /conf/modules ]; then + for x in $(cat /conf/modules); do + modprobe -v $x + done + fi } -- cgit v1.2.3 From 13d2d927fde9d9d79edebc9c9903929b522de44e Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 20 Jun 2005 23:13:48 +0000 Subject: Add .bzrignore file --- .bzrignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .bzrignore diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 0000000..9e5fa19 --- /dev/null +++ b/.bzrignore @@ -0,0 +1,2 @@ +debian/files +debian/initramfs-tools -- cgit v1.2.3 From f12ad818ffc10d8243cd75d552226273df3d65a0 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 21 Jun 2005 01:31:54 +0000 Subject: * Default to currently running kernel version. Based on a patch from maximilian attems, thanks! * Handle module arguments in /etc/mkinitramfs/modules * Do hookscripts at generation time. Drop things into /usr/share/initramfs-tools/hooks or /etc/mkinitramfs/hooks * Make sure local-bottom and nfs-bottom get created Thanks to Karl Hegbloom for these three patches! * Prune stray echo from call_scripts * Load raid1 for now so that md setups will work. * Detect ide modules load Thanks to Jeff Waugh for initial testing of this! --- conf/modules | 4 ++++ debian/changelog | 20 ++++++++++++++++++++ debian/dirs | 6 ++++-- mkinitramfs | 38 ++++++++++++++++++++++++++------------ scripts/functions | 49 ++++++++++++++++++++++++++++++++++++++++--------- scripts/local | 2 +- scripts/local-top/md | 3 +++ scripts/nfs | 1 + 8 files changed, 99 insertions(+), 24 deletions(-) diff --git a/conf/modules b/conf/modules index 8f12189..0067831 100644 --- a/conf/modules +++ b/conf/modules @@ -1,4 +1,8 @@ # List of modules that you want to include in your initramfs. +# +# Syntax: module_name [args ...] +# +# # This might be good choices: # # raid1 diff --git a/debian/changelog b/debian/changelog index 07d6a4e..54d3fcd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,31 @@ initramfs-tools (0.12) breezy; urgency=low + "I am not young enough to know everything." - Oscar Wilde + * Don't complain if /etc/mkinitramfs/modules doesn't exist. * Make sure that raid1 is pulled in. * Include /etc/modprobe.d/aliases in the initramfs + * Default to currently running kernel version. + Based on a patch from maximilian attems, thanks! + + * Handle module arguments in /etc/mkinitramfs/modules + + * Do hookscripts at generation time. Drop things into + /usr/share/initramfs-tools/hooks or /etc/mkinitramfs/hooks + + * Make sure local-bottom and nfs-bottom get created + Thanks to Karl Hegbloom for these three patches! + + * Prune stray echo from call_scripts + + * Load raid1 for now so that md setups will work. + + * Detect ide modules load + Thanks to Jeff Waugh for initial testing of this! + -- Jeff Bailey Mon, 20 Jun 2005 23:05:04 +0000 initramfs-tools (0.11) breezy; urgency=low diff --git a/debian/dirs b/debian/dirs index ef40692..94484bb 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,7 +1,9 @@ etc/mkinitramfs/init-bottom etc/mkinitramfs/init-top -etc/mkinitramfs/local-premount etc/mkinitramfs/local-top -etc/mkinitramfs/nfs-premount +etc/mkinitramfs/local-premount +etc/mkinitramfs/local-bottom etc/mkinitramfs/nfs-top +etc/mkinitramfs/nfs-premount +etc/mkinitramfs/nfs-bottom usr/share/initramfs-tools/modules.d diff --git a/mkinitramfs b/mkinitramfs index f06811e..4dabfce 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,7 +1,17 @@ #!/bin/sh +# For dependency ordered mkinitramfs hook scripts. +. /usr/share/initramfs-tools/scripts/functions + # Takes a file containing a list of modules to be added as an argument # Figures out dependancies and adds it in. +# +# File syntax: +# +# # comment +# modprobe_module_name [args ...] +# [...] +# manual_add_modules() { # Sanity check @@ -9,8 +19,8 @@ manual_add_modules() return fi - for x in $(sed -e '/^#/d' ${1}); do - for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + sed -e '/^#/d' ${1} | while read module rest; do + for y in $(modprobe --set-version=${version} --show-depends ${module} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/${y} ]; then continue @@ -18,7 +28,7 @@ manual_add_modules() mkdir -p ${TMPDIR}/$(dirname ${y}) ln -s ${y} ${TMPDIR}/$(dirname ${y}) - echo $(basename ${y} .ko) >>${TMPDIR}/conf/modules + echo $(basename ${y} .ko) "${rest}" >>${TMPDIR}/conf/modules done done } @@ -51,7 +61,7 @@ auto_add_modules() copy_modules_dir kernel/fs/xfs # These aren't caught by the above but really need to be there: - for x in mbcache nfs af_packet raid1; do + for x in mbcache nfs af_packet raid1 ide-cd ide-disk ide-generic; do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates if [ -e ${TMPDIR}/${y} ]; then @@ -99,9 +109,6 @@ while getopts "d:ko:r:" flag; do o) outfile="${OPTARG}" ;; - v) - version="${OPTARG}" - ;; k) keep="y" ;; @@ -112,14 +119,18 @@ shift $((${OPTIND} - 1)) . ${CONFDIR}/initramfs.conf -if [ x${outfile} = x ] || [ ${#} -ne 1 ]; then +if [ x${outfile} = x ]; then usage fi # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd -version=${1} -[ $# -gt 0 ] || unset version +if [ ${#} -ne 1 ]; then + version=$(uname -r) +else + version="${1}" +fi + case ${version} in /lib/modules/*/[!/]*) ;; @@ -136,8 +147,6 @@ case ${version} in ;; esac -version="${version-$(uname -r)}" - if [ -d ${outfile} ]; then echo "${outfile} is a directory" exit 1 @@ -193,6 +202,11 @@ ln -s /etc/modprobe.d/aliases ${TMPDIR}/etc/modprobe.d ln -s /sbin/mdadm ${TMPDIR}/sbin ln -s /sbin/mdrun ${TMPDIR}/sbin +run_scripts /usr/share/initramfs-tools/hooks +run_scripts /etc/mkinitramfs/hooks + +# FIXME catenate extra cpio.gz here >>${outfile} + (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) if [ "${keep}" = "y" ]; then diff --git a/scripts/functions b/scripts/functions index 73b773a..5fb8c04 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1,3 +1,5 @@ +# -*- shell-script -*- + panic() { echo $@ @@ -92,7 +94,6 @@ reduce_prereqs() call_scripts() { - echo ${runlist} for cs_x in ${runlist}; do ${initdir}/${cs_x} done @@ -106,9 +107,44 @@ run_scripts() call_scripts } +ide_boot_events() { + [ "$(echo /proc/ide/*/media)" = "/proc/ide/*/media" ] && return + + for drive in /proc/ide/*/media; do + # nothing to do if the device has already been took in charge + unit=${drive#/proc/ide/}; unit=${unit%/media} + [ -d /sys/block/$unit ] && continue + + read media < $drive + 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 +} + load_modules() { - depmod + depmod -a + + # Load custom modules first + if [ -e /conf/modules ]; then + cat /conf/modules | while read m; do + if [ -z "$m" ] \ + || expr "$m" : "#" >/dev/null \ + || expr "$m" : "[ \t]+#?" > /dev/null + then + continue; + else + modprobe -v $m + fi + done + fi for x in /sys/bus/pci/devices/*; do if [ -e ${x}/modalias ]; then @@ -125,11 +161,6 @@ load_modules() fi done - # Load the modules - # FIXME - do module options here - if [ -e /conf/modules ]; then - for x in $(cat /conf/modules); do - modprobe -v $x - done - fi + ide_boot_events + } diff --git a/scripts/local b/scripts/local index 99eea77..4a17abb 100644 --- a/scripts/local +++ b/scripts/local @@ -1,4 +1,4 @@ -# Local filesystem mounting +# Local filesystem mounting -*- shell-script -*- # Parameter: Where to mount the filesystem mountroot () diff --git a/scripts/local-top/md b/scripts/local-top/md index 864ffe4..062852f 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -15,4 +15,7 @@ prereqs) ;; esac +# FIXME detect this! +modprobe raid1 + /sbin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index 11c61f8..1e2be2c 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -1,3 +1,4 @@ +# NFS filesystem mounting *- shell-script -*- # Paramter: Where the root should be mounted mountroot () -- cgit v1.2.3 From af3ccf91e2ca354c65e45e34abd0f48fe11d7d39 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 30 Jun 2005 00:04:16 +0000 Subject: We --- init | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/init b/init index 8c5c53e..6486139 100644 --- a/init +++ b/init @@ -10,10 +10,11 @@ mount -t proc proc /proc . /scripts/functions # Parse command line options +export break= export init=/sbin/init -export root= +export quiet=n export readonly=y -export break= +export root= export rootmnt=/root for x in $(cat /proc/cmdline); do case $x in @@ -29,6 +30,9 @@ for x in $(cat /proc/cmdline); do boot=*) BOOT=${x#boot=} ;; + quiet) + quiet=y + ;; ro) readonly=y ;; @@ -41,22 +45,32 @@ for x in $(cat /proc/cmdline); do esac done +log_begin_msg "Running /script/init-top" run_scripts /scripts/init-top +log_end_msg . /scripts/${BOOT} +log_begin_msg "Loading modules" load_modules +log_end_msg # Populate /dev tree +log_begin_msg "Initializing /dev" udevstart +log_end_msg if [ x${break} = xyes ]; then panic "Spawning shell within the initramfs" fi +log_begin_msg "Mounting root file system" mountroot +log_end_msg +log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom +log_end_msg umount /sys umount /proc -- cgit v1.2.3 -- cgit v1.2.3 From 2c72958bfc090b046e21e9eaad9134235095ad30 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 30 Jun 2005 00:05:01 +0000 Subject: * Use detailed logging now for debian/changelog. We have at least three people hacking now, and details would probably be useful. * debian/TODO: Update * debian/dirs: Sort and add usr/share/initramfs-tools/hooks * debian/initramfs-tools.examples: Add docs/example_hook and docs/example_hook_cpiogz * debian/initramfs-tools.install: Pretty Print. * debian/rules: Ensure that mkinitramfs is executable * docs/example_script: New file * init: Add concept of 'quiet', be verbose if not specified * mkinitramfs: Do not load script functions until needed Clear up comments / documentation Use DESTDIR instead of TMPDIR Add ability to link in extra hunks into the cpio file Cosmetic cleanups * scripts/functions: Add lsb stype log_FOO_msg functions * scripts/local: Add logging * scripts/nfs: Add logging --- debian/TODO | 2 + debian/changelog | 39 +++++++++++++++ debian/dirs | 9 ++-- debian/initramfs-tools.examples | 2 + debian/initramfs-tools.install | 8 +-- debian/rules | 2 +- docs/example_script | 73 ++++++++++++++++++++++++++- mkinitramfs | 106 +++++++++++++++++++++++----------------- scripts/functions | 39 ++++++++++++++- scripts/local | 8 +++ scripts/nfs | 10 +++- 11 files changed, 240 insertions(+), 58 deletions(-) diff --git a/debian/TODO b/debian/TODO index bf7e07d..d080de3 100644 --- a/debian/TODO +++ b/debian/TODO @@ -1,6 +1,8 @@ TODO ==== + o Grep for TODO and FIXME and do those. =) + o Get udev compiled against klibc o Integrate hotplug-ng diff --git a/debian/changelog b/debian/changelog index 54d3fcd..6c37206 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +initramfs-tools (0.13) breezy; urgency=low + + "We live in age when unnecessary things are our only necessities." + - Oscar Wilde + + * Use detailed logging now for debian/changelog. We have at least + three people hacking now, and details would probably be useful. + + * debian/TODO: Update + + * debian/dirs: Sort and add usr/share/initramfs-tools/hooks + + * debian/initramfs-tools.examples: Add docs/example_hook and + docs/example_hook_cpiogz + + * debian/initramfs-tools.install: Pretty Print. + + * debian/rules: Ensure that mkinitramfs is executable + + * docs/example_script: New file + + * init: Add concept of 'quiet', be verbose if not specified + + * mkinitramfs: Do not load script functions until needed + Clear up comments / documentation + Use DESTDIR instead of TMPDIR + Add ability to link in extra hunks into the cpio file + Cosmetic cleanups + + * scripts/functions: Add lsb stype log_FOO_msg functions + + * scripts/local: Add logging + + * scripts/nfs: Add logging + + Thanks to Karl Hegbloom for most of these patches! + + -- Jeff Bailey Wed, 29 Jun 2005 23:50:56 +0000 + initramfs-tools (0.12) breezy; urgency=low "I am not young enough to know everything." - Oscar Wilde diff --git a/debian/dirs b/debian/dirs index 94484bb..ac6210e 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,9 +1,10 @@ etc/mkinitramfs/init-bottom etc/mkinitramfs/init-top -etc/mkinitramfs/local-top -etc/mkinitramfs/local-premount etc/mkinitramfs/local-bottom -etc/mkinitramfs/nfs-top -etc/mkinitramfs/nfs-premount +etc/mkinitramfs/local-premount +etc/mkinitramfs/local-top etc/mkinitramfs/nfs-bottom +etc/mkinitramfs/nfs-premount +etc/mkinitramfs/nfs-top +usr/share/initramfs-tools/hooks usr/share/initramfs-tools/modules.d diff --git a/debian/initramfs-tools.examples b/debian/initramfs-tools.examples index 0e8472b..9f67297 100644 --- a/debian/initramfs-tools.examples +++ b/debian/initramfs-tools.examples @@ -1,2 +1,4 @@ conf/modules docs/example_script +docs/example_hook +docs/example_hook_cpiogz diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index e76186f..a2a78f5 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -1,4 +1,4 @@ -mkinitramfs usr/sbin -init usr/share/initramfs-tools -scripts usr/share/initramfs-tools -conf/initramfs.conf etc/mkinitramfs +mkinitramfs usr/sbin +init usr/share/initramfs-tools +scripts usr/share/initramfs-tools +conf/initramfs.conf etc/mkinitramfs diff --git a/debian/rules b/debian/rules index 0a1575f..a1b8695 100644 --- a/debian/rules +++ b/debian/rules @@ -3,4 +3,4 @@ include /usr/share/cdbs/1/rules/debhelper.mk common-build-arch:: - chmod +x init + chmod +x init mkinitramfs diff --git a/docs/example_script b/docs/example_script index 111b0d8..221c888 100644 --- a/docs/example_script +++ b/docs/example_script @@ -1,7 +1,52 @@ #!/bin/sh -# List the soft prerequisites here. So if there's something you know -# should be run first iff it exists. +# +# This script is run inside of the initramfs environment during the +# system boot process. It is installed there by 'mkinitramfs'. The +# package that owns it may opt to install it in either an appropriate +# location under "/usr/share/initramfs-tools/scripts/", or a similar +# location under "/etc/mkinitramfs/scripts/", depending upon whether +# it should be considered to be a user modifiable conffile or not. +# +# TODO: How do we deal with the case where the package that installed +# this has been removed but not purged, if we always arbitrarily +# copy all of these scripts into the initramfs? +# +# * The available toolset is limited inside this environment... +# +# TODO: document that toolset in the man page. +# +# * /dev, /proc, and /sys are already mounted. / is a ?? ro/rw +# filesystem... etc. more documentation. +# +# * It is expected that /proc and /sys will be umounted before +# changing over to the real root file system, so you must not keep +# any files open on them beyond these scripts. +# +# * You may like to strip these documentation comments from this +# example if you take it for a template, to save a little space in +# the initramfs, since nobody will ever read it from inside of +# there anyhow. +# + +# +# The environment contains at least the following variables: +# +# TODO: Decide what environment variables are meaningful and defined +# in this context, then document them as part of the interface. +# +# Because this script will be run as a full separate process, rather +# than sourced inside the context of the driver script, if it needs to +# pass information to another script that may run after it, it must do +# so by writing data to a file location known to both scripts. Simply +# setting an environment variable will not work. +# + +# +# List the soft prerequisites here. This is a space separated list of +# names, of scripts that are in the same directory as this one, that +# must be run before this one can be. +# PREREQ="" prereqs() @@ -18,4 +63,28 @@ prereqs) esac # Do the work here. + echo "Got here!" + +# Handle an error: + +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 + # + # TODO: Decide if different error codes are meaningful, what they + # mean, and what the semantics of them are wrt 'init' pass + # or panic. Consider naming the error values with mnemonic + # symbols rather than magic numbers. + # +fi + +exit 0 + diff --git a/mkinitramfs b/mkinitramfs index 4dabfce..c05fa47 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,12 +1,9 @@ #!/bin/sh -# For dependency ordered mkinitramfs hook scripts. -. /usr/share/initramfs-tools/scripts/functions - -# Takes a file containing a list of modules to be added as an argument -# Figures out dependancies and adds it in. +# Takes a file containing a list of modules to be added as an +# argument, figures out dependancies, and adds them. # -# File syntax: +# Input file syntax: # # # comment # modprobe_module_name [args ...] @@ -22,13 +19,13 @@ manual_add_modules() sed -e '/^#/d' ${1} | while read module rest; do for y in $(modprobe --set-version=${version} --show-depends ${module} | awk '{ print $2 }'); do # Prune duplicates - if [ -e ${TMPDIR}/${y} ]; then + if [ -e ${DESTDIR}/${y} ]; then continue fi - mkdir -p ${TMPDIR}/$(dirname ${y}) - ln -s ${y} ${TMPDIR}/$(dirname ${y}) - echo $(basename ${y} .ko) "${rest}" >>${TMPDIR}/conf/modules + mkdir -p ${DESTDIR}/$(dirname ${y}) + ln -s ${y} ${DESTDIR}/$(dirname ${y}) + echo $(basename ${y} .ko) "${rest}" >>${DESTDIR}/conf/modules done done } @@ -36,7 +33,7 @@ manual_add_modules() # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase=${TMPDIR}/lib/modules/${version} + tmpdir_modbase=${DESTDIR}/lib/modules/${version} mkdir -p $(dirname ${tmpdir_modbase}/${1}) cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} } @@ -64,13 +61,13 @@ auto_add_modules() for x in mbcache nfs af_packet raid1 ide-cd ide-disk ide-generic; do for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do # Prune duplicates - if [ -e ${TMPDIR}/${y} ]; then + if [ -e ${DESTDIR}/${y} ]; then continue fi - mkdir -p ${TMPDIR}/$(dirname ${y}) - ln -s ${y} ${TMPDIR}/$(dirname ${y}) - depmod -b ${TMPDIR} ${version} + mkdir -p ${DESTDIR}/$(dirname ${y}) + ln -s ${y} ${DESTDIR}/$(dirname ${y}) + depmod -b ${DESTDIR} ${version} done done } @@ -96,6 +93,8 @@ EOF # Defaults keep="n" CONFDIR="/etc/mkinitramfs" +verbose="n" +errors_to="2>/dev/null" while getopts "d:ko:r:" flag; do case $flag in @@ -117,6 +116,9 @@ done shift $((${OPTIND} - 1)) +# For dependency ordered mkinitramfs hook scripts. +. /usr/share/initramfs-tools/scripts/functions + . ${CONFDIR}/initramfs.conf if [ x${outfile} = x ]; then @@ -157,10 +159,21 @@ if [ ! -e /lib/modules/${version} ]; then exit 1 fi -TMPDIR=$(mktemp -d) || exit 1 -mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc -mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts -mkdir -p ${TMPDIR}/sbin +DESTDIR=$(mktemp -t -d mkinitramfs_XXXXXX) || exit 1 +__TMPCPIOGZ=$(mktemp -t mkinitramfs-OL_XXXXXX) || exit 1 + +# Export environment for hook scripts. +# +export version +export CONFDIR +export DESTDIR + +# Private, used by 'catenate_cpiogz'. +export __TMPCPIOGZ + +for d in bin conf etc lib modules sbin scripts; do + mkdir -p ${DESTDIR}/${d} +done for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do manual_add_modules ${x} @@ -171,46 +184,51 @@ auto_add_modules # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin -ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib -ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init -cp -a /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts -ln -s ${CONFDIR}/initramfs.conf ${TMPDIR}/conf -ln -s /etc/udev ${TMPDIR}/etc +ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin +ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +ln -s /usr/share/initramfs-tools/init ${DESTDIR}/init +cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts +ln -s ${CONFDIR}/initramfs.conf ${DESTDIR}/conf +ln -s /etc/udev ${DESTDIR}/etc # Hack until udev is built with klibc -ln -s /sbin/udev ${TMPDIR}/bin -ln -s /sbin/udevstart ${TMPDIR}/bin -ln -s /lib/libc.so.* ${TMPDIR}/lib -ln -s /lib/ld*.so.* ${TMPDIR}/lib -rm ${TMPDIR}/lib/*lsb* +ln -s /sbin/udev ${DESTDIR}/bin +ln -s /sbin/udevstart ${DESTDIR}/bin +ln -s /lib/libc.so.* ${DESTDIR}/lib +ln -s /lib/ld*.so.* ${DESTDIR}/lib +rm ${DESTDIR}/lib/*lsb* # Busybox -rm ${TMPDIR}/bin/sh -ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/sh +rm ${DESTDIR}/bin/sh +ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/sh # This is ugly, but needed atm to make the builtins work =( -ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox +ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/busybox # Modutils -ln -s /sbin/modprobe ${TMPDIR}/sbin -ln -s /sbin/depmod ${TMPDIR}/sbin -ln -s /sbin/rmmod ${TMPDIR}/sbin -mkdir -p ${TMPDIR}/etc/modprobe.d -ln -s /etc/modprobe.d/aliases ${TMPDIR}/etc/modprobe.d +ln -s /sbin/modprobe ${DESTDIR}/sbin +ln -s /sbin/depmod ${DESTDIR}/sbin +ln -s /sbin/rmmod ${DESTDIR}/sbin +mkdir -p ${DESTDIR}/etc/modprobe.d +ln -s /etc/modprobe.d/aliases ${DESTDIR}/etc/modprobe.d # Raid -ln -s /sbin/mdadm ${TMPDIR}/sbin -ln -s /sbin/mdrun ${TMPDIR}/sbin +ln -s /sbin/mdadm ${DESTDIR}/sbin +ln -s /sbin/mdrun ${DESTDIR}/sbin run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks -# FIXME catenate extra cpio.gz here >>${outfile} +(cd ${DESTDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) -(cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) +if [ -s ${__TMPCPIOGZ} ]; then + cat ${__TMPCPIOGZ} >>${outfile} +fi if [ "${keep}" = "y" ]; then - echo "Working files in ${TMPDIR}" + echo "Working files in ${DESTDIR} and overlay in ${__TMPCPIOGZ}" else - rm -rf "${TMPDIR}" + rm -rf "${DESTDIR}" + rm -rf "${__TMPCPIOGZ}" fi + +exit 0 diff --git a/scripts/functions b/scripts/functions index 5fb8c04..1899a14 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1,9 +1,45 @@ # -*- shell-script -*- +_log_msg() +{ + if [ "$quiet" = "y" ]; then return; fi + echo "$@" +} + +log_success_msg() +{ + _log_msg "Success: $@" +} + +log_failure_msg() +{ + _log_msg "Failure: $@" +} + +log_warning_msg() +{ + _log_msg "Warning: $@" +} + +log_begin_msg() +{ + _log_msg "Begin: $@ ..." +} + +log_end_msg() +{ + _log_msg "Done." +} + +# update_progress() # ToDo: NOP placeholder... what else for usplash? +# { +# : +# } + panic() { echo $@ - FS1='(initramfs) ' exec /bin/sh + FS1='(initramfs) ' exec /bin/sh /dev/console 2>&1 } render() @@ -162,5 +198,4 @@ load_modules() done ide_boot_events - } diff --git a/scripts/local b/scripts/local index 4a17abb..bcc96ad 100644 --- a/scripts/local +++ b/scripts/local @@ -3,7 +3,9 @@ # Parameter: Where to mount the filesystem mountroot () { + log_begin_msg "Running /scripts/local-top" run_scripts /scripts/local-top + log_end_msg # Get the root filesystem type if [ ! -e ${ROOT} ]; then @@ -12,7 +14,9 @@ mountroot () eval $(fstype < ${ROOT}) + log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount + log_end_msg if [ ${readonly} = y ]; then roflag=-r @@ -20,10 +24,14 @@ mountroot () roflag=-w fi + # FIXME This has no error checking modprobe ${FSTYPE} + # FIXME This has no error checking # Mount root mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} + log_begin_msg "Running /scripts/log-bottom" run_scripts /scripts/local-bottom + log_end_msg } diff --git a/scripts/nfs b/scripts/nfs index 1e2be2c..8149e86 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -1,9 +1,13 @@ -# NFS filesystem mounting *- shell-script -*- +# NFS filesystem mounting -*- shell-script -*- + +# FIXME This needs error checking # Paramter: Where the root should be mounted mountroot () { + log_begin_msg "Running /scripts/nfs-top" run_scripts /scripts/nfs-top + log_end_msg modprobe nfs # For DHCP @@ -15,7 +19,9 @@ mountroot () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi + log_begin_msg "Running /scripts/nfs-premount" run_scripts /scripts/nfs-premount + log_end_msg if [ ${readonly} = y ]; then roflag="-o ro" @@ -25,6 +31,8 @@ mountroot () nfsmount ${roflag} ${NFSROOT} ${rootmnt} + log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom + log_end_msg } -- cgit v1.2.3 From 2777a4e8f7b7e7b14cbba813d3b1e30b1acb4a53 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 30 Jun 2005 00:07:32 +0000 Subject: * Use detailed logging now for debian/changelog. We have at least three people hacking now, and details would probably be useful. * debian/TODO: Update * debian/dirs: Sort and add usr/share/initramfs-tools/hooks * debian/initramfs-tools.examples: Add docs/example_hook and docs/example_hook_cpiogz * debian/initramfs-tools.install: Pretty Print. * debian/rules: Ensure that mkinitramfs is executable * docs/example_script: New file * init: Add concept of 'quiet', be verbose if not specified * mkinitramfs: Do not load script functions until needed Clear up comments / documentation Use DESTDIR instead of TMPDIR Add ability to link in extra hunks into the cpio file Cosmetic cleanups * scripts/functions: Add lsb stype log_FOO_msg functions * scripts/local: Add logging * scripts/nfs: Add logging --- docs/example_hook | 111 +++++++++++++++++++++++++++++++++++++++++++++++ docs/example_hook_cpiogz | 84 +++++++++++++++++++++++++++++++++++ hook-functions | 6 +++ 3 files changed, 201 insertions(+) create mode 100644 docs/example_hook create mode 100644 docs/example_hook_cpiogz create mode 100644 hook-functions diff --git a/docs/example_hook b/docs/example_hook new file mode 100644 index 0000000..27582a7 --- /dev/null +++ b/docs/example_hook @@ -0,0 +1,111 @@ +#!/bin/sh + +# +# This is an example hook script. It will be run by 'mkinitramfs' +# when it creates the image. It's job is to decide which files to +# install, then install them into the staging area, where the +# initramfs is being created. This happens when a new 'linux-image' +# package is installed, or when the administrator runs 'mkinitramfs' +# by hand to update an initramfs image. +# +# TODO: What about the case where you install something that should be +# 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 +# predicated on a user response to a debconf question? That +# issue needs to be explored and a solution specified. +# +# * Do not assume that any needed subdirectories have been created +# yet, but don't bail out if they are already there. +# +# * All of the standard system tools are available, of course, since +# this hook is running in the real system, not the initramfs. +# +# * TODO: ... ? Anything else to tell them in this bullet-list? +# + +# +# The environment contains at least: +# +# CONFDIR -- usually /etc/mkinitramfs, can be set on mkinitramfs +# command line. +# +# DESTDIR -- The staging directory where we are building the image. +# +# TODO: Decide what environment variables are meaningful and defined +# in this context, then document them as part of the interface. +# + + +# +# List the soft prerequisites here. This is a space separated list of +# names, of scripts that are in the same directory as this one, that +# must be run before this one can be. +# +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + + +# You can do anything you need to from here on. +# + +# Source the optional 'hook-functions' scriptlet, if you need the +# functions defined within it: +# +# . /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 +# course may be other reasons to have custom logic deciding what to +# install. +# +if [ -x /usr/bin/myprog ]; then + install -D /usr/bin/myprog ${DESTDIR}/usr/bin +fi + +# To accompany this, there should usually be a script for inside the +# initramfs named something like: +# +# "/etc/mkinitramfs/local-premount/myprog" +# +# ... and it should do what is necessary to have 'myprog' get run +# inside the early runtime environment. + +# Handle an error: +# +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 + # + # TODO: Decide if different error codes are meaningful, what they + # mean, and what the semantics of them are wrt 'mkinitramfs' + # pass or fail. Consider naming the error values with + # mnemonic symbols rather than magic numbers. They may or + # may not be the same set of errors as the set for + # in-initramfs scripts. + # +fi + +exit 0 + diff --git a/docs/example_hook_cpiogz b/docs/example_hook_cpiogz new file mode 100644 index 0000000..dcd1416 --- /dev/null +++ b/docs/example_hook_cpiogz @@ -0,0 +1,84 @@ +#!/bin/sh + +# +# The environment contains at least: +# +# CONFDIR -- usually /etc/mkinitramfs, can be set on mkinitramfs +# command line. +# +# DESTDIR -- The staging directory where we are building the image. +# +# TODO: Decide what environment variables are meaningful and defined +# in this context, then document them as part of the interface. +# +# TODO: Write a common header for these examples or move this +# documentation to a man page and reference it here. :-) +# + +# +# List the soft prerequisites here. This is a space separated list of +# names, of scripts that are in the same directory as this one, that +# must be run before this one can be. +# +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# +# Source the 'hook-functions' scriptlet (for 'catenate_cpiogz'): +# +. /usr/share/initramfs-tools/hook-functions + +# +# Lets pretend it has a conffile (think debconf), and we source it +# here. Don't make debconf lookup calls here. The postinst for the +# package owning this hook script should have done that and configured +# the "/etc/default/conffile" already. +# +# TODO: How does the package ensure that it's installed BEFORE the +# 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 + +# +# Also pretend that we only include our initramfs overlay if an opion +# is not "no", and the 'linux-image' package we are generating this +# initramfs for matches the version this script's package is designed +# for. Just for example; pretend this example mkinitramfs hook script +# is part of a 'linux-image' or 'xxx-modules' package. +# +if [ "$MYOPTION" != "no" -a "$version" = "2.6.12+ss2.1.9.1" ]; then + catenate_cpiogz /usr/lib/mypackage/initramfs.cpio.gz +fi + +# +# In this case, there does not have to be an (eg.): +# +# "/etc/mkinitramfs/init-top/mypackage" +# +# ... since that script is probably inside of the initramfs overlay +# already. If it's a conffile though, it does not belong in there, +# and should be placed in the appropriate location inside of +# "/etc/mkinitramfs". Remember that if it needs access to the +# settings in our "/etc/default/mypackage-initramfs", then that file +# must also get copied into a location inside of ${DESTDIR} by this +# hook script in order to make it available inside of the initramfs +# environment. +# + +exit 0 diff --git a/hook-functions b/hook-functions new file mode 100644 index 0000000..0d79703 --- /dev/null +++ b/hook-functions @@ -0,0 +1,6 @@ +# -*- shell-script -*- + +catenate_cpiogz() { + cat "$1" >>${__TMPCPIOGZ} +} + -- cgit v1.2.3 From 38f6779d4a0aa081412b154bd7cd88ed005678af Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 15 Jul 2005 02:40:59 +0000 Subject: Add lvm support, update control --- debian/changelog | 17 ++++++++ debian/control | 9 +++- mkinitramfs | 125 +++++++++++++++++++++++++++++++----------------------- scripts/functions | 2 + 4 files changed, 97 insertions(+), 56 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6c37206..ac451da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -35,6 +35,23 @@ initramfs-tools (0.13) breezy; urgency=low Thanks to Karl Hegbloom for most of these patches! + * debian/control: Get a much better description + + Thanks to Maximilian Attems for this! + + * scripts/functions: Add copy_exec function that copies a program + and all libraries that it depends on. + + * mkinitramfs: Use it + + * scripts/local-top/lvm: New file + + * mkinitramfs: Specify the modules to copy rather than mass copying + directories + + * scripts/functions: Always load ide-generic to cope with ide subsystem + suckage. + -- Jeff Bailey Wed, 29 Jun 2005 23:50:56 +0000 initramfs-tools (0.12) breezy; urgency=low diff --git a/debian/control b/debian/control index 7222e98..514368c 100644 --- a/debian/control +++ b/debian/control @@ -8,5 +8,10 @@ Standards-Version: 3.6.1 Package: initramfs-tools Architecture: all Depends: klibc-utils, busybox-cvs-initramfs, mdadm -Description: tools for generting an Ubuntu-style initramfs - This package generates an initramfs for an Ubuntu system. +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 + unpacks that archive into ram, mounts and uses it as initial root file system. + From there on the mounting of the real root file system occurs in user space. + klibc handles the boot-time networking setup. Supports nfs root system. + Any boot loader with initrd support is able to load an initramfs archive. diff --git a/mkinitramfs b/mkinitramfs index c05fa47..cbc1f82 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -9,7 +9,7 @@ # modprobe_module_name [args ...] # [...] # -manual_add_modules() +add_modules_from_file() { # Sanity check if [ ! -e ${1} ]; then @@ -17,16 +17,42 @@ manual_add_modules() fi sed -e '/^#/d' ${1} | while read module rest; do - for y in $(modprobe --set-version=${version} --show-depends ${module} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${DESTDIR}/${y} ]; then - continue - fi - - mkdir -p ${DESTDIR}/$(dirname ${y}) - ln -s ${y} ${DESTDIR}/$(dirname ${y}) - echo $(basename ${y} .ko) "${rest}" >>${DESTDIR}/conf/modules - done + manual_add_modules ${module} + echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules + done +} + +manual_add_modules() +{ + for mam_x in $(modprobe --set-version=${version} --show-depends ${1} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${DESTDIR}/${mam_x} ]; then + continue + fi + + mkdir -p ${DESTDIR}/$(dirname ${mam_x}) + ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) + depmod -b ${DESTDIR} ${version} + done +} + +# $1 is source +# $2 is relative destination +copy_exec() { + ln -s ${1} ${DESTDIR}/${2} + + # Copy the dependant libraries + for x in $(ldd ${1} 2>/dev/null | sed -e ' + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + libname=$(basename ${x}) + dirname=$(dirname ${x}) + mkdir -p ${DESTDIR}/${dirname} + if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then + ln -s ${x} ${DESTDIR}/${dirname} + fi done } @@ -41,35 +67,26 @@ copy_modules_dir() # Modules that we always add to the initramfs auto_add_modules() { - copy_modules_dir kernel/drivers/net - copy_modules_dir kernel/drivers/scsi - copy_modules_dir kernel/drivers/ide - copy_modules_dir kernel/drivers/md - copy_modules_dir kernel/drivers/usb - copy_modules_dir kernel/drivers/block - copy_modules_dir kernel/drivers/input - copy_modules_dir kernel/fs/ext2 - copy_modules_dir kernel/fs/ext3 - copy_modules_dir kernel/fs/isofs - copy_modules_dir kernel/fs/jbd - copy_modules_dir kernel/fs/jfs - copy_modules_dir kernel/fs/nfs - copy_modules_dir kernel/fs/reiserfs - copy_modules_dir kernel/fs/xfs - - # These aren't caught by the above but really need to be there: - for x in mbcache nfs af_packet raid1 ide-cd ide-disk ide-generic; do - for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${DESTDIR}/${y} ]; then - continue - fi - - mkdir -p ${DESTDIR}/$(dirname ${y}) - ln -s ${y} ${DESTDIR}/$(dirname ${y}) - depmod -b ${DESTDIR} ${version} - done + # base + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + manual_add_modules ${x} + done + + # Ethernet + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do + manual_add_modules ${x} + done + + # ide + for x in ide-cd ide-disk ide-generic aec62xx cmd64x generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix sc1200 siimage slc82c105 trm290 via82cxxx; do + manual_add_modules ${x} + done + + # scsi + for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips lpfc mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + manual_add_modules ${x} done + } usage() @@ -176,7 +193,7 @@ for d in bin conf etc lib modules sbin scripts; do done for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do - manual_add_modules ${x} + add_modules_from_file ${x} done auto_add_modules @@ -186,17 +203,14 @@ auto_add_modules ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib -ln -s /usr/share/initramfs-tools/init ${DESTDIR}/init +copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts -ln -s ${CONFDIR}/initramfs.conf ${DESTDIR}/conf -ln -s /etc/udev ${DESTDIR}/etc +copy_exec ${CONFDIR}/initramfs.conf /conf +cp -a /etc/udev ${DESTDIR}/etc # Hack until udev is built with klibc -ln -s /sbin/udev ${DESTDIR}/bin -ln -s /sbin/udevstart ${DESTDIR}/bin -ln -s /lib/libc.so.* ${DESTDIR}/lib -ln -s /lib/ld*.so.* ${DESTDIR}/lib -rm ${DESTDIR}/lib/*lsb* +copy_exec /sbin/udev /sbin +copy_exec /sbin/udevstart /sbin # Busybox rm ${DESTDIR}/bin/sh @@ -205,15 +219,18 @@ ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/sh ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/busybox # Modutils -ln -s /sbin/modprobe ${DESTDIR}/sbin -ln -s /sbin/depmod ${DESTDIR}/sbin -ln -s /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 -ln -s /etc/modprobe.d/aliases ${DESTDIR}/etc/modprobe.d +copy_exec /etc/modprobe.d/aliases /etc/modprobe.d # Raid -ln -s /sbin/mdadm ${DESTDIR}/sbin -ln -s /sbin/mdrun ${DESTDIR}/sbin +copy_exec /sbin/mdadm /sbin +copy_exec /sbin/mdrun /sbin + +# LVM +copy_exec /lib/lvm-200/vgchange /sbin run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks diff --git a/scripts/functions b/scripts/functions index 1899a14..d4e9ece 100644 --- a/scripts/functions +++ b/scripts/functions @@ -199,3 +199,5 @@ load_modules() ide_boot_events } + + -- cgit v1.2.3 From ec6a1979e3dab46996ebb1601cf892f24b1fc7e4 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 15 Jul 2005 02:41:15 +0000 Subject: Add lvm support, update control --- scripts/local-top/lvm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/local-top/lvm diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm new file mode 100644 index 0000000..8fcb234 --- /dev/null +++ b/scripts/local-top/lvm @@ -0,0 +1,18 @@ +#!/bin/sh + +PREREQ="md" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +vgchange -ay -- cgit v1.2.3 From 56fb010842d4ffa9bd5ff7491eeb8e12ee475006 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:44:32 -0400 Subject: initramfs-tools (0.14) breezy; urgency=low The --- init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init b/init index 6486139..b2a89e1 100644 --- a/init +++ b/init @@ -14,12 +14,12 @@ export break= export init=/sbin/init export quiet=n export readonly=y -export root= +export ROOT= export rootmnt=/root for x in $(cat /proc/cmdline); do case $x in init=*) - INIT=${x#init=} + init=${x#init=} ;; root=*) ROOT=${x#root=} -- cgit v1.2.3 From 9ba23f790a81b3e5f017e1a293e16e593ff9ccc9 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:45:18 -0400 Subject: initramfs-tools (0.14) breezy; urgency=low The --- scripts/functions | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/functions b/scripts/functions index d4e9ece..cf9f4a7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -144,14 +144,17 @@ run_scripts() } ide_boot_events() { - [ "$(echo /proc/ide/*/media)" = "/proc/ide/*/media" ] && return + [ -e /proc/ide ] || return - for drive in /proc/ide/*/media; do + modprobe -q ide-generic + + 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/}; unit=${unit%/media} + unit=${drive#/proc/ide/} [ -d /sys/block/$unit ] && continue - read media < $drive + read media < $drive/media case "$media" in disk) MODULE=ide-disk ;; cdrom) MODULE=ide-cd ;; @@ -164,6 +167,20 @@ ide_boot_events() { done } +scsi_boot_events() +{ + [ -e /sys/bus/scsi/devices/ ] || return + + for device in /sys/bus/scsi/devices/*; do + read media < ${device}/type + case "$media" in + 0) modprobe -q sd_mod; + esac + + done + +} + load_modules() { depmod -a @@ -198,6 +215,8 @@ load_modules() done ide_boot_events + + scsi_boot_events } -- cgit v1.2.3 From 3a6236e7ba7a060a4daddce8569633763c549412 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:45:30 -0400 Subject: initramfs-tools (0.14) breezy; urgency=low The --- scripts/local-top/lvm | 8 +++++++- scripts/local-top/md | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 8fcb234..4f199de 100644 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -15,4 +15,10 @@ prereqs) ;; esac -vgchange -ay +vg=$(echo ${ROOT} | sed -e 's#/dev/mapper/\(.*\)-.*#\1#') + +[ x${vg} != x ] || return + +modprobe -q dm-mod + +vgchange -ay ${vg} diff --git a/scripts/local-top/md b/scripts/local-top/md index 062852f..48c3ce6 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -15,7 +15,14 @@ prereqs) ;; esac -# FIXME detect this! -modprobe raid1 +unset raidlvl + +# Detect raid level +for x in /dev/hd* /dev/sd*; do + raidlvl=$(mdadm --examine ${x} | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + modprobe -q ${raidlvl} +done + +[ x${raidlvl} != x ] || return /sbin/mdrun /dev -- cgit v1.2.3 From b3976b14b676feb9481c8dc9204a792dc1199e2a Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:45:38 -0400 Subject: initramfs-tools (0.14) breezy; urgency=low The --- debian/changelog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac451da..e083ff1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +initramfs-tools (0.14) breezy; urgency=low + + "The world is a stage, but the play is badly cast." + - Oscar Wilde + + * scripts/functions: Add scsi_boot_events and call it to load sd_mod + + * scripts/local-top/md: Autodetect raid level + + * scripts/local-top/lvm: Only activate the volumegroup required by + the root device. Don't bother with lvm if the root partition isn't + /dev/mapper/FOO. + + * scripts/functions: Fix ide_boot_events. This never worked, even + if I thought it did. + + * init: init variable should be lower case. Exported ROOT variable + should be upper case. + + -- Jeff Bailey Tue, 26 Jul 2005 20:30:57 -0400 + initramfs-tools (0.13) breezy; urgency=low "We live in age when unnecessary things are our only necessities." -- cgit v1.2.3 From 8d797f301d02d933a10e68291f780e3759c89cf4 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:45:44 -0400 Subject: initramfs-tools (0.14) breezy; urgency=low The --- debian/TODO | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/TODO b/debian/TODO index d080de3..e3f93cc 100644 --- a/debian/TODO +++ b/debian/TODO @@ -3,8 +3,22 @@ TODO o Grep for TODO and FIXME and do those. =) - o Get udev compiled against klibc + o Only vgchange -ay the volume needed for the root partition - o Integrate hotplug-ng + o Support raid0, 5 and 6 for / - o Add option to make-kpkg to use mkinitramfs + o Eliminate udev. + + o Support list and dep options + + o Default to dep for PPC - Possibly to detect newworld? + + o Support evms + + o Support cryptroot + + o Trace lilo bug + + o Load scsi modules + + o Capture udev events and pass them to udevsend -- cgit v1.2.3 From e52d7074e9eed3252a86edd634c50ec44c45c968 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 27 Jul 2005 00:47:30 -0400 Subject: Update TODO List --- debian/TODO | 6 ------ 1 file changed, 6 deletions(-) diff --git a/debian/TODO b/debian/TODO index e3f93cc..7c6bc55 100644 --- a/debian/TODO +++ b/debian/TODO @@ -3,10 +3,6 @@ TODO o Grep for TODO and FIXME and do those. =) - o Only vgchange -ay the volume needed for the root partition - - o Support raid0, 5 and 6 for / - o Eliminate udev. o Support list and dep options @@ -19,6 +15,4 @@ TODO o Trace lilo bug - o Load scsi modules - o Capture udev events and pass them to udevsend -- cgit v1.2.3 From 3d319f70b29f804234fa5eb6e93c1168b0d2dddf Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 5 Aug 2005 11:46:54 -0400 Subject: DSDT, init-premount, and add sata_nv --- debian/changelog | 16 ++++++++++++++++ debian/dirs | 1 + init | 4 ++++ mkinitramfs | 7 ++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e083ff1..06f40e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +initramfs-tools (0.15) breezy; urgency=low + + "Nothing looks so like innocence as an indiscretion." + - Oscar Wilde + + * mkinitramfs: Handle putting DSDT.aml into the initramfs + Add sata_nv to list of modules to import for main mode. + + * init: New scripts directory, init-premount for generic premount + handling (like usplash) + + * debian/dirs: Make the /etc version of this directory for user + addons. + + -- Jeff Bailey Fri, 5 Aug 2005 11:39:26 -0400 + initramfs-tools (0.14) breezy; urgency=low "The world is a stage, but the play is badly cast." diff --git a/debian/dirs b/debian/dirs index ac6210e..6de384e 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,4 +1,5 @@ etc/mkinitramfs/init-bottom +etc/mkinitramfs/init-premount etc/mkinitramfs/init-top etc/mkinitramfs/local-bottom etc/mkinitramfs/local-premount diff --git a/init b/init index b2a89e1..e1fee77 100644 --- a/init +++ b/init @@ -64,6 +64,10 @@ if [ x${break} = xyes ]; then panic "Spawning shell within the initramfs" fi +log_begin_msg "Running /scripts/init-premount" +run_scripts /scripts/init-premount +log_end_msg + log_begin_msg "Mounting root file system" mountroot log_end_msg diff --git a/mkinitramfs b/mkinitramfs index cbc1f82..8092a14 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -83,7 +83,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips lpfc mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_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 atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips lpfc mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules ${x} done @@ -235,6 +235,11 @@ copy_exec /lib/lvm-200/vgchange /sbin 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 / +fi + (cd ${DESTDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) if [ -s ${__TMPCPIOGZ} ]; then -- cgit v1.2.3 From 618760b004d07efb11f05e57d46ed4b5adb2823c Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 16 Aug 2005 13:34:13 -0400 Subject: Cleanup commit, sorry for the mess --- conf/initramfs.conf | 9 ++- debian/TODO | 2 + debian/changelog | 99 +++++++++++++++++++++++++++++- debian/control | 4 +- debian/dirs | 1 - debian/initramfs-tools.install | 2 + debian/initramfs-tools.postinst | 22 +++++++ debian/initramfs-tools.postrm | 2 +- debian/rules | 2 +- hook-functions | 133 ++++++++++++++++++++++++++++++++++++++++ init | 4 ++ mkinitramfs | 122 +++++------------------------------- scripts/functions | 16 ++++- scripts/local-top/md | 9 ++- 14 files changed, 307 insertions(+), 120 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index a056469..b4a7dba 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -7,7 +7,7 @@ # Use busybox if available. You MUST use the -static version # -BUSYBOX=n +BUSYBOX=y # # BOOT: [ local | nfs ] @@ -28,7 +28,7 @@ BOOT=local # # list - Only include modules from the 'additional modules' list # -MODULES=list +MODULES=most # # NFS Section of the config. @@ -48,3 +48,8 @@ DEVICE=eth0 NFSROOT=auto +# Hardcode partition to resume from so it doesn't have to be specified +# on the command line. The command line will override this setting. + +#RESUME= + diff --git a/debian/TODO b/debian/TODO index 7c6bc55..58f35fd 100644 --- a/debian/TODO +++ b/debian/TODO @@ -16,3 +16,5 @@ TODO o Trace lilo bug o Capture udev events and pass them to udevsend + + o Detect RESUME partition diff --git a/debian/changelog b/debian/changelog index 06f40e3..11f476c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,98 @@ +initramfs-tools (0.19) breezy; urgency=low + + "The basis of optimism is sheer terror." + - Oscar Wilde + + * mkinitramfs: Honour MODULES=list and MODULES=dep. + + * hook-functions: New function dep_add_modules. + + -- Jeff Bailey Wed, 10 Aug 2005 23:20:11 -0400 + +initramfs-tools (0.18) breezy; urgency=low + + "We are all in the gutter, but some of us are looking at the stars." + - Oscar Wilde + + * debian/initramfs-tools.postrm: Use rm -f for removing the modules + file, in case it doesn't exist for some reason. (Ubuntu #13335) + Thanks to Colin Watson for the bug report! + + * mkinitramfs.8: Correct my email address to be jbailey@ubuntu.com + Document /etc/mkinitramfs/DSDT.aml + + * debian/initramfs-tools.postinst: Attempt to inherit RESUME settings + from initrd-tools. Also copy the DSDT from /etc/mkinitrd/DSDT to + /etc/mkinitramfs/DSDT.aml + + -- Jeff Bailey Wed, 10 Aug 2005 13:09:44 -0400 + +initramfs-tools (0.17) breezy; urgency=low + + "The public is wonderfully tolerant. It forgives everything except + genius." + - Oscar Wilde + + * debian/initramfs-tools.postinst: Get the name of the config file + right when seeding RESUME=. Also fix the sed expression. + Thanks to Matthew Garrett for noticing this! + + -- Jeff Bailey Wed, 10 Aug 2005 11:54:07 -0400 + +initramfs-tools (0.16) breezy; urgency=low + + "It is through art, and through art only, that we can realise our + perfection." + - Oscar Wilde + + * mkinitramfs: Make sure all relevant ide modules are included. + Add RESUME= support. + + * scripts/functions: Be silent when adding non-detected modules. + + * conf/mkinitramfs.conf: MODULES=most by default, BUSYBOX=y + (Non-busybox isn't supported now. It's not clear that it ever + will be). Add RESUME line for resuming from suspend-to-disk. + + * scripts/local-premount/suspend: New script for suspend-to-disk. + + * debian/control: Bump depends on busybox-cvs-initramfs to + 20040623-1ubuntu19. Add dependancy on lvm2. + Bump standards version to 3.6.2.0 (no-op) + + * debian/control: + Force version depend on lvm2 (>= 2.01.04-5) to make sure newer kernels + will boot. + Thanks for Andrew Mitchell for discovering this. + + * hooks/: New directory + + * debian/dirs: Move hooks to ... + * debian/initramfs-tools.install: ... here. + + * hooks/acpid: New file. + + * scripts/init-premount/acpid: New file + Thanks for the hint from Matthew Garrett for this. + + * debian/initramfs-tools.postinst: Add RESUME support on first install. + + * debian/mkinitramfs: Move functions to ... + * debian/hook-functions: ... here. + + * debian/initramfs-tools.install: Install hook-functions + + * mkinitramfs.8: New file. + Thanks to Maximilian Attems for contributing this! + + * scripts/local-top/md: Don't try to detect raid on non-existant devices + or on whole devices. Quiet other warning messages. + + * hook-functions: When generating initramfs, don't complain about missing + modules. + + -- Jeff Bailey Tue, 9 Aug 2005 23:35:08 -0400 + initramfs-tools (0.15) breezy; urgency=low "Nothing looks so like innocence as an indiscretion." @@ -12,7 +107,9 @@ initramfs-tools (0.15) breezy; urgency=low * debian/dirs: Make the /etc version of this directory for user addons. - -- Jeff Bailey Fri, 5 Aug 2005 11:39:26 -0400 + * debian/rules: Use prebuild, rather than debian-build-arch. + + -- Jeff Bailey Tue, 9 Aug 2005 11:29:10 -0400 initramfs-tools (0.14) breezy; urgency=low diff --git a/debian/control b/debian/control index 514368c..1c1a6b2 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,11 @@ Section: utils Priority: optional Maintainer: Jeff Bailey Build-Depends-Indep: debhelper (>= 4.0.0), cdbs -Standards-Version: 3.6.1 +Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-initramfs, mdadm +Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), mdadm, lvm2 (>= 2.01.04-5) Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel diff --git a/debian/dirs b/debian/dirs index 6de384e..d35ba7c 100644 --- a/debian/dirs +++ b/debian/dirs @@ -7,5 +7,4 @@ etc/mkinitramfs/local-top etc/mkinitramfs/nfs-bottom etc/mkinitramfs/nfs-premount etc/mkinitramfs/nfs-top -usr/share/initramfs-tools/hooks usr/share/initramfs-tools/modules.d diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index a2a78f5..8702d53 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -2,3 +2,5 @@ mkinitramfs usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs +hooks usr/share/initramfs-tools +hook-functions usr/share/initramfs-tools diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 70be9f6..ea92067 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -2,6 +2,28 @@ set -e +if [ "$1" = configure ]; then + if [ x${2} = x ]; then + + # First time install. Can we autodetect the RESUME partition? + RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + + # Inhertic initrd-tools settings if possible. + if [ -e /etc/mkinitrd/mkinitrd.conf ]; then + . /etc/mkinitrd/mkinitrd.conf + fi + + if [ -e ${RESUME} ]; then + sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf + fi + + if [ -e /etc/mkinitrd/DSDT ]; then + cp /etc/mkinitrd/DSDT /etc/mkinitramfs/DSDT.aml + fi + + fi +fi + if [ ! -e /etc/mkinitramfs/modules ]; then cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ fi diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 7bea06f..2af9945 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -1,7 +1,7 @@ #!/bin/sh if [ "x${1}" = "xpurge" ]; then - rm /etc/mkinitramfs/modules + rm -f /etc/mkinitramfs/modules fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index a1b8695..6b91c1f 100644 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,5 @@ include /usr/share/cdbs/1/rules/debhelper.mk -common-build-arch:: +pre-build:: chmod +x init mkinitramfs diff --git a/hook-functions b/hook-functions index 0d79703..5db7d27 100644 --- a/hook-functions +++ b/hook-functions @@ -4,3 +4,136 @@ catenate_cpiogz() { cat "$1" >>${__TMPCPIOGZ} } +add_modules_from_file() +{ + # Sanity check + if [ ! -e ${1} ]; then + return + fi + + sed -e '/^#/d' ${1} | while read module rest; do + manual_add_modules ${module} + echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules + done +} + +manual_add_modules() +{ + for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${DESTDIR}/${mam_x} ]; then + continue + fi + + mkdir -p ${DESTDIR}/$(dirname ${mam_x}) + ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) + depmod -b ${DESTDIR} ${version} + done +} + +# $1 is source +# $2 is relative destination +copy_exec() { + ln -s ${1} ${DESTDIR}/${2} + + # Copy the dependant libraries + for x in $(ldd ${1} 2>/dev/null | sed -e ' + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + libname=$(basename ${x}) + dirname=$(dirname ${x}) + mkdir -p ${DESTDIR}/${dirname} + if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then + ln -s ${x} ${DESTDIR}/${dirname} + fi + done +} + +# Copy entire subtrees to the initramfs +copy_modules_dir() +{ + tmpdir_modbase=${DESTDIR}/lib/modules/${version} + mkdir -p $(dirname ${tmpdir_modbase}/${1}) + cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} +} + +dep_add_modules() +{ + + # Things that are too hard to autodetect. + for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + manual_add_modules ${x} + done + + for x in /sys/bus/pci/devices/*; do + if [ -e ${x}/modalias ]; then + manual_add_modules $(cat ${x}/modalias) + fi + done + + # Give the USB bus a moment to catch up + sleep 2 + + for x in /sys/bus/usb/devices/*; do + if [ -e ${x}/modalias ]; then + manual_add_modules $(cat ${x}/modalias) + fi + done + + if [ -e /proc/ide ]; then + for x in ide-generic ide-disk ide-cd; do + manual_add_modules ${x} + done + fi + + if [ -e /sys/bus/scsi/devices/ ]; then + manual_add_modules sd_mod + fi +} + + +# Modules that we always add to the initramfs +auto_add_modules() +{ + # base + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + manual_add_modules ${x} + done + + # Ethernet + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do + manual_add_modules ${x} + done + + # ide + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + manual_add_modules ${x} + done + + # scsi + for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + manual_add_modules ${x} + done + +} + +usage() +{ + cat >&2 << EOF + +Usage: ${0} [OPTION]... <-o outfile> [version] + +Options: + -d confdir Specify an alternative configuration directory. + -k Keep temporary directory used to make the image. + -o outfile Write to outfile. + -r root Override ROOT setting in mkinitrd.conf. + +See ${0}(8) for further details. +EOF + exit 1 + +} + diff --git a/init b/init index e1fee77..38450da 100644 --- a/init +++ b/init @@ -15,6 +15,7 @@ export init=/sbin/init export quiet=n export readonly=y export ROOT= +export resume=${RESUME} export rootmnt=/root for x in $(cat /proc/cmdline); do case $x in @@ -30,6 +31,9 @@ for x in $(cat /proc/cmdline); do boot=*) BOOT=${x#boot=} ;; + resume=*) + resume=${x#resume=} + ;; quiet) quiet=y ;; diff --git a/mkinitramfs b/mkinitramfs index 8092a14..3257c94 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,112 +1,5 @@ #!/bin/sh -# Takes a file containing a list of modules to be added as an -# argument, figures out dependancies, and adds them. -# -# Input file syntax: -# -# # comment -# modprobe_module_name [args ...] -# [...] -# -add_modules_from_file() -{ - # Sanity check - if [ ! -e ${1} ]; then - return - fi - - sed -e '/^#/d' ${1} | while read module rest; do - manual_add_modules ${module} - echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules - done -} - -manual_add_modules() -{ - for mam_x in $(modprobe --set-version=${version} --show-depends ${1} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${DESTDIR}/${mam_x} ]; then - continue - fi - - mkdir -p ${DESTDIR}/$(dirname ${mam_x}) - ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) - depmod -b ${DESTDIR} ${version} - done -} - -# $1 is source -# $2 is relative destination -copy_exec() { - ln -s ${1} ${DESTDIR}/${2} - - # Copy the dependant libraries - for x in $(ldd ${1} 2>/dev/null | sed -e ' - /\//!d; - /linux-gate/d; - /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; - s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do - libname=$(basename ${x}) - dirname=$(dirname ${x}) - mkdir -p ${DESTDIR}/${dirname} - if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then - ln -s ${x} ${DESTDIR}/${dirname} - fi - done -} - -# Copy entire subtrees to the initramfs -copy_modules_dir() -{ - tmpdir_modbase=${DESTDIR}/lib/modules/${version} - mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} -} - -# Modules that we always add to the initramfs -auto_add_modules() -{ - # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} - done - - # Ethernet - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do - manual_add_modules ${x} - done - - # ide - for x in ide-cd ide-disk ide-generic aec62xx cmd64x generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix sc1200 siimage slc82c105 trm290 via82cxxx; do - manual_add_modules ${x} - done - - # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips lpfc mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do - manual_add_modules ${x} - done - -} - -usage() -{ - cat >&2 << EOF - -Usage: ${0} [OPTION]... <-o outfile> [version] - -Options: - -d confdir Specify an alternative configuration directory. - -k Keep temporary directory used to make the image. - -o outfile Write to outfile. - -r root Override ROOT setting in mkinitrd.conf. - -See ${0}(8) for further details. -EOF - exit 1 - -} - # Defaults keep="n" CONFDIR="/etc/mkinitramfs" @@ -135,6 +28,7 @@ shift $((${OPTIND} - 1)) # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions +. /usr/share/initramfs-tools/hook-functions . ${CONFDIR}/initramfs.conf @@ -150,6 +44,11 @@ else version="${1}" fi +if dpkg --compare-versions "${version}" lt 2.6.12; then + echo "Kernel version too old. initramfs-tools requires at least 2.6.12." + exit 1 +fi + case ${version} in /lib/modules/*/[!/]*) ;; @@ -192,11 +91,18 @@ for d in bin conf etc lib modules sbin scripts; do mkdir -p ${DESTDIR}/${d} done +# MODULES=list case. Always honour. for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do add_modules_from_file ${x} done -auto_add_modules +if [ "${MODULES}" = "dep" ]; then + dep_add_modules +fi + +if [ "${MODULES}" = "most" ]; then + auto_add_modules +fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. diff --git a/scripts/functions b/scripts/functions index cf9f4a7..10918f8 100644 --- a/scripts/functions +++ b/scripts/functions @@ -194,7 +194,7 @@ load_modules() then continue; else - modprobe -v $m + modprobe -q $m fi done fi @@ -219,4 +219,18 @@ load_modules() scsi_boot_events } +parse_numeric() { + case $1 in + *:*) + minor=${1#*:} + major=${1%:*} + ;; + *) + minor=$((0x${1#??})) + major=$((0x${1%??})) + ;; + esac + + mknod /dev/root b ${major} ${minor} +} diff --git a/scripts/local-top/md b/scripts/local-top/md index 48c3ce6..055e109 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -18,9 +18,12 @@ esac unset raidlvl # Detect raid level -for x in /dev/hd* /dev/sd*; do - raidlvl=$(mdadm --examine ${x} | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - modprobe -q ${raidlvl} +for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do + if [ ! -e ${x} ]; then + continue + fi + raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + modprobe -q ${raidlvl} 2>/dev/null done [ x${raidlvl} != x ] || return -- cgit v1.2.3 From 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 --- debian/initramfs-tools.manpages | 1 + hooks/acpid | 24 ++++++++++++++ mkinitramfs.8 | 71 +++++++++++++++++++++++++++++++++++++++++ scripts/init-premount/acpid | 19 +++++++++++ scripts/local-premount/suspend | 30 +++++++++++++++++ 5 files changed, 145 insertions(+) create mode 100644 debian/initramfs-tools.manpages create mode 100644 hooks/acpid create mode 100644 mkinitramfs.8 create mode 100644 scripts/init-premount/acpid create mode 100644 scripts/local-premount/suspend diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages new file mode 100644 index 0000000..61d8057 --- /dev/null +++ b/debian/initramfs-tools.manpages @@ -0,0 +1 @@ +mkinitramfs.8 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 diff --git a/mkinitramfs.8 b/mkinitramfs.8 new file mode 100644 index 0000000..cc56915 --- /dev/null +++ b/mkinitramfs.8 @@ -0,0 +1,71 @@ +.TH MKINITRAMFS 8 "$Date: 2005/07/15 $" "" "mkinitramfs manual" + +.SH NAME +mkinitramfs \- generate an initramfs image + +.SH SYNOPSIS +.B mkinitramfs +.RB [ \-d +.IR confdir ] +.RB [ \-k ] +.RB [ \-o +.IR outfile ] +.RB [ \-r +.IR root ] +.RI [ version ] +.SH DESCRIPTION +The +.B mkinitramfs +script generates an initramfs image. The initramfs is an 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 +.TP +\fB \-d \fI confdir +Set an alternate configuration directory. + +.TP +\fB \-k +Keep the temporary directory used to make the image. + +.TP +\fB \-o \fI outfile +Write the image to +.IR outfile . + +.TP +\fB \-r \fI root +Override the +.B ROOT +setting in +.IR mkinitramfs.conf . + +.SH FILES +.TP +.I /etc/mkinitramfs/initramfs.conf +The default configuration file for the script. See +.BR initramfs.conf (8) +for a description of the available configuration parameter. + +.TP +.I /etc/mkinitramfs/modules +Specified modules will be put in the generated image and loaded when the system boots. The format - one per line - is identical to that of +.I /etc/modules, +which is described in +.BR modules (5). + +.TP +.I /etc/mkinitramfs/DSDT.aml +If this file exists, it will be appended to the initramfs in a way that causes +it to be loaded by ACPI. + + +.SH AUTHOR +The initramfs-tools are written by Jeff Bailey . +This manual is maintained by Maximilian Attems . + +.SH SEE ALSO + +.BR initramfs.conf (8) diff --git a/scripts/init-premount/acpid b/scripts/init-premount/acpid new file mode 100644 index 0000000..61d226a --- /dev/null +++ b/scripts/init-premount/acpid @@ -0,0 +1,19 @@ +#!/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/local-premount/suspend b/scripts/local-premount/suspend new file mode 100644 index 0000000..5791123 --- /dev/null +++ b/scripts/local-premount/suspend @@ -0,0 +1,30 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ "x${resume}" = "x" ]; then + exit +fi + +if [ ! -e ${resume} ]; then + exit +fi + +if [ -e /sys/power/resume ]; then + major=$((0x$(stat -c%t ${resume}))) + minor=$((0x$(stat -c%T ${resume}))) + echo ${major}:${minor} >/sys/power/resume +fi -- cgit v1.2.3 From f903a759dea3c85c88bbec151337efd2c64ba3bf Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 16 Aug 2005 13:38:52 -0400 Subject: Commit colin's changes to initramfs-tools --- debian/changelog | 6 ++++++ debian/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 11f476c..445d581 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.20) breezy; urgency=low + + * Depend on cpio. + + -- Colin Watson Fri, 12 Aug 2005 10:43:04 +0100 + initramfs-tools (0.19) breezy; urgency=low "The basis of optimism is sheer terror." diff --git a/debian/control b/debian/control index 1c1a6b2..cd47480 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), mdadm, lvm2 (>= 2.01.04-5) +Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5) Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel -- 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 diff --git a/debian/changelog b/debian/changelog index 445d581..aaa2dba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.21) breezy; urgency=low + + "All that I desire to point out is the general principle that + life imitates art far more than art imitates life." + - Oscar Wilde + + * mkinitramfs: Define MODULESDIR and use it. + + * hook-functions: Use MODULESDIR + (add_modules_from_file): Do not add .ko extension to file lists. + Call force_load instead of twiddling conf/modules directly. + (Ubuntu #13372) + (force_load): New function. + (copy_exec): Attempt to use non-optimsed libraries if available. + (Ubuntu #13470) + (auto_add_modules) Include forcedeth (Ubuntu #13448) + + * hooks/kernelextras: New file. (Ubuntu #13414) + + * debian/initramfs-tools.postinst: Preserve /etc/mkinitrd/modules if + possible on new install. (Ubuntu #13372) + + -- Jeff Bailey Tue, 16 Aug 2005 15:56:00 -0400 + initramfs-tools (0.20) breezy; urgency=low * Depend on cpio. diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index ea92067..fe734cf 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -13,6 +13,10 @@ if [ "$1" = configure ]; then . /etc/mkinitrd/mkinitrd.conf fi + if [ -e /etc/mkinitrd/modules ]; then + cp /etc/mkinitrd/modules /etc/mkinitramfs + fi + if [ -e ${RESUME} ]; then sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf fi diff --git a/hook-functions b/hook-functions index 5db7d27..8642af9 100644 --- a/hook-functions +++ b/hook-functions @@ -4,6 +4,12 @@ catenate_cpiogz() { cat "$1" >>${__TMPCPIOGZ} } +force_load() +{ + manual_add_modules ${module} + echo ${@} >>${DESTDIR}/conf/modules +} + add_modules_from_file() { # Sanity check @@ -12,8 +18,7 @@ add_modules_from_file() fi sed -e '/^#/d' ${1} | while read module rest; do - manual_add_modules ${module} - echo ${module}.ko "${rest}" >>${DESTDIR}/conf/modules + force_load ${module} "${rest}" done } @@ -42,8 +47,18 @@ copy_exec() { /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + + # Try to use non-optimised libraries where possible. + # We assume that all HWCAP libraries will be in tls. + nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + + if [ -e ${nonoptlib} ]; then + x=${nonoptlib} + fi + libname=$(basename ${x}) dirname=$(dirname ${x}) + mkdir -p ${DESTDIR}/${dirname} if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then ln -s ${x} ${DESTDIR}/${dirname} @@ -56,7 +71,7 @@ copy_modules_dir() { tmpdir_modbase=${DESTDIR}/lib/modules/${version} mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a /lib/modules/${version}/${1} ${tmpdir_modbase}/${1} + cp -a ${MODULESDIR}/${1} ${tmpdir_modbase}/${1} } dep_add_modules() @@ -103,7 +118,7 @@ auto_add_modules() done # Ethernet - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi forcedeth hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do manual_add_modules ${x} done diff --git a/hooks/kernelextras b/hooks/kernelextras new file mode 100644 index 0000000..d1b8c34 --- /dev/null +++ b/hooks/kernelextras @@ -0,0 +1,39 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hooks for loading loading extra kernel bits into the initramfs + +. /usr/share/initramfs-tools/hook-functions + +fbcon=n + +for x in ${MODULESDIR}/initrd/*; do + x=${x##*/} + x=${x%.*} + case ${x} in + *fb) + fbcon=y + ;; + esac + + force_load ${x} +done + +if [ ${fbcon} = "y" ]; then + force_load fbcon +fi + diff --git a/mkinitramfs b/mkinitramfs index 3257c94..7344a03 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -70,8 +70,10 @@ if [ -d ${outfile} ]; then exit 1 fi -if [ ! -e /lib/modules/${version} ]; then - echo "Cannot find /lib/modules/${version}" +MODULESDIR="/lib/modules/${version}" + +if [ ! -e ${MODULESDIR} ]; then + echo "Cannot find ${MODULESDIR}" exit 1 fi @@ -80,6 +82,7 @@ __TMPCPIOGZ=$(mktemp -t mkinitramfs-OL_XXXXXX) || exit 1 # Export environment for hook scripts. # +export MODULESDIR export version export CONFDIR export DESTDIR -- cgit v1.2.3 From f0a04306ac01b22e80cbd1d2a7578a1a3efa6e5f Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 25 Aug 2005 16:21:19 -0400 Subject: initramfs-tools (0.23) breezy; urgency=low "This suspense is terrible. I hope it will last." - Oscar Wilde * scripts/local: Quote ${ROOT} so that an empty value causes us to drop to a shell. Thanks to Matt Zimmerman for this fix! - hook-functions (auto_add_modules): Add atiixp and opti621 to the IDE set. - hook-functions (dep_add_modules): Detect i2o and add i2o_block (auto_add_modules): Include i2o_block. - scripts/functions (i2o_boot_events): New function (load_modules): Call it. (Ubuntu# 13806) Thanks to Tollef Fog Heen for the i2o patch! - debian/control: Depend on udev. Thanks to Alexander Butenko for troubleshooting this with me. - init: Move the /dev directory to the root filesystem. Handle all the udev bind mounts as needed. Make sure input and output is associated with dev/console. - scripts/functions (parse_numeric): Exit if we're refering to a path. Otherwise override root setting to be /dev/root. - init: Call parse_numeric when setting the root variable. - scripts/local-top/lvm: When using a numeric root, call vgchange -ay Don't attempt to start LVM on regular partitions. (Ubuntu #13365, #13778, and some of #13399) - scripts/local-top/lvm: Cope with -'s in the Volume Group and logical volume names. (Ubuntu #13387) Thanks to Stephen Shirley for the patch! -- Jeff Bailey Thu, 25 Aug 2005 11:48:15 -0400 initramfs-tools (0.22) breezy; urgency=low * Fix argument handling in force_load hook-function * Add "sleep 3" to scripts/nfs as a nasty hack around bug #12942 -- Matt Zimmerman Fri, 19 Aug 2005 23:50:16 -0700 --- debian/changelog | 48 ++++++++++++++++++++++++++++++++++++++++- debian/control | 2 +- debian/initramfs-tools.postinst | 1 + hook-functions | 13 +++++++++-- init | 12 ++++++++++- scripts/functions | 15 +++++++++++++ scripts/local | 2 +- scripts/local-top/lvm | 17 ++++++++++++--- scripts/nfs | 1 + 9 files changed, 102 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index aaa2dba..09bc345 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,49 @@ +initramfs-tools (0.23) breezy; urgency=low + + "This suspense is terrible. I hope it will last." + - Oscar Wilde + + * scripts/local: Quote ${ROOT} so that an empty value causes us + to drop to a shell. + Thanks to Matt Zimmerman for this fix! + + - hook-functions (auto_add_modules): Add atiixp and opti621 to + the IDE set. + + - hook-functions (dep_add_modules): Detect i2o and add i2o_block + (auto_add_modules): Include i2o_block. + + - scripts/functions (i2o_boot_events): New function + (load_modules): Call it. (Ubuntu# 13806) + Thanks to Tollef Fog Heen for the i2o patch! + + - debian/control: Depend on udev. + Thanks to Alexander Butenko for troubleshooting this with me. + + - init: Move the /dev directory to the root filesystem. + Handle all the udev bind mounts as needed. + Make sure input and output is associated with dev/console. + + - scripts/functions (parse_numeric): Exit if we're refering to a path. + Otherwise override root setting to be /dev/root. + - init: Call parse_numeric when setting the root variable. + - scripts/local-top/lvm: When using a numeric root, call vgchange -ay + Don't attempt to start LVM on regular partitions. + (Ubuntu #13365, #13778, and some of #13399) + + - scripts/local-top/lvm: Cope with -'s in the Volume Group and + logical volume names. (Ubuntu #13387) + Thanks to Stephen Shirley for the patch! + + -- Jeff Bailey Thu, 25 Aug 2005 11:48:15 -0400 + +initramfs-tools (0.22) breezy; urgency=low + + * Fix argument handling in force_load hook-function + * Add "sleep 3" to scripts/nfs as a nasty hack around bug #12942 + + -- Matt Zimmerman Fri, 19 Aug 2005 23:50:16 -0700 + initramfs-tools (0.21) breezy; urgency=low "All that I desire to point out is the general principle that @@ -20,7 +66,7 @@ initramfs-tools (0.21) breezy; urgency=low * debian/initramfs-tools.postinst: Preserve /etc/mkinitrd/modules if possible on new install. (Ubuntu #13372) - -- Jeff Bailey Tue, 16 Aug 2005 15:56:00 -0400 + -- Jeff Bailey Thu, 18 Aug 2005 00:20:11 -0400 initramfs-tools (0.20) breezy; urgency=low diff --git a/debian/control b/debian/control index cd47480..4120074 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5) +Depends: klibc-utils, busybox-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5), udev Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index fe734cf..6e61803 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -15,6 +15,7 @@ if [ "$1" = configure ]; then if [ -e /etc/mkinitrd/modules ]; then cp /etc/mkinitrd/modules /etc/mkinitramfs + sed -i -e 's/mkinitrd/mkinitramfs/g' /etc/mkinitramfs/modules fi if [ -e ${RESUME} ]; then diff --git a/hook-functions b/hook-functions index 8642af9..8ff5267 100644 --- a/hook-functions +++ b/hook-functions @@ -6,7 +6,7 @@ catenate_cpiogz() { force_load() { - manual_add_modules ${module} + manual_add_modules ${@} echo ${@} >>${DESTDIR}/conf/modules } @@ -106,6 +106,10 @@ dep_add_modules() if [ -e /sys/bus/scsi/devices/ ]; then manual_add_modules sd_mod fi + + if [ -e /sys/bus/i2o/devices/ ]; then + manual_add_modules i2o_block + fi } @@ -123,7 +127,7 @@ auto_add_modules() done # ide - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do manual_add_modules ${x} done @@ -132,6 +136,11 @@ auto_add_modules() manual_add_modules ${x} done + # i2o + for x in i2o_block; do + manual_add_modules ${x} + done + } usage() diff --git a/init b/init index 38450da..f3aa221 100644 --- a/init +++ b/init @@ -61,6 +61,9 @@ log_end_msg # Populate /dev tree log_begin_msg "Initializing /dev" +mount -t ramfs none /dev +touch /dev/.initramfs-tools +parse_numeric ${ROOT} udevstart log_end_msg @@ -80,8 +83,15 @@ log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom log_end_msg +# Move our /dev to the real filesystem. Do the setup that udev otherwise +# would. +mkdir -p /dev/.static/dev +chmod 700 /dev/.static/ +mount -o bind /root/dev /dev/.static/dev +mount -o move /dev /root/dev + umount /sys umount /proc # Chain to real filesystem -exec run-init ${rootmnt} ${init} "$@" +exec run-init ${rootmnt} ${init} "$@" /root/dev/console diff --git a/scripts/functions b/scripts/functions index 10918f8..956b1c3 100644 --- a/scripts/functions +++ b/scripts/functions @@ -181,6 +181,15 @@ scsi_boot_events() } +i2o_boot_events() +{ + [ -e /sys/bus/i2o/devices/ ] || return + + for device in /sys/bus/i2o/devices/*; do + [ -e ${device}/block ] && modprobe i2o_block + done +} + load_modules() { depmod -a @@ -217,10 +226,15 @@ load_modules() ide_boot_events scsi_boot_events + + i2o_boot_events } parse_numeric() { case $1 in + /*) + return + ;; *:*) minor=${1#*:} major=${1%:*} @@ -232,5 +246,6 @@ parse_numeric() { esac mknod /dev/root b ${major} ${minor} + ROOT=/dev/root } diff --git a/scripts/local b/scripts/local index bcc96ad..539a2a4 100644 --- a/scripts/local +++ b/scripts/local @@ -8,7 +8,7 @@ mountroot () log_end_msg # Get the root filesystem type - if [ ! -e ${ROOT} ]; then + if [ ! -e "${ROOT}" ]; then panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" fi diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 4f199de..9307f55 100644 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -15,10 +15,21 @@ prereqs) ;; esac -vg=$(echo ${ROOT} | sed -e 's#/dev/mapper/\(.*\)-.*#\1#') - -[ x${vg} != x ] || return +vg=${ROOT#/dev/mapper/} +case ${vg} in + /dev/root) + unset vg + ;; + /*) + exit 0 + ;; +esac + modprobe -q dm-mod +# Cope with -'s in the volume group and node names. +vg=$(echo ${vg} | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') + vgchange -ay ${vg} + diff --git a/scripts/nfs b/scripts/nfs index 8149e86..10f8f1d 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -29,6 +29,7 @@ mountroot () roflag="-o rw" fi + sleep 3 nfsmount ${roflag} ${NFSROOT} ${rootmnt} log_begin_msg "Running /scripts/nfs-bottom" -- cgit v1.2.3 From 7379c1bbf48cfa9df83dc7e92d169e2db37e3bc8 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Fri, 26 Aug 2005 14:39:14 -0400 Subject: initramfs-tools (0.24) breezy; urgency=low "Experience is simply the name we give out mistakes." - Oscar Wilde * hook-functions (auto_add_modules): Add cciss (Ubuntu #14177) Thanks Fabionne! * scripts/functions (parse_numeric): Noop on empty parameter. Fixes LTSP boot failure. Thanks to Oliver Grawert for testing! * scripts/local-top/md: Don't run modprobe when raidlvl is unset. Run mdadm if raidlvl has ever been set, not just if the most recent device checked was part of the raid setup. Thanks to Jeff Waugh for the bug report! * mkinitramfs: Feed the -o argument through readlink -f to get the canonical pathname. -- Jeff Bailey Fri, 26 Aug 2005 09:35:32 -0400 --- debian/changelog | 40 +++++++++++++++++++++++++++++++--------- hook-functions | 2 +- mkinitramfs | 3 ++- scripts/functions | 4 +++- scripts/local-top/md | 8 ++++++-- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 09bc345..06292ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +initramfs-tools (0.24) breezy; urgency=low + + "Experience is simply the name we give out mistakes." + - Oscar Wilde + + * hook-functions (auto_add_modules): Add cciss + (Ubuntu #14177) Thanks Fabionne! + + * scripts/functions (parse_numeric): Noop on empty parameter. + Fixes LTSP boot failure. Thanks to Oliver Grawert + for testing! + + * scripts/local-top/md: Don't run modprobe when raidlvl is unset. + Run mdadm if raidlvl has ever been set, not just if the most + recent device checked was part of the raid setup. + Thanks to Jeff Waugh for the bug report! + + * mkinitramfs: Feed the -o argument through readlink -f to + get the canonical pathname. + + -- Jeff Bailey Fri, 26 Aug 2005 09:35:32 -0400 + initramfs-tools (0.23) breezy; urgency=low "This suspense is terrible. I hope it will last." @@ -7,31 +29,31 @@ initramfs-tools (0.23) breezy; urgency=low to drop to a shell. Thanks to Matt Zimmerman for this fix! - - hook-functions (auto_add_modules): Add atiixp and opti621 to + * hook-functions (auto_add_modules): Add atiixp and opti621 to the IDE set. - - hook-functions (dep_add_modules): Detect i2o and add i2o_block + * hook-functions (dep_add_modules): Detect i2o and add i2o_block (auto_add_modules): Include i2o_block. - - scripts/functions (i2o_boot_events): New function + * scripts/functions (i2o_boot_events): New function (load_modules): Call it. (Ubuntu# 13806) Thanks to Tollef Fog Heen for the i2o patch! - - debian/control: Depend on udev. + * debian/control: Depend on udev. Thanks to Alexander Butenko for troubleshooting this with me. - - init: Move the /dev directory to the root filesystem. + * init: Move the /dev directory to the root filesystem. Handle all the udev bind mounts as needed. Make sure input and output is associated with dev/console. - - scripts/functions (parse_numeric): Exit if we're refering to a path. + * scripts/functions (parse_numeric): Exit if we're refering to a path. Otherwise override root setting to be /dev/root. - - init: Call parse_numeric when setting the root variable. - - scripts/local-top/lvm: When using a numeric root, call vgchange -ay + * init: Call parse_numeric when setting the root variable. + * scripts/local-top/lvm: When using a numeric root, call vgchange -ay Don't attempt to start LVM on regular partitions. (Ubuntu #13365, #13778, and some of #13399) - - scripts/local-top/lvm: Cope with -'s in the Volume Group and + * scripts/local-top/lvm: Cope with -'s in the Volume Group and logical volume names. (Ubuntu #13387) Thanks to Stephen Shirley for the patch! diff --git a/hook-functions b/hook-functions index 8ff5267..b189c34 100644 --- a/hook-functions +++ b/hook-functions @@ -132,7 +132,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules ${x} done diff --git a/mkinitramfs b/mkinitramfs index 7344a03..a93f97c 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -16,7 +16,8 @@ while getopts "d:ko:r:" flag; do fi ;; o) - outfile="${OPTARG}" + touch ${OPTARG} + outfile="$(readlink -f ${OPTARG})" ;; k) keep="y" diff --git a/scripts/functions b/scripts/functions index 956b1c3..4b3b7cf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -232,6 +232,9 @@ load_modules() parse_numeric() { case $1 in + "") + return + ;; /*) return ;; @@ -248,4 +251,3 @@ parse_numeric() { mknod /dev/root b ${major} ${minor} ROOT=/dev/root } - diff --git a/scripts/local-top/md b/scripts/local-top/md index 055e109..c7515fe 100644 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -16,6 +16,7 @@ prereqs) esac unset raidlvl +gotraid=n # Detect raid level for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do @@ -23,9 +24,12 @@ for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do continue fi raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - modprobe -q ${raidlvl} 2>/dev/null + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi done -[ x${raidlvl} != x ] || return +[ "${gotraid}" = y ] || exit /sbin/mdrun /dev -- cgit v1.2.3 From 841a533b3b11b4a41f2eb8e6849fbd4ace0217fb Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 1 Sep 2005 00:14:03 -0400 Subject: initramfs-tools (0.25) breezy; urgency=low "If there was less sympathy in the world, there would be less trouble in the world." - Oscar Wilde * init: Module the /dev tmpfs earlier. Make /dev/console, and /dev/null on it at the beginning, just in case. * debian/initramfs-tools.postinst: When copying the modules file over from initrd-tools installations, filter out ext2, ext3, ide-generic and ide-disk. These are leftovers from Warty. (Ubuntu #14242) * hooks/udev: New File (Ubuntu #12915) * init: panic if ${init} doesn't exist on the target filesystem. -- Jeff Bailey Thu, 1 Sep 2005 00:13:47 -0400 --- debian/changelog | 20 ++++++++++++++++++++ debian/initramfs-tools.postinst | 8 +++++++- init | 10 ++++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 06292ff..38ec69f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.25) breezy; urgency=low + + "If there was less sympathy in the world, there would be less + trouble in the world." + - Oscar Wilde + + * init: Module the /dev tmpfs earlier. Make /dev/console, and + /dev/null on it at the beginning, just in case. + + * debian/initramfs-tools.postinst: When copying the modules file over + from initrd-tools installations, filter out ext2, ext3, ide-generic + and ide-disk. These are leftovers from Warty. + (Ubuntu #14242) + + * hooks/udev: New File (Ubuntu #12915) + + * init: panic if ${init} doesn't exist on the target filesystem. + + -- Jeff Bailey Thu, 1 Sep 2005 00:13:47 -0400 + initramfs-tools (0.24) breezy; urgency=low "Experience is simply the name we give out mistakes." diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 6e61803..7d4eff6 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -15,7 +15,13 @@ if [ "$1" = configure ]; then if [ -e /etc/mkinitrd/modules ]; then cp /etc/mkinitrd/modules /etc/mkinitramfs - sed -i -e 's/mkinitrd/mkinitramfs/g' /etc/mkinitramfs/modules + sed -i \ + -e 's/mkinitrd/mkinitramfs/g' \ + -e '/^ide-generic/d' \ + -e '/^ide-disk/d' \ + -e '/^ext2/d' \ + -e '/^ext3/d' \ + /etc/mkinitramfs/modules fi if [ -e ${RESUME} ]; then diff --git a/init b/init index f3aa221..f11908d 100644 --- a/init +++ b/init @@ -5,6 +5,10 @@ mkdir /proc mkdir /tmp mount -t sysfs sysfs /sys mount -t proc proc /proc +mount -t ramfs none /dev +touch /dev/.initramfs-tools +mknod /dev/console c 5 1 +mknod /dev/null c 1 3 . /conf/initramfs.conf . /scripts/functions @@ -61,8 +65,6 @@ log_end_msg # Populate /dev tree log_begin_msg "Initializing /dev" -mount -t ramfs none /dev -touch /dev/.initramfs-tools parse_numeric ${ROOT} udevstart log_end_msg @@ -93,5 +95,9 @@ mount -o move /dev /root/dev umount /sys umount /proc +if [ ! -x ${rootmnt}${init} ]; then + panic "Target filesystem doesn't have ${init}" +fi + # Chain to real filesystem exec run-init ${rootmnt} ${init} "$@" /root/dev/console -- 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 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 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 11969599dad064723cad310e021613ae0bb88a20 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Sat, 17 Sep 2005 16:49:37 -0400 Subject: Add thanks to Jerry for helping test and typo fix to changelog --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7232019..de24ee0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,8 @@ initramfs-tools (0.26) breezy; urgency=low * debian/dirs: Add /var/lib/initramfs-tools * hooks/evms: New file - * scripts/local-top: New file. + * scripts/local-top/evms: New file. + Thanks to Jerry Haltom for helping test this! * debian/control: Bump klibc depends to 1.0.14-1ubuntu2 for jfs support -- cgit v1.2.3 From 60d4c3a0afa4517174f9b3c0b065c82a11c357b2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 15:09:06 +0200 Subject: fix man reference --- mkinitramfs.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs.8 b/mkinitramfs.8 index cc56915..a4b1530 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -46,7 +46,7 @@ setting in .TP .I /etc/mkinitramfs/initramfs.conf The default configuration file for the script. See -.BR initramfs.conf (8) +.BR initramfs.conf (5) for a description of the available configuration parameter. .TP @@ -68,4 +68,4 @@ This manual is maintained by Maximilian Attems . .SH SEE ALSO -.BR initramfs.conf (8) +.BR initramfs.conf (5) -- cgit v1.2.3 From 8b2a636d8c7979256c47c192c33477b031361c0c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 15:14:15 +0200 Subject: remove unused BUSYBOX variable --- conf/initramfs.conf | 7 ------- debian/changelog | 6 ++++++ initramfs.conf.5 | 5 ----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index b4a7dba..f1b0151 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -2,13 +2,6 @@ # initramfs.conf # -# BUSYBOX: [ y | n ] -# -# Use busybox if available. You MUST use the -static version -# - -BUSYBOX=y - # # BOOT: [ local | nfs ] # diff --git a/debian/changelog b/debian/changelog index de24ee0..ef59e2c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.27) unstable; urgency=low + + * Remove unused BUSYBOX config option as we use busybox anyway. + + -- maximilian attems Mon, 19 Sep 2005 15:09:26 +0200 + initramfs-tools (0.26) breezy; urgency=low "Experience is one thing you can't get for nothing." diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 24cfff7..c1ee3e7 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -30,11 +30,6 @@ 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 -- cgit v1.2.3 From f6492f6923910c26951398716f273767a545d1db Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 15:17:17 +0200 Subject: kernel team as maintainer ;) --- debian/changelog | 3 +++ debian/control | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ef59e2c..5aacf84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ initramfs-tools (0.27) unstable; urgency=low * Remove unused BUSYBOX config option as we use busybox anyway. + * Add Jeff Bailey and myself as Uploaders, Debian kernel team as + MAINTAINER. + -- maximilian attems Mon, 19 Sep 2005 15:09:26 +0200 initramfs-tools (0.26) breezy; urgency=low diff --git a/debian/control b/debian/control index 8a1aae1..16c557d 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,8 @@ Source: initramfs-tools Section: utils Priority: optional -Maintainer: Jeff Bailey +Uploaders: Jeff Bailey , maximilan attems +Maintainer: Debian kernel team Build-Depends-Indep: debhelper (>= 4.0.0), cdbs Standards-Version: 3.6.2.0 -- cgit v1.2.3 From 02914affe8ec60eac7c2f72b1cde38bcb0fe237f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 15:18:40 +0200 Subject: close itp bug --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5aacf84..b893a18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ initramfs-tools (0.27) unstable; urgency=low * Add Jeff Bailey and myself as Uploaders, Debian kernel team as MAINTAINER. + * Upload to debian unstable. (Closes: #312561) + -- maximilian attems Mon, 19 Sep 2005 15:09:26 +0200 initramfs-tools (0.26) breezy; urgency=low -- cgit v1.2.3 From e82955072791604c2691fac6ae796fc26b08c8e3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 16:12:02 +0200 Subject: more changelog changes --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b893a18..ddad11a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,8 @@ initramfs-tools (0.27) unstable; urgency=low * Add Jeff Bailey and myself as Uploaders, Debian kernel team as MAINTAINER. - * Upload to debian unstable. (Closes: #312561) + * Upload to debian unstable - allows use of nondevfs kernel >= 2.6.13 + with initramfs image. (Closes: #312561, #315654) -- maximilian attems Mon, 19 Sep 2005 15:09:26 +0200 -- cgit v1.2.3 From d88210509bcd6e79ab77c062ce57d99380d55718 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 19 Sep 2005 18:16:59 +0200 Subject: fix debian busybox dep --- debian/changelog | 4 +++- debian/control | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ddad11a..440bb81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,9 @@ initramfs-tools (0.27) unstable; urgency=low * Upload to debian unstable - allows use of nondevfs kernel >= 2.6.13 with initramfs image. (Closes: #312561, #315654) - -- maximilian attems Mon, 19 Sep 2005 15:09:26 +0200 + * Fix busybox dependency to the relevant debian package. + + -- maximilian attems Mon, 19 Sep 2005 18:14:59 +0200 initramfs-tools (0.26) breezy; urgency=low diff --git a/debian/control b/debian/control index 16c557d..4182659 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-cvs-initramfs (>= 20040623-1ubuntu19), cpio, mdadm, lvm2 (>= 2.01.04-5), udev +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox-cvs-static (>= 20040623-1), 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 -- cgit v1.2.3 From 21555c3e52c0165aa081aec15de5ac4eba3b23fc Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 12:39:37 +0200 Subject: reoder initramfs.conf --- conf/initramfs.conf | 38 ++++++++++++++++++++++---------------- debian/changelog | 2 ++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index f1b0151..88728b4 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -1,17 +1,8 @@ # # initramfs.conf +# Configuration file for mkinitramfs(8). See mkinitramfs.conf(5). # -# -# BOOT: [ local | nfs ] -# -# local - Boot off of local media (harddrive, USB stick). -# -# nfs - Boot using an NFS drive as the root of the drive. -# - -BOOT=local - # # MODULES: [ most | dep | list ] # @@ -21,16 +12,36 @@ BOOT=local # # list - Only include modules from the 'additional modules' list # + MODULES=most +# +# RESUME: [ /dev/hda2 | /dev/sdb2 ] +# +# Optionaly set the swap partition to resume from. +# Above are only possible example please costumize. +# The command line of your boot loader will override this setting. + +#RESUME= + # # NFS Section of the config. # +# +# BOOT: [ local | nfs ] +# +# local - Boot off of local media (harddrive, USB stick). +# +# nfs - Boot using an NFS drive as the root of the drive. +# + +BOOT=local + # # DEVICE: ... # -# Specify the network device, like eth0 +# Specify the network interface, like eth0 # DEVICE=eth0 @@ -41,8 +52,3 @@ DEVICE=eth0 NFSROOT=auto -# Hardcode partition to resume from so it doesn't have to be specified -# on the command line. The command line will override this setting. - -#RESUME= - diff --git a/debian/changelog b/debian/changelog index 440bb81..33108a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ initramfs-tools (0.27) unstable; urgency=low * Fix busybox dependency to the relevant debian package. + * Reorder the initramfs.conf variables. + -- maximilian attems Mon, 19 Sep 2005 18:14:59 +0200 initramfs-tools (0.26) breezy; urgency=low -- cgit v1.2.3 From 2299a84b5dfa78e7fc8f89724ab105571095bc9c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 13:32:17 +0200 Subject: add question mark to the getopts --- debian/changelog | 2 ++ update-initramfs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 33108a0..c25c38b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ initramfs-tools (0.27) unstable; urgency=low * Reorder the initramfs.conf variables. + * Add question mark to the getopts for the help message. + -- maximilian attems Mon, 19 Sep 2005 18:14:59 +0200 initramfs-tools (0.26) breezy; urgency=low diff --git a/update-initramfs b/update-initramfs index 9d7d1bc..f93fc97 100644 --- a/update-initramfs +++ b/update-initramfs @@ -231,7 +231,7 @@ takeover=0 ## -while getopts "k:cudyvht" flag; do +while getopts "k:cudyvht?" flag; do case "${flag}" in k) version="${OPTARG}" @@ -254,7 +254,7 @@ while getopts "k:cudyvht" flag; do t) takeover="1" ;; - h) + h|?) usage ;; esac -- cgit v1.2.3 From d1373b552d74f2ec4dd36bc0c8ea9e8faa963150 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 13:53:59 +0200 Subject: add update-initramfs.8 --- debian/changelog | 4 ++- debian/initramfs-tools.manpages | 1 + update-initramfs.8 | 60 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 update-initramfs.8 diff --git a/debian/changelog b/debian/changelog index c25c38b..d497980 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,7 +14,9 @@ initramfs-tools (0.27) unstable; urgency=low * Add question mark to the getopts for the help message. - -- maximilian attems Mon, 19 Sep 2005 18:14:59 +0200 + * update-initramfs.8 New file install it. + + -- maximilian attems Tue, 20 Sep 2005 13:52:00 +0200 initramfs-tools (0.26) breezy; urgency=low diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 95edfac..0f42d94 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,2 +1,3 @@ mkinitramfs.8 initramfs.conf.5 +update-initramfs.8 diff --git a/update-initramfs.8 b/update-initramfs.8 new file mode 100644 index 0000000..90b7bd9 --- /dev/null +++ b/update-initramfs.8 @@ -0,0 +1,60 @@ +.TH UPDATE-INITRAMFS 8 "$Date: 2005/09/20" $" "" "update-initramfs manual" + +.SH NAME +update-initramfs \- generate an initramfs image + +.SH SYNOPSIS +.B update-initramfs +.RB [ \-k +.IR version ] +.RB [ \-c ] +.RB [ \-u ] +.RB [ \-t ] +.RB [ \-v ] +.RB [ \-h ] +.SH DESCRIPTION +The +.B update-initramfs +script manages your initramfs images. The initramfs is an 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 +.TP +\fB \-k \fI version +Set the kernel for whom the initramfs will be generated. + +.TP +\fB \-c +Create a new initramfs. + +.TP +\fB \-u +Update an existing initramfs. + +.TP +\fB \-d +Remove an existing initramfs. + +.TP +\fB \-t +Take over a custom initramfs with this one. + +.TP +\fB \-v +This option increases the amount of information you are given during +the chosen action. + +.TP +\fB \-h +Print a short help page describing the available options in +.B update-initramfs. + +.SH AUTHOR +The initramfs-tools are written by Jeff Bailey . +This manual is maintained by Maximilian Attems . + +.SH SEE ALSO + +.BR initramfs.conf (5) -- cgit v1.2.3 From b1745fbbd0ca53ce3e47e1a35a100dac9ecf002a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 14:35:14 +0200 Subject: fix typo in Uploaders --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4182659..c2610db 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilan attems +Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends-Indep: debhelper (>= 4.0.0), cdbs Standards-Version: 3.6.2.0 -- cgit v1.2.3 From 2c2d674d922cc0dbc762e96948f741f319fa88fb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 14:59:24 +0200 Subject: fix bb path --- debian/changelog | 3 +++ mkinitramfs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d497980..30d3c79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,9 @@ initramfs-tools (0.27) unstable; urgency=low * update-initramfs.8 New file install it. + * The debian busybox-cvs-static installs into /bin/busybox: + fix pathes vis--vis ubuntu version. + -- maximilian attems Tue, 20 Sep 2005 13:52:00 +0200 initramfs-tools (0.26) breezy; urgency=low diff --git a/mkinitramfs b/mkinitramfs index 8257b7f..b8a591a 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -134,9 +134,9 @@ copy_exec /sbin/udevstart /sbin # Busybox rm ${DESTDIR}/bin/sh -ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/sh +ln -s /bin/busybox ${DESTDIR}/bin/sh # This is ugly, but needed atm to make the builtins work =( -ln -s /usr/lib/initramfs-tools/bin/busybox ${DESTDIR}/bin/busybox +ln -s /bin/busybox ${DESTDIR}/bin/busybox # Modutils copy_exec /sbin/modprobe /sbin -- cgit v1.2.3 From 14739b596ae27800ae6ce071745cf2da382d73b4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 20 Sep 2005 15:09:16 +0200 Subject: use BUSYBOXDIR variable --- debian/changelog | 2 +- mkinitramfs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 30d3c79..4591d65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,7 +17,7 @@ initramfs-tools (0.27) unstable; urgency=low * update-initramfs.8 New file install it. * The debian busybox-cvs-static installs into /bin/busybox: - fix pathes vis--vis ubuntu version. + fix pathes vis--vis ubuntu version. make that a variable on top. -- maximilian attems Tue, 20 Sep 2005 13:52:00 +0200 diff --git a/mkinitramfs b/mkinitramfs index b8a591a..3866a76 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -7,6 +7,8 @@ keep="n" CONFDIR="/etc/mkinitramfs" verbose="n" errors_to="2>/dev/null" +# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" +BUSYBOXDIR="/bin" while getopts "d:ko:r:" flag; do case $flag in @@ -134,9 +136,9 @@ copy_exec /sbin/udevstart /sbin # Busybox rm ${DESTDIR}/bin/sh -ln -s /bin/busybox ${DESTDIR}/bin/sh +ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh # This is ugly, but needed atm to make the builtins work =( -ln -s /bin/busybox ${DESTDIR}/bin/busybox +ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox # Modutils copy_exec /sbin/modprobe /sbin -- cgit v1.2.3 From a893fa82665ee472079292eb84a125ef81009124 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Oct 2005 02:33:30 +0200 Subject: apply all the 0.30 upstream changes. --- HACKING | 19 +++++++++++++++++++ debian/changelog | 41 ++++++++++++++++++++++++++++++++++++++++- debian/initramfs-tools.docs | 1 + debian/rules | 4 ++++ hook-functions | 2 +- init | 11 +++++++++-- scripts/functions | 19 ++++++++++++++++--- scripts/local-premount/suspend | 2 +- update-initramfs | 4 ++-- 9 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 HACKING create mode 100644 debian/initramfs-tools.docs diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..2fd9136 --- /dev/null +++ b/HACKING @@ -0,0 +1,19 @@ +> I am not sure how to modify mkinitramfs to do this automatically, maybe you know? + +I need to document this more clearly, but the initramfs-tools have a collection of hooks that will solve your problem. While there's no way that Breezy could do this in the install, we could certainly include the scripts in the package (Especially if you're willing to test them to make sure they work! *g*) + +There are two phases that need to be accounted for. The first is the install phase for generating the initramfs, the second is run-time phase for actually doing the needed magic. + +To install the components you need, look at the scripts in /usr/share/initramfs-tools/hooks. evms and acpid are good choices. You can see a bunch of header stuff at the top that basically guarantees that things are run in the right order if they need to be. Two functions that will interest you: + +copy_exec copies a binary and any libraries it depends on +manual_add_modules takes bareword module names (like fan, thermal, etc) and installs those modules and any of their dependancies into the initramfs. + +The runtime phase is handled by scripts in /usr/share/initramfs-tools/scripts/ you probably want to start up at about the same point as lvm, md, and evms do, so local-top is a good directory to look in. +You can see the same sort of magic at the top of the script, although lvm and evms each require that md run first. + +I hope this helps. I'll paste this text into a HACKING file on the hopes that someone will see fit to improve it. That person will probably be me, mind you... =) + +Tks, +Jeff Bailey + diff --git a/debian/changelog b/debian/changelog index 4591d65..1ea455b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +initramfs-tools (0.30) unstable; urgency=low + + Apparition Octobre Rouge + + [ maximilian Attems ] + + * Resynconise with latest upstream now we are in unstable. + + [ Jeff Bailey ] + * debian/rules: Make sure hooks and scripts are chmod +x + + * hook-functions (auto_add_modules): Add advansys. + + * debian/init: Add "Loading, please wait..." message. + Don't log for init-top scripts to avoid usplash noise. + + * init: Add start of debug command line option. + + * scripts/functions (log_begin_msg): Call usplash if available + (log_end_msg): Call usplash if available + (panic): Close usplash if available + + * scripts/functions (load_modules): Quote resume variable. + Thanks to Christian Kellner for helping test that! + + * scripts/local-premount/suspend: Quote resume variable. + + * update-initramfs: Use basename on the link target to get the + version number. + + * HACKING: Start of some notes on how this package actually works. + * debian/initramfs-tools.docs: Install it. + + [ Matthew Garrett ] + * scripts/functions (load_modules): Run udevstart after loading block + drivers should fix resume from hibernate on non-LVM systems. + + -- maximilian attems Fri, 30 Sep 2005 19:34:55 +0200 + initramfs-tools (0.27) unstable; urgency=low * Remove unused BUSYBOX config option as we use busybox anyway. @@ -17,7 +56,7 @@ initramfs-tools (0.27) unstable; urgency=low * update-initramfs.8 New file install it. * The debian busybox-cvs-static installs into /bin/busybox: - fix pathes vis--vis ubuntu version. make that a variable on top. + fix pathes vis-a-vis ubuntu version. make that a variable on top. -- maximilian attems Tue, 20 Sep 2005 13:52:00 +0200 diff --git a/debian/initramfs-tools.docs b/debian/initramfs-tools.docs new file mode 100644 index 0000000..5c374b1 --- /dev/null +++ b/debian/initramfs-tools.docs @@ -0,0 +1 @@ +HACKING diff --git a/debian/rules b/debian/rules index 6b91c1f..2a5ae55 100644 --- a/debian/rules +++ b/debian/rules @@ -4,3 +4,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk pre-build:: chmod +x init mkinitramfs + chmod +x hooks/* + for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \ + chmod -R +x $$x; \ + done diff --git a/hook-functions b/hook-functions index 4371962..bc21b5f 100644 --- a/hook-functions +++ b/hook-functions @@ -144,7 +144,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules ${x} done diff --git a/init b/init index 6bf4be7..4193dcd 100644 --- a/init +++ b/init @@ -1,5 +1,7 @@ #!/bin/sh +echo "Loading, please wait..." + mkdir /sys mkdir /proc mkdir /tmp @@ -22,6 +24,7 @@ export readonly=y export ROOT= export resume=${RESUME} export rootmnt=/root +export debug= for x in $(cat /proc/cmdline); do case $x in init=*) @@ -48,15 +51,19 @@ for x in $(cat /proc/cmdline); do rw) readonly=n ;; + debug) + debug=y + exec >/tmp/initramfs.debug 2>&1 + set -x + ;; break) break=yes ;; esac done -log_begin_msg "Running /scripts/init-top" +# Don't do log messages here to avoid confusing usplash run_scripts /scripts/init-top -log_end_msg . /scripts/${BOOT} diff --git a/scripts/functions b/scripts/functions index 148dda7..de2268c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -23,12 +23,18 @@ log_warning_msg() log_begin_msg() { - _log_msg "Begin: $@ ..." + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "TEXT $@" + fi + _log_msg "Begin: $@ ..." } log_end_msg() { - _log_msg "Done." + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "SUCCESS ok" + fi + _log_msg "Done." } # update_progress() # ToDo: NOP placeholder... what else for usplash? @@ -38,6 +44,9 @@ log_end_msg() panic() { + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "QUIT" + fi echo $@ FS1='(initramfs) ' exec /bin/sh /dev/console 2>&1 } @@ -228,8 +237,12 @@ load_modules() i2o_boot_events + # FIXME - need to start LVM here + + udevstart + if [ -e /sys/power/resume ]; then - if [ -e ${resume} ]; then + if [ -e "${resume}" ]; then major=$((0x$(stat -c%t ${resume}))) minor=$((0x$(stat -c%T ${resume}))) echo ${major}:${minor} >/sys/power/resume diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 5791123..6aab596 100644 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -19,7 +19,7 @@ if [ "x${resume}" = "x" ]; then exit fi -if [ ! -e ${resume} ]; then +if [ ! -e "${resume}" ]; then exit fi diff --git a/update-initramfs b/update-initramfs index f93fc97..bd5a4ab 100644 --- a/update-initramfs +++ b/update-initramfs @@ -115,11 +115,11 @@ get_sorted_versions() set_linked_version() { if [ -L /initrd.img ]; then - linktarget=$(readlink /initrd.img) + linktarget=$(basename $(readlink /initrd.img)) fi if [ -L /boot/initrd.img ]; then - linktarget=$(readlink /boot/initrd.img) + linktarget=$(basename $(readlink /boot/initrd.img)) fi if [ -z "${linktarget}" ]; then -- cgit v1.2.3 From 402fc00b3d7c55532f6e7408d6245783b909bd77 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:11:52 +0200 Subject: new repo format v6 --- debian/rules | 0 hooks/acpid | 0 hooks/evms | 0 hooks/kernelextras | 0 hooks/udev | 0 init | 0 mkinitramfs | 0 scripts/init-premount/acpid | 0 scripts/local-premount/suspend | 0 scripts/local-top/evms | 0 scripts/local-top/lvm | 0 scripts/local-top/md | 0 12 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 debian/rules mode change 100644 => 100755 hooks/acpid mode change 100644 => 100755 hooks/evms mode change 100644 => 100755 hooks/kernelextras mode change 100644 => 100755 hooks/udev mode change 100644 => 100755 init mode change 100644 => 100755 mkinitramfs mode change 100644 => 100755 scripts/init-premount/acpid mode change 100644 => 100755 scripts/local-premount/suspend mode change 100644 => 100755 scripts/local-top/evms mode change 100644 => 100755 scripts/local-top/lvm mode change 100644 => 100755 scripts/local-top/md 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 60417290f1be20067c64431a5249cafe8a9bbc51 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:13:32 +0200 Subject: fix the wrong busybox depend, was a bad fix as it needs consequent fixes --- debian/changelog | 9 +++++++++ debian/control | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1ea455b..a44d9a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.31) unstable; urgency=low + + Quick fix for sluggish dep + + [ Bastian Blank ] + * Use new busybox. (closes: #333755) + + -- maximilian attems Mon, 17 Oct 2005 16:27:31 +0200 + initramfs-tools (0.30) unstable; urgency=low Apparition Octobre Rouge diff --git a/debian/control b/debian/control index c2610db..6dcbbec 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-cvs-static (>= 20040623-1), 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 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 -- 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(-) 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 a5ceeefab355e57948134a8857f0b15fa56a8c6e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:28:26 +0200 Subject: mklibs-small got as mklibs-copy into the archive, fix that --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 7e9481a..6ff9320 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -149,7 +149,7 @@ cp /sbin/mdrun ${DESTDIR}/sbin # LVM cp /lib/lvm-200/vgchange ${DESTDIR}/sbin -mklibs-small -d ${DESTDIR}/lib --root=${DESTDIR} $(find ${DESTDIR} -type f -perm +0111 -o -name '*.so') +mklibs-copy -d ${DESTDIR}/lib --root=${DESTDIR} $(find ${DESTDIR} -type f -perm +0111 -o -name '*.so') ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib -- cgit v1.2.3 From b96ed45312562bbfc976ce0c6cf32b7e704f1e2f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:33:03 +0200 Subject: waldi udev fixes --- debian/changelog | 15 ++++++++++++++- init | 16 ++++++++++++---- mkinitramfs | 6 ++++-- scripts/functions | 22 ---------------------- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/debian/changelog b/debian/changelog index 600d835..832a67d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,20 @@ initramfs-tools (0.31) UNRELEASED; urgency=low * mkinitramfs - Use cp instead of copy_exec. - Call mklibs-copy to collect necessary libs. - + * Use udevsynthesize. + * Add hotplug agents. + + * init udev fixes + - Start and kill udevd. + - Create /dev/.udevdb. + - Use udevsynthesize. + - Call depmod. + * mkinitramfs udev fixes + - Install udevd and udevsynthesize instead of udevstart. + - Install hotplug agents. + * scripts/functions (load_modules) + - Don't call depmod and udevstart. + - Don't crawl pci devices ourself. -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 diff --git a/init b/init index 4193dcd..113a224 100755 --- a/init +++ b/init @@ -67,15 +67,21 @@ run_scripts /scripts/init-top . /scripts/${BOOT} +depmod -a + +# Populate /dev tree +log_begin_msg "Initializing /dev" +mkdir /dev/.udevdb +UDEVD_EXPECTED_SEQNUM=$(($(cat /sys/kernel/hotplug_seqnum) + 1)) udevd --daemon +udevsynthesize +sleep 2 +log_end_msg + log_begin_msg "Loading modules" load_modules log_end_msg -# Populate /dev tree -log_begin_msg "Initializing /dev" parse_numeric ${ROOT} -udevstart -log_end_msg if [ x${break} = xyes ]; then panic "Spawning shell within the initramfs" @@ -85,6 +91,8 @@ log_begin_msg "Running /scripts/init-premount" run_scripts /scripts/init-premount log_end_msg +killall udevd + log_begin_msg "Mounting root file system" mountroot log_end_msg diff --git a/mkinitramfs b/mkinitramfs index 6ff9320..e870489 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -128,9 +128,11 @@ done cp ${CONFDIR}/initramfs.conf ${DESTDIR}/conf cp -a /etc/udev ${DESTDIR}/etc -# Hack until udev is built with klibc +# udev cp /sbin/udev ${DESTDIR}/sbin -cp /sbin/udevstart ${DESTDIR}/sbin +cp /sbin/udevd ${DESTDIR}/sbin +cp /sbin/udevsynthesize ${DESTDIR}/sbin +cp -a /lib/hotplug ${DESTDIR}/lib # Busybox cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox diff --git a/scripts/functions b/scripts/functions index de2268c..68cfcea 100644 --- a/scripts/functions +++ b/scripts/functions @@ -203,8 +203,6 @@ i2o_boot_events() load_modules() { - depmod -a - # Load custom modules first if [ -e /conf/modules ]; then cat /conf/modules | while read m; do @@ -219,18 +217,6 @@ 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 @@ -239,8 +225,6 @@ load_modules() # FIXME - need to start LVM here - udevstart - if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then major=$((0x$(stat -c%t ${resume}))) @@ -249,12 +233,6 @@ load_modules() fi fi - for x in /sys/bus/pci/devices/*; do - if [ -e ${x}/modalias ]; then - modprobe -q $(cat ${x}/modalias) - fi - done - # Give the USB bus a moment to catch up sleep 2 -- cgit v1.2.3 From 762c80e985a461a6d37f395696204184ec1f1d64 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:35:08 +0200 Subject: waldi: add ibmvscsic module --- debian/changelog | 2 ++ hook-functions | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 832a67d..7288dcf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ initramfs-tools (0.31) UNRELEASED; urgency=low - Don't call depmod and udevstart. - Don't crawl pci devices ourself. + * hook-functions: Add ibmvscsic to list of scsi modules. + -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 24be12c..c06d3e9 100644 --- a/hook-functions +++ b/hook-functions @@ -114,7 +114,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules ${x} done -- cgit v1.2.3 From bee1355e2c21a86751648b6f0df8a6e4e4e5a45d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:38:32 +0200 Subject: added latest upstream fixes :-) --- debian/changelog | 19 ++++++++++++++++++- hook-functions | 4 ++-- init | 4 ++-- scripts/local | 12 ++++++------ scripts/nfs | 18 +++++++++++------- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7288dcf..00643e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,7 +24,24 @@ initramfs-tools (0.31) UNRELEASED; urgency=low * hook-functions: Add ibmvscsic to list of scsi modules. - -- Bastian Blank Mon, 10 Oct 2005 18:27:12 +0000 + [ maximilian attems ] + * Resynchronise with latest upstream release. + + [ Jeff Bailey ] + * scripts/nfs (mountroot): New variable: NFSOPTS, default to + -o retranfs=10. (Ubuntu 12942) + This can be overridden in the initramfs.conf file. + Thanks to Oliver Grawert for testing this! + + * hook-scripts (auto_add_modules): Add jfs + (dep_add_modules): Ditto. (Ubuntu #16742) + Thanks to Colin Watson for this fix! + + [ Adam Conrad ] + * Make us a bit more silent/tidy by default, unless "quiet" isn't on + the kernel's command line (then we're just as verbose as ever) + + -- maximilian attems Sun, 16 Oct 2005 19:22:55 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index c06d3e9..cb424d4 100644 --- a/hook-functions +++ b/hook-functions @@ -63,7 +63,7 @@ dep_add_modules() { # Things that are too hard to autodetect. - for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do manual_add_modules ${x} done @@ -99,7 +99,7 @@ dep_add_modules() auto_add_modules() { # base - for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs nfs reiserfs xfs af_packet dm_mod; do + for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do manual_add_modules ${x} done diff --git a/init b/init index 113a224..18d31ad 100755 --- a/init +++ b/init @@ -97,9 +97,9 @@ log_begin_msg "Mounting root file system" mountroot log_end_msg -log_begin_msg "Running /scripts/init-bottom" +[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom -log_end_msg +[ "$quiet" != "y" ] && log_end_msg # Move our /dev to the real filesystem. Do the setup that udev otherwise # would. diff --git a/scripts/local b/scripts/local index 539a2a4..aa2cbfb 100644 --- a/scripts/local +++ b/scripts/local @@ -3,9 +3,9 @@ # Parameter: Where to mount the filesystem mountroot () { - log_begin_msg "Running /scripts/local-top" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top" run_scripts /scripts/local-top - log_end_msg + [ "$quiet" != "y" ] && log_end_msg # Get the root filesystem type if [ ! -e "${ROOT}" ]; then @@ -14,9 +14,9 @@ mountroot () eval $(fstype < ${ROOT}) - log_begin_msg "Running /scripts/local-premount" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount - log_end_msg + [ "$quiet" != "y" ] && log_end_msg if [ ${readonly} = y ]; then roflag=-r @@ -31,7 +31,7 @@ mountroot () # Mount root mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} - log_begin_msg "Running /scripts/log-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom" run_scripts /scripts/local-bottom - log_end_msg + [ "$quiet" != "y" ] && log_end_msg } diff --git a/scripts/nfs b/scripts/nfs index 10f8f1d..7166b08 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -5,9 +5,9 @@ # Paramter: Where the root should be mounted mountroot () { - log_begin_msg "Running /scripts/nfs-top" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" run_scripts /scripts/nfs-top - log_end_msg + [ "$quiet" != "y" ] && log_end_msg modprobe nfs # For DHCP @@ -19,9 +19,13 @@ mountroot () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi - log_begin_msg "Running /scripts/nfs-premount" + if [ "x${NFSOPTS}" = "x" ]; then + NFSOPTS="-o retrans=10" + fi + + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount" run_scripts /scripts/nfs-premount - log_end_msg + [ "$quiet" != "y" ] && log_end_msg if [ ${readonly} = y ]; then roflag="-o ro" @@ -30,10 +34,10 @@ mountroot () fi sleep 3 - nfsmount ${roflag} ${NFSROOT} ${rootmnt} + nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} - log_begin_msg "Running /scripts/nfs-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom - log_end_msg + [ "$quiet" != "y" ] && log_end_msg } -- cgit v1.2.3 From 46727679e6e5bfdb67268511dc7a91a7a828abd7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 18:50:53 +0200 Subject: jonas: use gnu getopt instead of getopts --- debian/changelog | 5 ++++- mkinitramfs | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 00643e0..4b75eec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -41,7 +41,10 @@ initramfs-tools (0.31) UNRELEASED; urgency=low * Make us a bit more silent/tidy by default, unless "quiet" isn't on the kernel's command line (then we're just as verbose as ever) - -- maximilian attems Sun, 16 Oct 2005 19:22:55 +0200 + [ Jonas Smedegaard ] + * Use GNU getopt (instead of bash builtin getopts) for improved handling. + + -- Jonas Smedegaard Tue, 18 Oct 2005 04:03:48 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index e870489..bcf640b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -10,27 +10,47 @@ errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" BUSYBOXDIR="/bin" -while getopts "d:ko:r:" flag; do - case $flag in - d) - CONFDIR="${OPTAGS}" +OPTIONS=`getopt -o d:ko:r: -n "$0" -- "$@"` + +# Check for non-GNU getopt +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$OPTIONS" + +while true; do + case "$1" in + -d) + CONFDIR="$2" + shift 2 if [ ! d "${CONFDIR}" ]; then echo "${0}: ${CONFDIR}: Not a directory" >&2 exit 1 fi ;; - o) - touch ${OPTARG} - outfile="$(readlink -f ${OPTARG})" + -o) + touch $2 + shift $2 + outfile="$(readlink -f $2)" ;; - k) + -k) keep="y" + shift + ;; + -r) + # ignore (FIXME: manpage says differently?!?) + shift 2 + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 ;; esac done -shift $((${OPTIND} - 1)) - # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions -- cgit v1.2.3 From bbf15576550507c54b3e190ae6eac63ca070e333 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:07:51 +0200 Subject: jonas: Quote variables. Use test options -n and -z. --- debian/changelog | 4 ++- hook-functions | 40 ++++++++++++------------ mkinitramfs | 92 ++++++++++++++++++++++++++++---------------------------- update-initramfs | 28 ++++++++--------- 4 files changed, 83 insertions(+), 81 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4b75eec..96efc42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,8 +43,10 @@ initramfs-tools (0.31) UNRELEASED; urgency=low [ Jonas Smedegaard ] * Use GNU getopt (instead of bash builtin getopts) for improved handling. + * Quote variables. + * Use test options -n and -z. - -- Jonas Smedegaard Tue, 18 Oct 2005 04:03:48 +0200 + -- Jonas Smedegaard Tue, 18 Oct 2005 04:16:30 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/hook-functions b/hook-functions index cb424d4..32a7e5f 100644 --- a/hook-functions +++ b/hook-functions @@ -7,13 +7,13 @@ catenate_cpiogz() { return fi - cat "${1}" >>${__TMPCPIOGZ} + cat "${1}" >>"${__TMPCPIOGZ}" } force_load() { manual_add_modules ${@} - echo ${@} >>${DESTDIR}/conf/modules + echo ${@} >>"${DESTDIR}/conf/modules" } # Takes a file containing a list of modules to be added as an @@ -34,7 +34,7 @@ add_modules_from_file() fi sed -e '/^#/d' ${1} | while read module rest; do - force_load ${module} "${rest}" + force_load "${module}" "${rest}" done } @@ -42,21 +42,21 @@ manual_add_modules() { for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do # Prune duplicates - if [ -e ${DESTDIR}/${mam_x} ]; then + if [ -e "${DESTDIR}/${mam_x}" ]; then continue fi - mkdir -p ${DESTDIR}/$(dirname ${mam_x}) - ln -s ${mam_x} ${DESTDIR}/$(dirname ${mam_x}) + mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" + ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" done } # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase=${DESTDIR}/lib/modules/${version} - mkdir -p $(dirname ${tmpdir_modbase}/${1}) - cp -a ${MODULESDIR}/${1} ${tmpdir_modbase}/${1} + tmpdir_modbase="${DESTDIR}/lib/modules/${version}" + mkdir -p "$(dirname "${tmpdir_modbase}/${1}")" + cp -a "${MODULESDIR}/${1}" "${tmpdir_modbase}/${1}" } dep_add_modules() @@ -64,24 +64,24 @@ dep_add_modules() # Things that are too hard to autodetect. for x in md raid0 raid1 raid5 raid6 ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} + manual_add_modules "${x}" done for x in /sys/bus/pci/devices/*; do - if [ -e ${x}/modalias ]; then - manual_add_modules $(cat ${x}/modalias) + if [ -e "${x}/modalias" ]; then + manual_add_modules $(cat "${x}/modalias") fi done for x in /sys/bus/usb/devices/*; do - if [ -e ${x}/modalias ]; then - manual_add_modules $(cat ${x}/modalias) + if [ -e "${x}/modalias" ]; then + manual_add_modules $(cat "${x}/modalias") fi done if [ -e /proc/ide ]; then for x in ide-generic ide-disk ide-cd; do - manual_add_modules ${x} + manual_add_modules "${x}" done fi @@ -100,27 +100,27 @@ auto_add_modules() { # base for x in md raid0 raid1 raid5 raid6 ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet dm_mod; do - manual_add_modules ${x} + manual_add_modules "${x}" done # Ethernet for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi forcedeth hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do - manual_add_modules ${x} + manual_add_modules "${x}" done # ide for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do - manual_add_modules ${x} + manual_add_modules "${x}" done # scsi for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do - manual_add_modules ${x} + manual_add_modules "${x}" done # i2o for x in i2o_block; do - manual_add_modules ${x} + manual_add_modules "${x}" done } diff --git a/mkinitramfs b/mkinitramfs index bcf640b..874d2ce 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -30,7 +30,7 @@ while true; do -o) touch $2 shift $2 - outfile="$(readlink -f $2)" + outfile="$(readlink -f "$2")" ;; -k) keep="y" @@ -55,17 +55,17 @@ done . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions -. ${CONFDIR}/initramfs.conf +. "${CONFDIR}/initramfs.conf" -if [ x${outfile} = x ]; then +if [ -z "${outfile}" ]; then usage fi # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd if [ ${#} -ne 1 ]; then - version=$(uname -r) -else + version="$(uname -r)" +else version="${1}" fi @@ -74,36 +74,36 @@ if dpkg --compare-versions "${version}" lt 2.6.12; then exit 1 fi -case ${version} in +case "${version}" in /lib/modules/*/[!/]*) ;; /lib/modules/[!/]*) - version=${version#/lib/modules/} - version=${version%%/*} + version="${version#/lib/modules/}" + version="${version%%/*}" ;; esac -case ${version} in +case "${version}" in */*) - echo $PROG: ${version} is not a valid kernel version >&2 + echo "$PROG: ${version} is not a valid kernel version" >&2 exit 1 ;; esac -if [ -d ${outfile} ]; then +if [ -d "${outfile}" ]; then echo "${outfile} is a directory" exit 1 fi MODULESDIR="/lib/modules/${version}" -if [ ! -e ${MODULESDIR} ]; then +if [ ! -e "${MODULESDIR}" ]; then echo "Cannot find ${MODULESDIR}" exit 1 fi -DESTDIR=$(mktemp -t -d mkinitramfs_XXXXXX) || exit 1 -__TMPCPIOGZ=$(mktemp -t mkinitramfs-OL_XXXXXX) || exit 1 +DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 +__TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 # Export environment for hook scripts. # @@ -116,13 +116,13 @@ export DESTDIR export __TMPCPIOGZ for d in bin conf etc lib modules sbin scripts; do - mkdir -p ${DESTDIR}/${d} + mkdir -p "${DESTDIR}/${d}" done # MODULES=list case. Always honour. -for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do +for x in "${CONFDIR}/modules" /usr/share/initramfs-tools/modules.d/*; do if [ -f "${x}" ]; then - add_modules_from_file ${x} + add_modules_from_file "${x}" fi done @@ -137,60 +137,60 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -cp /usr/share/initramfs-tools/init ${DESTDIR}/init -cp -a /usr/share/initramfs-tools/scripts/* ${DESTDIR}/scripts +cp /usr/share/initramfs-tools/init "${DESTDIR}/init" +cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd /etc/mkinitramfs/scripts && \ find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ -o -type f -print); do - mkdir --parents ${DESTDIR}/scripts/$(dirname ${f}) -cp -p /etc/mkinitramfs/scripts/${f} ${DESTDIR}/scripts/$(dirname ${f}) + mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" +cp -p "/etc/mkinitramfs/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done -cp ${CONFDIR}/initramfs.conf ${DESTDIR}/conf -cp -a /etc/udev ${DESTDIR}/etc +cp "${CONFDIR}/initramfs.conf" "${DESTDIR}/conf" +cp -a /etc/udev "${DESTDIR}/etc" # udev -cp /sbin/udev ${DESTDIR}/sbin -cp /sbin/udevd ${DESTDIR}/sbin -cp /sbin/udevsynthesize ${DESTDIR}/sbin -cp -a /lib/hotplug ${DESTDIR}/lib +cp /sbin/udev "${DESTDIR}/sbin" +cp /sbin/udevd "${DESTDIR}/sbin" +cp /sbin/udevsynthesize "${DESTDIR}/sbin" +cp -a /lib/hotplug "${DESTDIR}/lib" # Busybox -cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox +cp "${BUSYBOXDIR}/busybox" "${DESTDIR}/bin/busybox" # Modutils -cp /sbin/modprobe ${DESTDIR}/sbin -cp /sbin/depmod ${DESTDIR}/sbin -cp /sbin/rmmod ${DESTDIR}/sbin -mkdir -p ${DESTDIR}/etc/modprobe.d -cp /etc/modprobe.d/aliases ${DESTDIR}/etc/modprobe.d +cp /sbin/modprobe "${DESTDIR}/sbin" +cp /sbin/depmod "${DESTDIR}/sbin" +cp /sbin/rmmod "${DESTDIR}/sbin" +mkdir -p "${DESTDIR}/etc/modprobe.d" +cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" # Raid -cp /sbin/mdadm ${DESTDIR}/sbin -cp /sbin/mdrun ${DESTDIR}/sbin +cp /sbin/mdadm "${DESTDIR}/sbin" +cp /sbin/mdrun "${DESTDIR}/sbin" # LVM -cp /lib/lvm-200/vgchange ${DESTDIR}/sbin +cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" -mklibs-copy -d ${DESTDIR}/lib --root=${DESTDIR} $(find ${DESTDIR} -type f -perm +0111 -o -name '*.so') +mklibs-copy -d "${DESTDIR}/lib" --root="${DESTDIR}" $(find "${DESTDIR}" -type f -perm +0111 -o -name '*.so') -ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +ln -s /usr/lib/klibc/bin/* "${DESTDIR}/bin" +ln -s /usr/lib/klibc/lib/* "${DESTDIR}/lib" -rm ${DESTDIR}/bin/sh -ln -s busybox ${DESTDIR}/bin/sh +rm "${DESTDIR}/bin/sh" +ln -s busybox "${DESTDIR}/bin/sh" run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks # Apply DSDT to initramfs -if [ -e ${CONFDIR}/DSDT.aml ]; then - cp ${CONFDIR}/DSDT.aml ${DESTDIR} +if [ -e "${CONFDIR}/DSDT.aml" ]; then + cp "${CONFDIR}/DSDT.aml" "${DESTDIR}" fi -(cd ${DESTDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) +(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") -if [ -s ${__TMPCPIOGZ} ]; then - cat ${__TMPCPIOGZ} >>${outfile} +if [ -s "${__TMPCPIOGZ}" ]; then + cat "${__TMPCPIOGZ}" >>"${outfile}" fi if [ "${keep}" = "y" ]; then diff --git a/update-initramfs b/update-initramfs index bd5a4ab..644a1aa 100644 --- a/update-initramfs +++ b/update-initramfs @@ -63,33 +63,33 @@ set_initramfs() generate_initramfs() { verbose "Generating ${initramfs}" - mkinitramfs -o ${initramfs} ${version} + mkinitramfs -o "${initramfs}" "${version}" set_sha1 } compare_sha1() { - sha1sum ${initramfs} | diff ${STATEDIR}/${version} - >/dev/null 2>&1 + sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1 return $? } # Note that this must overwrite so that updates work. set_sha1() { - sha1sum ${initramfs} > ${STATEDIR}/${version} + sha1sum "${initramfs}" > "${STATEDIR}/${version}" } delete_sha1() { - rm -f ${STATEDIR}/${version} + rm -f "${STATEDIR}/${version}" } get_sorted_versions() { version_list="" - for gsv_x in ${STATEDIR}/*; do - gsv_x=$(basename ${gsv_x}) + for gsv_x in "${STATEDIR}"/*; do + gsv_x="$(basename "${gsv_x}")" if [ "${gsv_x}" = '*' ]; then verbose "Nothing to do, exiting." exit 0 @@ -106,7 +106,7 @@ get_sorted_versions() if [ "${gsv_x}" != "" ]; then worklist="${worklist} ${gsv_x}" fi - version_list=${worklist} + version_list="${worklist}" done verbose "Available versions: ${version_list}" @@ -115,11 +115,11 @@ get_sorted_versions() set_linked_version() { if [ -L /initrd.img ]; then - linktarget=$(basename $(readlink /initrd.img)) + linktarget="$(basename "$(readlink /initrd.img)")" fi if [ -L /boot/initrd.img ]; then - linktarget=$(basename $(readlink /boot/initrd.img)) + linktarget="$(basename "$(readlink /boot/initrd.img)")" fi if [ -z "${linktarget}" ]; then @@ -145,11 +145,11 @@ create() set_initramfs if [ "${takeover}" = 0 ]; then - if version_exists ${version}; then + if version_exists "${version}"; then panic "Cannot create version ${version}: already exists" fi - if [ -e ${initramfs} ]; then + if [ -e "${initramfs}" ]; then panic "${initramfs} already exists, cannot create." fi fi @@ -176,7 +176,7 @@ update() fi # Don't stop if one version doesn't work. set +e - ${0} ${vflag} -u -k ${u_version} + "${0}" "${vflag}" -u -k "${u_version}" set -e done exit 0 @@ -198,11 +198,11 @@ delete() set_initramfs - if [ ! -e ${initramfs} ]; then + if [ ! -e "${initramfs}" ]; then panic "Cannot delete ${initramfs}, doesn't exist." fi - if ! version_exists ${version}; then + if ! version_exists "${version}"; then panic "Cannot delete version ${version}: Not created by this utility." fi -- cgit v1.2.3 From 198b6acac258faa88345e45593679d54791506f0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:08:44 +0200 Subject: fix small stupid bug in newer opts handling. --- debian/changelog | 1 + mkinitramfs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 96efc42..bc526d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ initramfs-tools (0.31) UNRELEASED; urgency=low [ maximilian attems ] * Resynchronise with latest upstream release. + * Place shift after variable outfile assignment. [ Jeff Bailey ] * scripts/nfs (mountroot): New variable: NFSOPTS, default to diff --git a/mkinitramfs b/mkinitramfs index 874d2ce..63c9b27 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -29,8 +29,8 @@ while true; do ;; -o) touch $2 - shift $2 outfile="$(readlink -f "$2")" + shift $2 ;; -k) keep="y" -- cgit v1.2.3 From 3457af4cd71c889f90fa505ac4f39264dad3be4c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:09:46 +0200 Subject: finalize 0.33 --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bc526d3..e897de8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.31) UNRELEASED; urgency=low +initramfs-tools (0.33) unstable; urgency=low [ Bastian Blank ] * debian/control: Add mklibs-copy as dependency. @@ -27,6 +27,8 @@ initramfs-tools (0.31) UNRELEASED; urgency=low [ maximilian attems ] * Resynchronise with latest upstream release. * Place shift after variable outfile assignment. + * Thanks to Bastian Blank for the fixes concerning the new busybox version. + (Closes: #334467) [ Jeff Bailey ] * scripts/nfs (mountroot): New variable: NFSOPTS, default to -- cgit v1.2.3 From dcd7525c33372c941631a6c6e38c2923a87f75b9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:20:15 +0200 Subject: really finalize that release --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e897de8..6a34902 100644 --- a/debian/changelog +++ b/debian/changelog @@ -49,7 +49,7 @@ initramfs-tools (0.33) unstable; urgency=low * Quote variables. * Use test options -n and -z. - -- Jonas Smedegaard Tue, 18 Oct 2005 04:16:30 +0200 + -- maximilian attems Fri, 21 Oct 2005 19:19:06 +0200 initramfs-tools (0.31) unstable; urgency=low -- cgit v1.2.3 From 58fa8de0d0a4ab01326623978ed200b1ad429d3b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:28:24 +0200 Subject: waldi: pump udev dep --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6a34902..fae7fff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ initramfs-tools (0.33) unstable; urgency=low * Use udevsynthesize. * Add hotplug agents. + * Bump udev dependency to a working version. * init udev fixes - Start and kill udevd. - Create /dev/.udevdb. diff --git a/debian/control b/debian/control index 68874cf..7b5918a 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, mklibs-copy +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, mdadm, lvm2 (>= 2.01.04-5), udev (>= 0.070-3), 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 -- cgit v1.2.3 From 2546ef6e65c7407c8352e5900cc3564b84bdb466 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 19:32:37 +0200 Subject: fix my bad hand merging, verified against the last debian-kernel svn tree --- hook-functions | 4 ++-- mkinitramfs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index 32a7e5f..189db2e 100644 --- a/hook-functions +++ b/hook-functions @@ -13,7 +13,7 @@ catenate_cpiogz() { force_load() { manual_add_modules ${@} - echo ${@} >>"${DESTDIR}/conf/modules" + echo "${@}" >>"${DESTDIR}/conf/modules" } # Takes a file containing a list of modules to be added as an @@ -40,7 +40,7 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version=${version} --show-depends ${1} 2>/dev/null | awk '{ print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '{ print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue diff --git a/mkinitramfs b/mkinitramfs index 63c9b27..58d42e1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -30,7 +30,7 @@ while true; do -o) touch $2 outfile="$(readlink -f "$2")" - shift $2 + shift 2 ;; -k) keep="y" -- cgit v1.2.3 From 90d305d4e462a4dcbd6d213a9ccad6413b42bd80 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 21 Oct 2005 20:05:42 +0200 Subject: upload without the .bzr.backup dirs, there for pumped version. --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fae7fff..c9dc563 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.33) unstable; urgency=low +initramfs-tools (0.34) unstable; urgency=low [ Bastian Blank ] * debian/control: Add mklibs-copy as dependency. @@ -30,6 +30,7 @@ initramfs-tools (0.33) unstable; urgency=low * Place shift after variable outfile assignment. * Thanks to Bastian Blank for the fixes concerning the new busybox version. (Closes: #334467) + * Dont upload with .bzr.backup dirs. [ Jeff Bailey ] * scripts/nfs (mountroot): New variable: NFSOPTS, default to @@ -50,7 +51,7 @@ initramfs-tools (0.33) unstable; urgency=low * Quote variables. * Use test options -n and -z. - -- maximilian attems Fri, 21 Oct 2005 19:19:06 +0200 + -- maximilian attems Fri, 21 Oct 2005 19:54:27 +0200 initramfs-tools (0.31) unstable; urgency=low -- cgit v1.2.3 From 17fed79e0dfb4fb5625a8195188d3d47da93391a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 08:44:19 +0200 Subject: merge the thing waldi uploaded as 0.32. it has the changes vorlon asked for so that 2.4 systems that use the ramdisk value in /etc/kernel-img.conf don't use the wrong tool. --- debian/changelog | 40 +++++++++++++--------------------------- debian/control | 1 + mkinitramfs | 23 ++++++++++++++++++++++- mkinitramfs.8 | 16 ++++++++++++++++ 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index c9dc563..3e5c166 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,36 +1,21 @@ -initramfs-tools (0.34) unstable; urgency=low +initramfs-tools (0.32) unstable; 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. - * Use udevsynthesize. - * Add hotplug agents. - - * Bump udev dependency to a working version. - * init udev fixes - - Start and kill udevd. - - Create /dev/.udevdb. - - Use udevsynthesize. - - Call depmod. - * mkinitramfs udev fixes - - Install udevd and udevsynthesize instead of udevstart. - - Install hotplug agents. - * scripts/functions (load_modules) - - Don't call depmod and udevstart. - - Don't crawl pci devices ourself. - - * hook-functions: Add ibmvscsic to list of scsi modules. + * Use mklibs-copy. + * Use udevsynthesize instead of udevstart. + * hook-functions: Add ibmvscsic to list of scsi modules. + + [ Sven Luther ] + * Added --supported-(host|target)-version support for the new post-2.6.13 + ramdisk-tool policy. Added linux-ramdisk-tool virtual package too. + (Closes: #333856) [ maximilian attems ] * Resynchronise with latest upstream release. * Place shift after variable outfile assignment. + * Fix strange chars in the Depends line resulting in no depends at all. * Thanks to Bastian Blank for the fixes concerning the new busybox version. (Closes: #334467) - * Dont upload with .bzr.backup dirs. [ Jeff Bailey ] * scripts/nfs (mountroot): New variable: NFSOPTS, default to @@ -47,11 +32,12 @@ initramfs-tools (0.34) unstable; urgency=low the kernel's command line (then we're just as verbose as ever) [ Jonas Smedegaard ] - * Use GNU getopt (instead of bash builtin getopts) for improved handling. + * Use GNU getopt (instead of bash builtin getopts) for improved long- + opts handling. * Quote variables. * Use test options -n and -z. - -- maximilian attems Fri, 21 Oct 2005 19:54:27 +0200 + -- maximilian attems Wed, 19 Oct 2005 17:42:08 +0200 initramfs-tools (0.31) unstable; urgency=low diff --git a/debian/control b/debian/control index 7b5918a..dbff057 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,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 (>= 0.070-3), mklibs-copy +Provides: linux-ramdisk-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel diff --git a/mkinitramfs b/mkinitramfs index 58d42e1..3f0d79b 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: -n "$0" -- "$@"` +OPTIONS=`getopt -o d:ko:r: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -40,6 +40,14 @@ while true; do # ignore (FIXME: manpage says differently?!?) shift 2 ;; + --supported-host-version) + supported_host_version="$2" + shift 2 + ;; + --supported-target-version) + supported_target_version="$2" + shift 2 + ;; --) shift break @@ -51,6 +59,19 @@ 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 1 + 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/mkinitramfs.8 b/mkinitramfs.8 index a4b1530..0918767 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -13,6 +13,12 @@ mkinitramfs \- generate an initramfs image .RB [ \-r .IR root ] .RI [ version ] +.B mkinitramfs +.RB [ \-\-supported-host-version= +.IR hversion ] +.RB [ \-\-supported-target-version= +.IR tversion ] + .SH DESCRIPTION The .B mkinitramfs @@ -42,6 +48,16 @@ Override the setting in .IR mkinitramfs.conf . +.TP +\fB\-\-supported-host-version=\fIhversion +This option queries if mkinitramfs can create ramdisks on a running kernel of version +.IR hversion . + +.TP +\fB\-\-supported-target-version=\fItversion +This option queries if mkinitramfs can create ramdisks for kernel version +.IR tversion . + .SH FILES .TP .I /etc/mkinitramfs/initramfs.conf -- cgit v1.2.3 From 4fa9959b55e1d5047eb27c6dbe4fd843f93118a4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 09:00:59 +0200 Subject: fix the lib deps of the hooks, run them before mklibs-copy. --- debian/changelog | 9 +++++++++ mkinitramfs | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3e5c166..8d38141 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.35) unstable; urgency=low + + * mkinitramfs: Return 2 for failure path of --supported-(host|target)-version. + + * mkinitramfs: Run the hooks before mklibs-copy, broke evms. + thanks to Steinar H. Gunderson + + -- maximilian attems Mon, 24 Oct 2005 08:57:55 +0200 + initramfs-tools (0.32) unstable; urgency=low [ Bastian Blank ] diff --git a/mkinitramfs b/mkinitramfs index 3f0d79b..d03c346 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -66,7 +66,7 @@ if [ -n "$supported_host_version" ] || [ -n "$supported_target_version" ]; then 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 1 + exit 2 fi fi exit 0 @@ -192,6 +192,9 @@ 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 + mklibs-copy -d "${DESTDIR}/lib" --root="${DESTDIR}" $(find "${DESTDIR}" -type f -perm +0111 -o -name '*.so') ln -s /usr/lib/klibc/bin/* "${DESTDIR}/bin" @@ -200,9 +203,6 @@ 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 cp "${CONFDIR}/DSDT.aml" "${DESTDIR}" -- cgit v1.2.3 From a568d07a67b52e9f3176edac16000604bef49846 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 09:18:52 +0200 Subject: change virtual package providen. --- debian/changelog | 4 +++- debian/control | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8d38141..3c8fe88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,9 @@ initramfs-tools (0.35) unstable; urgency=low * mkinitramfs: Run the hooks before mklibs-copy, broke evms. thanks to Steinar H. Gunderson - -- maximilian attems Mon, 24 Oct 2005 08:57:55 +0200 + * Change name of virtual package that is provided into linux-initramfs-tool. + + -- maximilian attems Mon, 24 Oct 2005 09:08:48 +0200 initramfs-tools (0.32) unstable; urgency=low diff --git a/debian/control b/debian/control index dbff057..c1d9b7e 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,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 (>= 0.070-3), mklibs-copy -Provides: linux-ramdisk-tool +Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel -- 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 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 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(+) 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 496ba1a67c18ad88e66534566819b8e6a89a0c6b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 19:19:07 +0200 Subject: remove the mdadm and lvm2 dep. --- debian/changelog | 8 ++++++-- debian/control | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 399560d..7042008 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ initramfs-tools (0.35) unstable; urgency=low * mkinitramfs: Return 2 for failure path of --supported-(host|target)-version. * mkinitramfs: Run the hooks before mklibs-copy, broke evms. - thanks to Steinar H. Gunderson + Thanks for fix and testing to Steinar H. Gunderson * Change name of virtual package that is provided into linux-initramfs-tool. @@ -11,7 +11,11 @@ initramfs-tools (0.35) unstable; urgency=low * Add hooks/md allowing to remove dependency on mdadm. - -- maximilian attems Mon, 24 Oct 2005 09:49:48 +0200 + * Remove the mdadm and lvm dependencies, they work as hooks when present. + The lvm2 version in sarge is good enough to address issues mentioned in + 0.16. A woody backport will need newer lvm2 although.. + + -- maximilian attems Mon, 24 Oct 2005 19:16:14 +0200 initramfs-tools (0.32) unstable; urgency=low diff --git a/debian/control b/debian/control index c1d9b7e..2ff1be9 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 (>= 0.070-3), mklibs-copy +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.070-3), mklibs-copy Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged -- cgit v1.2.3 From 2002749a483fabac4b0ee32256bd937a1d9effd6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Oct 2005 19:55:46 +0200 Subject: Sesse wanted to have all the changes documented that i did relative to latest version in debian unstable. ;-) --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7042008..6a608d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +initramfs-tools (0.36) unstable; urgency=low + + "Sunny Autumn Release" + + * Minor cleanups in mkiniramfs. + + * Remove manpage section about return values. Needs to be rephrased. + Not sure if it's important for the enduser. + + -- maximilian attems Mon, 24 Oct 2005 19:51:51 +0200 + initramfs-tools (0.35) unstable; urgency=low * mkinitramfs: Return 2 for failure path of --supported-(host|target)-version. -- cgit v1.2.3 From a62c8eadea176cc83f83cf1eeeca4aabe59e5a95 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Oct 2005 09:05:53 +0200 Subject: fix stat usage, which is no longer available in newer busybox. use awk instead for determinig major_minor. great patch cures a hang observed on one of my laptops. :-) patch from Adrian Bridgett , #335801. --- debian/changelog | 8 ++++++++ scripts/functions | 6 +++--- scripts/local-premount/suspend | 5 ++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a608d1..b6eddfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.37) unstable; urgency=low + + * scripts/functions, scripts/local-premount/suspend: Use of "stat" + which isn' any more provided by busybox (1.01-3). + Thanks to Adrian Bridgett for the patch using awk. + + -- maximilian attems Wed, 26 Oct 2005 08:43:36 +0200 + initramfs-tools (0.36) unstable; urgency=low "Sunny Autumn Release" diff --git a/scripts/functions b/scripts/functions index 68cfcea..8e82896 100644 --- a/scripts/functions +++ b/scripts/functions @@ -227,9 +227,9 @@ load_modules() if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then - major=$((0x$(stat -c%t ${resume}))) - minor=$((0x$(stat -c%T ${resume}))) - echo ${major}:${minor} >/sys/power/resume + major_minor=$(ls -l ${resume} | \ + awk '{printf "0x%x:0x%x", $5, $6}') + echo $major_minor >/sys/power/resume fi fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 6aab596..2e0b43f 100755 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -24,7 +24,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major=$((0x$(stat -c%t ${resume}))) - minor=$((0x$(stat -c%T ${resume}))) - echo ${major}:${minor} >/sys/power/resume + major_minor=$(ls -l ${resume} | awk '{printf "0x%x:0x%x", $5, $6}') + echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 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(-) 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(-) 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 0abf7fae2bed74f635cad52f39d00b922aef69bf Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Nov 2005 07:10:28 +0100 Subject: fix reference to manpage. --- conf/initramfs.conf | 2 +- debian/changelog | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 88728b4..93554c1 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -1,6 +1,6 @@ # # initramfs.conf -# Configuration file for mkinitramfs(8). See mkinitramfs.conf(5). +# Configuration file for mkinitramfs(8). See initramfs.conf(5). # # diff --git a/debian/changelog b/debian/changelog index 1895572..0c4b918 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.38) unstable; urgency=low + + [ dann frazier ] + + * Reference correct manpage in initramfs.conf. Closes: #336095 + + -- maximilian attems Wed, 2 Nov 2005 06:58:17 +0100 + initramfs-tools (0.37) unstable; urgency=low * scripts/functions, scripts/local-premount/suspend: Use of "stat" -- cgit v1.2.3 From 32b804ba08c6d1bbc08491bcb0d50c6e84a75b98 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Nov 2005 07:15:49 +0100 Subject: fix suspend to disk: use decimal numbers. --- debian/changelog | 10 ++++++++-- scripts/functions | 2 +- scripts/local-premount/suspend | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0c4b918..fea4793 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,9 +2,15 @@ initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] - * Reference correct manpage in initramfs.conf. Closes: #336095 + * initramfs.conf: Reference correct manpage. Closes: #336095 - -- maximilian attems Wed, 2 Nov 2005 06:58:17 +0100 + [ maximilian attems ] + + * scripts/functions, scripts/local-premount/suspend: Fix suspend to disk + by using decimal numbers. Thanks to Adrian Bridgett + for the patch. (Closes: #336936) + + -- maximilian attems Wed, 2 Nov 2005 07:10:45 +0100 initramfs-tools (0.37) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index 8e82896..5147009 100644 --- a/scripts/functions +++ b/scripts/functions @@ -228,7 +228,7 @@ load_modules() if [ -e /sys/power/resume ]; then if [ -e "${resume}" ]; then major_minor=$(ls -l ${resume} | \ - awk '{printf "0x%x:0x%x", $5, $6}') + awk '{printf "%d:%d", $5, $6}') echo $major_minor >/sys/power/resume fi fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend index 2e0b43f..0c88ccc 100755 --- a/scripts/local-premount/suspend +++ b/scripts/local-premount/suspend @@ -24,6 +24,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "0x%x:0x%x", $5, $6}') + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 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(-) 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 32b031319c9696f35246b482c23d8d060cb5c6c8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Nov 2005 09:50:58 +0100 Subject: whitespace cleanup --- debian/changelog | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 70ac2ae..05a67bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,7 +14,6 @@ initramfs-tools (0.38) unstable; urgency=low 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 -- 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(-) 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 57bc760c182d013bd656abe0b7cefda67e80986b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Nov 2005 20:30:47 +0100 Subject: fixes for newer udev. --- debian/changelog | 7 ++++++- debian/control | 2 +- mkinitramfs | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 637e896..0bc4e36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,12 @@ initramfs-tools (0.39) unstable; urgency=low hook-fuctions: Readds copy_exec. mkinitramfs, hooks/{evms,lvm,md}: Use copy_exec. - -- maximilian attems Thu, 17 Nov 2005 18:43:19 +0100 + * mkinitramfs: Newer udev no longer uses /sbin/udev - remove usage. + (Closes: #339568, #339365, #338814) + + * Pump udev dependency. + + -- maximilian attems Thu, 17 Nov 2005 19:59:47 +0100 initramfs-tools (0.38) unstable; urgency=low diff --git a/debian/control b/debian/control index de0181f..b959cfd 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) +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.072-2) 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/mkinitramfs b/mkinitramfs index d7bc38b..529defc 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -172,7 +172,6 @@ copy_exec "${CONFDIR}/initramfs.conf" /conf cp -a /etc/udev "${DESTDIR}/etc" # Hack until udev is built with klibc -copy_exec /sbin/udev /sbin copy_exec /sbin/udevd /sbin copy_exec /sbin/udevsynthesize /sbin -- cgit v1.2.3 From b69379d8aba5cb2cf30f1786c547385e1d401cd8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Nov 2005 20:45:34 +0100 Subject: use higher timeout, so that lesser people ends without devices. future udevd should have condition to test against so that this timeout is no longer needed. --- debian/changelog | 4 ++++ init | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0bc4e36..1cf51c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,10 @@ initramfs-tools (0.39) unstable; urgency=low * Pump udev dependency. + * init: Pump timeout as there is currently no way to check which udevd + processes are still running and why. Cures hopefully breakage of missing + devices. + -- maximilian attems Thu, 17 Nov 2005 19:59:47 +0100 initramfs-tools (0.38) unstable; urgency=low diff --git a/init b/init index 18d31ad..a1d6923 100755 --- a/init +++ b/init @@ -74,7 +74,8 @@ log_begin_msg "Initializing /dev" mkdir /dev/.udevdb UDEVD_EXPECTED_SEQNUM=$(($(cat /sys/kernel/hotplug_seqnum) + 1)) udevd --daemon udevsynthesize -sleep 2 +# FIXME: future udevd should have condition to test against +sleep 5 log_end_msg log_begin_msg "Loading modules" -- cgit v1.2.3 From 6c4e2850f0bc8c554a0faf9b9becc879a8dc53c5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Nov 2005 21:04:24 +0100 Subject: sync with latest ubuntu: * typo in mkinitramfs -d handling * only cp klibc-*.so file --- debian/changelog | 19 +++++++++++++++++-- mkinitramfs | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1cf51c0..398378d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,11 +10,26 @@ initramfs-tools (0.39) unstable; urgency=low * Pump udev dependency. * init: Pump timeout as there is currently no way to check which udevd - processes are still running and why. Cures hopefully breakage of missing - devices. + processes are still running and why. + Cures hopefully breakage of missing devices on boot. + + * Sync with latest Ubuntu. -- maximilian attems Thu, 17 Nov 2005 19:59:47 +0100 +initramfs-tools (0.36ubuntu3) dapper; urgency=low + + * mkinitramfs: only copy the klibc-*.so file, and not the development + pieces that happen to sit alongside it. + + -- Scott James Remnant Thu, 10 Nov 2005 16:44:08 -0500 + +initramfs-tools (0.36ubuntu2) dapper; urgency=low + + * Fix typos in the handling of the mkinitramfs -d option (thanks, Colin). + + -- Adam Conrad Thu, 10 Nov 2005 12:12:32 -0500 + initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] diff --git a/mkinitramfs b/mkinitramfs index 529defc..8e390cd 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -22,7 +22,7 @@ while true; do -d) CONFDIR="$2" shift 2 - if [ ! d "${CONFDIR}" ]; then + if [ ! -d "${CONFDIR}" ]; then echo "${0}: ${CONFDIR}: Not a directory" >&2 exit 1 fi @@ -159,7 +159,7 @@ fi # symlinks. ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +ln -s /usr/lib/klibc/lib/klibc-*.so ${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 && \ -- cgit v1.2.3 From b270bb806236c50163f5d4139d92ba36c1b20846 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 09:55:38 +0100 Subject: medium priority upload --- debian/changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 398378d..2742915 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,7 @@ -initramfs-tools (0.39) unstable; urgency=low +initramfs-tools (0.39) unstable; urgency=medium + + * Setting urgency to medium to get this into testing. This + will make life easier for d-i. * Revert the mklibs-small usage patch - reduces needed dependencies: hook-fuctions: Readds copy_exec. -- cgit v1.2.3 From 08319e643dc6743bc4f366942e15ea2cf4000c9e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 10:12:17 +0100 Subject: resynch with ubuntu: use $CONFDIR everywhere in mkinitramfs --- debian/changelog | 8 ++++++++ mkinitramfs | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2742915..79d36ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,14 @@ initramfs-tools (0.39) unstable; urgency=medium -- maximilian attems Thu, 17 Nov 2005 19:59:47 +0100 +initramfs-tools (0.36ubuntu4) dapper; urgency=low + + * Replace all occurances of /etc/mkinitramfs in mkinitramfs with $CONFDIR, + so -d can be used to point at a completely alternate tree (for example, + when installing into a chroot). + + -- Scott James Remnant Mon, 21 Nov 2005 08:34:03 +0000 + initramfs-tools (0.36ubuntu3) dapper; urgency=low * mkinitramfs: only copy the klibc-*.so file, and not the development diff --git a/mkinitramfs b/mkinitramfs index 8e390cd..612f2d7 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -162,11 +162,11 @@ ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /usr/lib/klibc/lib/klibc-*.so ${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 && \ +for f in $(cd ${CONFDIR}/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}")" +cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done copy_exec "${CONFDIR}/initramfs.conf" /conf cp -a /etc/udev "${DESTDIR}/etc" -- cgit v1.2.3 From 759dd419abdc2ee4408e4cc3e9daf2ac410c1178 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 10:31:48 +0100 Subject: fixes for latest udev 0.074-3 --- debian/changelog | 11 +++++++++++ debian/control | 2 +- mkinitramfs | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 79d36ea..eac527c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +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. + + * Pump udev dep on 0.074-3. + + -- maximilian attems Wed, 23 Nov 2005 10:12:40 +0100 + initramfs-tools (0.39) unstable; urgency=medium * Setting urgency to medium to get this into testing. This diff --git a/debian/control b/debian/control index b959cfd..70c2641 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.072-2) +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.074-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/mkinitramfs b/mkinitramfs index 612f2d7..505d480 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -173,7 +173,10 @@ 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 +cp /sbin/udevsynthesize "${DESTDIR}/sbin" +cp /lib/udev/udev_* "${DESTDIR}/lib/udev" # Busybox rm ${DESTDIR}/bin/sh -- 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(-) 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 07c254898028943d647a523c0cfa66df75eb8695 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 10:59:44 +0100 Subject: fix changelog, add bug nrs. --- debian/changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c92cc0..f8f3ba1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,13 +3,16 @@ 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. (Closes: #340257) * Pump udev dep on 0.074-3. * Fix evms hooks properly until they get merged into the evms itself. + (Closes: #337704) - -- maximilian attems Wed, 23 Nov 2005 10:31:57 +0100 + * Sync with Ubuntu (0.36ubuntu4). + + -- maximilian attems Wed, 23 Nov 2005 10:31:57 +0100 initramfs-tools (0.39) unstable; urgency=medium -- cgit v1.2.3 From 3ae0851026a65362aa40d568607c607f12a464a0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 11:00:41 +0100 Subject: better use copy_exec for the udev stuff --- mkinitramfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 505d480..c97b575 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -176,7 +176,8 @@ copy_exec /sbin/udevd /sbin mkdir "${DESTDIR}/lib/udev" copy_exec /lib/udev/udevsynthesize /lib/udev cp /sbin/udevsynthesize "${DESTDIR}/sbin" -cp /lib/udev/udev_* "${DESTDIR}/lib/udev" +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 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(-) 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 2ca278f1b3b60cad9170be85e5fa964f03107640 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Nov 2005 22:56:21 +0100 Subject: evms=${ROOT#/dev/evms/} expression already sets it to . So, the proper behavior is to exit if the volume name starts with a /, and continue if the volume name does not. --- scripts/local-top/evms | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/local-top/evms b/scripts/local-top/evms index 8a99549..46fca5d 100755 --- a/scripts/local-top/evms +++ b/scripts/local-top/evms @@ -18,13 +18,12 @@ esac evms=${ROOT#/dev/evms/} case ${evms} in - /dev/root) - unset evms - ;; /*) exit 0 ;; esac + +unset evms for module in dm-mod linear raid0 raid1 raid10 raid5 raid6; do modprobe -q $module -- 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(-) 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 5952a2fe8e6484b1813faaab93783764ff9026e8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 28 Nov 2005 17:47:23 +0100 Subject: fix for newest upstream udev: udev has no a queue, which we can test (loop) against. :) --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- init | 15 +++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index ee6a61f..099c3a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +initramfs-tools (0.41) unstable; urgency=low + + "Una mattina mi sono svegliato" + + * High urgency upload to cope with newer udev upstream - bonus: + condition to test against when udev is ready. (Closes: #341014) + + * Pump udev dep on 0.076-2. + + * Special thanks to Paul Traina for previous udev / emvs work. + + -- maximilian attems Mon, 28 Nov 2005 17:26:40 +0100 + initramfs-tools (0.40) unstable; urgency=high * High urgency upload as udev changed under our feet. Fix RC bugs. diff --git a/debian/control b/debian/control index 70c2641..2a90d0d 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.074-3) +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.076-2) 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/init b/init index a1d6923..8b00234 100755 --- a/init +++ b/init @@ -71,11 +71,18 @@ depmod -a # Populate /dev tree log_begin_msg "Initializing /dev" -mkdir /dev/.udevdb -UDEVD_EXPECTED_SEQNUM=$(($(cat /sys/kernel/hotplug_seqnum) + 1)) udevd --daemon +udevd_timeout=30 +echo > /proc/sys/kernel/hotplug +mkdir /dev/.udev /dev/.udev/db/ /dev/.udev/queue/ +udevd --daemon udevsynthesize -# FIXME: future udevd should have condition to test against -sleep 5 +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 log_begin_msg "Loading modules" -- cgit v1.2.3 From 57732aa03ef035c09cfcea98086fff11670e7470 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 28 Nov 2005 17:50:24 +0100 Subject: sync ubuntu: breaknow --- debian/changelog | 16 ++++++++++++++++ init | 3 +++ 2 files changed, 19 insertions(+) diff --git a/debian/changelog b/debian/changelog index 099c3a8..aa337a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ initramfs-tools (0.41) unstable; urgency=low * Special thanks to Paul Traina for previous udev / emvs work. + * Sync with Ubuntu (0.36ubuntu6). + -- maximilian attems Mon, 28 Nov 2005 17:26:40 +0100 initramfs-tools (0.40) unstable; urgency=high @@ -49,6 +51,20 @@ initramfs-tools (0.39) unstable; urgency=medium -- maximilian attems Thu, 17 Nov 2005 19:59:47 +0100 +initramfs-tools (0.36ubuntu6) dapper; urgency=low + + * Rename "panic" to "breaknow" + + -- Scott James Remnant Wed, 23 Nov 2005 10:23:54 +0000 + +initramfs-tools (0.36ubuntu5) dapper; urgency=low + + * Abort the boot sequence as early as possible if "panic" is placed on the + kernel command-line, allowing debugging of scripts in init-top. + + -- 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, diff --git a/init b/init index 8b00234..2d9683e 100755 --- a/init +++ b/init @@ -59,6 +59,9 @@ for x in $(cat /proc/cmdline); do break) break=yes ;; + breaknow) + panic "Spawning shell within the initramfs" + ;; esac done -- cgit v1.2.3 From 31cb69967fcd2cb034b0ef68e648e9a43fdd32a3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 28 Nov 2005 17:54:12 +0100 Subject: kill udev as late as possible. --- debian/changelog | 7 +++++-- init | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index aa337a8..323affc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ initramfs-tools (0.41) unstable; urgency=low - "Una mattina mi sono svegliato" + "Una mattina mi sono svegliato" * High urgency upload to cope with newer udev upstream - bonus: condition to test against when udev is ready. (Closes: #341014) @@ -11,7 +11,10 @@ initramfs-tools (0.41) unstable; urgency=low * Sync with Ubuntu (0.36ubuntu6). - -- maximilian attems Mon, 28 Nov 2005 17:26:40 +0100 + * Kill udevd as late as possible. Thanks David Härdeman + for the patch. (Closes: #339093) + + -- maximilian attems Mon, 28 Nov 2005 17:53:24 +0100 initramfs-tools (0.40) unstable; urgency=high diff --git a/init b/init index 2d9683e..f8853b1 100755 --- a/init +++ b/init @@ -102,8 +102,6 @@ log_begin_msg "Running /scripts/init-premount" run_scripts /scripts/init-premount log_end_msg -killall udevd - log_begin_msg "Mounting root file system" mountroot log_end_msg @@ -114,6 +112,7 @@ run_scripts /scripts/init-bottom # 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 -- cgit v1.2.3 From 3bfff7852627e577d0a5efe97b842934044873ef Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 28 Nov 2005 18:57:22 +0100 Subject: 0.076-3 has all the fixes we want!! with 0.076-2 we have missing mousedev stories resulting in missing /dev/input dir -> no xorg.. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 2a90d0d..132693a 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.076-2) +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.076-3) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged -- cgit v1.2.3 From 928f3367583b19162a58e837906b64e0adab95ef Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 28 Nov 2005 19:01:19 +0100 Subject: fix changelog mention, add credits --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 323affc..4becc2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,13 @@ -initramfs-tools (0.41) unstable; urgency=low +initramfs-tools (0.41) unstable; urgency=high "Una mattina mi sono svegliato" * 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 + Heikki Henriksen for double check. - * Pump udev dep on 0.076-2. + * Pump udev dep on 0.076-3. * Special thanks to Paul Traina for previous udev / emvs work. -- cgit v1.2.3 From bfd7efb29d7e706d6378ad2b91d2be9d21f8b8ee Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 1 Dec 2005 16:54:49 +0100 Subject: add mptspi to the scsi modules list --- debian/changelog | 8 ++++++++ hook-functions | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4becc2e..a76d5bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.42) unstable; urgency=low + + * hook-functions: The mptspi module is required for at least some machines + that use the mptscsih. Thanks dann frazier for the patch. + (Closes: #341162) + + -- maximilian attems Thu, 1 Dec 2005 16:42:12 +0100 + initramfs-tools (0.41) unstable; urgency=high "Una mattina mi sono svegliato" diff --git a/hook-functions b/hook-functions index c715df5..9d0bc29 100644 --- a/hook-functions +++ b/hook-functions @@ -144,7 +144,7 @@ auto_add_modules() done # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules "${x}" done -- cgit v1.2.3 From 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 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 3b5cba6582b27a688d11ea5bc961470869bb6061 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Dec 2005 17:26:23 +0100 Subject: missed the newer udev depend on previous change. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 132693a..ee26d30 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.076-3) +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), 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 -- cgit v1.2.3 From c4163d08f4517cf0aebee2350b5e1b2c23bd7c37 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Dec 2005 17:43:22 +0100 Subject: fix wording in initramfs.conf regarding resume option. --- conf/initramfs.conf | 6 +++--- debian/changelog | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 93554c1..079fe47 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -18,9 +18,9 @@ MODULES=most # # RESUME: [ /dev/hda2 | /dev/sdb2 ] # -# Optionaly set the swap partition to resume from. -# Above are only possible example please costumize. -# The command line of your boot loader will override this setting. +# 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. #RESUME= diff --git a/debian/changelog b/debian/changelog index 6a95f20..52ac5da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.43) unstable; urgency=low + + * initramfs.conf: Fix wording choice for resume option. (Closes: #337575) + + -- maximilian attems Mon, 5 Dec 2005 17:38:50 +0100 + initramfs-tools (0.42) unstable; urgency=low * hook-functions: The mptspi module is required for at least some machines -- cgit v1.2.3 From 94cdc6efb0303ed4d3db0c7ebd15d08dd935957c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Dec 2005 17:56:44 +0100 Subject: activate all lvm volumes --- debian/changelog | 5 ++++- scripts/local-top/lvm | 7 +------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52ac5da..48fd54b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,10 @@ initramfs-tools (0.43) unstable; urgency=low * initramfs.conf: Fix wording choice for resume option. (Closes: #337575) - -- maximilian attems Mon, 5 Dec 2005 17:38:50 +0100 + * 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 initramfs-tools (0.42) unstable; urgency=low diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 7ac81e6..9f608af 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -28,10 +28,5 @@ esac modprobe -q dm-mod -# 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 -- 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(-) 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 6ee91456c25623ea694b8aab41dc5ca2fe2f1c91 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Dec 2005 10:34:22 +0100 Subject: add initramfs-tools.8 update manpage crossreferences --- debian/changelog | 9 +- debian/initramfs-tools.manpages | 1 + initramfs-tools.8 | 397 ++++++++++++++++++++++++++++++++++++++++ initramfs.conf.5 | 4 +- mkinitramfs.8 | 4 +- update-initramfs.8 | 4 +- 6 files changed, 412 insertions(+), 7 deletions(-) create mode 100644 initramfs-tools.8 diff --git a/debian/changelog b/debian/changelog index 6a87941..3aa7509 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,14 @@ initramfs-tools (0.43) unstable; urgency=low * hooks/kernelextras: Really fix #335505. Don't expand wildcase to current dir. (Closes: #342153) - -- maximilian attems Tue, 6 Dec 2005 01:16:41 +0100 + * Add initramfs-tools.8 describing how the hooks of initramfs-tools work + and how to use them. Thanks David Härdeman for the patch. + (Closes: #339091) + + * initramfs.conf.5, mkinitramfs.8, update-initramfs.8: Update + cross-references of the different manpages. + + -- maximilian attems Tue, 6 Dec 2005 10:25:28 +0100 initramfs-tools (0.42) unstable; urgency=low diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 0f42d94..8a27566 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,3 +1,4 @@ mkinitramfs.8 initramfs.conf.5 +initramfs-tools.8 update-initramfs.8 diff --git a/initramfs-tools.8 b/initramfs-tools.8 new file mode 100644 index 0000000..1df7c62 --- /dev/null +++ b/initramfs-tools.8 @@ -0,0 +1,397 @@ +.TH INITRAMFS-TOOLS 8 "Date: 2005/12/06" "" "mkinitramfs script overview" + +.SH NAME +initramfs-tools \- an introduction to writing scripts for mkinitramfs + +.SH DESCRIPTION +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 +image itself. They can however cause files to be included in the image. + +.SS Boot scripts +These are included in the initramfs image and normally executed during +kernel boot in the early user-space before the root partition has been +mounted. + +.SH INIT SCRIPT +The script which is executed first and is in charge of running all other +scripts can be found in /usr/share/initramfs-tools/init. It takes a number of +arguments which influence the boot procedure: + +.SS Boot options + +.TP +\fB \fI init +the binary to hand over execution to on the root fs after the initramfs scripts are done. + +.TP +\fB \fI root +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 + +.TP +\fB \fI boot +either local or nfs (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). + +.TP +\fB \fI resume +device node which holds the result of a previous suspension using swsusp +(usually the swap partition). + +.TP +\fB \fI quiet +reduces the amount of text output to the console during boot + +.TP +\fB \fI ro +mounts the rootfs read-only + +.TP +\fB \fI rw +mounts the rootfs read-write + +.TP +\fB \fI debug +generates lots of output to /tmp/initramfs.debug + +.TP +\fB \fI break +spawns a shell in the initramfs image at chosen run-time + + +.SH HOOK SCRIPTS + +Hooks can be found in two places: /usr/share/initramfs-tools/hooks and +/etc/mkinitramfs/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. + +.SS Header +In order to support prereqs, each script should begin with the following lines: + +.RS +.nf +#!/bin/sh +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions +# Begin real processing below this line +.fi +.RE + +For example, if you are writing a new hook script which relies on lvm, the line +starting with PREREQ should be changed to PREREQ="lvm" which will ensure that +the lvm hook script is run before your custom script. + +.SS Help functions +/usr/share/initramfs-tools/hook-functions contains a number of functions which +deal with some common tasks in a hook script: +.TP +\fB \fI +manual_add_modules +adds a module (and any modules which it depends on) to the initramfs image. +.RS +.PP +.B Example: +manual_add_modules reiserfs +.RE + +.TP +\fB \fI +add_modules_from_file +reads a file containing a list of modules (one per line) to be added to the +initramfs image. The file can contain comments (lines starting with #) and +arguments to the modules by writing the arguments on the same line as the name +of the module. +.RS +.PP +.B Example: +add_modules_from_file /tmp/modlist +.RE + +.TP +\fB \fI +force_load +adds a module (and its dependencies) to the initramfs image and also +unconditionally loads the module during boot. Also supports passing arguments +to the module by listing them after the module name. +.RS +.PP +.B Example: +force_load cdrom debug=1 +.RE + +.TP +\fB \fI +copy_modules_dir +copies an entire module directory from /lib/modules/KERNELVERSION/ into the +initramfs image. +.RS +.PP +.B Example: +copy_modules_dir kernel/drivers/pci/foobar +.RE + +.SS Including binaries +If you need to copy binaries to the initramfs module, a command like this +should be used: +.PP +.RS +copy_exec /sbin/mdadm "${DESTDIR}/sbin" +.RE + +mkinitramfs will automatically detect which libraries the executable depends on +and copy them to the initramfs. This means that most executables, unless +compiled with klibc, will automatically include glibc in the image which will +increase its size by several hundred kilobytes. + + +.SH BOOT SCRIPTS + +Similarly to hook scripts, boot scripts can be found in two places +/usr/share/initramfs-tools/scripts/ and /etc/mkinitramfs/scripts/. There are a +number of subdirectories to these two directories which control the boot stage +at which the scripts are executed. + +.SS Header +Like for hook scripts, there are no guarantees as to the order in which the +different scripts in one subdirectory (see "Subdirectories" below) are +executed. In order to define a certain order, a similar header as for hook +scripts should be used: + +.RS +.nf +#!/bin/sh +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac +.fi +.RE + +Where PREREQ is modified to list other scripts in the same subdirectory if necessary. + +.SS Help functions +A number of functions (mostly dealing with output) are provided to boot scripts: + +.TP +\fB \fI +log_success_msg +Logs a success message +.RS +.PP +.B Example: +log_success_msg "Frobnication successful" +.RE + +.TP +\fB \fI +log_failure_msg +Logs a failure message +.RS +.PP +.B Example: +log_failure_msg "Frobnication component froobz missing" +.RE + +.TP +\fB \fI +log_warning_msg +Logs a warning message +.RS +.PP +.B Example: +log_warning_msg "Only partial frobnication possible" +.RE + +.TP +\fB \fI +log_begin_msg +Logs a message that some processing step has begun + +.TP +\fB \fI +log_end_msg +Logs a message that some processing step is finished +.RS +.PP +.B Example: +.PP +.RS +.nf +log_begin_msg "Frobnication begun" +# Do something +log_end_msg +.fi +.RE +.RE + +.TP +\fB \fI +panic +Logs an error message and executes a shell in the initramfs image to allow the +user to investigate the situation. +.RS +.PP +.B Example: +panic "Frobnication failed" +.RE + +.SS Subdirectories +Both /usr/share/initramfs-tools/scripts and /etc/mkinitramfs/scripts contains +the following subdirectories. + +.TP +\fB \fI +init-top +the scripts in this directory are the first scripts to be executed after sysfs +and procfs have been mounted and /dev/console and /dev/null have been created. +No other device files are present yet. + +.TP +\fB \fI +init-premount +runs the udev hooks for populating the /dev tree (udev will keep running until +init-bottom) after modules specified by hooks and /etc/mkinitramfs/modules have +been loaded. + +.TP +\fB \fI +local-top OR nfs-top +After these scripts have been executed, the root device node is expected to be +present (local) or the network interface is expected to be usable (nfs). + +.TP +\fB \fI +local-premount OR nfs-premount +are run after the sanity of the root device has been verified (local) or the +network interface has been brought up (nfs), but before the actual root fs has +been mounted. + +.TP +\fB \fI +local-bottom OR nfs-bottom +are run after the rootfs has been mounted (local) or the nfs root share has +been mounted. udev is stopped. + +.TP +\fB \fI +init-bottom +are the last scripts to be executed before procfs and sysfs are moved to the +real rootfs and execution is turned over to the init binary which should now be +found in the mounted rootfs. + +.SH EXAMPLES + +.SS Hook script +An example hook script would look something like this (and would usually be +placed in /etc/mkinitramfs/hooks/frobnicate): + +.RS +.nf +#!/bin/sh +# Example frobnication hook script + +PREREQ="lvm" +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions +# Begin real processing below this line + +if [ ! -x "/sbin/frobnicate" ]; then + exit 0 +fi + +force_load frobnicator interval=10 +cp /sbin/frobnicate "${DESTDIR}/sbin" +exit 0 +.fi +.RE + +.SS Boot script +An example boot script would look something like this (and would usually be placed in /etc/mkinitramfs/scripts/local-top/frobnicate): + +.RS +.nf +#!/bin/sh +# Example frobnication boot script + +PREREQ="lvm" +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +# Begin real processing below this line +if [ ! -x "/sbin/frobnicate" ]; then + panic "Frobnication executable not found" +fi + +if [ ! -e "/dev/mapper/frobb" ]; then + panic "Frobnication device not found" +fi + +log_begin_msg "Starting frobnication" +/sbin/frobnicate "/dev/mapper/frobb" || panic "Frobnication failed" +log_end_msg + +exit 0 +.fi +.RE + +.SH AUTHOR +The initramfs-tools are written by Jeff Bailey . +.PP +This manual was written by David Hrdeman , +updated by Maximilian Attems . + +.SH SEE ALSO +.BR +initramfs.conf (5), mkinitramfs (8), update-initramfs(8) + diff --git a/initramfs.conf.5 b/initramfs.conf.5 index c1ee3e7..a1cb341 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2005/09/13 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2005/12/06 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -48,7 +48,7 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH SEE ALSO -.BR mkinitramfs (8) +.BR initramfs-tools (8), mkinitramfs (8), update-initramfs (8) .SH AUTHOR The initramfs-tools are written by Jeff Bailey . diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 0918767..64f8786 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2005/07/15 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2005/12/06 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -84,4 +84,4 @@ This manual is maintained by Maximilian Attems . .SH SEE ALSO -.BR initramfs.conf (5) +.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) diff --git a/update-initramfs.8 b/update-initramfs.8 index 90b7bd9..35f1572 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2005/09/20" $" "" "update-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2005/12/06" $" "" "update-initramfs manual" .SH NAME update-initramfs \- generate an initramfs image @@ -57,4 +57,4 @@ This manual is maintained by Maximilian Attems . .SH SEE ALSO -.BR initramfs.conf (5) +.BR initramfs.conf (5), initramfs-tools (8), mkinitramfs (8) -- cgit v1.2.3 From 7131aa52d493fb25413b092d1e0a9f1625c0a8cd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Dec 2005 12:27:21 +0100 Subject: update TODO to current state. --- debian/TODO | 12 +++--------- debian/changelog | 6 ++++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/debian/TODO b/debian/TODO index 58f35fd..1f187ae 100644 --- a/debian/TODO +++ b/debian/TODO @@ -3,18 +3,12 @@ TODO o Grep for TODO and FIXME and do those. =) - o Eliminate udev. + o Eliminate ?udev?, klibc. o Support list and dep options o Default to dep for PPC - Possibly to detect newworld? - o Support evms + o External hooks support for evms - o Support cryptroot - - o Trace lilo bug - - o Capture udev events and pass them to udevsend - - o Detect RESUME partition + o Support cryptoroot diff --git a/debian/changelog b/debian/changelog index 3aa7509..07c6537 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,10 +12,12 @@ initramfs-tools (0.43) unstable; urgency=low and how to use them. Thanks David Härdeman for the patch. (Closes: #339091) - * initramfs.conf.5, mkinitramfs.8, update-initramfs.8: Update + * initramfs.conf.5, mkinitramfs.8, update-initramfs.8: Update cross-references of the different manpages. - -- maximilian attems Tue, 6 Dec 2005 10:25:28 +0100 + * TODO: update to current state. + + -- maximilian attems Tue, 6 Dec 2005 12:25:48 +0100 initramfs-tools (0.42) unstable; urgency=low -- cgit v1.2.3 From edfcf7ea648bc07435064df4d8c603db7d26aa56 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Dec 2005 13:27:57 +0100 Subject: remove dup suspend code --- debian/changelog | 4 +++- scripts/functions | 9 --------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 07c6537..6080b93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,7 +17,9 @@ initramfs-tools (0.43) unstable; urgency=low * TODO: update to current state. - -- maximilian attems Tue, 6 Dec 2005 12:25:48 +0100 + * scripts/functions: remove old duplicate suspend support. + + -- maximilian attems Wed, 7 Dec 2005 13:26:33 +0100 initramfs-tools (0.42) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index 8a49c8e..cde870d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -174,15 +174,6 @@ load_modules() fi done fi - - # FIXME: wrong place, but it gets done ;) - 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 } parse_numeric() { -- cgit v1.2.3 From 7c5923bbc4ec57eb144b773c0abc8711ffda292a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 11:21:27 +0100 Subject: merge ubuntu modprobe silence stuff and cp all /etc/modprobe.d :) --- debian/changelog | 14 ++++++++++++++ mkinitramfs | 3 +-- scripts/functions | 2 +- scripts/init-premount/thermal | 6 +++--- scripts/local | 9 +-------- scripts/local-top/evms | 2 +- scripts/local-top/lvm | 2 +- scripts/local-top/md | 2 +- scripts/nfs | 4 ++-- 9 files changed, 25 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6080b93..8683c70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ initramfs-tools (0.43) unstable; urgency=low * scripts/functions: remove old duplicate suspend support. + * Sync with 0.40ubuntu8. (Closes: #337318) + -- maximilian attems Wed, 7 Dec 2005 13:26:33 +0100 initramfs-tools (0.42) unstable; urgency=low @@ -38,6 +40,18 @@ initramfs-tools (0.42) unstable; urgency=low -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu8) dapper; urgency=low + + * Call modprobe everywhere with "-Qb" to silence messages and allow user + blacklisting. + * Copy the entire /etc/modprobe.d directory to the initramfs, so we can + pick up all user blacklists and options. + * Remove the slumber for SCSI/USB devices from the local filesystem mount + script, udev's init-premount script will take care of this when + necessary. + + -- Scott James Remnant Wed, 7 Dec 2005 16:18:12 +0000 + initramfs-tools (0.40ubuntu7) dapper; urgency=low * remove "sleep 3" from the nfs script before the nfsmount command, diff --git a/mkinitramfs b/mkinitramfs index 9892a36..6855ff3 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -180,8 +180,7 @@ copy_exec /sbin/modprobe /sbin 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 +cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks diff --git a/scripts/functions b/scripts/functions index cde870d..da77542 100644 --- a/scripts/functions +++ b/scripts/functions @@ -170,7 +170,7 @@ load_modules() then continue; else - modprobe -q $m + modprobe -Qb $m fi done fi diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index e0d79c3..64858af 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -16,8 +16,8 @@ prereqs) esac # For ACPI systems -modprobe -q fan -modprobe -q thermal +modprobe -Qb fan +modprobe -Qb thermal # For ppc64 systems -modprobe -q therm_pm72 +modprobe -Qb therm_pm72 diff --git a/scripts/local b/scripts/local index df09298..6c08f39 100644 --- a/scripts/local +++ b/scripts/local @@ -7,13 +7,6 @@ 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 while [ ! -e "${ROOT}" ]; do panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" @@ -32,7 +25,7 @@ mountroot () fi # FIXME This has no error checking - modprobe ${FSTYPE} + modprobe -Qb ${FSTYPE} # FIXME This has no error checking # Mount root diff --git a/scripts/local-top/evms b/scripts/local-top/evms index 46fca5d..563a9ae 100755 --- a/scripts/local-top/evms +++ b/scripts/local-top/evms @@ -26,7 +26,7 @@ esac unset evms for module in dm-mod linear raid0 raid1 raid10 raid5 raid6; do - modprobe -q $module + modprobe -Qb $module done /sbin/evms_activate diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 9f608af..40c4e9b 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -26,7 +26,7 @@ case ${vg} in ;; esac -modprobe -q dm-mod +modprobe -Qb dm-mod vgchange -ay diff --git a/scripts/local-top/md b/scripts/local-top/md index c7515fe..4132159 100755 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -25,7 +25,7 @@ for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do 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 + modprobe -Qb ${raidlvl} 2>/dev/null gotraid=y fi done diff --git a/scripts/nfs b/scripts/nfs index a2f6c3e..0205047 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -9,9 +9,9 @@ mountroot () run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe nfs + modprobe -Qb nfs # For DHCP - modprobe af_packet + modprobe -Qb af_packet ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf -- cgit v1.2.3 From 98bc2119723c77cdcdd5c0a4bfa4e823c334c146 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 11:26:09 +0100 Subject: set urgency=high --- debian/changelog | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8683c70..b04358b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,8 @@ -initramfs-tools (0.43) unstable; urgency=low +initramfs-tools (0.43) unstable; urgency=high + + "O partigiano portami via" + + * Urgency high upload to stay in sync with udev for testing. * initramfs.conf: Fix wording choice for resume option. (Closes: #337575) @@ -21,7 +25,7 @@ initramfs-tools (0.43) unstable; urgency=low * Sync with 0.40ubuntu8. (Closes: #337318) - -- maximilian attems Wed, 7 Dec 2005 13:26:33 +0100 + -- maximilian attems Mon, 12 Dec 2005 11:22:15 +0100 initramfs-tools (0.42) unstable; urgency=low -- cgit v1.2.3 From e548ec35a740acc4d5359bfb42e962c5b2c24ba5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 11:35:01 +0100 Subject: fix lintian warning due to non latin char in manpage. --- initramfs-tools.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 1df7c62..a23372e 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -388,7 +388,7 @@ exit 0 .SH AUTHOR The initramfs-tools are written by Jeff Bailey . .PP -This manual was written by David Hrdeman , +This manual was written by David H\[:a]rdeman , updated by Maximilian Attems . .SH SEE ALSO -- 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(-) 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 1c8330542d7a5d35c10e02db4e210352517176b3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 11:52:57 +0100 Subject: debian's module-init-tools of testing doesn't have yet the modprobe -Qb interface, keep the change for next time. :( --- debian/changelog | 2 ++ scripts/functions | 2 +- scripts/init-premount/thermal | 6 +++--- scripts/local | 2 +- scripts/local-top/evms | 2 +- scripts/local-top/lvm | 2 +- scripts/local-top/md | 2 +- scripts/nfs | 4 ++-- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index b04358b..1a61807 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ initramfs-tools (0.43) unstable; urgency=high * scripts/functions: remove old duplicate suspend support. * Sync with 0.40ubuntu8. (Closes: #337318) + - Revert the modprobe changes for now as modules-init-tools of + testing doesn't have yet the wanted interface. -- maximilian attems Mon, 12 Dec 2005 11:22:15 +0100 diff --git a/scripts/functions b/scripts/functions index da77542..cde870d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -170,7 +170,7 @@ load_modules() then continue; else - modprobe -Qb $m + modprobe -q $m fi done fi diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index 64858af..e0d79c3 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -16,8 +16,8 @@ prereqs) esac # For ACPI systems -modprobe -Qb fan -modprobe -Qb thermal +modprobe -q fan +modprobe -q thermal # For ppc64 systems -modprobe -Qb therm_pm72 +modprobe -q therm_pm72 diff --git a/scripts/local b/scripts/local index 6c08f39..979f07d 100644 --- a/scripts/local +++ b/scripts/local @@ -25,7 +25,7 @@ mountroot () fi # FIXME This has no error checking - modprobe -Qb ${FSTYPE} + modprobe ${FSTYPE} # FIXME This has no error checking # Mount root diff --git a/scripts/local-top/evms b/scripts/local-top/evms index 563a9ae..46fca5d 100755 --- a/scripts/local-top/evms +++ b/scripts/local-top/evms @@ -26,7 +26,7 @@ esac unset evms for module in dm-mod linear raid0 raid1 raid10 raid5 raid6; do - modprobe -Qb $module + modprobe -q $module done /sbin/evms_activate diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 40c4e9b..9f608af 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -26,7 +26,7 @@ case ${vg} in ;; esac -modprobe -Qb dm-mod +modprobe -q dm-mod vgchange -ay diff --git a/scripts/local-top/md b/scripts/local-top/md index 4132159..c7515fe 100755 --- a/scripts/local-top/md +++ b/scripts/local-top/md @@ -25,7 +25,7 @@ for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do fi raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') if [ "$raidlvl" ]; then - modprobe -Qb ${raidlvl} 2>/dev/null + modprobe -q ${raidlvl} 2>/dev/null gotraid=y fi done diff --git a/scripts/nfs b/scripts/nfs index 0205047..a2f6c3e 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -9,9 +9,9 @@ mountroot () run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe -Qb nfs + modprobe nfs # For DHCP - modprobe -Qb af_packet + modprobe af_packet ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf -- cgit v1.2.3 From 05982a63b2425a309325ba7a945a4bb11fd6146d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 12 Dec 2005 16:03:17 +0100 Subject: revert activate all vg, may leed to data loss. --- debian/changelog | 5 +---- scripts/local-top/lvm | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a61807..8b14a93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.43) unstable; urgency=high +initramfs-tools (0.44) unstable; urgency=high "O partigiano portami via" @@ -6,9 +6,6 @@ initramfs-tools (0.43) unstable; urgency=high * initramfs.conf: Fix wording choice for resume option. (Closes: #337575) - * local-top/lvm: Activate all lvm groups for future support of - lvm-crypt roots. (Closes: #339087) - * hooks/kernelextras: Really fix #335505. Don't expand wildcase to current dir. (Closes: #342153) diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 9f608af..7ac81e6 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -28,5 +28,10 @@ esac modprobe -q dm-mod -vgchange -ay +# 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} -- cgit v1.2.3 From e0de055ba1a1c32acb70f92ec65bf23139b73b8f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Dec 2005 01:28:31 +0100 Subject: fix passing of the debug param to init. --- debian/changelog | 6 ++++++ init | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8b14a93..b53ff18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.45) unstable; urgency=low + + * Unset debug before calling init, confuses /etc/init.d/rc. + + -- maximilian attems Tue, 27 Dec 2005 19:12:31 +0100 + initramfs-tools (0.44) unstable; urgency=high "O partigiano portami via" diff --git a/init b/init index 1f6c732..db18f15 100755 --- a/init +++ b/init @@ -105,6 +105,11 @@ while [ ! -x ${rootmnt}${init} ]; do panic "Target filesystem doesn't have ${init}" done +# Confuses /etc/init.d/rc +if [ -n ${debug} ]; then + unset debug +fi + # Chain to real filesystem maybe_break init exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console -- cgit v1.2.3 From 0f9b079738bd9e63896735b80d1768e34fc0b8ea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 29 Dec 2005 10:30:39 +0100 Subject: add hook ide depending on udev loads ide-disk and ide-generic on all needed ide cases. --- debian/changelog | 10 ++++++++-- scripts/init-premount/ide | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 scripts/init-premount/ide diff --git a/debian/changelog b/debian/changelog index b53ff18..e054662 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ -initramfs-tools (0.45) unstable; urgency=low +initramfs-tools (0.45) unstable; urgency=high + + "Che mi sento di morir." * Unset debug before calling init, confuses /etc/init.d/rc. - -- maximilian attems Tue, 27 Dec 2005 19:12:31 +0100 + * scripts/init-premount/ide: Load uncondionally for ide boots ide-generic + and also ide-disk, as udev ignores them. High urgency upload for rc bugs. + (Closes: #332824, #342925, #344754, #337045, #338406) + + -- maximilian attems Thu, 29 Dec 2005 10:28:11 +0100 initramfs-tools (0.44) unstable; urgency=high diff --git a/scripts/init-premount/ide b/scripts/init-premount/ide new file mode 100644 index 0000000..03a3fdf --- /dev/null +++ b/scripts/init-premount/ide @@ -0,0 +1,38 @@ +#!/bin/sh + +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +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 -- cgit v1.2.3 From 8c914c8ced50b1eb8c62353bb73101347212a862 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 29 Dec 2005 14:12:28 +0100 Subject: upps had included the .bzr files due to newer dev machine. --- debian/changelog | 12 ++++++++++-- scripts/init-premount/ide | 0 2 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/init-premount/ide diff --git a/debian/changelog b/debian/changelog index e054662..cef2ae6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.46) unstable; urgency=low + + * Don't include .bzr dirs in source upload. + Thanks Frederik Schler + + -- maximilian attems Thu, 29 Dec 2005 14:07:07 +0100 + initramfs-tools (0.45) unstable; urgency=high "Che mi sento di morir." @@ -6,9 +13,10 @@ initramfs-tools (0.45) unstable; urgency=high * scripts/init-premount/ide: Load uncondionally for ide boots ide-generic and also ide-disk, as udev ignores them. High urgency upload for rc bugs. - (Closes: #332824, #342925, #344754, #337045, #338406) + Thanks Frans Pop and Joey Hess for + testing! (Closes: #332824, #342925, #344754, #337045, #338406) - -- maximilian attems Thu, 29 Dec 2005 10:28:11 +0100 + -- maximilian attems Thu, 29 Dec 2005 10:34:32 +0100 initramfs-tools (0.44) unstable; urgency=high diff --git a/scripts/init-premount/ide b/scripts/init-premount/ide old mode 100644 new mode 100755 -- cgit v1.2.3 From bc24e84988f7cf998091d3e2602b34523068ce81 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 29 Dec 2005 15:14:36 +0100 Subject: dch char changes + fs email --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cef2ae6..2d3ae93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ initramfs-tools (0.46) unstable; urgency=low * Don't include .bzr dirs in source upload. - Thanks Frederik Schler + Thanks Frederik Schüler - -- maximilian attems Thu, 29 Dec 2005 14:07:07 +0100 + -- maximilian attems Thu, 29 Dec 2005 14:23:46 +0100 initramfs-tools (0.45) unstable; urgency=high -- cgit v1.2.3 From 3632a55d4a4ebc581a557600dc6e3dfad6ad5269 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jan 2006 12:02:15 +0100 Subject: small quick fix for klibc 1.1.14 /bin/sh no longer build don't complain about missing it. --- debian/changelog | 7 +++++++ mkinitramfs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2d3ae93..67d3b59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.47) unstable; urgency=low + + * mkinitramfs: Don't complain about missing /bin/sh - use rm -f. + Minor cleanup for the newer packaging of klibc 1.1.14. + + -- maximilian attems Sat, 31 Dec 2005 14:17:31 +0100 + initramfs-tools (0.46) unstable; urgency=low * Don't include .bzr dirs in source upload. diff --git a/mkinitramfs b/mkinitramfs index 6855ff3..0004dbc 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -171,7 +171,7 @@ done copy_exec "${CONFDIR}/initramfs.conf" /conf # Busybox -rm ${DESTDIR}/bin/sh +rm -f ${DESTDIR}/bin/sh copy_exec ${BUSYBOXDIR}/busybox /bin/busybox ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh -- cgit v1.2.3 From 795eab98a8e317ba9a1252c8389517a216f830b7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jan 2006 16:12:21 +0100 Subject: /lib/klibc-*.so moved from /usr/lib/klibc/lib/klibc-*.so --- debian/changelog | 8 ++++++++ debian/control | 2 +- mkinitramfs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 67d3b59..d201cff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.48) unstable; urgency=low + + * mkinitramfs: klibc 1.1.14 moved from /usr/lib/klibc/lib to /lib + Bonus: You can now execute any klibc bin directly. + Cope with the move and pump dep. (Closes: 345949) + + -- maximilian attems Wed, 4 Jan 2006 16:11:25 +0100 + initramfs-tools (0.47) unstable; urgency=low * mkinitramfs: Don't complain about missing /bin/sh - use rm -f. diff --git a/debian/control b/debian/control index ee26d30..463307a 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.076-5) +Depends: klibc-utils (>= 1.1.14-2), busybox (>= 1:1.01-3), 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/mkinitramfs b/mkinitramfs index 0004dbc..5a89213 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -159,7 +159,7 @@ fi # symlinks. ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin -ln -s /usr/lib/klibc/lib/klibc-*.so ${DESTDIR}/lib +ln -s /lib/klibc-*.so ${DESTDIR}/lib copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd ${CONFDIR}/scripts && \ -- cgit v1.2.3 From 11a02f5b0266ef6e4816e92561dbb5ca0f3579dc Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jan 2006 16:40:22 +0100 Subject: pump debhelper dep as pointed out by linda --- debian/changelog | 6 ++++++ debian/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d201cff..4f6cca9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.49) unstable; urgency=low + + * Pump dephelper to 4.1.0 dependency as pointed out by linda. + + -- maximilian attems Wed, 4 Jan 2006 16:39:00 +0100 + initramfs-tools (0.48) unstable; urgency=low * mkinitramfs: klibc 1.1.14 moved from /usr/lib/klibc/lib to /lib diff --git a/debian/control b/debian/control index 463307a..bf50d66 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: utils Priority: optional Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team -Build-Depends-Indep: debhelper (>= 4.0.0), cdbs +Build-Depends-Indep: debhelper (>= 4.1.0), cdbs Standards-Version: 3.6.2.0 Package: initramfs-tools -- cgit v1.2.3 From b8a9c0fbd0830aa536882d2047c7df0472a9faf5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 11 Jan 2006 03:37:57 +0100 Subject: add first DEBUG section to initramfs-tools.8 --- debian/changelog | 4 +++- initramfs-tools.8 | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4f6cca9..aee598d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,9 @@ initramfs-tools (0.49) unstable; urgency=low * Pump dephelper to 4.1.0 dependency as pointed out by linda. - -- maximilian attems Wed, 4 Jan 2006 16:39:00 +0100 + * initramfs-tools.8: Add DEBUG section, cheat how to check the initramfs. + + -- maximilian attems Wed, 11 Jan 2006 03:33:24 +0100 initramfs-tools (0.48) unstable; urgency=low diff --git a/initramfs-tools.8 b/initramfs-tools.8 index a23372e..a08ef1b 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -385,6 +385,19 @@ exit 0 .fi .RE +.SH DEBUG +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 +mkdir tmp/initramfs +cd tmp/initramfs +gunzip -c -9 /boot/initrd.img-2.6.15-1-686 | \\ +cpio -i -d -H newc --no-absolute-filenames +.fi +.RE + + .SH AUTHOR The initramfs-tools are written by Jeff Bailey . .PP -- 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 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 51aeb44deb330033ad26ffcb1494136a4d0fd159 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 14 Jan 2006 17:40:23 +0100 Subject: fix MODULES=dep due to modprobe --show-depends printing not only insmod commands but also the install ones. --- debian/changelog | 8 ++++++-- hook-functions | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 79b7c9e..6b63420 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,13 @@ initramfs-tools (0.50) unstable; urgency=low - * EVMS takes care of it's own hooks, rm: hooks/evms, scripts/local-top/evms. + * hook-functions: Fix MODULES=dep as `modprobe --show-depends' prints not + only the insmod commands, but also the install ones. Thanks for the patch + to Jean Charles Delepine . (Closes: #342616) + + * hooks/evms, scripts/local-top/evms: EVMS takes care of it's own hooks, rm. Thanks Steinar H. Gunderson . (Closes: 340258) - -- maximilian attems Sat, 14 Jan 2006 17:26:24 +0100 + -- maximilian attems Sat, 14 Jan 2006 17:38:08 +0100 initramfs-tools (0.49) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 9d0bc29..d3fe0a3 100644 --- a/hook-functions +++ b/hook-functions @@ -40,7 +40,7 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '{ print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue -- cgit v1.2.3 From 389869941448db6563146be8e7eb3fe20612a6f7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 14 Jan 2006 18:29:35 +0100 Subject: add latest changelog --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6b63420..db92821 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,15 @@ initramfs-tools (0.50) unstable; urgency=low - * hook-functions: Fix MODULES=dep as `modprobe --show-depends' prints not + "E so io muoio da partigiano" + + * hook-functions: Fix MODULES=dep as `modprobe --show-depends' prints not only the insmod commands, but also the install ones. Thanks for the patch to Jean Charles Delepine . (Closes: #342616) * hooks/evms, scripts/local-top/evms: EVMS takes care of it's own hooks, rm. Thanks Steinar H. Gunderson . (Closes: 340258) - -- maximilian attems Sat, 14 Jan 2006 17:38:08 +0100 + -- maximilian attems Sat, 14 Jan 2006 17:40:48 +0100 initramfs-tools (0.49) unstable; urgency=low -- cgit v1.2.3 From af11b6a4f24b46cce5a46ddafa5e3d98f79f0403 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 14 Jan 2006 18:32:45 +0100 Subject: uuh removed a revision with shelve from previous 0.49 --- debian/changelog | 4 +++- debian/control | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index db92821..a1a029e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,7 +17,9 @@ initramfs-tools (0.49) unstable; urgency=low * initramfs-tools.8: Add DEBUG section, cheat how to check the initramfs. - -- maximilian attems Wed, 11 Jan 2006 03:33:24 +0100 + * Add optional sarge busybox-cvs-static dep to ease backport. + + -- maximilian attems Thu, 12 Jan 2006 17:28:42 +0100 initramfs-tools (0.48) unstable; urgency=low diff --git a/debian/control b/debian/control index bf50d66..4e06b8e 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), cpio, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.14-2), 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 -- cgit v1.2.3 From 4857b243fc2c8b1148041320fd923fab4b1d7a6e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Jan 2006 10:38:37 +0100 Subject: another changelog fix --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a1a029e..4d3195f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.50) unstable; urgency=low +initramfs-tools (0.50c) unstable; urgency=low "E so io muoio da partigiano" @@ -19,7 +19,7 @@ initramfs-tools (0.49) unstable; urgency=low * Add optional sarge busybox-cvs-static dep to ease backport. - -- maximilian attems Thu, 12 Jan 2006 17:28:42 +0100 + -- maximilian attems Thu, 12 Jan 2006 17:28:42 +0100 initramfs-tools (0.48) unstable; urgency=low -- cgit v1.2.3 From 270657ae007b35223c57829bfa6ed2e331eed851 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Jan 2006 21:39:16 +0100 Subject: Call panic on circular deps to get rescue shell. --- debian/changelog | 6 ++++++ scripts/functions | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4d3195f..f354777 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.51) unstable; urgency=low + + * scripts/functions: Call panic on circular deps to get rescue shell. + + -- maximilian attems Mon, 23 Jan 2006 21:37:45 +0100 + initramfs-tools (0.50c) unstable; urgency=low "E so io muoio da partigiano" diff --git a/scripts/functions b/scripts/functions index cde870d..f9cad01 100644 --- a/scripts/functions +++ b/scripts/functions @@ -138,8 +138,7 @@ reduce_prereqs() fi done if [ ${i} -eq ${oldi} ]; then - echo "PANIC: Circular dependancy. Exiting." >&2 - exit 1 + panic "PANIC: Circular dependancy. Exiting." fi done } -- cgit v1.2.3 From f2688cc18d0e0420ad4ad069ed6bb32b2869badb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Jan 2006 21:47:26 +0100 Subject: use CONFDIR everywhere --- debian/changelog | 4 +++- mkinitramfs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f354777..1308f23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,9 @@ initramfs-tools (0.51) unstable; urgency=low * scripts/functions: Call panic on circular deps to get rescue shell. - -- maximilian attems Mon, 23 Jan 2006 21:37:45 +0100 + * mkinitramfs: Use ${CONFDIR} everywhere. + + -- maximilian attems Mon, 23 Jan 2006 21:46:45 +0100 initramfs-tools (0.50c) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index 5a89213..9b9e734 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -183,7 +183,7 @@ mkdir -p "${DESTDIR}/etc/modprobe.d" cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" run_scripts /usr/share/initramfs-tools/hooks -run_scripts /etc/mkinitramfs/hooks +run_scripts "${CONFDIR}"/hooks # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then -- 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(-) diff --git a/debian/changelog b/debian/changelog index 1308f23..b82a343 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,12 @@ initramfs-tools (0.51) unstable; urgency=low * mkinitramfs: Use ${CONFDIR} everywhere. - -- maximilian attems Mon, 23 Jan 2006 21:46:45 +0100 + * Sync with 0.40ubuntu16: + - skip 0.40ubuntu15 udev gets fixed to only call update-initramfs + when /etc/mkinitramfs/initramfs.conf is there. + - 0.40ubuntu13 don't take over all initramfs images in Debian. + + -- maximilian attems Tue, 24 Jan 2006 11:12:18 +0100 initramfs-tools (0.50c) unstable; urgency=low @@ -109,6 +114,71 @@ initramfs-tools (0.42) unstable; urgency=low -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu16) dapper; urgency=low + + * Bump klibc-utils dependency to (>= 1.1.16-1), for hppa and ia64. + + -- Adam Conrad Thu, 19 Jan 2006 04:00:39 +1100 + +initramfs-tools (0.40ubuntu15) dapper; urgency=low + + * Drop the udev dependency, so we always get configured before udev. + We can get away with this now that udev hooks/scripts have been split + into the udev package proper. This should close Malone bug #28808. + + -- Adam Conrad Wed, 18 Jan 2006 22:50:27 +1100 + +initramfs-tools (0.40ubuntu14) dapper; urgency=low + + * If copy_exec is asked to copy to the same location twice, check if + we're copying the same file again. If so, do nothing and carry on, if + not, warn that we asked it for an impossibility, and don't overwrite. + + -- Adam Conrad Thu, 12 Jan 2006 18:00:12 +1100 + +initramfs-tools (0.40ubuntu13) dapper; urgency=low + + * Default to taking over other initramfs images in Ubuntu, as this is + more consistent with what our packaging expects to be able to do. + * Make "update-initramfs -u" try to find the running kernel before it + attempts to search the symbolic link list and its own sha1 list. + + -- Adam Conrad Wed, 11 Jan 2006 16:25:20 +1100 + +initramfs-tools (0.40ubuntu12) dapper; urgency=low + + * Oops, move the progress state file into the new directory too. + + -- Adam Conrad Mon, 9 Jan 2006 21:26:44 +1100 + +initramfs-tools (0.40ubuntu11) dapper; urgency=low + + * Move the state directory from /dev/initramfs to /dev/.initramfs + + -- Adam Conrad Mon, 9 Jan 2006 21:17:50 +1100 + +initramfs-tools (0.40ubuntu10) dapper; urgency=low + + * Create the /dev/initramfs directory as soon as we mount /dev, so other + packages that need a playground in /dev can do so in a uniform location. + * Update the usplash progress bar every time we are asked to output a + success or failure value from an init action, and write our progress to + /dev/initramfs for sysv-init to gather up and pick up where we left off. + * Export $DPKG_ARCH in both mkinitramfs (for use by hooks) and initramfs. + * Use $DPKG_ARCH in the thermal hook/script to divide the x86 stuff from + the powerpc stuff, not because we have to, but as an example to others. + + -- Adam Conrad Mon, 9 Jan 2006 10:51:51 +1100 + +initramfs-tools (0.40ubuntu9) dapper; urgency=low + + * Make some changes to cope with the new and improved klibc packaging: + - Add a force to the deletion of ${DESTDIR}/bin/sh, to avoid errors. + - Cope with libklibc moving from /usr/lib/klibc/lib to /lib. + - Bump dependency on klibc-utils to one new enough for the above. + + -- Adam Conrad Thu, 5 Jan 2006 15:13:15 +1100 + initramfs-tools (0.40ubuntu8) dapper; urgency=low * Call modprobe everywhere with "-Qb" to silence messages and allow user diff --git a/debian/control b/debian/control index 4e06b8e..b4124ab 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.14-2), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, udev (>= 0.076-5) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/hook-functions b/hook-functions index d3fe0a3..000c701 100644 --- a/hook-functions +++ b/hook-functions @@ -54,7 +54,15 @@ manual_add_modules() # $1 is source # $2 is relative destination copy_exec() { - ln -s ${1} ${DESTDIR}/${2} + final_destination=${DESTDIR}/${2}/`basename ${1}` + if [ -L "$final_destination" ]; then + if ! [ `readlink ${final_destination}` = "${1}" ]; then + echo "W:copy_exec: Not copying ${1} to \$DESTDIR${2}/`basename ${1}`, which is already a copy of `readlink ${final_destination}`" >&2 + return + fi + else + ln -s ${1} ${DESTDIR}/${2} + fi # Copy the dependant libraries for x in $(ldd ${1} 2>/dev/null | sed -e ' diff --git a/hooks/thermal b/hooks/thermal index 4426de3..c27c957 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -19,10 +19,13 @@ esac . /usr/share/initramfs-tools/hook-functions -# ACPI Systems -for x in fan thermal; do - manual_add_modules ${x} -done - -# PPC64 Systems -manual_add_modules therm_pm72 +case "$DPKG_ARCH" in +# copy the right modules +powerpc|ppc64) + manual_add_modules therm_pm72 + ;; +i386|amd64|ia64) + manual_add_modules fan + manual_add_modules thermal + ;; +esac diff --git a/init b/init index db18f15..e983534 100755 --- a/init +++ b/init @@ -13,9 +13,15 @@ mount -t proc none /proc # are used; which they will be, but it's worth pointing out mount -t tmpfs -o mode=0755 udev /dev touch /dev/.initramfs-tools +mkdir /dev/.initramfs mknod /dev/console c 5 1 mknod /dev/null c 1 3 +# Export the dpkg architecture +export DPKG_ARCH= +. /conf/arch.conf + +# Bring in the main config . /conf/initramfs.conf . /scripts/functions diff --git a/mkinitramfs b/mkinitramfs index 9b9e734..d3d6504 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -126,12 +126,15 @@ fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 +DPKG_ARCH=`dpkg --print-installation-architecture` + # Export environment for hook scripts. # export MODULESDIR export version export CONFDIR export DESTDIR +export DPKG_ARCH # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ @@ -168,6 +171,7 @@ for f in $(cd ${CONFDIR}/scripts && \ mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done +echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf # Busybox diff --git a/scripts/functions b/scripts/functions index f9cad01..7f8fa3c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -35,12 +35,22 @@ log_end_msg() /sbin/usplash_write "SUCCESS ok" fi _log_msg "Done." + update_progress } -# update_progress() # ToDo: NOP placeholder... what else for usplash? -# { -# : -# } +update_progress() +{ + if [ -z "$PROGRESS_STATE" ]; then + export PROGRESS_STATE=0 + fi + + PROGRESS_STATE=$(($PROGRESS_STATE + 1)) + echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state + + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "PROGRESS $PROGRESS_STATE" + fi +} panic() { diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index e0d79c3..a41f6f3 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -15,9 +15,13 @@ prereqs) ;; esac -# For ACPI systems -modprobe -q fan -modprobe -q thermal - -# For ppc64 systems -modprobe -q therm_pm72 +case "$DPKG_ARCH" in +# load the right modules +powerpc|ppc64) + modprobe -q therm_pm72 + ;; +i386|amd64|ia64) + modprobe -q fan + modprobe -q thermal + ;; +esac diff --git a/update-initramfs b/update-initramfs index 644a1aa..0d757b1 100644 --- a/update-initramfs +++ b/update-initramfs @@ -112,6 +112,13 @@ get_sorted_versions() verbose "Available versions: ${version_list}" } +set_current_version() +{ + if [ -f /boot/vmlinu?-`uname -r` ]; then + version=`uname -r` + fi +} + set_linked_version() { if [ -L /initrd.img ]; then @@ -159,6 +166,10 @@ create() update() { + if [ -z "${version}" ]; then + set_current_version + fi + if [ -z "${version}" ]; then set_linked_version fi @@ -227,6 +238,7 @@ altered_check() # Defaults verbose=0 yes=0 +# We default to takeover=1 in Ubuntu, but not Debian takeover=0 ## -- cgit v1.2.3 From e31be60a62406ef81d949eb67ac2bc64e90bf4ad Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 24 Jan 2006 13:10:56 +0100 Subject: take care of modular atkb and i8042. seen on the Debian ppc .config!? --- debian/changelog | 7 ++++++- hook-functions | 2 +- scripts/functions | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b82a343..9704e27 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,13 @@ initramfs-tools (0.51) unstable; urgency=low - skip 0.40ubuntu15 udev gets fixed to only call update-initramfs when /etc/mkinitramfs/initramfs.conf is there. - 0.40ubuntu13 don't take over all initramfs images in Debian. + + * hook-functions: auto_add_modules atkb and i8042. + + * scripts/functions: on panic modprobe atkb and i8042 - work around for + broken configs, where those are not build in. (Closes: #337497) - -- maximilian attems Tue, 24 Jan 2006 11:12:18 +0100 + -- maximilian attems Tue, 24 Jan 2006 13:04:40 +0100 initramfs-tools (0.50c) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 000c701..bb44d9e 100644 --- a/hook-functions +++ b/hook-functions @@ -137,7 +137,7 @@ dep_add_modules() auto_add_modules() { # base - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do manual_add_modules "${x}" done diff --git a/scripts/functions b/scripts/functions index 7f8fa3c..2113745 100644 --- a/scripts/functions +++ b/scripts/functions @@ -57,6 +57,8 @@ panic() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "QUIT" fi + modprobe -q i8042 + modprobe -q atkbd echo $@ FS1='(initramfs) ' /bin/sh /dev/console 2>&1 } -- cgit v1.2.3 From 0403b8bc09e6a4e499e3489ac24359a24e20d16a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 24 Jan 2006 13:13:56 +0100 Subject: check for /dev/.initramfs/ before writing into it, seen on an testboot with "break=init". --- debian/changelog | 7 +++++-- scripts/functions | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9704e27..fb9f4ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,13 +8,16 @@ initramfs-tools (0.51) unstable; urgency=low - skip 0.40ubuntu15 udev gets fixed to only call update-initramfs when /etc/mkinitramfs/initramfs.conf is there. - 0.40ubuntu13 don't take over all initramfs images in Debian. - + * hook-functions: auto_add_modules atkb and i8042. * scripts/functions: on panic modprobe atkb and i8042 - work around for broken configs, where those are not build in. (Closes: #337497) - -- maximilian attems Tue, 24 Jan 2006 13:04:40 +0100 + * scripts/functions: update_progress check if /dev/.initramfs/ exists + before writing into it. + + -- maximilian attems Tue, 24 Jan 2006 13:11:24 +0100 initramfs-tools (0.50c) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index 2113745..c550123 100644 --- a/scripts/functions +++ b/scripts/functions @@ -44,8 +44,11 @@ update_progress() export PROGRESS_STATE=0 fi - PROGRESS_STATE=$(($PROGRESS_STATE + 1)) - echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state + if [ -d /dev/.initramfs ]; then + PROGRESS_STATE=$(($PROGRESS_STATE + 1)) + echo "PROGRESS_STATE=${PROGRESS_STATE}" \ + > /dev/.initramfs/progress_state + fi if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "PROGRESS $PROGRESS_STATE" -- 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(-) 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 9c19e494cea61a5b89ab0ef87ba5cbc1da362c81 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Jan 2006 00:57:15 +0100 Subject: fix stage checking --- debian/changelog | 4 +++- init | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e783755..ccc9223 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,9 @@ 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 + * init: Fix maybe_break test for the bottom stage. + + -- maximilian attems Mon, 30 Jan 2006 00:56:04 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/init b/init index e983534..61a8379 100755 --- a/init +++ b/init @@ -98,7 +98,7 @@ log_begin_msg "Mounting root file system" mountroot log_end_msg -maybe_break mount +maybe_break bottom [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom" run_scripts /scripts/init-bottom [ "$quiet" != "y" ] && log_end_msg -- cgit v1.2.3 From 8281a8acd88b580a75585e254c068c01e70404a1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 6 Feb 2006 00:48:57 +0100 Subject: rename ide -> udev-helper as this is an debian udev workaround and will need more. --- debian/changelog | 8 +++++--- scripts/init-premount/ide | 38 -------------------------------------- scripts/init-premount/udev-helper | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 41 deletions(-) delete mode 100755 scripts/init-premount/ide create mode 100755 scripts/init-premount/udev-helper diff --git a/debian/changelog b/debian/changelog index ccc9223..67daa85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,13 @@ 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) + * hooks/lvm: manual_add_modules dm_snapshot, will allow boot from lvm + snapshot. (ubuntu: #3842) * init: Fix maybe_break test for the bottom stage. + + * scripts/init-premount/udev-helper: Renamed from scripts/init-premount/ide. - -- maximilian attems Mon, 30 Jan 2006 00:56:04 +0100 + -- maximilian attems Mon, 6 Feb 2006 00:47:53 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/scripts/init-premount/ide b/scripts/init-premount/ide deleted file mode 100755 index 03a3fdf..0000000 --- a/scripts/init-premount/ide +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -PREREQ="udev" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -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 diff --git a/scripts/init-premount/udev-helper b/scripts/init-premount/udev-helper new file mode 100755 index 0000000..03a3fdf --- /dev/null +++ b/scripts/init-premount/udev-helper @@ -0,0 +1,38 @@ +#!/bin/sh + +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +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 -- cgit v1.2.3 From 57bae4e1d5de2dceaf2c08937fceb6a5879075c2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 13 Feb 2006 11:19:33 +0100 Subject: s/was/has/ been altered --- debian/changelog | 6 ++++-- update-initramfs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 67daa85..31ed427 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,10 +4,12 @@ initramfs-tools (0.52) unstable; urgency=low snapshot. (ubuntu: #3842) * init: Fix maybe_break test for the bottom stage. - + * scripts/init-premount/udev-helper: Renamed from scripts/init-premount/ide. - -- maximilian attems Mon, 6 Feb 2006 00:47:53 +0100 + * update-initramfs: s/was/has/ been altered. (closes: #351939) + + -- maximilian attems Mon, 13 Feb 2006 11:18:11 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/update-initramfs b/update-initramfs index 0d757b1..ddb6877 100644 --- a/update-initramfs +++ b/update-initramfs @@ -230,7 +230,7 @@ altered_check() if [ "${takeover}" = 0 ]; then if ! compare_sha1; then delete_sha1 - mild_panic "${initramfs} was been altered. Cannot update." + mild_panic "${initramfs} has been altered. Cannot update." fi fi } -- cgit v1.2.3 From b3fcee343807b6dcec5bb6a075ede8b3bc5da060 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Feb 2006 11:22:50 +0100 Subject: better document the point of update-initramfs and mkinitramfs. --- debian/changelog | 5 ++++- mkinitramfs.8 | 9 ++++++++- update-initramfs.8 | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 31ed427..bc1f8d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,7 +9,10 @@ initramfs-tools (0.52) unstable; urgency=low * update-initramfs: s/was/has/ been altered. (closes: #351939) - -- maximilian attems Mon, 13 Feb 2006 11:18:11 +0100 + * update-initramfs(8), mkinitramfs(8): The point of the first is to be used + on your local box. The second cmd should help for advanced usage. + + -- maximilian attems Tue, 14 Feb 2006 11:18:44 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 64f8786..79ce777 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -22,7 +22,14 @@ mkinitramfs \- generate an initramfs image .SH DESCRIPTION The .B mkinitramfs -script generates an initramfs image. The initramfs is an cpio archive. +script generates an initramfs image. +The initramfs is an 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 +.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 happens in this early userspace. diff --git a/update-initramfs.8 b/update-initramfs.8 index 35f1572..d1e1ed0 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -15,7 +15,11 @@ update-initramfs \- generate an initramfs image .SH DESCRIPTION The .B update-initramfs -script manages your initramfs images. The initramfs is an cpio archive. +script manages your initramfs images on your local box. +It keeps track of the existing initramfs archives in /boot. +It helps to update, create and remove those. + +The initramfs is an 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. -- cgit v1.2.3 From 785fb28847d8a620625a23aeafdc0fe85ef7adf9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 17 Feb 2006 10:05:12 +0100 Subject: highlight the mode of operation of update-initramfs --- debian/changelog | 10 ++++++---- update-initramfs.8 | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc1f8d7..fe7fc20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,18 +1,20 @@ initramfs-tools (0.52) unstable; urgency=low * hooks/lvm: manual_add_modules dm_snapshot, will allow boot from lvm - snapshot. (ubuntu: #3842) + snapshot. * init: Fix maybe_break test for the bottom stage. * scripts/init-premount/udev-helper: Renamed from scripts/init-premount/ide. - * update-initramfs: s/was/has/ been altered. (closes: #351939) + * update-initramfs: s/was/has/ been altered. + (closes: #351939, #352633, #353087) * update-initramfs(8), mkinitramfs(8): The point of the first is to be used - on your local box. The second cmd should help for advanced usage. + on your local box. Highlight its mode of operations. The second cmd is + only needed for advanced usage. - -- maximilian attems Tue, 14 Feb 2006 11:18:44 +0100 + -- maximilian attems Fri, 17 Feb 2006 10:04:17 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/update-initramfs.8 b/update-initramfs.8 index d1e1ed0..dd9efe3 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -17,7 +17,8 @@ The .B update-initramfs script manages your initramfs images on your local box. It keeps track of the existing initramfs archives in /boot. -It helps to update, create and remove those. +There are three modes of operation create, update or delete. +You must at least specify one of those modes. The initramfs is an cpio archive. At boot time, the kernel unpacks that archive into ram disk, mounts and @@ -31,19 +32,19 @@ Set the kernel for whom the initramfs will be generated. .TP \fB \-c -Create a new initramfs. +This mode creates a new initramfs. .TP \fB \-u -Update an existing initramfs. +This mode updates an existing initramfs. .TP \fB \-d -Remove an existing initramfs. +This mode removes an existing initramfs. .TP \fB \-t -Take over a custom initramfs with this one. +Allows to take over an custom initramfs with a newer one. .TP \fB \-v -- cgit v1.2.3 From 0d19ff751ee9d9ceb2bf41de2b6fb0c0094a1aaa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 17 Feb 2006 21:43:38 +0100 Subject: add kernel-package compat stuff, behaves like mkinitramfs and adds an sha1sum for update-initramfs. is meant for etch release, hope we get rid afterwards. will allow to clean up mkinitramfs from the longoption calls. --- debian/changelog | 9 +++- debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + mkinitramfs-kpkg | 94 +++++++++++++++++++++++++++++++++++++++++ mkinitramfs-kpkg.8 | 49 +++++++++++++++++++++ mkinitramfs.8 | 2 +- update-initramfs.8 | 2 +- 7 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 mkinitramfs-kpkg create mode 100644 mkinitramfs-kpkg.8 diff --git a/debian/changelog b/debian/changelog index fe7fc20..720c344 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,10 +11,15 @@ initramfs-tools (0.52) unstable; urgency=low (closes: #351939, #352633, #353087) * update-initramfs(8), mkinitramfs(8): The point of the first is to be used - on your local box. Highlight its mode of operations. The second cmd is + on your local box. Highlight its mode of operations. The second cmd is only needed for advanced usage. - -- maximilian attems Fri, 17 Feb 2006 10:04:17 +0100 + * mkinitramfs-kpkg: Add an compat call for kernel-package. Has the same + broken syntax than mkinitrd and adds an sha1sum for update-initramfs. + + * mkinitramfs-kpkg.8: Add warnings to use update-initramfs instead. + + -- maximilian attems Fri, 17 Feb 2006 21:41:11 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 3a7a503..b722d90 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -1,4 +1,5 @@ mkinitramfs usr/sbin +mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 8a27566..f127e99 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,4 +1,5 @@ mkinitramfs.8 +mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg new file mode 100644 index 0000000..d36710a --- /dev/null +++ b/mkinitramfs-kpkg @@ -0,0 +1,94 @@ +#!/bin/sh + +STATEDIR=/var/lib/initramfs-tools + +usage() +{ + cat >&2 << EOF + +Usage: ${0} <-o outfile> [version] + +Please use update-initramfs(8): +${0} exists for compatibility by kernel-package(5) calls. +See ${0}(8) for further details. +EOF + exit 1 +} + +OPTIONS=`getopt -o m:o: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` +# Check for non-GNU getopt +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$OPTIONS" + +while true; do + case "$1" in + -m) + # ignore + shift 2 + ;; + -o) + touch $2 + outfile="$(readlink -f "$2")" + shift 2 + ;; + --supported-host-version) + supported_host_version="$2" + shift 2 + ;; + --supported-target-version) + supported_target_version="$2" + shift 2 + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + ;; + 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 + + +if [ -z "${outfile}" ]; then + usage +fi + +# And by "version" we really mean path to kernel modules +# This is braindead, and exists to preserve the interface with mkinitrd +version="${1}" + +case "${version}" in +/lib/modules/*/[!/]*) + ;; +/lib/modules/[!/]*) + version="${version#/lib/modules/}" + version="${version%%/*}" + ;; +esac + +case "${version}" in +*/*) + echo "$PROG: ${version} is not a valid kernel version" >&2 + exit 1 + ;; +esac + +# 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 new file mode 100644 index 0000000..34f76db --- /dev/null +++ b/mkinitramfs-kpkg.8 @@ -0,0 +1,49 @@ +.TH MKINITRAMFS-KPKG 8 "$Date: 2006/02/17 $" "" "mkinitramfs-kpkg manual" + +.SH NAME +mkinitramfs-kpkg \- generates an initramfs image for kernel-package + +.SH SYNOPSIS +.B mkinitramfs +.RB [ \-o +.IR outfile ] +.RI [ version ] +.B mkinitramfs +.RB [ \-\-supported-host-version= +.IR hversion ] +.RB [ \-\-supported-target-version= +.IR tversion ] + +.SH DESCRIPTION +The +.B mkinitramfs-kpkg +script calls +.B mkinitramfs +for kernel-package. It's usage is not recommended. +See +.B update-initramfs +for an better alternative. + +.SH OPTIONS + +.TP +\fB \-o \fI outfile +Write the image to +.IR outfile . + +.TP +\fB\-\-supported-host-version=\fIhversion +This option queries if mkinitramfs can create ramdisks on a running kernel of version +.IR hversion . + +.TP +\fB\-\-supported-target-version=\fItversion +This option queries if mkinitramfs can create ramdisks for kernel version +.IR tversion . + +.SH AUTHOR +mkinitramfs-kpkg is maintained by Maximilian Attems . + +.SH SEE ALSO + +.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 79ce777..b0da75e 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2005/12/06 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2006/02/17 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image diff --git a/update-initramfs.8 b/update-initramfs.8 index dd9efe3..9e107e9 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2005/12/06" $" "" "update-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/02/17" $" "" "update-initramfs manual" .SH NAME update-initramfs \- generate an initramfs image -- cgit v1.2.3 From 70610d50c1815295a8bbe2c580738808b34034dc Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 20 Feb 2006 13:32:23 +0100 Subject: set takeover=1 in debian too, removes the need of a stupid wrapper package --- debian/changelog | 15 ++++--- debian/initramfs-tools.install | 1 - debian/initramfs-tools.manpages | 1 - mkinitramfs-kpkg | 94 ----------------------------------------- mkinitramfs-kpkg.8 | 49 --------------------- update-initramfs | 4 +- 6 files changed, 11 insertions(+), 153 deletions(-) delete mode 100644 mkinitramfs-kpkg delete mode 100644 mkinitramfs-kpkg.8 diff --git a/debian/changelog b/debian/changelog index 720c344..033943e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.52b) unstable; urgency=high + + * update-initramfs: Set takeover=1. This allows hooks to regenerate the + latest initramfs per default. No need for an kpkg wrapper, as + kernel-package doesn't call update-initramfs, but mkinitramfs. + + -- maximilian attems Mon, 20 Feb 2006 13:30:54 +0100 + initramfs-tools (0.52) unstable; urgency=low * hooks/lvm: manual_add_modules dm_snapshot, will allow boot from lvm @@ -8,17 +16,12 @@ initramfs-tools (0.52) unstable; urgency=low * scripts/init-premount/udev-helper: Renamed from scripts/init-premount/ide. * update-initramfs: s/was/has/ been altered. - (closes: #351939, #352633, #353087) + (closes: #351939, #352633, #353087, #353668) * update-initramfs(8), mkinitramfs(8): The point of the first is to be used on your local box. Highlight its mode of operations. The second cmd is only needed for advanced usage. - * mkinitramfs-kpkg: Add an compat call for kernel-package. Has the same - broken syntax than mkinitrd and adds an sha1sum for update-initramfs. - - * mkinitramfs-kpkg.8: Add warnings to use update-initramfs instead. - -- maximilian attems Fri, 17 Feb 2006 21:41:11 +0100 initramfs-tools (0.51) unstable; urgency=low diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index b722d90..3a7a503 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -1,5 +1,4 @@ mkinitramfs usr/sbin -mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index f127e99..8a27566 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,5 +1,4 @@ mkinitramfs.8 -mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg deleted file mode 100644 index d36710a..0000000 --- a/mkinitramfs-kpkg +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh - -STATEDIR=/var/lib/initramfs-tools - -usage() -{ - cat >&2 << EOF - -Usage: ${0} <-o outfile> [version] - -Please use update-initramfs(8): -${0} exists for compatibility by kernel-package(5) calls. -See ${0}(8) for further details. -EOF - exit 1 -} - -OPTIONS=`getopt -o m:o: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` -# Check for non-GNU getopt -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi - -eval set -- "$OPTIONS" - -while true; do - case "$1" in - -m) - # ignore - shift 2 - ;; - -o) - touch $2 - outfile="$(readlink -f "$2")" - shift 2 - ;; - --supported-host-version) - supported_host_version="$2" - shift 2 - ;; - --supported-target-version) - supported_target_version="$2" - shift 2 - ;; - --) - shift - break - ;; - *) - echo "Internal error!" >&2 - exit 1 - ;; - 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 - - -if [ -z "${outfile}" ]; then - usage -fi - -# And by "version" we really mean path to kernel modules -# This is braindead, and exists to preserve the interface with mkinitrd -version="${1}" - -case "${version}" in -/lib/modules/*/[!/]*) - ;; -/lib/modules/[!/]*) - version="${version#/lib/modules/}" - version="${version%%/*}" - ;; -esac - -case "${version}" in -*/*) - echo "$PROG: ${version} is not a valid kernel version" >&2 - exit 1 - ;; -esac - -# 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 deleted file mode 100644 index 34f76db..0000000 --- a/mkinitramfs-kpkg.8 +++ /dev/null @@ -1,49 +0,0 @@ -.TH MKINITRAMFS-KPKG 8 "$Date: 2006/02/17 $" "" "mkinitramfs-kpkg manual" - -.SH NAME -mkinitramfs-kpkg \- generates an initramfs image for kernel-package - -.SH SYNOPSIS -.B mkinitramfs -.RB [ \-o -.IR outfile ] -.RI [ version ] -.B mkinitramfs -.RB [ \-\-supported-host-version= -.IR hversion ] -.RB [ \-\-supported-target-version= -.IR tversion ] - -.SH DESCRIPTION -The -.B mkinitramfs-kpkg -script calls -.B mkinitramfs -for kernel-package. It's usage is not recommended. -See -.B update-initramfs -for an better alternative. - -.SH OPTIONS - -.TP -\fB \-o \fI outfile -Write the image to -.IR outfile . - -.TP -\fB\-\-supported-host-version=\fIhversion -This option queries if mkinitramfs can create ramdisks on a running kernel of version -.IR hversion . - -.TP -\fB\-\-supported-target-version=\fItversion -This option queries if mkinitramfs can create ramdisks for kernel version -.IR tversion . - -.SH AUTHOR -mkinitramfs-kpkg is maintained by Maximilian Attems . - -.SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) diff --git a/update-initramfs b/update-initramfs index ddb6877..9ab4607 100644 --- a/update-initramfs +++ b/update-initramfs @@ -238,8 +238,8 @@ altered_check() # Defaults verbose=0 yes=0 -# We default to takeover=1 in Ubuntu, but not Debian -takeover=0 +# We default to takeover=1 to allow hooks to update latest initramfs +takeover=1 ## -- cgit v1.2.3 From a563d25cc42346ba18a43c2a37896316c245d922 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 20 Feb 2006 22:55:01 +0100 Subject: fix adding initrd against newer handbuild kernels. --- debian/changelog | 8 ++++++++ update-initramfs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 033943e..a20ff37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.52c) unstable; urgency=high + + * update-initramfs: set_current_version needs to check against + /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. + Otherwise this builds initramfs for newer handbuild trees too. + + -- maximilian attems Mon, 20 Feb 2006 15:46:54 +0100 + initramfs-tools (0.52b) unstable; urgency=high * update-initramfs: Set takeover=1. This allows hooks to regenerate the diff --git a/update-initramfs b/update-initramfs index 9ab4607..0c7b9e7 100644 --- a/update-initramfs +++ b/update-initramfs @@ -114,7 +114,7 @@ get_sorted_versions() set_current_version() { - if [ -f /boot/vmlinu?-`uname -r` ]; then + if [ -f /boot/initrd.img-`uname -r` ]; then version=`uname -r` fi } -- cgit v1.2.3 From 830fd3fa51658cf0398cbb037a8485439ae4ce2d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 00:20:17 +0100 Subject: sync with ubuntu22 + some handmerges --- conf/initramfs.conf | 4 ++- debian/changelog | 63 ++++++++++++++++++++++++++++++++++++++++--- hook-functions | 59 +++++++++++++++++++++++----------------- init | 12 +++++++-- initramfs.conf.5 | 2 ++ mkinitramfs | 5 ++++ scripts/functions | 9 +++---- scripts/init-premount/thermal | 1 + scripts/nfs | 4 +-- 9 files changed, 121 insertions(+), 38 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 38a0594..a9cadf7 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -4,12 +4,14 @@ # # -# MODULES: [ most | dep | list ] +# MODULES: [ most | netboot | dep | list ] # # most - Add all framebuffer, acpi, filesystem, and harddrive drivers. # # dep - Try and guess which modules to load. # +# netboot - Add the base modules, network modules, but skip block devices. +# # list - Only include modules from the 'additional modules' list # diff --git a/debian/changelog b/debian/changelog index a20ff37..74facf0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,20 @@ -initramfs-tools (0.52c) unstable; urgency=high +initramfs-tools (0.53) unstable; urgency=high * update-initramfs: set_current_version needs to check against - /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. + /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. Otherwise this builds initramfs for newer handbuild trees too. - -- maximilian attems Mon, 20 Feb 2006 15:46:54 +0100 + * Resync with 0.40ubuntu22: + - mptspi already included + - keep nfsmount for now, we don't want to add further busybox deps. + * Further reduce ubuntudiff: + - scripts/functions: remove duplicate dir check. + - scripts/nfs: add quiet to modules loading. + + * Add kernel-package compat stuff, behaves like mkinitramfs, + but adds the sha1sum for update-initramfs. + + -- maximilian attems Thu, 23 Feb 2006 16:59:56 +0100 initramfs-tools (0.52b) unstable; urgency=high @@ -155,6 +165,53 @@ initramfs-tools (0.42) unstable; urgency=low even if bootloader setting is preferred. -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 +initramfs-tools (0.40ubuntu22) dapper; urgency=low + + * Add mptspi to the list of SCSI modules put in the initramfs by default, + which is required for some LSI Logic controllers and for the VMware SCSI + controller in recent VMware versions (See launchpad.net/{27187,31229}) + * Fix typo of /dev/disk/by-*, which I wrote as /dev/disks/by-{uuid,label} + * Load i2c-keywest before loading therm_pm72 in the PowerPC thermal hook, + since the latter sometimes needs the former (Closes launchpad.net/27269) + + -- Adam Conrad Tue, 14 Feb 2006 23:28:35 +1100 + +initramfs-tools (0.40ubuntu21) dapper; urgency=low + + * Don't update the progress bar once udev has taken /dev away; + after all, we can't contact usplash anyway at this point. + + -- Scott James Remnant Wed, 8 Feb 2006 14:34:10 +0000 + +initramfs-tools (0.40ubuntu20) dapper; urgency=low + + * Add ... to end of strings to match main boot sequence. + + -- Scott James Remnant Tue, 7 Feb 2006 11:07:50 +0000 + +initramfs-tools (0.40ubuntu19) dapper; urgency=low + + * Change the first of many "Loading modules" to "Loading essential drivers" + to improve debugging when people say it breaks at that stage. + + -- Scott James Remnant Tue, 7 Feb 2006 11:05:15 +0000 + +initramfs-tools (0.40ubuntu18) dapper; urgency=low + + * Add support for selecting root by UUID or LABEL with syntax such as: + root=LABEL=myrootfs or root=UUID=92addf34-0f02-4a0e-bfb2-cbaa1e907b77 + + -- Adam Conrad Fri, 3 Feb 2006 15:55:01 +0000 + +initramfs-tools (0.40ubuntu17) dapper; urgency=low + + * Make auto_add_modules take an argument, so you can use it to add only + some of the auto* modules (like "net" or "ide"), and create a "netboot" + option that only includes base and net (Closes launchpad.net/26426) + * Change the nfs script to use "mount -o nolock" instead of "nfsmount", + to fix some timeouts for ltsp NFS roots (Closes launchpad.net/19196) + + -- Adam Conrad Tue, 31 Jan 2006 11:55:11 +0000 initramfs-tools (0.40ubuntu16) dapper; urgency=low diff --git a/hook-functions b/hook-functions index bb44d9e..51e0a8d 100644 --- a/hook-functions +++ b/hook-functions @@ -136,31 +136,40 @@ dep_add_modules() # Modules that we always add to the initramfs auto_add_modules() { - # base - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do - manual_add_modules "${x}" - done - - # Ethernet - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi forcedeth hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do - manual_add_modules "${x}" - done - - # ide - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do - manual_add_modules "${x}" - done - - # scsi - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do - manual_add_modules "${x}" - done - - # i2o - for x in i2o_block; do - manual_add_modules "${x}" - done - + case "$1" in + base) + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + manual_add_modules "${x}" + done + ;; + net) + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi forcedeth hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do + manual_add_modules "${x}" + done + ;; + ide) + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + manual_add_modules "${x}" + done + ;; + scsi) + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + manual_add_modules "${x}" + done + ;; + i2o) + for x in i2o_block; do + manual_add_modules "${x}" + done + ;; + *) + auto_add_modules base + auto_add_modules net + auto_add_modules ide + auto_add_modules scsi + auto_add_modules i2o + ;; + esac } usage() diff --git a/init b/init index 61a8379..f4ec157 100755 --- a/init +++ b/init @@ -41,6 +41,14 @@ for x in $(cat /proc/cmdline); do ;; root=*) ROOT=${x#root=} + case $ROOT in + LABEL=*) + ROOT="/dev/disk/by-label/${ROOT#LABEL=}" + ;; + UUID=*) + ROOT="/dev/disk/by-uuid/${ROOT#UUID=}" + ;; + esac ;; nfsroot=*) NFSROOT=${x#nfsroot=} @@ -84,7 +92,7 @@ run_scripts /scripts/init-top parse_numeric ${ROOT} maybe_break modules -log_begin_msg "Loading modules" +log_begin_msg "Loading essential drivers..." load_modules log_end_msg @@ -94,7 +102,7 @@ run_scripts /scripts/init-premount log_end_msg maybe_break mount -log_begin_msg "Mounting root file system" +log_begin_msg "Mounting root file system..." mountroot log_end_msg diff --git a/initramfs.conf.5 b/initramfs.conf.5 index a1cb341..c289ee2 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -22,6 +22,8 @@ The default setting is \fImost\fP. \fIdep\fP tries to guess which modules are necessary for the running box. +\fInetboot\fP adds the base modules, network modules, but skips block devices. + \fIlist\fP includes only modules from the additional modules list. .TP diff --git a/mkinitramfs b/mkinitramfs index d3d6504..6c2be32 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -158,6 +158,11 @@ if [ "${MODULES}" = "most" ]; then auto_add_modules fi +if [ "${MODULES}" = "netboot" ]; then + auto_add_modules base + auto_add_modules net +fi + # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. diff --git a/scripts/functions b/scripts/functions index c550123..6825519 100644 --- a/scripts/functions +++ b/scripts/functions @@ -40,15 +40,14 @@ log_end_msg() update_progress() { + [ -d /dev/.initramfs ] || return + if [ -z "$PROGRESS_STATE" ]; then export PROGRESS_STATE=0 fi - if [ -d /dev/.initramfs ]; then - PROGRESS_STATE=$(($PROGRESS_STATE + 1)) - echo "PROGRESS_STATE=${PROGRESS_STATE}" \ - > /dev/.initramfs/progress_state - fi + PROGRESS_STATE=$(($PROGRESS_STATE + 1)) + echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "PROGRESS $PROGRESS_STATE" diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index a41f6f3..d59af8a 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,6 +18,7 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) + modprobe -q i2c-keywest modprobe -q therm_pm72 ;; i386|amd64|ia64) diff --git a/scripts/nfs b/scripts/nfs index a2f6c3e..89b5c20 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -9,9 +9,9 @@ mountroot () run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe nfs + modprobe -q nfs # For DHCP - modprobe af_packet + modprobe -q af_packet ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf -- cgit v1.2.3 From b32ee94abe4682241d1b00f430858c5f1ac5d955 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 01:08:13 +0100 Subject: resync ubuntu24 aka nice conf.d --- debian/changelog | 25 +++++++++++++++++++++++-- debian/initramfs-tools.dirs | 1 + debian/initramfs-tools.postinst | 2 +- debian/initramfs-tools.postrm | 1 + debian/initramfs-tools.preinst | 14 ++++++++++++++ hook-functions | 2 +- init | 3 +++ initramfs.conf.5 | 9 ++++++++- mkinitramfs | 12 +++++++++++- 9 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 debian/initramfs-tools.preinst diff --git a/debian/changelog b/debian/changelog index 74facf0..bef47a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,15 +4,18 @@ initramfs-tools (0.53) unstable; urgency=high /boot/initrd-`uname -r` and not /boot/vmlinu?-`uname -r`. Otherwise this builds initramfs for newer handbuild trees too. - * Resync with 0.40ubuntu22: + * Resync with 0.40ubuntu24: - mptspi already included - keep nfsmount for now, we don't want to add further busybox deps. + - adds mptfc and mptsas modules (closes: #341930) + - adds MODULES=netboot support (closes: #352669) * Further reduce ubuntudiff: - scripts/functions: remove duplicate dir check. - scripts/nfs: add quiet to modules loading. * Add kernel-package compat stuff, behaves like mkinitramfs, - but adds the sha1sum for update-initramfs. + but adds the sha1sum for update-initramfs. Reset takeover=0. + (closes: #353809) -- maximilian attems Thu, 23 Feb 2006 16:59:56 +0100 @@ -165,6 +168,24 @@ initramfs-tools (0.42) unstable; urgency=low even if bootloader setting is preferred. -- maximilian attems Mon, 5 Dec 2005 12:59:59 +0100 + +initramfs-tools (0.40ubuntu24) dapper; urgency=low + + * Add support for LSI Logic's Fusion MPT SAS and FC controllers as well. + + -- Adam Conrad Thu, 23 Feb 2006 23:27:16 +1100 + +initramfs-tools (0.40ubuntu23) dapper; urgency=low + + * Grow a conf.d directory for config snippets, and toss the RESUME option + in there, to stop editing our own conffile in our maintainer scripts. + * Add a cleverly hackish preinst that will pull the RESUME setting from + old config files, migrate it to conf.d/resume, and reset that part of the + conffile to a factory fresh state. This should fix the unwanted conffile + prompt in breezy->dapper upgrades for people who made no local changes. + + -- Adam Conrad Fri, 17 Feb 2006 15:34:53 +1100 + initramfs-tools (0.40ubuntu22) dapper; urgency=low * Add mptspi to the list of SCSI modules put in the initramfs by default, diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index ba4ac4d..9325057 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -8,5 +8,6 @@ etc/mkinitramfs/scripts/nfs-bottom etc/mkinitramfs/scripts/nfs-premount etc/mkinitramfs/scripts/nfs-top etc/mkinitramfs/hooks +etc/mkinitramfs/conf.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index c6025e5..63ceef8 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -25,7 +25,7 @@ if [ "$1" = configure ]; then fi if [ -e ${RESUME} ]; then - sed -i -e "s@#RESUME=@RESUME=${RESUME}@" /etc/mkinitramfs/initramfs.conf + echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume fi if [ -e /etc/mkinitrd/DSDT ]; then diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 2af9945..0c2d39a 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -2,6 +2,7 @@ if [ "x${1}" = "xpurge" ]; then rm -f /etc/mkinitramfs/modules + rm -f /etc/mkinitramfs/conf.d/resume fi #DEBHELPER# diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst new file mode 100644 index 0000000..3582290 --- /dev/null +++ b/debian/initramfs-tools.preinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +[ -f /etc/mkinitramfs/initramfs.conf ] && . /etc/mkinitramfs/initramfs.conf +if [ -z ${RESUME} ]; then + exit 0 +else + mkdir -p /etc/mkinitramfs/conf.d + echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume + sed -i -e "s/RESUME=.*/#RESUME=/" /etc/mkinitramfs/initramfs.conf +fi + +#DEBHELPER# diff --git a/hook-functions b/hook-functions index 51e0a8d..9b0d949 100644 --- a/hook-functions +++ b/hook-functions @@ -153,7 +153,7 @@ auto_add_modules() done ;; scsi) - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptscsih mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules "${x}" done ;; diff --git a/init b/init index f4ec157..1e4e2fd 100755 --- a/init +++ b/init @@ -23,6 +23,9 @@ export DPKG_ARCH= # Bring in the main config . /conf/initramfs.conf +for i in conf/conf.d/*; do + [ -f ${i} ] && . ${i} +done . /scripts/functions # Parse command line options diff --git a/initramfs.conf.5 b/initramfs.conf.5 index c289ee2..7fb79b1 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -12,6 +12,12 @@ Each line in the file can be a configuration variable, a blank line, or a comment. The value of an variable is assigned by an statement of the form: \fIname\fP=[\fIvalue\fP] +Configuration options can be broken out into configuration snippets and +placed in individual files in the /etc/mkinitramfs/conf.d directory. Files +in this directory are always read \fBafter\fP the main configuration file, +so you can override the settings in the main config file without editing it +directly. + .SH GENERAL VARIABLES .TP \fB MODULES @@ -30,7 +36,8 @@ The default setting is \fImost\fP. \fB RESUME Optional setting of the swap partition to resume from. The resume= passed on the command line of your boot loader -will override this setting. +will override this setting. By default, this is set in +/etc/mkinitramfs/conf.d/resume. .SH NFS VARIABLES .TP diff --git a/mkinitramfs b/mkinitramfs index 6c2be32..06e892d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -77,6 +77,13 @@ fi . /usr/share/initramfs-tools/hook-functions . "${CONFDIR}/initramfs.conf" +EXTRA_CONF='' +for i in ${CONFDIR}/conf.d/*; do + EXTRA_CONF="${EXTRA_CONF} $(basename $i | grep '^[a-z0-9][a-z0-9\._-]*$' | grep -v '\.dpkg-.*$')"; +done +for i in ${EXTRA_CONF}; do +. ${CONFDIR}/conf.d/${i} +done if [ -z "${outfile}" ]; then usage @@ -139,7 +146,7 @@ export DPKG_ARCH # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf etc lib modules sbin scripts; do +for d in bin conf/conf.d etc lib modules sbin scripts; do mkdir -p "${DESTDIR}/${d}" done @@ -178,6 +185,9 @@ cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf +for i in ${EXTRA_CONF}; do + copy_exec ${CONFDIR}/conf.d/${i} /conf/conf.d +done # Busybox rm -f ${DESTDIR}/bin/sh -- cgit v1.2.3 From 833ebf13b59f2cc2e9af15f2df3727f4e09bec41 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 01:16:09 +0100 Subject: readd the kpkg compat wrapper --- mkinitramfs-kpkg | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ mkinitramfs-kpkg.8 | 49 ++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 mkinitramfs-kpkg create mode 100644 mkinitramfs-kpkg.8 diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg new file mode 100644 index 0000000..d36710a --- /dev/null +++ b/mkinitramfs-kpkg @@ -0,0 +1,94 @@ +#!/bin/sh + +STATEDIR=/var/lib/initramfs-tools + +usage() +{ + cat >&2 << EOF + +Usage: ${0} <-o outfile> [version] + +Please use update-initramfs(8): +${0} exists for compatibility by kernel-package(5) calls. +See ${0}(8) for further details. +EOF + exit 1 +} + +OPTIONS=`getopt -o m:o: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` +# Check for non-GNU getopt +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$OPTIONS" + +while true; do + case "$1" in + -m) + # ignore + shift 2 + ;; + -o) + touch $2 + outfile="$(readlink -f "$2")" + shift 2 + ;; + --supported-host-version) + supported_host_version="$2" + shift 2 + ;; + --supported-target-version) + supported_target_version="$2" + shift 2 + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + ;; + 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 + + +if [ -z "${outfile}" ]; then + usage +fi + +# And by "version" we really mean path to kernel modules +# This is braindead, and exists to preserve the interface with mkinitrd +version="${1}" + +case "${version}" in +/lib/modules/*/[!/]*) + ;; +/lib/modules/[!/]*) + version="${version#/lib/modules/}" + version="${version%%/*}" + ;; +esac + +case "${version}" in +*/*) + echo "$PROG: ${version} is not a valid kernel version" >&2 + exit 1 + ;; +esac + +# 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 new file mode 100644 index 0000000..34f76db --- /dev/null +++ b/mkinitramfs-kpkg.8 @@ -0,0 +1,49 @@ +.TH MKINITRAMFS-KPKG 8 "$Date: 2006/02/17 $" "" "mkinitramfs-kpkg manual" + +.SH NAME +mkinitramfs-kpkg \- generates an initramfs image for kernel-package + +.SH SYNOPSIS +.B mkinitramfs +.RB [ \-o +.IR outfile ] +.RI [ version ] +.B mkinitramfs +.RB [ \-\-supported-host-version= +.IR hversion ] +.RB [ \-\-supported-target-version= +.IR tversion ] + +.SH DESCRIPTION +The +.B mkinitramfs-kpkg +script calls +.B mkinitramfs +for kernel-package. It's usage is not recommended. +See +.B update-initramfs +for an better alternative. + +.SH OPTIONS + +.TP +\fB \-o \fI outfile +Write the image to +.IR outfile . + +.TP +\fB\-\-supported-host-version=\fIhversion +This option queries if mkinitramfs can create ramdisks on a running kernel of version +.IR hversion . + +.TP +\fB\-\-supported-target-version=\fItversion +This option queries if mkinitramfs can create ramdisks for kernel version +.IR tversion . + +.SH AUTHOR +mkinitramfs-kpkg is maintained by Maximilian Attems . + +.SH SEE ALSO + +.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) -- cgit v1.2.3 From 236d8183a72e0de357a743bc909ea25e8bd1995e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 09:39:30 +0100 Subject: hardcoded root support --- debian/changelog | 11 +++++++++-- init | 4 +++- mkinitramfs | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index bef47a5..d4858ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,8 @@ initramfs-tools (0.53) unstable; urgency=high Otherwise this builds initramfs for newer handbuild trees too. * Resync with 0.40ubuntu24: - - mptspi already included + - New conf.d dir for config snippet. + - mptspi already included. - keep nfsmount for now, we don't want to add further busybox deps. - adds mptfc and mptsas modules (closes: #341930) - adds MODULES=netboot support (closes: #352669) @@ -17,7 +18,13 @@ initramfs-tools (0.53) unstable; urgency=high but adds the sha1sum for update-initramfs. Reset takeover=0. (closes: #353809) - -- maximilian attems Thu, 23 Feb 2006 16:59:56 +0100 + * init: Move the ROOT export up, so we actually source the hardcoded device + in initramfs.conf. (closes: #352958) + + * mkinitramfs: When invoked with -r switch pass the hardcoded root device to + /etc/mkinitramfs/conf.d/root inside the initramfs. + + -- maximilian attems Mon, 27 Feb 2006 01:45:56 +0100 initramfs-tools (0.52b) unstable; urgency=high diff --git a/init b/init index 1e4e2fd..f69b3e8 100755 --- a/init +++ b/init @@ -21,6 +21,9 @@ mknod /dev/null c 1 3 export DPKG_ARCH= . /conf/arch.conf +# Export it for root hardcoding +export ROOT= + # Bring in the main config . /conf/initramfs.conf for i in conf/conf.d/*; do @@ -33,7 +36,6 @@ export break= export init=/sbin/init export quiet=n export readonly=y -export ROOT= export resume=${RESUME} export rootmnt=/root export debug= diff --git a/mkinitramfs b/mkinitramfs index 06e892d..a72865b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -37,7 +37,7 @@ while true; do shift ;; -r) - # ignore (FIXME: manpage says differently?!?) + ROOT="$2" shift 2 ;; --supported-host-version) @@ -188,6 +188,7 @@ copy_exec "${CONFDIR}/initramfs.conf" /conf for i in ${EXTRA_CONF}; do copy_exec ${CONFDIR}/conf.d/${i} /conf/conf.d done +echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root # Busybox rm -f ${DESTDIR}/bin/sh -- cgit v1.2.3 From 308b8323da7e00ae42953152682172e2d3ca1e08 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 09:50:19 +0100 Subject: initial ieee1394 support --- debian/changelog | 4 +++- hook-functions | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d4858ff..8094038 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,7 +24,9 @@ initramfs-tools (0.53) unstable; urgency=high * mkinitramfs: When invoked with -r switch pass the hardcoded root device to /etc/mkinitramfs/conf.d/root inside the initramfs. - -- maximilian attems Mon, 27 Feb 2006 01:45:56 +0100 + * hook-functions: First shot at IEEE1394 support - add ohci1394 and sbp2. + + -- maximilian attems Mon, 27 Feb 2006 09:45:54 +0100 initramfs-tools (0.52b) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 9b0d949..040aea2 100644 --- a/hook-functions +++ b/hook-functions @@ -157,6 +157,11 @@ auto_add_modules() manual_add_modules "${x}" done ;; + ieee1394) + for x in ohci1394 sbp2; do + manual_add_modules "${x}" + done + ;; i2o) for x in i2o_block; do manual_add_modules "${x}" -- cgit v1.2.3 From 288e6e8f91ea7b05414853ded1f7568c4e7c3888 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 09:52:49 +0100 Subject: really set takeover=0 --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index 0c7b9e7..2093220 100644 --- a/update-initramfs +++ b/update-initramfs @@ -238,7 +238,7 @@ altered_check() # Defaults verbose=0 yes=0 -# We default to takeover=1 to allow hooks to update latest initramfs +# We default to takeover=1 in Ubuntu, but not Debian takeover=1 ## -- cgit v1.2.3 From 75b6694d4359db60f73416d1fe0c9e5bfb3ba812 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 27 Feb 2006 10:21:35 +0100 Subject: really install those compat scripts. changelog nitpicking --- debian/changelog | 6 +++--- debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8094038..b4cbb08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,9 +14,9 @@ initramfs-tools (0.53) unstable; urgency=high - scripts/functions: remove duplicate dir check. - scripts/nfs: add quiet to modules loading. - * Add kernel-package compat stuff, behaves like mkinitramfs, + * mkinitramfs-kpkg: Add kernel-package compat stuff, behaves like mkinitramfs, but adds the sha1sum for update-initramfs. Reset takeover=0. - (closes: #353809) + (closes: #353809) Add small mkinitramf-kpkg.8. * init: Move the ROOT export up, so we actually source the hardcoded device in initramfs.conf. (closes: #352958) @@ -26,7 +26,7 @@ initramfs-tools (0.53) unstable; urgency=high * hook-functions: First shot at IEEE1394 support - add ohci1394 and sbp2. - -- maximilian attems Mon, 27 Feb 2006 09:45:54 +0100 + -- maximilian attems Mon, 27 Feb 2006 10:20:03 +0100 initramfs-tools (0.52b) unstable; urgency=high diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 3a7a503..b722d90 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -1,4 +1,5 @@ mkinitramfs usr/sbin +mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/mkinitramfs diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 8a27566..f127e99 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,4 +1,5 @@ mkinitramfs.8 +mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 -- 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(-) 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 8e676d49ba216a80ca3294c9d1deb2c1cbb873af Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 28 Feb 2006 17:47:18 +0100 Subject: update copyright info --- debian/changelog | 4 +++- debian/copyright | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ccc474..7872991 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,9 @@ 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 + * debian/copyright: Meniton current bzr archive. (closes: #352738) + + -- maximilian attems Tue, 28 Feb 2006 17:43:57 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/debian/copyright b/debian/copyright index a40b722..d495248 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,9 +5,15 @@ Copyright: Author: Jeff Bailey -The source code can be found by using "bzr" at: +The source code up to 0.31 can be found by using "bzr" at: http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools +The current ubuntu release can be found at: +http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ + +The Debian tree is maintained with "bzr" at: +http://debian.stro.at/bzr-test/initramfs-tools/ + License: PUBLIC DOMAIN -- cgit v1.2.3 From 17ffd2765842d306dd1b7c996adf839b6a23d6ab Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 4 Mar 2006 00:06:59 +0100 Subject: add dac960 for alpha --- debian/changelog | 4 +++- hook-functions | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7872991..1f673bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,9 @@ initramfs-tools (0.54) unstable; urgency=low * debian/copyright: Meniton current bzr archive. (closes: #352738) - -- maximilian attems Tue, 28 Feb 2006 17:43:57 +0100 + * hook-function: Add dac960 scsi driver for alpha arch. (closes: #355162) + + -- maximilian attems Sat, 4 Mar 2006 00:05:35 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 040aea2..bdb657a 100644 --- a/hook-functions +++ b/hook-functions @@ -156,6 +156,12 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do manual_add_modules "${x}" done + case "${DPKG_ARCH}" in + alpha) + for x in dac960; do + manual_add_modules "${x}" + done + esac ;; ieee1394) for x in ohci1394 sbp2; do -- cgit v1.2.3 From 0d1c081c48fbfb69cbf6932e358971e7d29c45e1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 4 Mar 2006 00:20:03 +0100 Subject: merge ubunut udev hook. --- debian/changelog | 9 +++- scripts/init-premount/udev-helper | 38 ---------------- scripts/local-top/udev-helper | 95 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 39 deletions(-) delete mode 100755 scripts/init-premount/udev-helper create mode 100755 scripts/local-top/udev-helper diff --git a/debian/changelog b/debian/changelog index 1f673bc..e2a24de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,14 @@ initramfs-tools (0.54) unstable; urgency=low * hook-function: Add dac960 scsi driver for alpha arch. (closes: #355162) - -- maximilian attems Sat, 4 Mar 2006 00:05:35 +0100 + * scripts/local-top/udev-helper: moved from + scripts/init-premount/udev-helper, add code by Scott James Remnant + from the ubuntu udev hook. We now wait on scsi + and usb devices to settle, load ide-generic on ide boot only if + no root device appeared. + The udev hook is adding ide.agent so no longer duplicate that code. + + -- maximilian attems Sat, 4 Mar 2006 00:14:00 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/scripts/init-premount/udev-helper b/scripts/init-premount/udev-helper deleted file mode 100755 index 03a3fdf..0000000 --- a/scripts/init-premount/udev-helper +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -PREREQ="udev" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -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 diff --git a/scripts/local-top/udev-helper b/scripts/local-top/udev-helper new file mode 100755 index 0000000..8ae47d2 --- /dev/null +++ b/scripts/local-top/udev-helper @@ -0,0 +1,95 @@ +#!/bin/sh + +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + 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 + /sbin/modprobe -Qb 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 +;; -- cgit v1.2.3 From 493677ae27c577d0a78fc23ea644a680b0968b54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 17:33:40 +0100 Subject: split up the long lines in audo_add_modules add a bunch of needed modules --- debian/changelog | 23 ++++++++++++++++++----- hook-functions | 38 +++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index e2a24de..b83cd21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,20 +1,33 @@ initramfs-tools (0.54) unstable; urgency=low - * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. + * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. (closes: #354708) * debian/copyright: Meniton current bzr archive. (closes: #352738) - * hook-function: Add dac960 scsi driver for alpha arch. (closes: #355162) + * hook-function: Add dac960 scsi driver. (closes: #355162) - * scripts/local-top/udev-helper: moved from - scripts/init-premount/udev-helper, add code by Scott James Remnant + * scripts/local-top/udev_helper: moved from + scripts/init-premount/udev_helper, add code by Scott James Remnant from the ubuntu udev hook. We now wait on scsi and usb devices to settle, load ide-generic on ide boot only if no root device appeared. The udev hook is adding ide.agent so no longer duplicate that code. - -- maximilian attems Sat, 4 Mar 2006 00:14:00 +0100 + * hook-function: auto_add_modules, split 1000 char wide lines up. + Should allow better diffing. Splitting them out in proper files with + each modules / line costs too much initramfs generation time. + Should allow easier diffing. + + * modules.d/scsi: Add sata_mv thanks Kenshi Muto . + (closes: #355486) + + * hook-function: Add dasd class to auto_add_modules and dd zfcp module. + Thanks to s390 support Bastian Blank . (closes: #355595) + + * modules.d/ide: Add it821x. (closes #352460) + + -- maximilian attems Tue, 7 Mar 2006 00:49:46 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/hook-functions b/hook-functions index bdb657a..90986cb 100644 --- a/hook-functions +++ b/hook-functions @@ -133,35 +133,50 @@ dep_add_modules() } -# Modules that we always add to the initramfs +# The modules "most" classes added per default to the initramfs auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do manual_add_modules "${x}" done ;; net) - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx dl2k e1000 e100 epic100 eql fealnx famachi forcedeth hp100 mace mv643xx_eth natsemi ne2k-pci netconsole ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire sundance sungem sungem_phy sunhme tg3 tlan de2104x de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb typhon via-rhine via-velocity yellowfin; do + for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ + dl2k e1000 e100 epic100 eql fealnx famachi forcedeth \ + hp100 mace mv643xx_eth natsemi ne2k-pci netconsole \ + ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire \ + sundance sungem sungem_phy sunhme tg3 tlan de2104x \ + de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ + typhon via-rhine via-velocity yellowfin; do manual_add_modules "${x}" done ;; ide) - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 generic hpt34x hpt366 ns87415 opti621 pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks siimage sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ + amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ + generic hpt34x hpt366 it821x ns87415 opti621 pdc202xx_new \ + pdc202xx_old piix rz1000 sc1200 serverworks siimage \ + sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do manual_add_modules "${x}" done ;; scsi) - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic cciss ch dc395x dmx3191d dpt_i2o eata fdomain ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_promise sata_nv sata_qstor sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc scsi_mod scsi_transport_fc scsi_transport_iscsi scsi_transport_spi sd_mod sym53c8xx tmscsim; do + for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ + aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ + cciss ch dac960 dc395x dmx3191d dpt_i2o eata fdomain \ + ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ + megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ + mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 \ + qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ + sata_nv sata_promise sata_qstor sata_sil sata_sis sata_svw \ + sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ + scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ + sd_mod sym53c8xx tmscsim zfcp; do manual_add_modules "${x}" done - case "${DPKG_ARCH}" in - alpha) - for x in dac960; do - manual_add_modules "${x}" - done - esac ;; ieee1394) for x in ohci1394 sbp2; do @@ -179,6 +194,7 @@ auto_add_modules() auto_add_modules ide auto_add_modules scsi auto_add_modules i2o + auto_add_modules dasd ;; esac } -- cgit v1.2.3 From 65391c38c52dcbc0fab11340fd59ed83089d5cd5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 17:36:52 +0100 Subject: add the 0.53[bc] changesets: where takeover=0 and no '-' in script names --- debian/changelog | 15 ++++++- scripts/local-top/udev-helper | 95 ------------------------------------------- scripts/local-top/udev_helper | 95 +++++++++++++++++++++++++++++++++++++++++++ update-initramfs | 2 +- 4 files changed, 110 insertions(+), 97 deletions(-) delete mode 100755 scripts/local-top/udev-helper create mode 100755 scripts/local-top/udev_helper diff --git a/debian/changelog b/debian/changelog index b83cd21..f6db559 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,7 +27,20 @@ initramfs-tools (0.54) unstable; urgency=low * modules.d/ide: Add it821x. (closes #352460) - -- maximilian attems Tue, 7 Mar 2006 00:49:46 +0100 + -- maximilian attems Wed, 8 Mar 2006 17:34:25 +0100 + +initramfs-tools (0.53c) unstable; urgency=low + + * update-initramfs: Really reset takeover to zero. + + -- maximilian attems Mon, 6 Mar 2006 07:59:34 +0100 + +initramfs-tools (0.53b) unstable; urgency=low + + * scripts/init-premount/udev_helper: Renamed from udev-helper. + Thanks to Tollef Fog Heen (closes: #355235) + + -- maximilian attems Sat, 4 Mar 2006 15:26:13 +0100 initramfs-tools (0.53) unstable; urgency=high diff --git a/scripts/local-top/udev-helper b/scripts/local-top/udev-helper deleted file mode 100755 index 8ae47d2..0000000 --- a/scripts/local-top/udev-helper +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh - -PREREQ="udev" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - 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 - /sbin/modprobe -Qb 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-top/udev_helper b/scripts/local-top/udev_helper new file mode 100755 index 0000000..8ae47d2 --- /dev/null +++ b/scripts/local-top/udev_helper @@ -0,0 +1,95 @@ +#!/bin/sh + +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + 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 + /sbin/modprobe -Qb 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/update-initramfs b/update-initramfs index 2093220..2e39ed0 100644 --- a/update-initramfs +++ b/update-initramfs @@ -239,7 +239,7 @@ altered_check() verbose=0 yes=0 # We default to takeover=1 in Ubuntu, but not Debian -takeover=1 +takeover=0 ## -- cgit v1.2.3 From f5e3b39c44184f553d750ea889fb30eb3978375c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 17:54:00 +0100 Subject: really add the dasd modules; remove superflous ';' --- hook-functions | 5 +++++ scripts/local-top/udev_helper | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 90986cb..03eb87d 100644 --- a/hook-functions +++ b/hook-functions @@ -188,6 +188,11 @@ auto_add_modules() manual_add_modules "${x}" done ;; + dasd) + for x in dasd_eckd_mod dasd_fba_mod; do + manual_add_modules "${x}" + done + ;; *) auto_add_modules base auto_add_modules net diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 8ae47d2..22cd9f7 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -92,4 +92,3 @@ scsi) fi ;; esac -;; -- cgit v1.2.3 From f835fe173312291924661646febed813cfeaaa4f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Mar 2006 18:15:21 +0100 Subject: remove useless prerequs --- scripts/local-top/udev_helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 22cd9f7..b501ec0 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="udev" +PREREQ="" prereqs() { -- cgit v1.2.3 From ff26ba49cc41fae343e9acc9af486ee8d3e6b1ba Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Mar 2006 10:19:55 +0100 Subject: fix wrong modprobe args --- debian/changelog | 7 +++++++ scripts/local-top/udev_helper | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f6db559..d18c9d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.55) unstable; urgency=low + + * scripts/local-top/udev_helper: Fix modprobe args. + Thanks Frans Pop . + + -- maximilian attems Fri, 10 Mar 2006 01:13:33 +0100 + initramfs-tools (0.54) unstable; urgency=low * hooks/lvm: lvm10 has also an vgchange - exit if no lvm2 libs. diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index b501ec0..8abcb2b 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -61,7 +61,7 @@ ide) # 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 - /sbin/modprobe -Qb ide-generic + modprobe -q ide-generic fi ;; -- cgit v1.2.3 From 161cd9fd2df641037edf53d72d096b0f87dd06f1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Mar 2006 10:21:02 +0100 Subject: use quiet for fs module loading --- debian/changelog | 4 +++- scripts/local | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d18c9d0..eec885d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,9 @@ initramfs-tools (0.55) unstable; urgency=low * scripts/local-top/udev_helper: Fix modprobe args. Thanks Frans Pop . - -- maximilian attems Fri, 10 Mar 2006 01:13:33 +0100 + * scripts/local: Use quiet to load the fs. (closes: #339092) + + -- maximilian attems Tue, 14 Mar 2006 10:20:03 +0100 initramfs-tools (0.54) unstable; urgency=low diff --git a/scripts/local b/scripts/local index 979f07d..917528a 100644 --- a/scripts/local +++ b/scripts/local @@ -25,7 +25,7 @@ mountroot () fi # FIXME This has no error checking - modprobe ${FSTYPE} + modprobe -q ${FSTYPE} # FIXME This has no error checking # Mount root -- cgit v1.2.3 From c4a1c8838be207397a4c676db729ed9de416bbba Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Mar 2006 10:32:48 +0100 Subject: fix firewire booting --- debian/changelog | 5 ++++- hook-functions | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index eec885d..24506a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,10 @@ initramfs-tools (0.55) unstable; urgency=low * scripts/local: Use quiet to load the fs. (closes: #339092) - -- maximilian attems Tue, 14 Mar 2006 10:20:03 +0100 + * hook-functions: Really add the ieee1394 modules. + Thanks to Michael Prokop for testing the fix. + + -- maximilian attems Tue, 14 Mar 2006 10:21:34 +0100 initramfs-tools (0.54) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 03eb87d..859f1c6 100644 --- a/hook-functions +++ b/hook-functions @@ -200,6 +200,7 @@ auto_add_modules() auto_add_modules scsi auto_add_modules i2o auto_add_modules dasd + auto_add_modules ieee1394 ;; esac } -- cgit v1.2.3 From 9c42241824afb2759d22d2cf7962fb2ce534e0dd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 14 Mar 2006 10:43:28 +0100 Subject: udev stuff needs to be in scripts/init-premount only do the block device hacks on local boot --- debian/changelog | 3 +- scripts/init-premount/udev_helper | 103 ++++++++++++++++++++++++++++++++++++++ scripts/local-top/udev_helper | 94 ---------------------------------- 3 files changed, 104 insertions(+), 96 deletions(-) create mode 100755 scripts/init-premount/udev_helper delete mode 100755 scripts/local-top/udev_helper diff --git a/debian/changelog b/debian/changelog index 24506a6..8f2f7ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,8 +19,7 @@ initramfs-tools (0.54) unstable; urgency=low * hook-function: Add dac960 scsi driver. (closes: #355162) - * scripts/local-top/udev_helper: moved from - scripts/init-premount/udev_helper, add code by Scott James Remnant + * scripts/init-premount/udev_helper: add code by Scott James Remnant from the ubuntu udev hook. We now wait on scsi and usb devices to settle, load ide-generic on ide boot only if no root device appeared. diff --git a/scripts/init-premount/udev_helper b/scripts/init-premount/udev_helper new file mode 100755 index 0000000..f2bc204 --- /dev/null +++ b/scripts/init-premount/udev_helper @@ -0,0 +1,103 @@ +#!/bin/sh + +PREREQ="udev" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# 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-top/udev_helper b/scripts/local-top/udev_helper deleted file mode 100755 index 8abcb2b..0000000 --- a/scripts/local-top/udev_helper +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - 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 -- cgit v1.2.3 From b34fe26dd06da3daa40a75a853a96c2013fcfc18 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 15 Mar 2006 09:58:00 +0100 Subject: run lilo if no grub is around. --- debian/changelog | 8 ++++++-- update-initramfs | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8f2f7ea..1571265 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,10 +5,14 @@ initramfs-tools (0.55) unstable; urgency=low * scripts/local: Use quiet to load the fs. (closes: #339092) - * hook-functions: Really add the ieee1394 modules. + * hook-functions: Really add the ieee1394 modules. Thanks to Michael Prokop for testing the fix. - -- maximilian attems Tue, 14 Mar 2006 10:21:34 +0100 + * update-initramfs: Run lilo on updates if no grub is around. + Thanks Adeodato Simó for finding the issue. + (Closes: #356850) + + -- maximilian attems Wed, 15 Mar 2006 09:55:22 +0100 initramfs-tools (0.54) unstable; urgency=low diff --git a/update-initramfs b/update-initramfs index 2e39ed0..08a2f3a 100644 --- a/update-initramfs +++ b/update-initramfs @@ -67,6 +67,20 @@ generate_initramfs() set_sha1 } +# only run lilo if no grub is around +run_bootloader() +{ + if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then + return 0 + fi + if [ -e /etc/lilo.conf ]; then + lilo -t > /dev/null + if [ $? -eq 0 ]; then + lilo + fi + fi +} + compare_sha1() { sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1 @@ -199,6 +213,8 @@ update() generate_initramfs + run_bootloader + } delete() -- cgit v1.2.3 From 64a2b7212bd6f2cddf29b465cf3ced6f2e0fc807 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 15 Mar 2006 11:42:52 +0100 Subject: fix changelog for 0.55 release --- debian/changelog | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1571265..3edb850 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ initramfs-tools (0.55) unstable; urgency=low - * scripts/local-top/udev_helper: Fix modprobe args. - Thanks Frans Pop . + * scripts/init-premount/udev_helper: Fix modprobe args. + Thanks Frans Pop for testing 0.54. * scripts/local: Use quiet to load the fs. (closes: #339092) @@ -12,7 +12,7 @@ initramfs-tools (0.55) unstable; urgency=low Thanks Adeodato Simó for finding the issue. (Closes: #356850) - -- maximilian attems Wed, 15 Mar 2006 09:55:22 +0100 + -- maximilian attems Wed, 15 Mar 2006 11:29:12 +0100 initramfs-tools (0.54) unstable; urgency=low @@ -21,7 +21,7 @@ initramfs-tools (0.54) unstable; urgency=low * debian/copyright: Meniton current bzr archive. (closes: #352738) - * hook-function: Add dac960 scsi driver. (closes: #355162) + * hook-functions: Add dac960 scsi driver. (closes: #355162) * scripts/init-premount/udev_helper: add code by Scott James Remnant from the ubuntu udev hook. We now wait on scsi @@ -29,18 +29,18 @@ initramfs-tools (0.54) unstable; urgency=low no root device appeared. The udev hook is adding ide.agent so no longer duplicate that code. - * hook-function: auto_add_modules, split 1000 char wide lines up. + * hook-functions: auto_add_modules, split 1000 char wide lines up. Should allow better diffing. Splitting them out in proper files with each modules / line costs too much initramfs generation time. Should allow easier diffing. - * modules.d/scsi: Add sata_mv thanks Kenshi Muto . + * hook-functions: Add sata_mv thanks Kenshi Muto . (closes: #355486) - * hook-function: Add dasd class to auto_add_modules and dd zfcp module. + * hook-functions: Add dasd class to auto_add_modules and dd zfcp module. Thanks to s390 support Bastian Blank . (closes: #355595) - * modules.d/ide: Add it821x. (closes #352460) + * hook-functions: Add it821x. (closes #352460) -- maximilian attems Wed, 8 Mar 2006 17:34:25 +0100 -- 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(-) 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 41f695c8066c3d4955049d547b16aaf06273c20f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 19 Mar 2006 23:54:27 +0100 Subject: fix bug nr. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c67e009..8abea21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,7 +12,7 @@ initramfs-tools (0.56) unstable; urgency=low * scripts/init-premount/udev_helper: Source the relevant definition to get it really run. Thanks to Maurice Massar . - (closes: #354458) + (closes: #357450) -- maximilian attems Fri, 17 Mar 2006 19:09:11 +0100 -- cgit v1.2.3 From 0318bb9b8e61f0a4c9d89ec678a75f6f7ea8c5d5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Mar 2006 12:25:50 +0100 Subject: add verbose mode for mkinitramfs, use it when calling it display which modules gets added, we might want to have even more verbose info, but that is a nice start. add cpqarray module document `-' filename restriction don't exit succesfully if root fs full --- debian/changelog | 17 +++++++++++++++++ hook-functions | 5 ++++- initramfs-tools.8 | 6 +++++- mkinitramfs | 11 ++++++++--- update-initramfs | 6 +++++- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8abea21..bfbd682 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.57) unstable; urgency=low + + * mkinitramfs, update-initramfs, hook-functions: + On verbose mode show, which modules gets added to the initramfs. + + * hook-functions: Add cpqarray to the scsi modules - thanks for the patch + to Petter Reinholdtsen . (closes: #357980) + + * initramfs-tools.8: Document that `-' is not allowed to be used in a script + filename - the filenames get used as shell variable. (closes: #355235) + + * mkinitramfs: Don't exit succesfully in a case of a full fs. Leaves the + linux-image unconfigured. Thanks martin f krafft + for pointing to that potential boot failure. (closes: #350875) + + -- maximilian attems Tue, 21 Mar 2006 11:56:29 +0100 + initramfs-tools (0.56) unstable; urgency=low * hooks/md: Add linear module - thanks to Moshe Yudkowsky . diff --git a/hook-functions b/hook-functions index 859f1c6..efce32d 100644 --- a/hook-functions +++ b/hook-functions @@ -48,6 +48,9 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" + if [ -n "${verbose}" -a "${verbose}" = "y" ]; then + echo "Adding module ${mam_x}" + fi done } @@ -166,7 +169,7 @@ auto_add_modules() scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ - cciss ch dac960 dc395x dmx3191d dpt_i2o eata fdomain \ + cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 \ diff --git a/initramfs-tools.8 b/initramfs-tools.8 index a08ef1b..991cff9 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -16,7 +16,11 @@ image itself. They can however cause files to be included in the image. .SS Boot scripts These are included in the initramfs image and normally executed during kernel boot in the early user-space before the root partition has been -mounted. +mounted. + +initramfs-tools uses shell variable names for handling dependencies. +Notice that `-' is not a valid shell variable name and thus should +not be used as script filename. .SH INIT SCRIPT The script which is executed first and is in charge of running all other diff --git a/mkinitramfs b/mkinitramfs index a72865b..b7de71b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -10,7 +10,7 @@ errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" BUSYBOXDIR="/bin" -OPTIONS=`getopt -o d:ko:r: --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` +OPTIONS=`getopt -o d:ko:r:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -40,6 +40,10 @@ while true; do ROOT="$2" shift 2 ;; + -v) + verbose="y" + shift + ;; --supported-host-version) supported_host_version="$2" shift 2 @@ -142,6 +146,7 @@ export version export CONFDIR export DESTDIR export DPKG_ARCH +export verbose # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ @@ -210,10 +215,10 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / fi -(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") +(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then - cat "${__TMPCPIOGZ}" >>"${outfile}" + cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 fi if [ "${keep}" = "y" ]; then diff --git a/update-initramfs b/update-initramfs index 08a2f3a..9b69981 100644 --- a/update-initramfs +++ b/update-initramfs @@ -63,7 +63,11 @@ set_initramfs() generate_initramfs() { verbose "Generating ${initramfs}" - mkinitramfs -o "${initramfs}" "${version}" + OPTS="-o" + if [ "${verbose}" = 1 ]; then + OPTS="-v $OPTS" + fi + mkinitramfs $OPTS "${initramfs}" "${version}" set_sha1 } -- cgit v1.2.3 From 4b5cc6ce7567a7075802dd8c3e47dd7cf8e84627 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 26 Mar 2006 21:09:50 +0200 Subject: fix copyright module-init-tools dep gdth lilo minor parsing fixes --- debian/changelog | 28 ++++++++++++++++++++++++++-- debian/control | 2 +- debian/copyright | 13 ++++++++++--- hook-functions | 4 ++-- mkinitramfs-kpkg | 3 ++- scripts/functions | 7 ++++++- 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index bfbd682..a2e8cef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,28 @@ -initramfs-tools (0.57) unstable; urgency=low +initramfs-tools (0.59) unstable; urgency=low + + * debian/copyright: Add years of copyright and authors. + + -- maximilian attems Sun, 26 Mar 2006 21:04:28 +0200 + +initramfs-tools (0.58) unstable; urgency=low + + * hook-functions: Be more carefull about the minor parsing. The fix of + #357332 works for 3 digit roots, but not for hdc6 aka root=1606. + Thanks Martijn Pieters for report + (closes: #358354, #358740). + + * hook-functions: Add gdth to the scsi modules. + + * mkinitramfs-kpkg: Use set -eu to capture full /boot. + Really (closes: #350875) + + * Add dependency on module-init-tools. (closes: #358632) + + * Don't include full path for man page reference. (closes: #358371) + + -- maximilian attems Sun, 26 Mar 2006 16:39:37 +0200 + +initramfs-tools (0.57b) unstable; urgency=low * mkinitramfs, update-initramfs, hook-functions: On verbose mode show, which modules gets added to the initramfs. @@ -7,7 +31,7 @@ initramfs-tools (0.57) unstable; urgency=low to Petter Reinholdtsen . (closes: #357980) * initramfs-tools.8: Document that `-' is not allowed to be used in a script - filename - the filenames get used as shell variable. (closes: #355235) + filename - the filenames get used as shell variable. (closes: #344639) * mkinitramfs: Don't exit succesfully in a case of a full fs. Leaves the linux-image unconfigured. Thanks martin f krafft diff --git a/debian/control b/debian/control index b4124ab..01ddf3b 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.076-5) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/debian/copyright b/debian/copyright index d495248..3a3bc5b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,9 +1,7 @@ This package was debianized by Jeff Bailey on Thu, 27 Jan 2005 15:23:52 -0500. -Copyright: - -Author: Jeff Bailey +The current Debian maintainer is maximilian attems The source code up to 0.31 can be found by using "bzr" at: http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools @@ -14,6 +12,15 @@ http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ The Debian tree is maintained with "bzr" at: http://debian.stro.at/bzr-test/initramfs-tools/ +Authors: Jeff Bailey , Adam Conrad , + Scott James Remnant , + maximilian attems + +Copyright: 2005 Jeff Bailey + 2005 - 2006 Adam Conrad + 2005 - 2006 Scott James Remnant + 2005 - 2006 maximilian attems + License: PUBLIC DOMAIN diff --git a/hook-functions b/hook-functions index efce32d..874d55f 100644 --- a/hook-functions +++ b/hook-functions @@ -170,7 +170,7 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ - ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ + gdth ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 \ qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ @@ -220,7 +220,7 @@ Options: -o outfile Write to outfile. -r root Override ROOT setting in mkinitrd.conf. -See ${0}(8) for further details. +See mkinitramfs(8) for further details. EOF exit 1 diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index d36710a..8d32005 100644 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -1,4 +1,5 @@ #!/bin/sh +set -eu STATEDIR=/var/lib/initramfs-tools @@ -10,7 +11,7 @@ Usage: ${0} <-o outfile> [version] Please use update-initramfs(8): ${0} exists for compatibility by kernel-package(5) calls. -See ${0}(8) for further details. +See mkinitramfs-kpkg(8) for further details. EOF exit 1 } diff --git a/scripts/functions b/scripts/functions index 05b7779..8cf6ddc 100644 --- a/scripts/functions +++ b/scripts/functions @@ -189,6 +189,7 @@ load_modules() fi } +# lilo compatibility parse_numeric() { case $1 in "") @@ -201,10 +202,14 @@ parse_numeric() { minor=${1#*:} major=${1%:*} ;; - *) + [0-9][0-9][0-9]) minor=$((0x${1#?})) major=$((0x${1%??})) ;; + *) + minor=$((0x${1#??})) + major=$((0x${1%??})) + ;; esac mknod /dev/root b ${major} ${minor} -- cgit v1.2.3 From 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 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 7f7832004e1fe8b9a13afb2ac765f4f611ffc6ed Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 28 Mar 2006 18:36:16 +0200 Subject: fix not initialized variables --- debian/changelog | 7 +++++++ mkinitramfs-kpkg | 3 +++ 2 files changed, 10 insertions(+) mode change 100644 => 100755 mkinitramfs-kpkg diff --git a/debian/changelog b/debian/changelog index 93b55c4..757a015 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.59b) unstable; urgency=low + + * mkinitramfs-kpkg: Intialialize the variables. + (closes: #359355, #359620, #359613, #359666, #359681) + + -- maximilian attems Tue, 28 Mar 2006 16:30:59 +0200 + initramfs-tools (0.59) unstable; urgency=low * debian/copyright: Add years of copyright and authors. diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg old mode 100644 new mode 100755 index 8d32005..437b0ac --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -2,6 +2,9 @@ set -eu STATEDIR=/var/lib/initramfs-tools +supported_host_version="" +supported_target_version="" +outfile="" usage() { -- cgit v1.2.3 From c29d49d84418075e1887c965d978c7cc0e07a95f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 18 Apr 2006 13:44:02 +0200 Subject: 0.60: - bug script - cryptoroot support - change exported variables - nfsopts, rootflags support - warn lilo+grub install - doc fixes --- debian/bug | 3 +++ debian/changelog | 32 ++++++++++++++++++++++++++++++++ debian/initramfs-tools.install | 1 + init | 18 ++++++++++++++---- initramfs-tools.8 | 9 ++++++++- mkinitramfs-kpkg.8 | 5 +++-- scripts/functions | 4 ++++ scripts/local | 2 +- update-initramfs | 11 +++++++++-- 9 files changed, 75 insertions(+), 10 deletions(-) create mode 100755 debian/bug mode change 100644 => 100755 update-initramfs diff --git a/debian/bug b/debian/bug new file mode 100755 index 0000000..fda2017 --- /dev/null +++ b/debian/bug @@ -0,0 +1,3 @@ +cat /proc/cmdline >&3 +grep -v nodev /proc/filesystems >&3 +lsmod >&3 diff --git a/debian/changelog b/debian/changelog index 757a015..4c773aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,35 @@ +initramfs-tools (0.60) unstable; urgency=low + + "E ho trovato l'invasor" + + * scripts/functions: Allow boot scripts to modify exported boot parameters. + Thanks David Härdeman for the patch. (closes: 348147) + This allows the inclusion of cryptoroot hooks to cryptsetup! + + * init: add cryptopts parsing and export. + + * init: Move parse_numeric down to the "mounting root" block. + + * init, scripts/local: Allow rootflags to be passed in kernel cmdline. + Thanks Thomas Luzat for the patch. (closes: #358917) + + * init: Allow passing nfs root mount option in kernel cmdline. Thanks + Brian Brunswick for the patch. (closes: #358649) + + * update-initramfs: s/ALL/all/, fix it to actually run on update in non + verbose mode. (closes: #362568) + + * update-initramfs: Warn in big letters about grub and lilo installs. + (closes: #362816) + + * debian/bug: Add reportbug script with info about cmdline, fs and lsmod. + + * initramfs-tools(8): Document the /conf/param.conf feature. + + * mkinitramfs-kpkg(8): Spell out, why the wrapper script is needed. + + -- maximilian attems Tue, 18 Apr 2006 13:33:18 +0200 + initramfs-tools (0.59b) unstable; urgency=low * mkinitramfs-kpkg: Intialialize the variables. diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index b722d90..9a4f31e 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -6,3 +6,4 @@ conf/initramfs.conf etc/mkinitramfs hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools update-initramfs usr/sbin +debian/bug usr/share/bug/initramfs-tools diff --git a/init b/init index f69b3e8..04b7602 100755 --- a/init +++ b/init @@ -39,6 +39,8 @@ export readonly=y export resume=${RESUME} export rootmnt=/root export debug= +export cryptopts=${CRYPTOPTS} + for x in $(cat /proc/cmdline); do case $x in init=*) @@ -55,8 +57,17 @@ for x in $(cat /proc/cmdline); do ;; esac ;; + rootflags=*) + ROOTFLAGS="-o ${x#rootflags=}" + ;; + cryptopts=*) + cryptopts="${x#cryptopts=}" + ;; nfsroot=*) - NFSROOT=${x#nfsroot=} + NFSROOT="${x#nfsroot=}" + ;; + nfsopts=*) + NFSOPTS="-o ${x#nfsopts=}" ;; boot=*) BOOT=${x#boot=} @@ -93,9 +104,6 @@ maybe_break top # Don't do log messages here to avoid confusing usplash run_scripts /scripts/init-top -. /scripts/${BOOT} -parse_numeric ${ROOT} - maybe_break modules log_begin_msg "Loading essential drivers..." load_modules @@ -108,6 +116,8 @@ log_end_msg maybe_break mount log_begin_msg "Mounting root file system..." +. /scripts/${BOOT} +parse_numeric ${ROOT} mountroot log_end_msg diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 991cff9..f0077ec 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -118,7 +118,7 @@ adds a module (and any modules which it depends on) to the initramfs image. .RS .PP .B Example: -manual_add_modules reiserfs +manual_add_modules isofs .RE .TP @@ -314,6 +314,13 @@ are the last scripts to be executed before procfs and sysfs are moved to the real rootfs and execution is turned over to the init binary which should now be found in the mounted rootfs. +.SS Boot parameters +.TP +\fB \fI +/conf/param.conf +allows boot scripts to change exported variables that are listed on top of init. Write the new values to it. It will be sourced after an boot script run if it exists. + + .SH EXAMPLES .SS Hook script diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 34f76db..0bdc1dc 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -19,9 +19,10 @@ The .B mkinitramfs-kpkg script calls .B mkinitramfs -for kernel-package. It's usage is not recommended. +as wrapper script for kernel-package. It preservers the old mkinitrd calling +conventions. It's usage is not recommended. See -.B update-initramfs +.B update-initramfs (8) for an better alternative. .SH OPTIONS diff --git a/scripts/functions b/scripts/functions index 8cf6ddc..96a5577 100644 --- a/scripts/functions +++ b/scripts/functions @@ -161,6 +161,10 @@ call_scripts() { for cs_x in ${runlist}; do ${initdir}/${cs_x} + # allow boot scripts to modify exported boot paramaters + if [ -e /conf/param.conf ]; then + . /conf/param.conf + fi done } diff --git a/scripts/local b/scripts/local index dd5924d..25aca70 100644 --- a/scripts/local +++ b/scripts/local @@ -53,7 +53,7 @@ mountroot () # FIXME This has no error checking # Mount root - mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt} + mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom" run_scripts /scripts/local-bottom diff --git a/update-initramfs b/update-initramfs old mode 100644 new mode 100755 index 9b69981..488806f --- a/update-initramfs +++ b/update-initramfs @@ -14,7 +14,7 @@ usage() Usage: ${0} [OPTION]... Options: - -k [version] Specify kernel version or ALL + -k [version] Specify kernel version or all -c Create a new initramfs -u Update an existing initramfs -d Remove an existing initramfs @@ -75,6 +75,13 @@ generate_initramfs() run_bootloader() { if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then + if [ -e /etc/lilo.conf ]; then + 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 if [ -e /etc/lilo.conf ]; then @@ -205,7 +212,7 @@ update() fi # Don't stop if one version doesn't work. set +e - "${0}" "${vflag}" -u -k "${u_version}" + "${0}" -u -k "${u_version}" ${vflag} set -e done exit 0 -- cgit v1.2.3 From 02b32f0a24c8e0724bca66ef57f144c4d708dce2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 20 May 2006 12:14:44 +0200 Subject: - mv /etc/mkinitramfs /etc/initramfs-tools upgrade handling on preinst - update TODO - update bug script --- debian/TODO | 6 +++--- debian/bug | 18 +++++++++++++++--- debian/changelog | 32 ++++++++++++++++++++++++++++++++ debian/control | 4 ++-- debian/initramfs-tools.dirs | 22 +++++++++++----------- debian/initramfs-tools.install | 2 +- debian/initramfs-tools.postinst | 12 ++++++------ debian/initramfs-tools.postrm | 4 ++-- debian/initramfs-tools.preinst | 25 +++++++++++++++++++++---- init | 6 +++++- initramfs-tools.8 | 20 ++++++++++---------- mkinitramfs | 2 +- mkinitramfs.8 | 6 +++--- 13 files changed, 112 insertions(+), 47 deletions(-) diff --git a/debian/TODO b/debian/TODO index 1f187ae..2c2edc0 100644 --- a/debian/TODO +++ b/debian/TODO @@ -3,12 +3,12 @@ TODO o Grep for TODO and FIXME and do those. =) - o Eliminate ?udev?, klibc. + o Eliminate ?udev?, ?klibc?, busybox (-> glibc). o Support list and dep options o Default to dep for PPC - Possibly to detect newworld? - o External hooks support for evms + o lilo timeouts handling - o Support cryptoroot + o mdadm + lvm2 hooks to their respective packages diff --git a/debian/bug b/debian/bug index fda2017..b1b477d 100755 --- a/debian/bug +++ b/debian/bug @@ -1,3 +1,15 @@ -cat /proc/cmdline >&3 -grep -v nodev /proc/filesystems >&3 -lsmod >&3 +#!/bin/sh + +exec >&3 + +echo "-- /proc/cmdline" +cat /proc/cmdline +echo + +echo "-- /proc/filesystems" +grep -v nodev /proc/filesystems +echo + +echo "-- lsmod" +lsmod +echo diff --git a/debian/changelog b/debian/changelog index 4c773aa..4a02bdc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,35 @@ +initramfs-tools (0.61) unstable; urgency=low + + Release "O partigiano portami via" + + * debian/TODO: update to latest state. + + * debian/bug: Fix reportbug script shebang line, add some descriptive echos. + + * debian/control: Pump to 3.7.2 standard version without changes. + + * init: Use 10M as tmpfs_size for the udev /dev. (closes: #352434) + + * /etc/initramfs-tools: Use the much more intituive conf dir location. + Thanks for the idea to Andres Salomon . + + * debian/initramfs-tools.preinst: mv /etc/mkinitramfs /etc/initramfs-tools + on upgrade as this should work even with drive space issues. + Thanks to Jeff Bailey for the posix atomic + mv hint and Daniel Blaschke for testing. + + * mkinitramfs: Set CONFDIR to /etc/initramfs-tools. + + * mkinitramfs.8, initramfs-tools.8: Document the new pathes. + + * debian/control: Change Build-depends-indep to Build-depends as we need + debhelper and cdbs for the clean target, fulfills policy 7.6. + + * debian/initramfs-tools.preinst: Warn and bail out if /etc/initramfs-tools + already exists. + + -- maximilian attems Thu, 18 May 2006 17:27:44 +0200 + initramfs-tools (0.60) unstable; urgency=low "E ho trovato l'invasor" diff --git a/debian/control b/debian/control index 01ddf3b..bf022d9 100644 --- a/debian/control +++ b/debian/control @@ -3,8 +3,8 @@ Section: utils Priority: optional Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team -Build-Depends-Indep: debhelper (>= 4.1.0), cdbs -Standards-Version: 3.6.2.0 +Build-Depends: debhelper (>= 4.1.0), cdbs +Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index 9325057..0a807a5 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -1,13 +1,13 @@ -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 -etc/mkinitramfs/conf.d +etc/initramfs-tools/scripts/init-bottom +etc/initramfs-tools/scripts/init-premount +etc/initramfs-tools/scripts/init-top +etc/initramfs-tools/scripts/local-bottom +etc/initramfs-tools/scripts/local-premount +etc/initramfs-tools/scripts/local-top +etc/initramfs-tools/scripts/nfs-bottom +etc/initramfs-tools/scripts/nfs-premount +etc/initramfs-tools/scripts/nfs-top +etc/initramfs-tools/hooks +etc/initramfs-tools/conf.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 9a4f31e..a5b87df 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -2,7 +2,7 @@ mkinitramfs usr/sbin mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools -conf/initramfs.conf etc/mkinitramfs +conf/initramfs.conf etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools update-initramfs usr/sbin diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 63ceef8..94c5c1b 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -14,29 +14,29 @@ if [ "$1" = configure ]; then fi if [ -e /etc/mkinitrd/modules ]; then - cp /etc/mkinitrd/modules /etc/mkinitramfs + cp /etc/mkinitrd/modules /etc/initramfs-tools sed -i \ -e 's/mkinitrd/mkinitramfs/g' \ -e '/^ide-generic/d' \ -e '/^ide-disk/d' \ -e '/^ext2/d' \ -e '/^ext3/d' \ - /etc/mkinitramfs/modules + /etc/initramfs-tools/modules fi if [ -e ${RESUME} ]; then - echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume + echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume fi if [ -e /etc/mkinitrd/DSDT ]; then - cp /etc/mkinitrd/DSDT /etc/mkinitramfs/DSDT.aml + cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi fi fi -if [ ! -e /etc/mkinitramfs/modules ]; then - cp /usr/share/doc/initramfs-tools/examples/modules /etc/mkinitramfs/ +if [ ! -e /etc/initramfs-tools/modules ]; then + cp /usr/share/doc/initramfs-tools/examples/modules /etc/initramfs-tools/ fi # Regenerate initramfs on upgrade diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 0c2d39a..b711f2c 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -1,8 +1,8 @@ #!/bin/sh if [ "x${1}" = "xpurge" ]; then - rm -f /etc/mkinitramfs/modules - rm -f /etc/mkinitramfs/conf.d/resume + rm -f /etc/initramfs-tools/modules + rm -f /etc/initramfs-tools/conf.d/resume fi #DEBHELPER# diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 3582290..3ec83c6 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -2,13 +2,30 @@ set -e -[ -f /etc/mkinitramfs/initramfs.conf ] && . /etc/mkinitramfs/initramfs.conf +case "$1" in + upgrade) + if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then + if [ -d /etc/initramfs-tools ]; then + echo + echo "Warning: /etc/initramfs-tools already exists." + echo " Please remove it for upgrade." + echo + exit 1 + fi + if [ -d /etc/mkinitramfs ]; then + mv /etc/mkinitramfs /etc/initramfs-tools + fi + fi + ;; +esac + +[ -f /etc/initramfs-tools/initramfs.conf ] && . /etc/initramfs-tools/initramfs.conf if [ -z ${RESUME} ]; then exit 0 else - mkdir -p /etc/mkinitramfs/conf.d - echo "RESUME=${RESUME}" > /etc/mkinitramfs/conf.d/resume - sed -i -e "s/RESUME=.*/#RESUME=/" /etc/mkinitramfs/initramfs.conf + mkdir -p /etc/initramfs-tools/conf.d + echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume + sed -i -e "s/RESUME=.*/#RESUME=/" /etc/initramfs-tools/initramfs.conf fi #DEBHELPER# diff --git a/init b/init index 04b7602..5e2084f 100755 --- a/init +++ b/init @@ -11,7 +11,11 @@ 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 +tmpfs_size="10M" +if [ -e /etc/udev/udev.conf ]; then + . /etc/udev/udev.conf +fi +mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev touch /dev/.initramfs-tools mkdir /dev/.initramfs mknod /dev/console c 5 1 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index f0077ec..b0a9f32 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -75,7 +75,7 @@ spawns a shell in the initramfs image at chosen run-time .SH HOOK SCRIPTS Hooks can be found in two places: /usr/share/initramfs-tools/hooks and -/etc/mkinitramfs/hooks. They are executed during generation of the +/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. @@ -174,9 +174,9 @@ increase its size by several hundred kilobytes. .SH BOOT SCRIPTS Similarly to hook scripts, boot scripts can be found in two places -/usr/share/initramfs-tools/scripts/ and /etc/mkinitramfs/scripts/. There are a -number of subdirectories to these two directories which control the boot stage -at which the scripts are executed. +/usr/share/initramfs-tools/scripts/ and /etc/initramfs-tools/scripts/. There +are a number of subdirectories to these two directories which control the boot +stage at which the scripts are executed. .SS Header Like for hook scripts, there are no guarantees as to the order in which the @@ -271,8 +271,8 @@ panic "Frobnication failed" .RE .SS Subdirectories -Both /usr/share/initramfs-tools/scripts and /etc/mkinitramfs/scripts contains -the following subdirectories. +Both /usr/share/initramfs-tools/scripts and /etc/initramfs-tools/scripts +contains the following subdirectories. .TP \fB \fI @@ -285,8 +285,8 @@ No other device files are present yet. \fB \fI init-premount runs the udev hooks for populating the /dev tree (udev will keep running until -init-bottom) after modules specified by hooks and /etc/mkinitramfs/modules have -been loaded. +init-bottom) after modules specified by hooks and /etc/initramfs-tools/modules +have been loaded. .TP \fB \fI @@ -325,7 +325,7 @@ allows boot scripts to change exported variables that are listed on top of init. .SS Hook script An example hook script would look something like this (and would usually be -placed in /etc/mkinitramfs/hooks/frobnicate): +placed in /etc/initramfs-tools/hooks/frobnicate): .RS .nf @@ -359,7 +359,7 @@ exit 0 .RE .SS Boot script -An example boot script would look something like this (and would usually be placed in /etc/mkinitramfs/scripts/local-top/frobnicate): +An example boot script would look something like this (and would usually be placed in /etc/initramfs-tools/scripts/local-top/frobnicate): .RS .nf diff --git a/mkinitramfs b/mkinitramfs index b7de71b..05800bb 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -4,7 +4,7 @@ umask 0022 # Defaults keep="n" -CONFDIR="/etc/mkinitramfs" +CONFDIR="/etc/initramfs-tools" verbose="n" errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 539c4c0..49b606f 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -67,20 +67,20 @@ This option queries if mkinitramfs can create ramdisks for kernel version .SH FILES .TP -.I /etc/mkinitramfs/initramfs.conf +.I /etc/initramfs-tools/initramfs.conf The default configuration file for the script. See .BR initramfs.conf (5) for a description of the available configuration parameter. .TP -.I /etc/mkinitramfs/modules +.I /etc/initramfs-tools/modules Specified modules will be put in the generated image and loaded when the system boots. The format - one per line - is identical to that of .I /etc/modules, which is described in .BR modules (5). .TP -.I /etc/mkinitramfs/DSDT.aml +.I /etc/initramfs-tools/DSDT.aml If this file exists, it will be appended to the initramfs in a way that causes it to be loaded by ACPI. -- cgit v1.2.3 From d471f025bf9e5ff0217cc387250be4a410a90aba Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 21 Jun 2006 09:48:23 +0200 Subject: - News entry for the confdir mv - check for doc befor copying modules - add arcmsr to scsi module - tighten udev dep --- debian/NEWS | 11 +++++++++++ debian/changelog | 16 ++++++++++++++++ debian/control | 2 +- debian/initramfs-tools.postinst | 7 ++++++- hook-functions | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index e755806..d4647d4 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,14 @@ +initramfs-tools (0.61) unstable; urgency=low + + * This release moves the initramfs-tools confdir from /etc/mkinitramfs to + /etc/initramfs-tools. Packages are encouraged to ship files as scripts + under /usr/share/initramfs-tools. + + Local tests behaved fine, but be warned that this could potentially + cause boot troubles on upgrade. + + -- maximilian attems Wed, 21 Jun 2006 09:16:01 +0200 + initramfs-tools (0.10) breezy; urgency=low * This release includes hardware auto detection in the initramfs. diff --git a/debian/changelog b/debian/changelog index 4a02bdc..ba0fe4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +initramfs-tools (0.62) unstable; urgency=low + + * debian/control: Tighten dep on udev. udev 0.086-1 loads ide-disk. + Can't lower to sarge version anyway as no coldplugg support there. + (closes: #358360, #362816) + + * debian/initramfs-tools.postinst: Check if modules example is available + under doc before copying if not touch $CONFDIR/modules. + (closes: #368043) + + * hook-functions: Add arcmsr to the scsi modules list. + + * debian/NEWS: Add Notice about confdir mv as version 0.61. + + -- maximilian attems Wed, 21 Jun 2006 09:22:23 +0200 + initramfs-tools (0.61) unstable; urgency=low Release "O partigiano portami via" diff --git a/debian/control b/debian/control index bf022d9..6c59d5e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.076-5) +Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 94c5c1b..f1cfcfa 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -36,7 +36,12 @@ if [ "$1" = configure ]; then fi if [ ! -e /etc/initramfs-tools/modules ]; then - cp /usr/share/doc/initramfs-tools/examples/modules /etc/initramfs-tools/ + if [ -e /usr/share/doc/initramfs-tools/examples/modules ]; then + cp /usr/share/doc/initramfs-tools/examples/modules \ + /etc/initramfs-tools/ + else + touch /etc/initramfs-tools/modules + fi fi # Regenerate initramfs on upgrade diff --git a/hook-functions b/hook-functions index 874d55f..6d41f2e 100644 --- a/hook-functions +++ b/hook-functions @@ -168,7 +168,7 @@ auto_add_modules() ;; scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx ata_piix atari_scsi atp870u BusLogic \ + aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ gdth ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ -- cgit v1.2.3 From 0754335a68ecc127f73dd5c42fa042928952b579 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 22 Jun 2006 20:50:14 +0200 Subject: rephrase docs remove cp modules from postinstall, install confdir lots of small polishing thanks to Sesse review don't use touch on init --- debian/changelog | 40 ++++++++++++++++++++++++++++++++-------- debian/control | 9 +++++---- debian/initramfs-tools.install | 1 + debian/initramfs-tools.postinst | 9 --------- init | 2 +- initramfs-tools.8 | 8 ++++---- mkinitramfs.8 | 6 +++--- update-initramfs.8 | 4 ++-- 8 files changed, 48 insertions(+), 31 deletions(-) diff --git a/debian/changelog b/debian/changelog index ba0fe4f..83c5a46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,34 @@ -initramfs-tools (0.62) unstable; urgency=low +initramfs-tools (0.64) unstable; urgency=low + + RELEASE o bella, ciao! bella, ciao! + + * debian/initramfs-tools.install: Add /etc/initramfs-tools/modules conffile, + instead of a cp from postinstall. (closes: #368043) + + * debian/control, update-initramfs.8, mkinitramfs.8: Capitalize RAM + NFS. + Rephrase nfs root support. + + Thanks to Jeff Bailey and + Steinar H. Gunderson for the review. + + -- maximilian attems Thu, 22 Jun 2006 20:45:59 +0200 - * debian/control: Tighten dep on udev. udev 0.086-1 loads ide-disk. - Can't lower to sarge version anyway as no coldplugg support there. - (closes: #358360, #362816) +initramfs-tools (0.63) unstable; urgency=low + + * init: Use redirection '>' for touching /dev/.initramfs-tools. + + * debian/control, update-initramfs.8, mkinitramfs.8: + s/an (cpio archive)/a gzipped \1/. + Thanks to Andy Somerville . + + -- maximilian attems Thu, 22 Jun 2006 01:11:17 +0200 + +initramfs-tools (0.62) unstable; urgency=low - * debian/initramfs-tools.postinst: Check if modules example is available - under doc before copying if not touch $CONFDIR/modules. - (closes: #368043) + * debian/control: We need at least udev 0.086-1, since earlier versions + had hooks, which don't load ide-disk automatically for 2.6.15 kernels. + Can't lower dependency to sarge version as it has no coldplug support + to escape udev dependency loop on upgrade. (closes: #358360, #362816) * hook-functions: Add arcmsr to the scsi modules list. @@ -21,10 +43,12 @@ initramfs-tools (0.61) unstable; urgency=low * debian/TODO: update to latest state. * debian/bug: Fix reportbug script shebang line, add some descriptive echos. + Use exec to open file descriptor 3 for reportbug. * debian/control: Pump to 3.7.2 standard version without changes. - * init: Use 10M as tmpfs_size for the udev /dev. (closes: #352434) + * init: Use 10M as tmpfs_size for the udev /dev, that can be overriden in + /etc/udev/udev.conf. (closes: #352434) * /etc/initramfs-tools: Use the much more intituive conf dir location. Thanks for the idea to Andres Salomon . diff --git a/debian/control b/debian/control index 6c59d5e..a5a1cee 100644 --- a/debian/control +++ b/debian/control @@ -12,8 +12,9 @@ Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static ( Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged - 2.6 Linux kernel. The initramfs is an cpio archive. At boot time, the kernel - unpacks that archive into ram, mounts and uses it as initial root file system. - From there on the mounting of the real root file system occurs in user space. - klibc handles the boot-time networking setup. Supports nfs root system. + 2.6 Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the + kernel unpacks that archive into RAM, mounts and uses it as initial root file + system. From there on the mounting of the real root file system occurs in user + space. klibc handles the boot-time networking setup. Having the root on NFS + is also supported. Any boot loader with initrd support is able to load an initramfs archive. diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index a5b87df..84cde80 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/modules etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools update-initramfs usr/sbin diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index f1cfcfa..9a0b555 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -35,15 +35,6 @@ if [ "$1" = configure ]; then fi fi -if [ ! -e /etc/initramfs-tools/modules ]; then - if [ -e /usr/share/doc/initramfs-tools/examples/modules ]; then - cp /usr/share/doc/initramfs-tools/examples/modules \ - /etc/initramfs-tools/ - else - touch /etc/initramfs-tools/modules - fi -fi - # Regenerate initramfs on upgrade if [ "$1" = "configure" -a -n "$2" ]; then update-initramfs -u diff --git a/init b/init index 5e2084f..2c25295 100755 --- a/init +++ b/init @@ -16,7 +16,7 @@ if [ -e /etc/udev/udev.conf ]; then . /etc/udev/udev.conf fi mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev -touch /dev/.initramfs-tools +> /dev/.initramfs-tools mkdir /dev/.initramfs mknod /dev/console c 5 1 mknod /dev/null c 1 3 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index b0a9f32..eb46827 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -44,7 +44,7 @@ string of the form NFSSERVER:NFSPATH .TP \fB \fI boot -either local or nfs (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). +either local or NFS (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). .TP \fB \fI resume @@ -292,19 +292,19 @@ have been loaded. \fB \fI local-top OR nfs-top After these scripts have been executed, the root device node is expected to be -present (local) or the network interface is expected to be usable (nfs). +present (local) or the network interface is expected to be usable (NFS). .TP \fB \fI local-premount OR nfs-premount are run after the sanity of the root device has been verified (local) or the -network interface has been brought up (nfs), but before the actual root fs has +network interface has been brought up (NFS), but before the actual root fs has been mounted. .TP \fB \fI local-bottom OR nfs-bottom -are run after the rootfs has been mounted (local) or the nfs root share has +are run after the rootfs has been mounted (local) or the NFS root share has been mounted. udev is stopped. .TP diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 49b606f..5af552b 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -23,14 +23,14 @@ mkinitramfs \- generate an initramfs image The .B mkinitramfs script generates an initramfs image. -The initramfs is an cpio archive. The archive can be used on a different -box of the same arch with the corresponding Linux kernel. +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 .B update-initramfs should do all necessary steps. -At boot time, the kernel unpacks that archive into ram disk, mounts and +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. diff --git a/update-initramfs.8 b/update-initramfs.8 index 7ab8b3f..71f2500 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -20,8 +20,8 @@ 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 an cpio archive. -At boot time, the kernel unpacks that archive into ram disk, mounts and +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. -- 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(-) 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 b7618c8e038c6e9a671ef62578bf79327fbc00be Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 24 Jun 2006 13:22:44 +0200 Subject: - no longer need to remove initramfs-tools/modules on postrm ubuntu sync: - change prereqs policy - add check_minver - use it in update-initramfs - fix version to use in update-initramfs --- debian/changelog | 23 ++++++++++++++++++++++- debian/initramfs-tools.postrm | 1 - scripts/functions | 39 +++++++++++++++++++++++++++++++++++++++ update-initramfs | 19 ++++++++++++++----- 4 files changed, 75 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2e939e9..82983ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,7 +17,28 @@ initramfs-tools (0.65) unstable; urgency=low * update-initramfs: Show by default which initramfs gets generated. (closes: #364301) - -- maximilian attems Sat, 24 Jun 2006 10:46:40 +0200 + * Resync with 0.40ubuntu32: + - 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. + (closes: #369617) + - 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. + - 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. + + * debian/initramfs-tools.postrm: We no longer need to explicitly remove + /etc/initramfs-tools/modules. + + -- maximilian attems Sat, 24 Jun 2006 11:42:07 +0200 initramfs-tools (0.64) unstable; urgency=low diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index b711f2c..b2f40bd 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -1,7 +1,6 @@ #!/bin/sh if [ "x${1}" = "xpurge" ]; then - rm -f /etc/initramfs-tools/modules rm -f /etc/initramfs-tools/conf.d/resume fi diff --git a/scripts/functions b/scripts/functions index 96a5577..35485c6 100644 --- a/scripts/functions +++ b/scripts/functions @@ -91,6 +91,14 @@ set_initlist() reduce_satisfied() { deplist="$(render array_${1})" + unset tmpdeplist + for rs_y in ${deplist}; do + if [ ! -f ${initdir}/${rs_y} ]; then + continue + fi + tmpdeplist="${tmpdeplist} ${rs_y}" + done + deplist=${tmpdeplist} for rs_x in ${runlist}; do pop_list_item ${rs_x} ${deplist} deplist=${tmppop} @@ -176,6 +184,37 @@ run_scripts() call_scripts } +check_minkver() +{ + curversion=${1} + initdir=${2} + set_initlist + if [ -z ${initdir} ]; then + DPKG_ARCH=`dpkg --print-installation-architecture` + case ${DPKG_ARCH} in + ia64|hppa) + minversion="2.6.15" + ;; + *) + minversion="2.6.12" + ;; + esac + if dpkg --compare-versions "${curversion}" lt "${minversion}"; then + echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + fi + [ -z ${initdir} ] || for cm_x in ${initlist}; do + tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) + if dpkg --compare-versions "${curversion}" lt "${tmp}"; then + echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + done +} + # Load custom modules first load_modules() { diff --git a/update-initramfs b/update-initramfs index 03bf5cf..2f3ebcf 100755 --- a/update-initramfs +++ b/update-initramfs @@ -67,8 +67,17 @@ generate_initramfs() if [ "${verbose}" = 1 ]; then OPTS="-v $OPTS" fi - mkinitramfs $OPTS "${initramfs}" "${version}" - set_sha1 + if mkinitramfs $OPTS "${initramfs}" "${version}"; then + set_sha1 + else + mkinitramfs_return="$?" + if [ "$mkinitramfs_return" = "2" ]; then + # minversion wasn't met, exit 0 + exit 0 + fi + verbose "mkinitramfs failed for ${initramfs}" + exit $mkinitramfs_return + fi } # only run lilo if no grub is around @@ -192,15 +201,15 @@ create() update() { if [ -z "${version}" ]; then - set_current_version + set_linked_version fi if [ -z "${version}" ]; then - set_linked_version + set_highest_version fi if [ -z "${version}" ]; then - set_highest_version + set_current_version fi if [ "${version}" = "all" ]; then -- cgit v1.2.3 From 6fc7a6092aa2fdd3006d99941ac774b5e4e0577c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 25 Jun 2006 01:20:05 +0200 Subject: minor changelog polishing --- debian/changelog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 82983ae..ad677f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ initramfs-tools (0.65) unstable; urgency=low 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 + * scripts/local-top/lvm: Be careful 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. @@ -12,7 +12,7 @@ initramfs-tools (0.65) unstable; urgency=low (closes: #374378) * mkinitramfs: Remove old kernel-package supported long param. - kernel-package uses since month make-kpkg. + kernel-package uses since 10.036 mkinitramfs-kpkg. * update-initramfs: Show by default which initramfs gets generated. (closes: #364301) @@ -38,7 +38,7 @@ initramfs-tools (0.65) unstable; urgency=low * debian/initramfs-tools.postrm: We no longer need to explicitly remove /etc/initramfs-tools/modules. - -- maximilian attems Sat, 24 Jun 2006 11:42:07 +0200 + -- maximilian attems Sat, 24 Jun 2006 13:27:49 +0200 initramfs-tools (0.64) unstable; urgency=low -- cgit v1.2.3 From c7ad939852fedfe308a643805df3d7e3a6549755 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 27 Jun 2006 12:02:38 +0200 Subject: fix lvm root load mirror and snapshot --- debian/changelog | 9 +++++++++ scripts/local-top/lvm | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad677f3..c39e1b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.65b) unstable; urgency=low + + * scripts/local-top/lvm: Load snapshot and mirror modules. (Closes: #375342) + + * scripts/local-top/lvm: Fix a wrong substitution for the lilo test. + (Closes: #375442) + + -- maximilian attems Mon, 26 Jun 2006 14:54:30 +0200 + initramfs-tools (0.65) unstable; urgency=low * scripts/local-top/lvm: Activate root and resume volume group. diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 8ff3b98..3b012ec 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -25,11 +25,12 @@ activate_vg() fi # Take care of lilo boot arg, risky activating of all vg - vg_lilo=${vg:0:2} - if [ "${vg_lilo}" = fe ]; then + case $vg in + fe[0-9]*) vgchange -ay exit 0 - fi + ;; + esac # Make sure that we have a d-m path vg=${vg#/dev/mapper/} @@ -50,6 +51,8 @@ if [ ! -e /sbin/vgchange ]; then fi modprobe -q dm-mod +modprobe -q dm-snapshot +modprobe -q dm-mirror activate_vg "$ROOT" activate_vg "$resume" -- 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(-) 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 09276c4c9f7deb9a46cf162747b5749f94738c2b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 29 Jun 2006 21:42:45 +0200 Subject: refix lilo root on lvm boot --- debian/changelog | 5 ++++- scripts/local-top/lvm | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ed11e31..b1e3272 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,10 @@ initramfs-tools (0.66) unstable; urgency=low * 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 + * scripts/local-top/lvm: Refix lilo check. (closes: #375786) + Thanks to the patch from Christian Weeks . + + -- maximilian attems Wed, 28 Jun 2006 12:11:49 +0200 initramfs-tools (0.65b) unstable; urgency=low diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 3b012ec..fc1036e 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -30,6 +30,11 @@ activate_vg() vgchange -ay exit 0 ;; + # FIXME: check major + /dev/root) + vgchange -ay + exit 0 + ;; esac # Make sure that we have a d-m path -- cgit v1.2.3 From 0d341b8d32810844ce035e89a9e60fb7a7dde4b6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 2 Jul 2006 18:57:07 +0200 Subject: woow pile of stuff turned up: - cleanup of activate_vg() in lvm boot script - use less of busybox utilities - conf.d for BUSYBOX=y usage for the packages - don't poke on conffile for RESUME - use printf instead of expr (ooh ash and dash are *fun*) - fix update-initramfs to use current_version when no other version exists around --- conf/initramfs.conf | 9 --------- debian/changelog | 37 +++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.dirs | 1 + debian/initramfs-tools.preinst | 9 --------- initramfs-tools.8 | 5 +++-- initramfs.conf.5 | 7 ------- mkinitramfs | 2 +- scripts/functions | 16 +++++++++------- scripts/local | 2 +- scripts/local-top/lvm | 11 +++++++++-- update-initramfs | 12 ++++++++++-- 11 files changed, 71 insertions(+), 40 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index a9cadf7..84d3b24 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -17,15 +17,6 @@ MODULES=most -# -# RESUME: [ /dev/hda2 | /dev/sdb2 ] -# -# 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. - -#RESUME= - # # NFS Section of the config. # diff --git a/debian/changelog b/debian/changelog index b1e3272..05140ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,40 @@ +initramfs-tools (0.67) unstable; urgency=high + + Release bella, ciao, ciao, ciao! + + * scripts/local: Fix typo in log_begin_msg. (closes: #375880) + + * update-initramfs: Generate initramfs for current version if there is no + sha1sum and no initrd exists yet - regression from 0.65. (closes: #375671) + Thanks martin f krafft for report. + + * conf/initramfs.conf, initramfs.conf(5): Drop RESUME section. + + * debian/initramfs-tools.preinst: Don't modify conffile initramfs.tools - + drop the corresponding code. (closes: #376008) + + * initramfs-tools(8): Document that RESUME is tried to be autodected and + written to /etc/initramfs-tools/conf.d/resume on install. + + * scripts/functions: Replace expr use with printf for skipping comments on + /etc/modules. Works on both busybox ash and klibc dash. Prefix space is + ignored by both. + + * scripts/local-top/lvm: Remove harmless warnings if a volumegroup is under + /dev/mapper but not an lvm device. (closes: 376311) + Thanks David Härdeman for the patch. + + * scripts/local-top/lvm: Change activate_vg() to return 1 if no volumegroup + is found. + + * debian/initramfs-tools.dirs: Add usr/share/initramfs-tools/conf.d entry. + + * mkinitramfs: Add stuff to the conf.d directory also from aboves directory. + + * Set urgency to high to get the RC bugfix into testing. + + -- maximilian attems Sun, 2 Jul 2006 18:35:34 +0200 + initramfs-tools (0.66) unstable; urgency=low * hooks/thermal: Add i2c-powermac. diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index 0a807a5..2c6a83a 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -9,5 +9,6 @@ etc/initramfs-tools/scripts/nfs-premount etc/initramfs-tools/scripts/nfs-top etc/initramfs-tools/hooks etc/initramfs-tools/conf.d +usr/share/initramfs-tools/conf.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 3ec83c6..f2b667e 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -19,13 +19,4 @@ case "$1" in ;; esac -[ -f /etc/initramfs-tools/initramfs.conf ] && . /etc/initramfs-tools/initramfs.conf -if [ -z ${RESUME} ]; then - exit 0 -else - mkdir -p /etc/initramfs-tools/conf.d - echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume - sed -i -e "s/RESUME=.*/#RESUME=/" /etc/initramfs-tools/initramfs.conf -fi - #DEBHELPER# diff --git a/initramfs-tools.8 b/initramfs-tools.8 index eb46827..5d7c105 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -48,8 +48,9 @@ either local or NFS (affects which initramfs scripts are run, see the "Subdirect .TP \fB \fI resume -device node which holds the result of a previous suspension using swsusp -(usually the swap partition). +On install initramfs-tools tries to autodetect the resume partition. On success +the RESUME variable is written to /etc/initramfs-tools/conf.d/resume. +The boot variable overrides it. .TP \fB \fI quiet diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 7fb79b1..2874fdb 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -32,13 +32,6 @@ The default setting is \fImost\fP. \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. By default, this is set in -/etc/mkinitramfs/conf.d/resume. - .SH NFS VARIABLES .TP \fB BOOT diff --git a/mkinitramfs b/mkinitramfs index 5fcc1fd..f0ba606 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -61,7 +61,7 @@ done . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' -for i in ${CONFDIR}/conf.d/*; do +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-.*$')"; done for i in ${EXTRA_CONF}; do diff --git a/scripts/functions b/scripts/functions index a4faaa8..fea6956 100644 --- a/scripts/functions +++ b/scripts/functions @@ -220,14 +220,16 @@ load_modules() { if [ -e /conf/modules ]; then cat /conf/modules | while read m; do - if [ -z "$m" ] \ - || expr "$m" : "#" >/dev/null \ - || expr "$m" : "[ \t]+#?" > /dev/null - then - continue; - else - modprobe -q $m + # Skip empty lines + if [ -z "$m" ]; then + continue fi + # Skip comments - d?ash removes whitespace prefix + com=$(printf "%.1s" "${m}") + if [ "$com" = "#" ]; then + continue + fi + modprobe -q $m done fi } diff --git a/scripts/local b/scripts/local index 25aca70..a565885 100644 --- a/scripts/local +++ b/scripts/local @@ -55,7 +55,7 @@ mountroot () # Mount root mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt} - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom" run_scripts /scripts/local-bottom [ "$quiet" != "y" ] && log_end_msg } diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index fc1036e..5323a7d 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -21,7 +21,7 @@ activate_vg() # Make sure that we have a non-empty argument if [ -z "${vg}" ]; then - return 0 + return 1 fi # Take care of lilo boot arg, risky activating of all vg @@ -40,7 +40,12 @@ activate_vg() # Make sure that we have a d-m path vg=${vg#/dev/mapper/} if [ "$vg" = "$1" ]; then - return 0 + 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. @@ -61,3 +66,5 @@ modprobe -q dm-mirror activate_vg "$ROOT" activate_vg "$resume" + +exit 0 diff --git a/update-initramfs b/update-initramfs index 2f3ebcf..1826233 100755 --- a/update-initramfs +++ b/update-initramfs @@ -125,8 +125,7 @@ get_sorted_versions() for gsv_x in "${STATEDIR}"/*; do gsv_x="$(basename "${gsv_x}")" if [ "${gsv_x}" = '*' ]; then - verbose "Nothing to do, exiting." - exit 0 + return 0 fi worklist="" for gsv_i in $version_list; do @@ -212,9 +211,18 @@ update() set_current_version fi + if [ -z "${version}" ]; then + verbose "Nothing to do, exiting." + exit 0 + fi + if [ "${version}" = "all" ]; then : FIXME check for --yes, and if not ask are you sure get_sorted_versions + if [ -z "${version_list}" ]; then + verbose "Nothing to do, exiting." + exit 0 + fi for u_version in ${version_list}; do if [ "${verbose}" = "1" ]; then vflag="-v" -- cgit v1.2.3 From af6f5f475221846f88a2bbda39a2a93d67556d07 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 2 Jul 2006 19:45:38 +0200 Subject: - move check_minkver() to hook-functions --- debian/changelog | 7 +++++++ hook-functions | 31 +++++++++++++++++++++++++++++++ scripts/functions | 31 ------------------------------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/debian/changelog b/debian/changelog index 05140ed..5035086 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.68) unstable; urgency=low + + * script/functions, hook-functions: Move check_minkver() to the second + file as it uses dpkg and is run by mkinitramfs and not on boot. + + -- maximilian attems Sun, 2 Jul 2006 19:44:45 +0200 + initramfs-tools (0.67) unstable; urgency=high Release bella, ciao, ciao, ciao! diff --git a/hook-functions b/hook-functions index 6d41f2e..fe10cfe 100644 --- a/hook-functions +++ b/hook-functions @@ -226,3 +226,34 @@ EOF } +# minimal supported kernel version +check_minkver() +{ + curversion=${1} + initdir=${2} + set_initlist + if [ -z ${initdir} ]; then + DPKG_ARCH=`dpkg --print-installation-architecture` + case ${DPKG_ARCH} in + ia64|hppa) + minversion="2.6.15" + ;; + *) + minversion="2.6.12" + ;; + esac + if dpkg --compare-versions "${curversion}" lt "${minversion}"; then + echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + fi + [ -z ${initdir} ] || for cm_x in ${initlist}; do + tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) + if dpkg --compare-versions "${curversion}" lt "${tmp}"; then + echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 + echo "W: not generating requested initramfs for kernel ${curversion}" >&2 + exit 2 + fi + done +} diff --git a/scripts/functions b/scripts/functions index fea6956..c3a3e16 100644 --- a/scripts/functions +++ b/scripts/functions @@ -184,37 +184,6 @@ run_scripts() call_scripts } -check_minkver() -{ - curversion=${1} - initdir=${2} - set_initlist - if [ -z ${initdir} ]; then - DPKG_ARCH=`dpkg --print-installation-architecture` - case ${DPKG_ARCH} in - ia64|hppa) - minversion="2.6.15" - ;; - *) - minversion="2.6.12" - ;; - esac - if dpkg --compare-versions "${curversion}" lt "${minversion}"; then - echo "W: kernerl ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2 - echo "W: not generating requested initramfs for kernel ${curversion}" >&2 - exit 2 - fi - fi - [ -z ${initdir} ] || for cm_x in ${initlist}; do - tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) - if dpkg --compare-versions "${curversion}" lt "${tmp}"; then - echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 - echo "W: not generating requested initramfs for kernel ${curversion}" >&2 - exit 2 - fi - done -} - # Load custom modules first load_modules() { -- cgit v1.2.3 From f82a46fac97eee643cbd8600657f533a6e31665f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 7 Jul 2006 12:05:34 +0200 Subject: - mkinitramfs take care of eventual missing depmod run - do the migration from mkinitramfs in preinst - sed the modules file so that it looks pretty some than ours - polish modules file - allow BUSYBOX=n --- conf/modules | 3 ++- debian/changelog | 24 ++++++++++++++++++++++-- debian/initramfs-tools.postinst | 33 --------------------------------- debian/initramfs-tools.preinst | 35 +++++++++++++++++++++++++++++++++++ mkinitramfs | 14 +++++++++++--- 5 files changed, 70 insertions(+), 39 deletions(-) diff --git a/conf/modules b/conf/modules index 0067831..9aa4646 100644 --- a/conf/modules +++ b/conf/modules @@ -2,8 +2,9 @@ # # Syntax: module_name [args ...] # +# You must run update-initramfs(8) to effect this change. # -# This might be good choices: +# Examples: # # raid1 # sd_mod diff --git a/debian/changelog b/debian/changelog index 5035086..bbc2944 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,29 @@ -initramfs-tools (0.68) unstable; urgency=low +initramfs-tools (0.68) unstable; urgency=high * script/functions, hook-functions: Move check_minkver() to the second file as it uses dpkg and is run by mkinitramfs and not on boot. - -- maximilian attems Sun, 2 Jul 2006 19:44:45 +0200 + * mkinitramfs: Check if ${BUSYBOX} is set to n before adding it. + Add a big fat warning that this not yet supported. Helps to do the + klibc-utils work. + + * mkinitramfs: Run depmod if no /lib/modules/${version}/modules.dep exists. + Solves initramfs creation for handbuild upstream Xen targets. + Thanks to Klaus Ita for the report. + + * debian/initramfs-tools.preinst, debian/initramfs-tools.postinst: Do the + migration of the mkinitrd settings in the preinst. (closes: #376604) Thanks + for the checks to Justin Pryzby . + + * debian/initramfs-tools.preinst: Reorder. Generate an modules file similar + to the one we ship. This should minimize Sarge upgrade prompting if no + relevant modules where added to /etc/mkinitrd/modules. + + * conf/initramfs.conf: Make it more similar to /etc/mkinitrd/modules. + + * Set urgency high for RC fixes upload. + + -- maximilian attems Fri, 7 Jul 2006 11:45:56 +0200 initramfs-tools (0.67) unstable; urgency=high diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 9a0b555..a8df95e 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -2,39 +2,6 @@ set -e -if [ "$1" = configure ]; then - if [ x${2} = x ]; then - - # First time install. Can we autodetect the RESUME partition? - RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') - - # Inhertic initrd-tools settings if possible. - if [ -e /etc/mkinitrd/mkinitrd.conf ]; then - . /etc/mkinitrd/mkinitrd.conf - fi - - if [ -e /etc/mkinitrd/modules ]; then - cp /etc/mkinitrd/modules /etc/initramfs-tools - sed -i \ - -e 's/mkinitrd/mkinitramfs/g' \ - -e '/^ide-generic/d' \ - -e '/^ide-disk/d' \ - -e '/^ext2/d' \ - -e '/^ext3/d' \ - /etc/initramfs-tools/modules - fi - - if [ -e ${RESUME} ]; then - echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume - fi - - if [ -e /etc/mkinitrd/DSDT ]; then - cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml - fi - - fi -fi - # Regenerate initramfs on upgrade if [ "$1" = "configure" -a -n "$2" ]; then update-initramfs -u diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index f2b667e..dca832f 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -3,6 +3,41 @@ set -e case "$1" in + configure) + if [ -n "$2" ]; then + # First time install. Can we autodetect the RESUME partition? + RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + + # Inhertic initrd-tools settings if possible. + if [ -e /etc/mkinitrd/mkinitrd.conf ]; then + . /etc/mkinitrd/mkinitrd.conf + fi + if [ -e ${RESUME} ]; then + echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume + fi + + # Add initrd-tools modules, while trying to minimize prompting + if [ -e /etc/mkinitrd/modules ]; then + cp /etc/mkinitrd/modules /etc/initramfs-tools + sed -i \ + -e 's/\/etc\/mkinitrd\/modules: Kernel modules to load for initrd./List of modules that you want to include in your initramfs./g' \ + -e 's/mkinitrd/update-initramfs/g' \ + -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 '/^ide-generic/d' \ + -e '/^ide-disk/d' \ + -e '/^ext2/d' \ + -e '/^ext3/d' \ + /etc/initramfs-tools/modules + fi + + 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 if [ -d /etc/initramfs-tools ]; then diff --git a/mkinitramfs b/mkinitramfs index f0ba606..f532228 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -112,6 +112,9 @@ if [ ! -e "${MODULESDIR}" ]; then echo "Cannot find ${MODULESDIR}" exit 1 fi +if [ ! -e "${MODULESDIR}/modules.depmod" ]; then + depmod ${version} +fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 @@ -175,9 +178,14 @@ done echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root # Busybox -rm -f ${DESTDIR}/bin/sh -copy_exec ${BUSYBOXDIR}/busybox /bin/busybox -ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh +if [ "x${BUSYBOX}" = "xn" ]; then + ln -s ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh + echo "Warning: Busybox is required for successful boot!" +else + rm -f ${DESTDIR}/bin/sh + copy_exec ${BUSYBOXDIR}/busybox /bin/busybox + ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh +fi # Modutils copy_exec /sbin/modprobe /sbin -- cgit v1.2.3 From 50586c0818aa8de3ba3aa1c105acbe31537a9be1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 12 Jul 2006 18:21:16 +0200 Subject: - rename suspend boot script in resume - update-initramfs add -b bootdif flag document it - check for noresume arg in init --- debian/changelog | 25 ++++++++++++++++++++++--- init | 10 ++++++++-- scripts/local-premount/resume | 29 +++++++++++++++++++++++++++++ scripts/local-premount/suspend | 29 ----------------------------- update-initramfs | 10 +++++++++- update-initramfs.8 | 5 +++++ 6 files changed, 73 insertions(+), 35 deletions(-) create mode 100755 scripts/local-premount/resume delete mode 100755 scripts/local-premount/suspend diff --git a/debian/changelog b/debian/changelog index bbc2944..9623ae4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,22 @@ -initramfs-tools (0.68) unstable; urgency=high +initramfs-tools (0.69) unstable; urgency=low + + * scripts/local-premount/suspend, scripts/local-premount/resume: Rename + to the later as the script resumes from resume arg. + + * init: Parse for noresume and only export resume if it is not set. + Allows boot scripts to check for it's eventual existence. + Thanks David Härdeman for the suggestion. + + * update-initramfs: Add option "-b directory" to override BOOTDIR. + Allows the initramfs to be created in another dir without awkward + mkinitramfs invocation. Check that the passed arg is really a dir. + (ubuntu: 37690) Thanks Colin Watson + + * update-initramfs.8: Document -b switch. + + -- maximilian attems Wed, 12 Jul 2006 16:51:49 +0200 + +initramfs-tools (0.68b) unstable; urgency=high * script/functions, hook-functions: Move check_minkver() to the second file as it uses dpkg and is run by mkinitramfs and not on boot. @@ -19,11 +37,12 @@ initramfs-tools (0.68) unstable; urgency=high to the one we ship. This should minimize Sarge upgrade prompting if no relevant modules where added to /etc/mkinitrd/modules. - * conf/initramfs.conf: Make it more similar to /etc/mkinitrd/modules. + * conf/modules: Make it more similar to /etc/mkinitrd/modules. * Set urgency high for RC fixes upload. + Thanks Steinar H. Gunderson for the review. - -- maximilian attems Fri, 7 Jul 2006 11:45:56 +0200 + -- maximilian attems Mon, 10 Jul 2006 00:13:52 +0200 initramfs-tools (0.67) unstable; urgency=high diff --git a/init b/init index 2c25295..427b964 100755 --- a/init +++ b/init @@ -40,7 +40,6 @@ export break= export init=/sbin/init export quiet=n export readonly=y -export resume=${RESUME} export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} @@ -77,7 +76,10 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - resume=${x#resume=} + RESUME=${x#resume=} + ;; + noresume) + NORESUME=y ;; quiet) quiet=y @@ -102,6 +104,10 @@ for x in $(cat /proc/cmdline); do esac done +if [ -n ${NORESUME} ]; then + export resume=${RESUME} +fi + depmod -a maybe_break top diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume new file mode 100755 index 0000000..0c88ccc --- /dev/null +++ b/scripts/local-premount/resume @@ -0,0 +1,29 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ "x${resume}" = "x" ]; then + exit +fi + +if [ ! -e "${resume}" ]; then + exit +fi + +if [ -e /sys/power/resume ]; then + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') + echo $major_minor >/sys/power/resume +fi diff --git a/scripts/local-premount/suspend b/scripts/local-premount/suspend deleted file mode 100755 index 0c88ccc..0000000 --- a/scripts/local-premount/suspend +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ "x${resume}" = "x" ]; then - exit -fi - -if [ ! -e "${resume}" ]; then - exit -fi - -if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume -fi diff --git a/update-initramfs b/update-initramfs index 1826233..71cc90d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -19,6 +19,7 @@ Options: -u Update an existing initramfs -d Remove an existing initramfs -t Take over a custom initramfs with this one + -b Set alternate boot directory -v Be verbose -h This message @@ -287,7 +288,7 @@ takeover=0 ## -while getopts "k:cudyvht?" flag; do +while getopts "k:cudyvtb:h?" flag; do case "${flag}" in k) version="${OPTARG}" @@ -310,6 +311,13 @@ while getopts "k:cudyvht?" flag; do t) takeover="1" ;; + b) + BOOTDIR="${OPTARG}" + if [ ! -d $BOOTDIR ]; then + echo "Error: ${BOOTDIR} is not a directory." + exit 1 + fi + ;; h|?) usage ;; diff --git a/update-initramfs.8 b/update-initramfs.8 index 71f2500..9590ca3 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -11,6 +11,7 @@ update-initramfs \- generate an initramfs image .RB [ \-u ] .RB [ \-t ] .RB [ \-v ] +.RB [ \-b ] .RB [ \-h ] .SH DESCRIPTION The @@ -52,6 +53,10 @@ Allows to take over an custom initramfs with a newer one. This option increases the amount of information you are given during the chosen action. +.TP +\fB \-b +Set an different bootdir for the image creation. + .TP \fB \-h Print a short help page describing the available options in -- cgit v1.2.3 From 62bb60b509b62e6ce68d067b7f293019ed102b9a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 13 Jul 2006 23:33:32 +0200 Subject: - fix noresume exporting - readd plain upgly kernel-package interface to mkinitramfs with depreciation warning - nice fixes in preinst by Kamion --- debian/changelog | 15 +++++++++++++++ debian/initramfs-tools.preinst | 4 +++- init | 2 +- mkinitramfs | 24 +++++++++++++++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9623ae4..056ccb2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +initramfs-tools (0.69b) unstable; urgency=high + + * debian/initramfs-tools.preinst: Don't depend upon shipped directories + to be existing. Thanks Colin Watson for patch. + Add trailing slash to copy command. (closes: 378089) + + * mkinitramfs: Revert the removal of kernel-package supported lonng param + of 0.65. Readd that plain ugly interface. Warn users they should use + ramdisk=mkinitramfs-kpkg. As kernel-package doesn't yet support + update-initramfs. Thanks Frans Pop for report. + + * Thus high urgency upload. + + -- maximilian attems Thu, 13 Jul 2006 23:20:49 +0200 + initramfs-tools (0.69) unstable; urgency=low * scripts/local-premount/suspend, scripts/local-premount/resume: Rename diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index dca832f..b92d393 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -5,6 +5,8 @@ set -e case "$1" in configure) if [ -n "$2" ]; then + mkdir -p /etc/initramfs-tools/conf.d + # First time install. Can we autodetect the RESUME partition? RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') @@ -18,7 +20,7 @@ case "$1" in # Add initrd-tools modules, while trying to minimize prompting if [ -e /etc/mkinitrd/modules ]; then - cp /etc/mkinitrd/modules /etc/initramfs-tools + cp /etc/mkinitrd/modules /etc/initramfs-tools/ sed -i \ -e 's/\/etc\/mkinitrd\/modules: Kernel modules to load for initrd./List of modules that you want to include in your initramfs./g' \ -e 's/mkinitrd/update-initramfs/g' \ diff --git a/init b/init index 427b964..2beb597 100755 --- a/init +++ b/init @@ -104,7 +104,7 @@ for x in $(cat /proc/cmdline); do esac done -if [ -n ${NORESUME} ]; then +if [ -z ${NORESUME} ]; then export resume=${RESUME} fi diff --git a/mkinitramfs b/mkinitramfs index f532228..a0bec9e 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 -n "$0" -- "$@"` +OPTIONS=`getopt -o d:ko:r:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -44,6 +44,14 @@ 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 @@ -55,6 +63,20 @@ 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 + echo "Depreciation warning: use ramdisk=mkinitramfs-kpkg." + exit 0 +fi + # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions -- cgit v1.2.3 From 7b658ecddad7e848e6c3c5d347c46d3b11aa1988 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 14 Jul 2006 00:34:42 +0200 Subject: - rename debian/bug to debian/script fix according install target gets the info really added by reportbug --- debian/bug | 15 --------------- debian/changelog | 5 ++++- debian/initramfs-tools.install | 2 +- debian/script | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 17 deletions(-) delete mode 100755 debian/bug create mode 100755 debian/script diff --git a/debian/bug b/debian/bug deleted file mode 100755 index b1b477d..0000000 --- a/debian/bug +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -exec >&3 - -echo "-- /proc/cmdline" -cat /proc/cmdline -echo - -echo "-- /proc/filesystems" -grep -v nodev /proc/filesystems -echo - -echo "-- lsmod" -lsmod -echo diff --git a/debian/changelog b/debian/changelog index 056ccb2..ddecf2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,9 +9,12 @@ initramfs-tools (0.69b) unstable; urgency=high ramdisk=mkinitramfs-kpkg. As kernel-package doesn't yet support update-initramfs. Thanks Frans Pop for report. + * debian/bug: Rename to script so that it shows up in reportbug. + Fix debian/initramfs-tools.install accordingly. + * Thus high urgency upload. - -- maximilian attems Thu, 13 Jul 2006 23:20:49 +0200 + -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 initramfs-tools (0.69) unstable; urgency=low diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 84cde80..add5a7f 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -7,4 +7,4 @@ conf/modules etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools update-initramfs usr/sbin -debian/bug usr/share/bug/initramfs-tools +debian/script usr/share/bug/initramfs-tools diff --git a/debian/script b/debian/script new file mode 100755 index 0000000..b1b477d --- /dev/null +++ b/debian/script @@ -0,0 +1,15 @@ +#!/bin/sh + +exec >&3 + +echo "-- /proc/cmdline" +cat /proc/cmdline +echo + +echo "-- /proc/filesystems" +grep -v nodev /proc/filesystems +echo + +echo "-- lsmod" +lsmod +echo -- 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(-) 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(-) 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 diff --git a/debian/changelog b/debian/changelog index b48be87..faaf90a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,16 @@ +initramfs-tools (0.70b) unstable; urgency=low + + * Be more careful about vi dot files, removed. + Thanks Frederik Schüler for review. + + -- maximilian attems Wed, 19 Jul 2006 16:00:47 +0200 + initramfs-tools (0.70) unstable; urgency=low + * mkinitramfs: Don't include static kinit, nor gzip. They are the biggest + klibc-utils binaries and we don't use them. Keep static gunzip, zcat and + shared kinit for now. + * Reduce diff against 0.69ubuntu3: - hook-functions: Fix kernel typo. - hooks/kernelextras: Fix comment and add vga16fb too. @@ -7,6 +18,8 @@ initramfs-tools (0.70) unstable; urgency=low - mkinitramfs: Use check_minkver instead of dpkg itself. Whitespace cleanup and add quoting. - scripts/local: Whitespace cleanup and add a comment. + - scripts/nfs: Use mount with nolock instead of nfsmount. + (closes: 359926) - update-initramfs: Add quoting + whitespace fix. - changelog: for noise reduction add 0.69ubuntu{1,2,3}, all 0.40ubuntu*, 0.36ubuntu1 and missing 0.29 + 0.28 entries. @@ -18,10 +31,17 @@ initramfs-tools (0.70) unstable; urgency=low hooks/lvm, hooks/md, init, initramfs-tools.8, initramfs.conf.5, mkinitramfs, mkinitramfs-kpkg, mkinitramfs-kpkg.8, mkinitramfs.8, scripts/functions, scripts/local-top/udev_helper, update-initramfs, - update-initramfs.8: Whitespace policy cleanup trailing whitespace and - non tabular indents. + update-initramfs.8: Cleanup trailing whitespace and non tabular indents. + + * scripts/local-premount/resume: Use new resume bin from klibc-utils. + Removes superflous stat and awk usage. + + * debian/control: Depend against newer klibc-utils 1.4.11-1. + + * hooks/md, scripts/local-top/md: Drop as mdadm > 2.5-1 features them. + (closes: #367567) - -- maximilian attems Sun, 16 Jul 2006 21:50:34 +0200 + -- maximilian attems Wed, 19 Jul 2006 11:09:52 +0200 initramfs-tools (0.69b) unstable; urgency=high diff --git a/debian/control b/debian/control index a5a1cee..53caa8f 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.1.16-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/hooks/md b/hooks/md deleted file mode 100755 index df2abc8..0000000 --- a/hooks/md +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -if [ ! -x /sbin/mdadm ]; then - exit 0 -fi - -. /usr/share/initramfs-tools/hook-functions - -copy_exec /sbin/mdadm /sbin -copy_exec /sbin/mdrun /sbin - -for x in md linear raid0 raid1 raid5 raid6 raid10; do - manual_add_modules ${x} -done diff --git a/mkinitramfs b/mkinitramfs index 81a859e..0f1cb58 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -183,8 +183,11 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. +# klibc ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin ln -s /lib/klibc-*.so ${DESTDIR}/lib +rm -f ${DESTDIR}/bin/kinit ${DESTDIR}/bin/gzip + copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd ${CONFDIR}/scripts && \ diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 0c88ccc..059e7a4 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -24,6 +24,5 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + resume ${resume} fi diff --git a/scripts/local-top/md b/scripts/local-top/md deleted file mode 100755 index aa48474..0000000 --- a/scripts/local-top/md +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -/sbin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index 89b5c20..47e9ac1 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,7 @@ mountroot () roflag="-o rw" fi - nfsmount ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} + mount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom -- cgit v1.2.3 From 8761821795732a9755d673e92fb45ac9202270df Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 24 Jul 2006 09:13:28 +0200 Subject: - add BUSYBOX section to conf - add myri10ge, smc911x and hptiop modules - fix check_minkver() logic - escape resume variables - fix SEE ALSO section in all manpages - source /usr/share/initramfs-tools/conf.d/* - check against modules.dep before running depmod - more verbose output - open console with -i for dash interactive - fix resume param by LABEL or UUID - lvm has new prereq mdadm - update-initramfs fix -v calling - functions/scripts replace basename usage with shell expansion --- conf/initramfs.conf | 7 ++++++ debian/changelog | 50 +++++++++++++++++++++++++++++++++++++++++++ hook-functions | 17 ++++++++------- init | 4 ++-- initramfs-tools.8 | 5 +++-- initramfs.conf.5 | 16 +++++++++++--- mkinitramfs | 12 ++++++++--- mkinitramfs-kpkg.8 | 6 ++++-- mkinitramfs.8 | 9 ++++++-- scripts/functions | 8 +++++-- scripts/local-premount/resume | 9 ++++++++ scripts/local-top/lvm | 2 +- update-initramfs | 4 ++-- update-initramfs.8 | 6 ++++-- 14 files changed, 126 insertions(+), 29 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 84d3b24..b0d1dc0 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -17,6 +17,13 @@ MODULES=most +# BUSYBOX: [ y | n ] +# +# Use busybox if available. +# + +BUSYBOX=y + # # NFS Section of the config. # diff --git a/debian/changelog b/debian/changelog index faaf90a..e6f271b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,46 @@ +initramfs-tools (0.71) unstable; urgency=low + + * initramfs.conf.5, initramfs-tools.8, mkinitramfs.8, mkinitramfs-kpkg.8, + update-initramfs.8: Fix spacing in the SEE ALSO section and have this + section everywhere as last. Fix linebreak in mkinitramfs.8 options. + Thanks Martin Michlmayr for the notice. + + * scripts/functions: Use shell parameter expansion to strip known dir + prefix instead of gratious basename call. + + * scripts/functions: On panic call open the rescue shell with -i to get + dash interactive features. ash from busybox ignores the param. + Thanks David Härdeman for the suggestion. + + * conf/initramfs.conf: Readd BUSYBOX=y section. Beware that a lot of boot + scripts need busybox and the current default image still does too. + + * initramfs.conf: Document BUSYBOX usage. + + * init: Add variable quoting around resume, NORESUME parsing and checks. + + * hook-functions: Add myri10ge and smc911x to the net section. Add hptiop to + the scsi section. + + * update-initramfs: Fix -v usage by not passing quoted ${OPTS} as one + option. Thanks Famelis George for the patch. + (closes: 379212) + + * mkinitramfs: Really source /usr/share/initramfs-tools/conf.d/ entries. + + * mkinitramfs: Check against modules.dep before invoking depmod. + + * hook-functions: check_minkver() only needs to call init_list(), + when a dir gets passed. Clean up check_minkver() logic. + + * scripts/function, mkinitramfs: Add output on verbose mode. + + * merge 0.69ubuntu4. + + * scripts/local-top/lvm: Prereqs s/md/mdadm/ for the new hooks. + + -- maximilian attems Mon, 24 Jul 2006 09:10:53 +0200 + initramfs-tools (0.70b) unstable; urgency=low * Be more careful about vi dot files, removed. @@ -61,6 +104,13 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu4) edgy; urgency=low + + * scripts/local-premount/suspend: Check for UUID= or LABEL= on the + start of $resume, and use /dev/disk/by-{uuid,label} if found. + + -- Scott James Remnant Fri, 21 Jul 2006 17:58:34 +0100 + initramfs-tools (0.69ubuntu3) edgy; urgency=low * debian/initramfs-tools.install, debian/initramfs-tools.preinst, diff --git a/hook-functions b/hook-functions index 9b1bd24..3175cba 100644 --- a/hook-functions +++ b/hook-functions @@ -149,8 +149,8 @@ auto_add_modules() net) for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ dl2k e1000 e100 epic100 eql fealnx famachi forcedeth \ - hp100 mace mv643xx_eth natsemi ne2k-pci netconsole \ - ns83820 pcnet32 r8169 s2io sis900 skge slhc starfire \ + hp100 mace mv643xx_eth myri10ge natsemi ne2k-pci netconsole \ + ns83820 pcnet32 r8169 s2io sis900 skge slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do @@ -170,10 +170,10 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ - gdth ibmvscsic initio ipr ips isp1020 lpfc max_scsi mac53c94 \ - megaraid megaraid_mbox megaraid_mm mesh mptfc mptscsih \ - mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 qla2300 \ - qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ + gdth hptiop ibmvscsic initio ipr ips isp1020 lpfc max_scsi \ + mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc \ + mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 \ + qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ sata_nv sata_promise sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ @@ -231,7 +231,6 @@ check_minkver() { curversion=${1} initdir=${2} - set_initlist if [ -z ${initdir} ]; then DPKG_ARCH=`dpkg --print-installation-architecture` case ${DPKG_ARCH} in @@ -247,8 +246,10 @@ check_minkver() echo "W: not generating requested initramfs for kernel ${curversion}" >&2 exit 2 fi + return 0 fi - [ -z ${initdir} ] || for cm_x in ${initlist}; do + set_initlist + for cm_x in ${initlist}; do tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) if dpkg --compare-versions "${curversion}" lt "${tmp}"; then echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 diff --git a/init b/init index eb14326..69d9542 100755 --- a/init +++ b/init @@ -76,7 +76,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - RESUME=${x#resume=} + RESUME="${x#resume=}" ;; noresume) NORESUME=y @@ -104,7 +104,7 @@ for x in $(cat /proc/cmdline); do esac done -if [ -z ${NORESUME} ]; then +if [ -z "${NORESUME}" ]; then export resume=${RESUME} fi diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 5712bdd..0950b39 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -418,5 +418,6 @@ updated by Maximilian Attems . .SH SEE ALSO .BR -initramfs.conf (5), mkinitramfs (8), update-initramfs(8) - +.IR initramfs.conf (5), +.IR mkinitramfs (8), +.IR update-initramfs(8). diff --git a/initramfs.conf.5 b/initramfs.conf.5 index afd799b..8d6b621 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -32,6 +32,14 @@ The default setting is \fImost\fP. \fIlist\fP includes only modules from the additional modules list. +.TP +\fB BUSYBOX +Include busybox utilities for the boot scripts. +If set to 'n' +.B mkinitramfs +will build an initramfs whithout busybox. +Beware that many boot scripts need busybox utilities. + .SH NFS VARIABLES .TP \fB BOOT @@ -48,12 +56,14 @@ Specifies the network interface, like eth0. Defaults to \fIauto\fP in order to pick up value from DHCP server. Otherwise you need to specify \fIHOST:MOUNT\fP. -.SH SEE ALSO - -.BR initramfs-tools (8), mkinitramfs (8), update-initramfs (8) .SH AUTHOR The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . Loosely based on mkinitrd.conf by Herbert Xu. +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). diff --git a/mkinitramfs b/mkinitramfs index 0f1cb58..52dea45 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -83,11 +83,16 @@ fi . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' -for i in ${CONFDIR}/conf.d/* /usr/share/initramfs-tools/conf.d/*; do +for i in ${CONFDIR}/conf.d/*; do EXTRA_CONF="${EXTRA_CONF} $(basename $i | grep '^[a-z0-9][a-z0-9\._-]*$' | grep -v '\.dpkg-.*$')"; done for i in ${EXTRA_CONF}; do -. ${CONFDIR}/conf.d/${i} + . ${CONFDIR}/conf.d/${i} +done +for i in /usr/share/initramfs-tools/conf.d/*; do + if [ -e $i ]; then + . ${i} + fi done if [ -z "${outfile}" ]; then @@ -135,7 +140,7 @@ if [ ! -e "${MODULESDIR}" ]; then echo "Cannot find ${MODULESDIR}" exit 1 fi -if [ ! -e "${MODULESDIR}/modules.depmod" ]; then +if [ ! -e "${MODULESDIR}/modules.dep" ]; then depmod ${version} fi @@ -228,6 +233,7 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / fi +[ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 871a0f4..2a3072b 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -46,5 +46,7 @@ This option queries if mkinitramfs can create ramdisks for kernel version mkinitramfs-kpkg is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR update-initramfs (8). diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 3dc2e2e..65f6203 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -13,9 +13,12 @@ mkinitramfs \- generate an initramfs image .RB [ \-r .IR root ] .RI [ version ] + .B mkinitramfs .RB [ \-\-supported-host-version= .IR hversion ] + +.B mkinitramfs .RB [ \-\-supported-target-version= .IR tversion ] @@ -90,5 +93,7 @@ The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), update-initramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR update-initramfs (8). diff --git a/scripts/functions b/scripts/functions index 53e07ca..9e578d7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -62,7 +62,7 @@ panic() modprobe -q i8042 modprobe -q atkbd echo $@ - PS1='(initramfs) ' /bin/sh /dev/console 2>&1 + PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } maybe_break() @@ -84,7 +84,7 @@ set_initlist() if [ ! -x ${si_x} ]; then continue fi - initlist="${initlist} $(basename ${si_x})" + initlist="${initlist} ${si_x#${initdir}/}" done } @@ -168,6 +168,10 @@ reduce_prereqs() call_scripts() { for cs_x in ${runlist}; do + # mkinitramfs verbose output + if [ "${verbose}" = "y" ]; then + echo "Calling hook ${cs_x}" + fi ${initdir}/${cs_x} # allow boot scripts to modify exported boot paramaters if [ -e /conf/param.conf ]; then diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 059e7a4..564d6f8 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -19,6 +19,15 @@ if [ "x${resume}" = "x" ]; then exit fi +case $resume in + LABEL=*) + resume="/dev/disk/by-label/${resume#LABEL=}" + ;; + UUID=*) + resume="/dev/disk/by-uuid/${resume#UUID=}" + ;; +esac + if [ ! -e "${resume}" ]; then exit fi diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 5323a7d..9a45220 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="md" +PREREQ="mdadm" prereqs() { diff --git a/update-initramfs b/update-initramfs index 85a5dd2..ea74136 100755 --- a/update-initramfs +++ b/update-initramfs @@ -66,9 +66,9 @@ generate_initramfs() echo "update-initramfs: Generating ${initramfs}" OPTS="-o" if [ "${verbose}" = 1 ]; then - OPTS="-v $OPTS" + OPTS="-v ${OPTS}" fi - if mkinitramfs "${OPTS}" "${initramfs}" "${version}"; then + if mkinitramfs ${OPTS} "${initramfs}" "${version}"; then set_sha1 else mkinitramfs_return="$?" diff --git a/update-initramfs.8 b/update-initramfs.8 index a36e83c..7cfc206 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -67,5 +67,7 @@ The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . .SH SEE ALSO - -.BR initramfs.conf (5), initramfs-tools (8), mkinitramfs (8) +.BR +.IR initramfs.conf (5), +.IR initramfs-tools (8), +.IR mkinitramfs (8). -- cgit v1.2.3 From 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 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 a44616dd8e197c348d6061db84c2a6893fae5a27 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Aug 2006 09:31:06 +0200 Subject: - revert s/mount/nfsmount debian busybux has no nfs support lately --- debian/changelog | 10 ++++++++++ scripts/nfs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a43c6b0..028f0e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +initramfs-tools (0.73b) unstable; urgency=high + + * Revert nfs change in 0.70: Debian busybox is build with CONFIG_NFSMOUNT=n. + Reuse nfsmount from klibc. nfsroot parsing needs more care for the next + release. Now at least support those users where nfs previously worked. + Thanks Vagrant Cascadian for report. + (closes: 380686). High urgency to get this into testing. + + -- maximilian attems Fri, 4 Aug 2006 09:53:46 +0200 + initramfs-tools (0.73) unstable; urgency=high * debian/initramfs-tools.postrm: Don't forget to remove config file diff --git a/scripts/nfs b/scripts/nfs index 47e9ac1..5bfb03d 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -33,7 +33,7 @@ mountroot () roflag="-o rw" fi - mount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} + nfsmount -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 317940266751218ffa46581a44260619ade32e0a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Aug 2006 09:32:03 +0200 Subject: revert klibc-utils resume usage for now. --- debian/changelog | 8 ++++++++ debian/control | 2 +- scripts/local-premount/resume | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 028f0e6..b613529 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.73c) unstable; urgency=low + + * scripts/local-premount/resume: Revert klibc-utils resume usage until + breakage cause is known. Thus downgrade klibc dep to 1.4.8-0. Thanks + Steinar H. Gunderson for report. (closes: #381475) + + -- maximilian attems Sat, 5 Aug 2006 09:31:16 +0200 + initramfs-tools (0.73b) unstable; urgency=high * Revert nfs change in 0.70: Debian busybox is build with CONFIG_NFSMOUNT=n. diff --git a/debian/control b/debian/control index 53caa8f..a9d0e90 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.8-0), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 564d6f8..593df78 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -33,5 +33,8 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then - resume ${resume} +# FIXME: klibc-utils resume needs more tests +# resume ${resume} + major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') + echo $major_minor >/sys/power/resume fi -- cgit v1.2.3 From 9bd9dc139d5001f7fce1245b2854080859fba9de Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 12 Aug 2006 09:18:39 +0200 Subject: - fix mdadm config path location --- debian/changelog | 7 +++++++ scripts/local-top/mdraid | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b613529..d930d08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.73d) unstable; urgency=low + + * scripts/local-top/mdraid: Fix path of expected mdadm config file. + Thanks Daniel Dickinson for report. (closes: 382602) + + -- maximilian attems Sat, 12 Aug 2006 09:02:10 +0200 + initramfs-tools (0.73c) unstable; urgency=low * scripts/local-premount/resume: Revert klibc-utils resume usage until diff --git a/scripts/local-top/mdraid b/scripts/local-top/mdraid index 2cf3b5d..8649aa4 100755 --- a/scripts/local-top/mdraid +++ b/scripts/local-top/mdraid @@ -38,4 +38,4 @@ done # Assemble all raid devices mkdir /dev/md -mdadm --assemble --config=/etc/mdadm.conf --scan --run --auto=yes +mdadm --assemble --config=/conf/mdadm.conf --scan --run --auto=yes -- cgit v1.2.3 From 659764e8cdb1dbffd4860348c113a5834ed4e09b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 12 Aug 2006 09:44:49 +0200 Subject: - really remove hooks/lvm - mkinitramfs: fix conf.d handling, thanks to vagrant patch - mkinitramfs.8: document conf.d usage --- debian/changelog | 15 +++++++++++++-- mkinitramfs | 17 ++++++++++------- mkinitramfs.8 | 8 +++++++- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index d930d08..3dec716 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,20 @@ -initramfs-tools (0.73d) unstable; urgency=low +initramfs-tools (0.73d) unstable; urgency=high * scripts/local-top/mdraid: Fix path of expected mdadm config file. Thanks Daniel Dickinson for report. (closes: 382602) - -- maximilian attems Sat, 12 Aug 2006 09:02:10 +0200 + * mkinitramfs: Treat /usr/share/initramfs-tools/conf.d config snippets as + the configuration files in /etc/initramfs-tools/conf.d. A configuration + file with the same name will override the first. (closes: 381315) + Thanks Vagrant Cascadian for the patch. + + * mkinitramfs.8: Document conf.d existence. + + * hooks/lvm: Really remove it, logic is in mkinitramfs. + + * urgency high for the mdraid bug fix, rest is trivial. + + -- maximilian attems Sat, 12 Aug 2006 09:43:55 +0200 initramfs-tools (0.73c) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index 799b77e..1f0a736 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -83,15 +83,14 @@ fi . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' -for i in ${CONFDIR}/conf.d/*; do +for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/conf.d/*; do EXTRA_CONF="${EXTRA_CONF} $(basename $i | grep '^[a-z0-9][a-z0-9\._-]*$' | grep -v '\.dpkg-.*$')"; done for i in ${EXTRA_CONF}; do - . ${CONFDIR}/conf.d/${i} -done -for i in /usr/share/initramfs-tools/conf.d/*; do - if [ -e $i ]; then - . ${i} + if [ -e ${CONFDIR}/conf.d/${i} ]; then + . ${CONFDIR}/conf.d/${i} + elif [ -e /usr/share/initramfs-tools/conf.d/${i} ]; then + . /usr/share/initramfs-tools/conf.d/${i} fi done @@ -204,7 +203,11 @@ 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 + if [ -e "${CONFDIR}/conf.d/${i}" /conf/conf.d ]; then + copy_exec "${CONFDIR}/conf.d/${i}" /conf/conf.d + elif [ -e "/usr/share/initramfs-tools/conf.d/${i}" ]; then + copy_exec "/usr/share/initramfs-tools/conf.d/${i}" /conf/conf.d + fi done echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 65f6203..9041ba6 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/02/17 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2006/08/12 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -82,6 +82,12 @@ Specified modules will be put in the generated image and loaded when the system which is described in .BR modules (5). +.TP +.I /etc/initramfs-tools/conf.d +The conf.d directory allows to hardcode bootargs at initramfs build time +via config snippets. This allows to set ROOT or RESUME. +This is especially useful for bootloaders, which do not pass an root bootarg. + .TP .I /etc/initramfs-tools/DSDT.aml If this file exists, it will be appended to the initramfs in a way that causes -- cgit v1.2.3 From a84613ae7742190e50cc619eee462cc0cd17f6c8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 13 Aug 2006 10:24:04 +0200 Subject: - conf.d configuration test was bogus, fixes: /usr/sbin/mkinitramfs: line 206: [: /etc/initramfs-tools/conf.d/resume: binary operator expected --- debian/changelog | 6 ++++++ mkinitramfs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3dec716..1686466 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.73e) unstable; urgency=high + + * mkinitramfs: Fix if statement for conf.d. (closes: 382740) + + -- maximilian attems Sun, 13 Aug 2006 10:05:10 +0200 + initramfs-tools (0.73d) unstable; urgency=high * scripts/local-top/mdraid: Fix path of expected mdadm config file. diff --git a/mkinitramfs b/mkinitramfs index 1f0a736..3df30ec 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -203,7 +203,7 @@ done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf for i in ${EXTRA_CONF}; do - if [ -e "${CONFDIR}/conf.d/${i}" /conf/conf.d ]; then + if [ -e "${CONFDIR}/conf.d/${i}" ]; then copy_exec "${CONFDIR}/conf.d/${i}" /conf/conf.d elif [ -e "/usr/share/initramfs-tools/conf.d/${i}" ]; then copy_exec "/usr/share/initramfs-tools/conf.d/${i}" /conf/conf.d -- cgit v1.2.3 From 839572386f35bf4b4404dac5f976566bc155de94 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Aug 2006 17:14:01 +0200 Subject: Release 0.74: - scripts/functions: fix debug boot param - update-initramfs: checkout /etc/kernel-img.conf if lilo and grub is installed - rename mdraid to mdrun, readd mdrun as it seems to work much better with sarge systems - add an help message for rescue shell - better package desc --- debian/changelog | 25 +++++++++++++++++++++++++ debian/control | 12 ++++++------ mkinitramfs | 1 + scripts/functions | 6 +++--- scripts/local | 2 ++ scripts/local-premount/resume | 6 ++---- scripts/local-top/mdraid | 41 ----------------------------------------- scripts/local-top/mdrun | 41 +++++++++++++++++++++++++++++++++++++++++ update-initramfs | 22 ++++++++++++++++++---- 9 files changed, 98 insertions(+), 58 deletions(-) delete mode 100755 scripts/local-top/mdraid create mode 100755 scripts/local-top/mdrun diff --git a/debian/changelog b/debian/changelog index 1686466..f089fe6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,28 @@ +initramfs-tools (0.74) unstable; urgency=low + + * scripts/local-premount/resume: Reuse klibc resume, hardcode path as + uswsusp shipps too an resume binary in initramfs-tools. Thus tighten + again klibc dep to 1.4.11-1. (closes: 381535) + + * mkinitramfs: Readd mdrun when around. + + * scripts/local-top/mdrun: Rename from mdraid. Use mdrun as previously, + there is no guarantee that the sarge mdadm works and that the sarge + mdadm.conf has any sense. + + * debian/control: Better package description. + + * scripts/local: mountroot add message what to check if root is not found + in 2 straight lines to keep as much of scrolling buffer. + + * scripts/functions: Use set ``--'' to change positional paramaters without + changing any options. This is useful for the debug bootparam on d?ash. + + * update-initramfs: Respect "do_bootloader = yes" from /etc/kernel-img.conf + to call lilo if both lilo and grub are installed. (closes: 382013) + + -- maximilian attems Thu, 17 Aug 2006 16:50:51 +0200 + initramfs-tools (0.73e) unstable; urgency=high * mkinitramfs: Fix if statement for conf.d. (closes: 382740) diff --git a/debian/control b/debian/control index a9d0e90..24d1bdc 100644 --- a/debian/control +++ b/debian/control @@ -8,13 +8,13 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.8-0), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs - This package contains tools to create and boot an initramfs for prepackaged - 2.6 Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the + This package contains tools to create and boot an initramfs for packaged 2.6 + Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the kernel unpacks that archive into RAM, mounts and uses it as initial root file - system. From there on the mounting of the real root file system occurs in user - space. klibc handles the boot-time networking setup. Having the root on NFS - is also supported. + system. The mounting of the real root file system occurs in early user space. + klibc provides utilities to setup root. Having the root on EVMS, MD, LVM2, + LUKS or NFS is also supported. Any boot loader with initrd support is able to load an initramfs archive. diff --git a/mkinitramfs b/mkinitramfs index 3df30ec..67d9df0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -235,6 +235,7 @@ run_scripts "${CONFDIR}"/hooks if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then mdadm --examine --scan > $DESTDIR/conf/mdadm.conf copy_exec /sbin/mdadm /sbin + copy_exec /sbin/mdrun /sbin for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do manual_add_modules ${x} done diff --git a/scripts/functions b/scripts/functions index 9e578d7..e9d7a07 100644 --- a/scripts/functions +++ b/scripts/functions @@ -117,7 +117,7 @@ get_prereqs() count_unsatisfied() { - set - ${@} + set -- ${@} return ${#} } @@ -126,7 +126,7 @@ pop_list_item() { item=${1} shift - set - ${@} + set -- ${@} unset tmppop # Iterate for pop in ${@}; do @@ -143,7 +143,7 @@ reduce_prereqs() { unset runlist set_initlist - set - ${initlist} + set -- ${initlist} i=$# # Loop until there's no more in the queue to loop through while [ ${i} -ne 0 ]; do diff --git a/scripts/local b/scripts/local index 8510088..0b9baab 100644 --- a/scripts/local +++ b/scripts/local @@ -33,6 +33,8 @@ mountroot () # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do + echo " Check root= bootarg cat /proc/cmdline" + echo " or missing modules, devices: cat /proc/modules ls /dev" panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 593df78..881af90 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -33,8 +33,6 @@ if [ ! -e "${resume}" ]; then fi if [ -e /sys/power/resume ]; then -# FIXME: klibc-utils resume needs more tests -# resume ${resume} - major_minor=$(ls -l ${resume} | awk '{printf "%d:%d", $5, $6}') - echo $major_minor >/sys/power/resume + # hardcode path, uswsusp ships an resume binary too + /bin/resume ${resume} fi diff --git a/scripts/local-top/mdraid b/scripts/local-top/mdraid deleted file mode 100755 index 8649aa4..0000000 --- a/scripts/local-top/mdraid +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ -e /scripts/local-top/mdadm ]; then - exit 0 -fi - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -# Assemble all raid devices -mkdir /dev/md -mdadm --assemble --config=/conf/mdadm.conf --scan --run --auto=yes diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun new file mode 100755 index 0000000..1b6ca3e --- /dev/null +++ b/scripts/local-top/mdrun @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="udev_helper" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ -e /scripts/local-top/mdadm ]; then + exit 0 +fi + +unset raidlvl +gotraid=n + +# Detect raid level +for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do + if [ ! -e ${x} ]; then + continue + fi + raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi +done + +[ "${gotraid}" = y ] || exit + +# Assemble all raid devices +# FIXME: assemble root raid first due to initrd-tools compatibility +/sbin/mdrun /dev diff --git a/update-initramfs b/update-initramfs index ea74136..e7dc586 100755 --- a/update-initramfs +++ b/update-initramfs @@ -81,11 +81,28 @@ generate_initramfs() fi } +# lilo call +run_lilo() +{ + lilo -t > /dev/null + if [ $? -eq 0 ]; then + lilo + fi +} + # only run lilo if no grub is around +# or if "do_bootloader = yes" is set run_bootloader() { if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then + do_bootloader=$(awk '/bootloader/{print $2}' \ + /etc/kernel-img.conf) + if [ "${do_bootloader}" = "yes" ]; then + run_lilo + return 0 + fi + echo echo "WARNING: grub and lilo installed." echo "If you use grub as bootloader everything is fine." @@ -95,10 +112,7 @@ run_bootloader() return 0 fi if [ -e /etc/lilo.conf ]; then - lilo -t > /dev/null - if [ $? -eq 0 ]; then - lilo - fi + run_lilo fi } -- cgit v1.2.3 From d1d6763409a1260708423e0092d7bc4182275773 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Aug 2006 15:59:40 +0200 Subject: - really add DAC960 + add megaraid_sas - update TODO - first take at the panic parsing - do_bootloader variable is not case sensitive, catch more cases - if panic is set to 0 reboot and don't open console, needs still work for all other values. --- debian/TODO | 6 +++--- debian/changelog | 20 ++++++++++++++++++++ hook-functions | 11 ++++++----- init | 4 ++++ scripts/functions | 4 ++++ update-initramfs | 5 +++-- 6 files changed, 40 insertions(+), 10 deletions(-) diff --git a/debian/TODO b/debian/TODO index 2c2edc0..7b9bf0a 100644 --- a/debian/TODO +++ b/debian/TODO @@ -5,10 +5,10 @@ TODO o Eliminate ?udev?, ?klibc?, busybox (-> glibc). - o Support list and dep options + o Better heuristics for MODULES=dep option o Default to dep for PPC - Possibly to detect newworld? - o lilo timeouts handling + o udevsettle timeouts handling - o mdadm + lvm2 hooks to their respective packages + o lvm2 hooks to their respective packages diff --git a/debian/changelog b/debian/changelog index f089fe6..995d76d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.75) unstable; urgency=high + + * hook-functions: Add megaraid_sas to the scsi list. Thanks Kenshi Muto + . + + * init: Parse for "panic=" bootarg. + + * hook-functions: Immediately call reboot in the panic function if panic=0 + to disallow any console access for secured boxes. (closes: 378455) + + * debian/TODO: Update to current state + + * update-initramfs: do_bootloader can be set mixed case or upper case. + Catch the obvious Yes and YES too. + + * hook-functions: Really include DAC960 driver. Thanks Tim Small + . (closes: 383486) 2 module fixes thus urgency high. + + -- maximilian attems Fri, 18 Aug 2006 15:35:09 +0200 + initramfs-tools (0.74) unstable; urgency=low * scripts/local-premount/resume: Reuse klibc resume, hardcode path as diff --git a/hook-functions b/hook-functions index 3175cba..08f396d 100644 --- a/hook-functions +++ b/hook-functions @@ -169,12 +169,13 @@ auto_add_modules() scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ - cciss ch cpqarray dac960 dc395x dmx3191d dpt_i2o eata fdomain \ + cciss ch cpqarray DAC960 dc395x dmx3191d dpt_i2o eata fdomain \ gdth hptiop ibmvscsic initio ipr ips isp1020 lpfc max_scsi \ - mac53c94 megaraid megaraid_mbox megaraid_mm mesh mptfc \ - mptscsih mptsas mptspi nsp32 osst qla1280 qla2100 qla2200 \ - qla2300 qla2322 qla2xxx qla6312 qlogicfas408 qlogicfc sata_mv \ - sata_nv sata_promise sata_qstor sata_sil sata_sis sata_svw \ + mac53c94 megaraid megaraid_mbox megaraid_mm megaraid_sas \ + mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 \ + qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 \ + qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ + sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ sd_mod sym53c8xx tmscsim zfcp; do diff --git a/init b/init index 69d9542..ab679b5 100755 --- a/init +++ b/init @@ -43,6 +43,7 @@ export readonly=y export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} +export panic for x in $(cat /proc/cmdline); do case $x in @@ -81,6 +82,9 @@ for x in $(cat /proc/cmdline); do noresume) NORESUME=y ;; + panic=*) + panic="${x#panic=}" + ;; quiet) quiet=y ;; diff --git a/scripts/functions b/scripts/functions index e9d7a07..178ad5d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -59,6 +59,10 @@ panic() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "QUIT" fi + # Disallow console access + if [ "${panic}" = 0 ]; then + reboot + fi modprobe -q i8042 modprobe -q atkbd echo $@ diff --git a/update-initramfs b/update-initramfs index e7dc586..3ce8f1f 100755 --- a/update-initramfs +++ b/update-initramfs @@ -96,9 +96,10 @@ run_bootloader() { if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then - do_bootloader=$(awk '/bootloader/{print $2}' \ + do_b=$(awk '/bootloader/{print $2}' \ /etc/kernel-img.conf) - if [ "${do_bootloader}" = "yes" ]; then + if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ + || [ "${do_b}" = "YES" ]; then run_lilo return 0 fi -- cgit v1.2.3 From fabe918dee7da26d177d67d4aa8fe3fd6e83e513 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 23 Aug 2006 09:22:54 +0200 Subject: - improved nfsroo parsing - added rootdelay and rootfstype bootargs - document this changes - initrd-tools backward compatible mdadm assembe and then run mdrun - update-initramfs really checkout use_bootloader from /etc/kernel-img.conf - tighter klibc deps --- debian/NEWS | 13 +++++++++++++ debian/changelog | 39 ++++++++++++++++++++++++++++++++++++++ debian/control | 2 +- init | 13 +++++++++++-- initramfs-tools.8 | 50 ++++++++++++++++++++++++++++++++++++++++--------- mkinitramfs | 19 +++++++++++++++++-- scripts/functions | 9 +++------ scripts/local | 19 +++++++++++++++---- scripts/local-top/mdrun | 9 +++++++-- scripts/nfs | 48 +++++++++++++++++++++++++++++++++++++++++++++-- update-initramfs | 5 +++-- 11 files changed, 196 insertions(+), 30 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index a6ae4bc..9ac39f5 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,16 @@ +initramfs-tools (0.76) unstable; urgency=low + + * This release features nfs auto detection in the initramfs. + The boot paramaters are parsed according to the linux source + Documentation/kernel-parameters.txt and more specifically + Documentation/nfsroot.txt. + + The initramfs-tools(8) manpage documents the parsed boot parameter. + Note that the undocumented and non compliant nfsoption bootarg got + dropped. + + -- maximilian attems Wed, 23 Aug 2006 08:47:26 +0200 + initramfs-tools (0.61) unstable; urgency=low * This release moves the initramfs-tools confdir from /etc/mkinitramfs to diff --git a/debian/changelog b/debian/changelog index 995d76d..a5ac22f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +initramfs-tools (0.76) unstable; urgency=medium + + * debian/control: Tighten klibc to 1.4.19-2 for fixed nuke. (closes: 383730) + + * mkinitramfs: Only hard code root when root arg got passed. + + * init: Parse /proc/cmdline for rootfstype, initrd-tools did it too. + + * init: Parse /proc/cmdline for rootdelay. + + * scripts/local: Use eventual rootfstype and rootdelay info. + + * initramfs-tools.8: Add more docs about boot args, s/2.6.15/2.6.17/. + + * scripts/functions: Simplify parse_numeric() by arithmetic calculation, + instead of working on it's representation. Thanks to tarski. + (launchpad.net/21759) Much more elegant than the 0.58 version fix. + + * mkinitramfs: Parse rootraid for sarge compatibility and pass the info + to the initramfs if etch mdadm is not yet installed. + + * scripts/local-top/mdrun: Assemble the root raid first before mdrun. + Thanks martin f krafft . (closes: 383908, 384063) + + * update-initramfs: Check if /etc/kernel-img.conf is readable, + before attempting to parse also check for the right field. + + * init: Check for root=/dev/nfs. Parse ip kernel command line for nfsroot. + Drop undocumented and not compliant nfsopts. + + * scripts/nfs: Add ip parsing conforming to Documentation/nfsroot.txt. + Use the nfsroot bootparam in combination with eventual ip provided + device or server-ip. Do minor code cleanups. Both items based on patches + by Vagrant Cascadian . (closes: 380649) + + * Set urgency medium due to large number of serious bug fixes. + + -- maximilian attems Wed, 23 Aug 2006 08:17:51 +0200 + initramfs-tools (0.75) unstable; urgency=high * hook-functions: Add megaraid_sas to the scsi list. Thanks Kenshi Muto diff --git a/debian/control b/debian/control index 24d1bdc..dd4c3b3 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.11-1), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.19-2), 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 packaged 2.6 diff --git a/init b/init index ab679b5..386ec37 100755 --- a/init +++ b/init @@ -59,19 +59,28 @@ for x in $(cat /proc/cmdline); do UUID=*) ROOT="/dev/disk/by-uuid/${ROOT#UUID=}" ;; + /dev/nfs) + BOOT=nfs + ;; esac ;; rootflags=*) ROOTFLAGS="-o ${x#rootflags=}" ;; + rootfstype=*) + ROOTFSTYPE="${x#rootfstype=}" + ;; + rootdelay=*) + ROOTDELAY="${x#rootdelay=}" + ;; cryptopts=*) cryptopts="${x#cryptopts=}" ;; nfsroot=*) NFSROOT="${x#nfsroot=}" ;; - nfsopts=*) - NFSOPTS="-o ${x#nfsopts=}" + ip=*) + IPOPTS="${x#ip=}" ;; boot=*) BOOT=${x#boot=} diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 0950b39..7af09e1 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2005/12/06" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/08/19" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -29,18 +29,44 @@ arguments which influence the boot procedure: .SS Boot options +The init and root are usually passed by the boot loader for local boot. +The other parameters are optional. + .TP \fB \fI init the binary to hand over execution to on the root fs after the initramfs scripts are done. .TP \fB \fI root -the device node to mount as the rootfs. +the device node to mount as the root file system. + +.TP +\fB \fI rootdelay +set delay in seconds. Determines how long mountroot waits for root to appear. + +.TP +\fB \fI rootflags +set the file system mount option string. + +.TP +\fB \fI rootfstype +set the root file system type. .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 or NFSSERVER:NFSPATH:NFSOPTS. +Use root=/dev/nfs for NFS to kick to in. + +.TP +\fB \fI ip +tells how to configure the ip adress. Allows to specify an different +NFS server than the DHCP server. See Documentation/nfsroot.txt in +any recent linux source for details. Optional paramater for NFS root. + +.TP +\fB \fI cryptopts +passes the args for cryptoroot. Set by the cryptsetup boot hooks. .TP \fB \fI boot @@ -50,27 +76,33 @@ either local or NFS (affects which initramfs scripts are run, see the "Subdirect \fB \fI resume On install initramfs-tools tries to autodetect the resume partition. On success the RESUME variable is written to /etc/initramfs-tools/conf.d/resume. -The boot variable overrides it. +The boot variable noresume overrides it. .TP \fB \fI quiet -reduces the amount of text output to the console during boot +reduces the amount of text output to the console during boot. .TP \fB \fI ro -mounts the rootfs read-only +mounts the rootfs read-only. .TP \fB \fI rw -mounts the rootfs read-write +mounts the rootfs read-write. + +.TP +\fB \fI panic +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 to /tmp/initramfs.debug. .TP \fB \fI break spawns a shell in the initramfs image at chosen run-time +(top, modules, premount, mount, bottom, init). +The default is premount without any arg. .SH HOOK SCRIPTS @@ -404,7 +436,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.15-1-686 | \\ +gunzip -c -9 /boot/initrd.img-2.6.17-2-686 | \\ cpio -i -d -H newc --no-absolute-filenames .fi .RE diff --git a/mkinitramfs b/mkinitramfs index 67d9df0..759d6cb 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -209,7 +209,11 @@ for i in ${EXTRA_CONF}; do copy_exec "/usr/share/initramfs-tools/conf.d/${i}" /conf/conf.d fi done -echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root + +# ROOT hardcoding +if [ -n "${ROOT}" ]; then + echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root +fi # Busybox if [ "x${BUSYBOX}" = "xn" ]; then @@ -233,7 +237,18 @@ 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 + # use mkinitrd magic for Sarge backwards compat + rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')" + echo "rootraiddev=${rootraiddev}" > /conf/mdadm.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 "'\''" }' \ + >> /conf/mdadm.conf copy_exec /sbin/mdadm /sbin copy_exec /sbin/mdrun /sbin for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do diff --git a/scripts/functions b/scripts/functions index 178ad5d..7e67771 100644 --- a/scripts/functions +++ b/scripts/functions @@ -224,13 +224,10 @@ parse_numeric() { minor=${1#*:} major=${1%:*} ;; - [0-9][0-9][0-9]) - minor=$((0x${1#?})) - major=$((0x${1%??})) - ;; *) - minor=$((0x${1#??})) - major=$((0x${1%??})) + value=$(( 0x${1} )) + minor=$(( ${value} % 256 )) + major=$(( ${value} / 256 )) ;; esac diff --git a/scripts/local b/scripts/local index 0b9baab..9d71a5e 100644 --- a/scripts/local +++ b/scripts/local @@ -11,11 +11,18 @@ mountroot () # to deal with removable devices if [ ! -e "${ROOT}" ]; then log_begin_msg "Waiting for root file system..." + + # Default delay is 180s + if [ -z "${ROOTDELAY}" ]; then + slumber=180 + else + slumber=${ROOTDELAY} + fi if [ -x /sbin/usplash_write ]; then - /sbin/usplash_write "TIMEOUT 180" || true + /sbin/usplash_write "TIMEOUT ${slumber}" || true fi - slumber=1800 + slumber=$(( ${slumber} * 10 )) while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do /bin/sleep 0.1 slumber=$(( ${slumber} - 1 )) @@ -38,8 +45,12 @@ mountroot () panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done - # Get the root filesystem type - eval $(fstype < ${ROOT}) + # Get the root filesystem type if not set + if [ -z "${ROOTFSTYPE}" ]; then + eval $(fstype < ${ROOT}) + else + FSTYPE=${ROOTFSTYPE} + fi [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun index 1b6ca3e..3ed995c 100755 --- a/scripts/local-top/mdrun +++ b/scripts/local-top/mdrun @@ -36,6 +36,11 @@ done [ "${gotraid}" = y ] || exit -# Assemble all raid devices -# FIXME: assemble root raid first due to initrd-tools compatibility +# source the presumed root md and it's info +. ./conf/mdadm.conf + +# assemble root raid first due to initrd-tools compatibility +mdadm -A ${rootraiddev} -R -u $uuid $devices + +# assemble all raid devices /sbin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index 5bfb03d..844db70 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -13,13 +13,57 @@ mountroot () # For DHCP modprobe -q af_packet - ipconfig ${DEVICE} + # support ip options see linux sources Documentation/nfsroot.txt + case ${IPOPTS} in + none|off) + # Do nothing + ;; + ""|on|any) + # Bring up device + ipconfig ${DEVICE} + ;; + dhcp|bootb|rarp|both) + ipconfig -c ${IPOPTS} -d ${DEVICE} + ;; + *) + ipconfig -d $IPOPTS + + # grab device entry from full line + NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} + NEW_DEVICE=${NEW_DEVICE%:*} + if [ -n "${NEW_DEVICE}" ]; then + DEVICE="${NEW_DEVICE}" + fi + # grab server-ip + SERVER_IP=${IPOPTS#*:} + SERVER_IP=${SERVER_IP%:*:*:*:*:*:*} + ;; + esac + + # FIXME: who writes that? . /tmp/net-${DEVICE}.conf + + # get nfs root from dhcp if [ "x${NFSROOT}" = "xauto" ]; then NFSROOT=${ROOTSERVER}:${ROOTPATH} + # nfsroot=[:][,] + elif [ -n "${NFSROOT}" ]; then + # nfs options are an optional arg + if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then + NFSOPTS="-o ${NFSROOT#*,}" + fi + NFSROOT=${NFSROOT%%,*} + # server-ip could be passed by ip + if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then + if [ -n "${SERVER_IP}" ]; then + NFSROOT="${SERVER_IP}:${NFSROOT}" + else + NFSROOT=${ROOTSERVER}:${ROOTPATH} + fi + fi fi - if [ "x${NFSOPTS}" = "x" ]; then + if [ -z "${NFSOPTS}" ]; then NFSOPTS="-o retrans=10" fi diff --git a/update-initramfs b/update-initramfs index 3ce8f1f..1ec8c7d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -2,6 +2,7 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot +KPKGCONF=/etc/kernel-img.conf set -e @@ -96,8 +97,8 @@ run_bootloader() { if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then - do_b=$(awk '/bootloader/{print $2}' \ - /etc/kernel-img.conf) + [ -r "${KPKGCONF}" ] && \ + do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ || [ "${do_b}" = "YES" ]; then run_lilo -- cgit v1.2.3 From 45989c9f37db0ef23e984ea559f2da784a028366 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Aug 2006 17:04:33 +0200 Subject: - fix bashism - rename mdadm.conf in mdrun.conf - retry nfsmount - harden init - fix lvm boot script prereqs --- debian/changelog | 20 ++++++++++++++++++ debian/initramfs-tools.postinst | 2 +- hook-functions | 2 +- init | 6 ++++-- mkinitramfs | 11 +++++----- scripts/local | 2 +- scripts/local-top/lvm | 2 +- scripts/local-top/mdrun | 2 +- scripts/nfs | 45 ++++++++++++++++++++++++++++++----------- update-initramfs | 2 +- 10 files changed, 69 insertions(+), 25 deletions(-) diff --git a/debian/changelog b/debian/changelog index a5ac22f..bc635a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.77) unstable; urgency=medium + + * mkinitramfs, scripts/local-top/mdrun: Use mdrun.conf as config file. + Ship mdrun unconditionally if around, should help in recovery situations. + + * debian/initramfs-tools.postinst, hook-functions, mkinitramfs, + scripts/local, update-initramfs: Cleanup the "-a" and "-o" bashism. + + * scripts/nfs: Retry to mount NFS on eventual failure. (closes: 377643) + Based on a patch by Vagrant Cascadian . + + * init: Make sure there is an /dev and /root. Usually passed by the kernel. + Also /dev/null or /dev/console might already be shipped. + Based on a patch by David Härdeman . (closes: 340494) + + * scripts/local-top/lvm: Fix prereqs s/mdraid/mdrun, thus urgency medium. + Thanks Rainer Gauweiler for the notice. + + -- maximilian attems Fri, 25 Aug 2006 16:55:56 +0200 + initramfs-tools (0.76) unstable; urgency=medium * debian/control: Tighten klibc to 1.4.19-2 for fixed nuke. (closes: 383730) diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 5f46777..2f36f3f 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -7,7 +7,7 @@ if [ ! -e /etc/initramfs-tools/modules ]; then fi # Regenerate initramfs on upgrade -if [ "$1" = "configure" -a -n "$2" ]; then +if [ "$1" = "configure" ] && [ -n "$2" ]; then update-initramfs -u fi diff --git a/hook-functions b/hook-functions index 08f396d..bfbe56a 100644 --- a/hook-functions +++ b/hook-functions @@ -48,7 +48,7 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" - if [ -n "${verbose}" -a "${verbose}" = "y" ]; then + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then echo "Adding module ${mam_x}" fi done diff --git a/init b/init index 386ec37..a83dc39 100755 --- a/init +++ b/init @@ -2,6 +2,10 @@ echo "Loading, please wait..." +[ -d /dev ] || mkdir -m 0755 /dev +[ -d /root ] || mkdir --mode=0700 /root +[ -e /dev/console ] || mknod /dev/console c 5 1 +[ -e /dev/null ] || mknod /dev/null c 1 3 mkdir /sys mkdir /proc mkdir /tmp @@ -18,8 +22,6 @@ fi mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev > /dev/.initramfs-tools mkdir /dev/.initramfs -mknod /dev/console c 5 1 -mknod /dev/null c 1 3 # Export the dpkg architecture export DPKG_ARCH= diff --git a/mkinitramfs b/mkinitramfs index 759d6cb..d088efa 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -236,10 +236,10 @@ run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks # FIXME: Remove this Raid block after Etch releases -if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then +if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then # use mkinitrd magic for Sarge backwards compat rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')" - echo "rootraiddev=${rootraiddev}" > /conf/mdadm.conf + echo "rootraiddev=${rootraiddev}" > /conf/mdrun.conf mdadm=$(mdadm --detail "${rootraiddev}") echo "${mdadm}" | awk ' $1 == "Number" && $2 == "Major" { start = 1; next } @@ -248,16 +248,17 @@ if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then $2 == 0 && $3 == 0 { next } { devices = devices " " $NF } END { print "devices='\''" devices "'\''" }' \ - >> /conf/mdadm.conf + >> /conf/mdrun.conf copy_exec /sbin/mdadm /sbin - copy_exec /sbin/mdrun /sbin for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do manual_add_modules ${x} done fi +[ -x /sbin/mdrun ] && copy_exec /sbin/mdrun /sbin # FIXME: Remove this LVM block after Etch releases -if [ -x /sbin/vgchange -a -d /lib/lvm-200 -a ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then +if [ -x /sbin/vgchange ] && [ -d /lib/lvm-200 ] \ + && [ ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then copy_exec /lib/lvm-200/vgchange /sbin for x in dm_mod dm_snapshot dm_mirror; do manual_add_modules ${x} diff --git a/scripts/local b/scripts/local index 9d71a5e..e7bf23e 100644 --- a/scripts/local +++ b/scripts/local @@ -23,7 +23,7 @@ mountroot () fi slumber=$(( ${slumber} * 10 )) - while [ ${slumber} -gt 0 -a ! -e "${ROOT}" ]; do + while [ ${slumber} -gt 0 ] && [ ! -e "${ROOT}" ]; do /bin/sleep 0.1 slumber=$(( ${slumber} - 1 )) done diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index f9d1490..27053de 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="mdadm mdraid lvm2" +PREREQ="mdadm mdrun lvm2" prereqs() { diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun index 3ed995c..da890c5 100755 --- a/scripts/local-top/mdrun +++ b/scripts/local-top/mdrun @@ -37,7 +37,7 @@ done [ "${gotraid}" = y ] || exit # source the presumed root md and it's info -. ./conf/mdadm.conf +. ./conf/mdrun.conf # assemble root raid first due to initrd-tools compatibility mdadm -A ${rootraiddev} -R -u $uuid $devices diff --git a/scripts/nfs b/scripts/nfs index 844db70..f42ed22 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,17 +2,9 @@ # FIXME This needs error checking -# Paramter: Where the root should be mounted -mountroot () +# parse nfs bootargs + launch ipconfig and nfsmount +do_nfsmount() { - [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" - run_scripts /scripts/nfs-top - [ "$quiet" != "y" ] && log_end_msg - - modprobe -q nfs - # For DHCP - modprobe -q af_packet - # support ip options see linux sources Documentation/nfsroot.txt case ${IPOPTS} in none|off) @@ -40,7 +32,7 @@ mountroot () ;; esac - # FIXME: who writes that? + # FIXME: source ipconfig output - might overwrite aboves . /tmp/net-${DEVICE}.conf # get nfs root from dhcp @@ -78,9 +70,38 @@ mountroot () fi nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt} +} + +# NFS root mounting +mountroot() +{ + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" + run_scripts /scripts/nfs-top + [ "$quiet" != "y" ] && log_end_msg + + modprobe -q nfs + # For DHCP + modprobe -q af_packet + + # Default delay is around 180s + # FIXME: add usplash info + if [ -z "${ROOTDELAY}" ]; then + delay=180 + else + delay=${ROOTDELAY} + fi + + # loop until nfsmount succeds + # FIXME: another place of init bin hardcoding + while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}/sbin/init ]; do + [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" + do_nfsmount + # FIXME: ipconfig loops every min at least - better param?? + delay=$(( ${delay} - 1 )) + [ "$quiet" != "y" ] && log_end_msg + done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" run_scripts /scripts/nfs-bottom [ "$quiet" != "y" ] && log_end_msg - } diff --git a/update-initramfs b/update-initramfs index 1ec8c7d..c1e42ab 100755 --- a/update-initramfs +++ b/update-initramfs @@ -95,7 +95,7 @@ run_lilo() # or if "do_bootloader = yes" is set run_bootloader() { - if [ -x /sbin/grub -o -e /boot/grub/menu.lst ]; then + if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then if [ -e /etc/lilo.conf ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") -- cgit v1.2.3 From 8ae9783215c2845b50dfb70b919df0753c2b0dd9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 1 Sep 2006 16:18:29 +0200 Subject: - fix destination of the mdrun.conf for partial sarge upgrades - checkout if /sbin/lilo is really there - guard more dirs against creation - add /etc/kernel-img.conf to reportbug output --- debian/changelog | 20 ++++++++++++++++++++ debian/script | 6 ++++++ init | 6 +++--- mkinitramfs | 4 ++-- update-initramfs | 3 +++ 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc635a3..b46db63 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.78) unstable; urgency=medium + + * update-initramfs: Check in call_lilo() if /sbin/lilo is executable, + when /etc/lilo.conf exists (closes: 384967) - thus urgency medium. + + * init: Guard all dirs against creation. (closes: 385281) + + * debian/scripts: Add /etc/kernel-img.conf section, as update-initramfs + needs to act according to it. + + -- maximilian attems Thu, 31 Aug 2006 14:44:01 +0200 + +initramfs-tools (0.77b) unstable; urgency=high + + * mkinitramfs: Fix destination of mdrun.conf. Thanks for the report to + Scott Glenn . Urgency high as broken in testing + too and needed for partial mdadm upgrades. (closes: 385406) + + -- maximilian attems Thu, 31 Aug 2006 13:20:51 +0200 + initramfs-tools (0.77) unstable; urgency=medium * mkinitramfs, scripts/local-top/mdrun: Use mdrun.conf as config file. diff --git a/debian/script b/debian/script index b1b477d..a8e3dd9 100755 --- a/debian/script +++ b/debian/script @@ -13,3 +13,9 @@ echo echo "-- lsmod" lsmod echo + +if [ -r /etc/kernel-img.conf ]; then + echo "-- kernel-img.conf" + cat /etc/kernel-img.conf + echo +fi diff --git a/init b/init index a83dc39..0c336b3 100755 --- a/init +++ b/init @@ -6,9 +6,9 @@ echo "Loading, please wait..." [ -d /root ] || mkdir --mode=0700 /root [ -e /dev/console ] || mknod /dev/console c 5 1 [ -e /dev/null ] || mknod /dev/null c 1 3 -mkdir /sys -mkdir /proc -mkdir /tmp +[ -d /sys ] || mkdir /sys +[ -d /proc ] || mkdir /proc +[ -d /tmp ] || mkdir /tmp mkdir -p /var/lock mount -t sysfs none /sys mount -t proc none /proc diff --git a/mkinitramfs b/mkinitramfs index d088efa..c36e845 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -239,7 +239,7 @@ run_scripts "${CONFDIR}"/hooks if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then # use mkinitrd magic for Sarge backwards compat rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')" - echo "rootraiddev=${rootraiddev}" > /conf/mdrun.conf + echo "rootraiddev=${rootraiddev}" > ${DESTDIR}/conf/mdrun.conf mdadm=$(mdadm --detail "${rootraiddev}") echo "${mdadm}" | awk ' $1 == "Number" && $2 == "Major" { start = 1; next } @@ -248,7 +248,7 @@ if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then $2 == 0 && $3 == 0 { next } { devices = devices " " $NF } END { print "devices='\''" devices "'\''" }' \ - >> /conf/mdrun.conf + >> ${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} diff --git a/update-initramfs b/update-initramfs index c1e42ab..5cd1e2e 100755 --- a/update-initramfs +++ b/update-initramfs @@ -85,6 +85,9 @@ generate_initramfs() # lilo call run_lilo() { + if [ ! -x /sbin/lilo ]; then + return 1 + fi lilo -t > /dev/null if [ $? -eq 0 ]; then lilo -- cgit v1.2.3 From cf4bba337d69510c4551ba84e8c69562873ea93f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 4 Sep 2006 18:54:59 +0200 Subject: - better nfs handling: merge vagrant branch :) + local changes - cleanup stupid whitespace all over the place --- debian/changelog | 23 +++++++++++++++++++---- init | 4 ++-- initramfs.conf.5 | 4 ++-- mkinitramfs | 10 +++++----- scripts/local | 2 +- scripts/local-top/mdrun | 2 +- scripts/nfs | 35 ++++++++++++++++++----------------- update-initramfs.8 | 4 ++-- 8 files changed, 50 insertions(+), 34 deletions(-) diff --git a/debian/changelog b/debian/changelog index b46db63..1f00b6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,11 +8,26 @@ initramfs-tools (0.78) unstable; urgency=medium * debian/scripts: Add /etc/kernel-img.conf section, as update-initramfs needs to act according to it. - -- maximilian attems Thu, 31 Aug 2006 14:44:01 +0200 + * scripts/nfs: Fix parsing of etherboot ip options. Based on a patch by + to Vagrant Cascadian . (closes: 385252) + + * scripts/nfs: No need to duplicate work of ntfsmount. Thanks for the patch + to Vagrant Cascadian . (closes: 385226) + + * scripts/nfs: Add an sleep 0.1 in the retry loop to slow down retry + attempts. Only log "Retrying .." after first run. Use init variable. + (closes: 385624) + + * init: Reorder the early mknod after tmpfs mount. (closes: 385641) + + * initramfs.conf.5, mkinitramfs, scripts/local, scripts/local-top/mdrun, + scripts/nfs, update-initramfs.8, debian/changelog: Whitespace policy. + + -- maximilian attems Mon, 4 Sep 2006 17:38:13 +0200 initramfs-tools (0.77b) unstable; urgency=high - * mkinitramfs: Fix destination of mdrun.conf. Thanks for the report to + * mkinitramfs: Fix destination of mdrun.conf. Thanks for the report to Scott Glenn . Urgency high as broken in testing too and needed for partial mdadm upgrades. (closes: 385406) @@ -1347,7 +1362,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. @@ -1850,7 +1865,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/init b/init index 0c336b3..85f6291 100755 --- a/init +++ b/init @@ -4,8 +4,6 @@ echo "Loading, please wait..." [ -d /dev ] || mkdir -m 0755 /dev [ -d /root ] || mkdir --mode=0700 /root -[ -e /dev/console ] || mknod /dev/console c 5 1 -[ -e /dev/null ] || mknod /dev/null c 1 3 [ -d /sys ] || mkdir /sys [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp @@ -20,6 +18,8 @@ if [ -e /etc/udev/udev.conf ]; then . /etc/udev/udev.conf fi mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev +[ -e /dev/console ] || mknod /dev/console c 5 1 +[ -e /dev/null ] || mknod /dev/null c 1 3 > /dev/.initramfs-tools mkdir /dev/.initramfs diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 8d6b621..89e9f4b 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2005/12/06 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2006/09/02 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -35,7 +35,7 @@ The default setting is \fImost\fP. .TP \fB BUSYBOX Include busybox utilities for the boot scripts. -If set to 'n' +If set to 'n' .B mkinitramfs will build an initramfs whithout busybox. Beware that many boot scripts need busybox utilities. diff --git a/mkinitramfs b/mkinitramfs index c36e845..8d5911d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -242,11 +242,11 @@ if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then 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 } + $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 diff --git a/scripts/local b/scripts/local index e7bf23e..299fc65 100644 --- a/scripts/local +++ b/scripts/local @@ -48,7 +48,7 @@ mountroot () # Get the root filesystem type if not set if [ -z "${ROOTFSTYPE}" ]; then eval $(fstype < ${ROOT}) - else + else FSTYPE=${ROOTFSTYPE} fi diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun index da890c5..f733656 100755 --- a/scripts/local-top/mdrun +++ b/scripts/local-top/mdrun @@ -16,7 +16,7 @@ prereqs) esac if [ -e /scripts/local-top/mdadm ]; then - exit 0 + exit 0 fi unset raidlvl diff --git a/scripts/nfs b/scripts/nfs index f42ed22..c66e2a1 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,6 +2,8 @@ # FIXME This needs error checking +retry_nr=0 + # parse nfs bootargs + launch ipconfig and nfsmount do_nfsmount() { @@ -20,19 +22,21 @@ do_nfsmount() *) ipconfig -d $IPOPTS - # grab device entry from full line + # grab device entry from ip option NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} - NEW_DEVICE=${NEW_DEVICE%:*} + if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then + NEW_DEVICE=${NEW_DEVICE%:*} + else + # wrong parse, possibly only a partial string + NEW_DEVICE= + fi if [ -n "${NEW_DEVICE}" ]; then DEVICE="${NEW_DEVICE}" fi - # grab server-ip - SERVER_IP=${IPOPTS#*:} - SERVER_IP=${SERVER_IP%:*:*:*:*:*:*} ;; esac - - # FIXME: source ipconfig output - might overwrite aboves + + # source relevant ipconfig output . /tmp/net-${DEVICE}.conf # get nfs root from dhcp @@ -45,13 +49,8 @@ do_nfsmount() NFSOPTS="-o ${NFSROOT#*,}" fi NFSROOT=${NFSROOT%%,*} - # server-ip could be passed by ip if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then - if [ -n "${SERVER_IP}" ]; then - NFSROOT="${SERVER_IP}:${NFSROOT}" - else - NFSROOT=${ROOTSERVER}:${ROOTPATH} - fi + NFSROOT=${ROOTSERVER}:${NFSROOT} fi fi @@ -92,13 +91,15 @@ mountroot() fi # loop until nfsmount succeds - # FIXME: another place of init bin hardcoding - while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}/sbin/init ]; do + while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}${init} ]; do + [ ${retry_nr} -gt 0 ] && \ [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" - do_nfsmount + do_nfsmount # FIXME: ipconfig loops every min at least - better param?? delay=$(( ${delay} - 1 )) - [ "$quiet" != "y" ] && log_end_msg + [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg + [ ! -e ${rootmnt}/sbin/init ] && /bin/sleep 0.1 + retry_nr=$(( ${retry_nr} + 1 )) done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" diff --git a/update-initramfs.8 b/update-initramfs.8 index 7cfc206..fa1728a 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/02/17" $" "" "update-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/02" $" "" "update-initramfs manual" .SH NAME update-initramfs \- generate an initramfs image @@ -67,7 +67,7 @@ The initramfs-tools are written by Jeff Bailey . This manual is maintained by Maximilian Attems . .SH SEE ALSO -.BR +.BR .IR initramfs.conf (5), .IR initramfs-tools (8), .IR mkinitramfs (8). -- cgit v1.2.3 From 773f7f37a7a28977409e1369ae284d4ccc03812a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Sep 2006 09:29:44 +0200 Subject: - check for ro /boot - allow -k all for all modes and more feedback on deleting - small whitespace cleanup --- HACKING | 1 - break.txt | 4 ---- debian/changelog | 18 ++++++++++++++ update-initramfs | 69 +++++++++++++++++++++++++++++++++++------------------- update-initramfs.8 | 34 ++++++++++++++++++++++----- 5 files changed, 91 insertions(+), 35 deletions(-) delete mode 100644 break.txt diff --git a/HACKING b/HACKING index 2fd9136..d171c56 100644 --- a/HACKING +++ b/HACKING @@ -16,4 +16,3 @@ I hope this helps. I'll paste this text into a HACKING file on the hopes that s Tks, Jeff Bailey - diff --git a/break.txt b/break.txt deleted file mode 100644 index 64ecf84..0000000 --- a/break.txt +++ /dev/null @@ -1,4 +0,0 @@ -if [ x${break} = xyes ]; then - panic "Spawning shell within the initramfs" -fi - diff --git a/debian/changelog b/debian/changelog index 1f00b6d..6c06903 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +initramfs-tools (0.79) unstable; urgency=high + + * update-initramfs: Allow create and delete to work on "all" kernelversions. + Fixes bug on update to pass all the specified optional args. + Thanks to Osamu Aoki for the patch. (closes: 360281) + Improve it to parse args once and also highlight 'all' on usage. + + * update-initramfs.8: Document usage of "all" + add example section. + + * update-initramfs: On update check if /boot is ro, warn and exit. + Thanks to Alexander Wirt to improve the awk snippet. + + * update-initramfs: run_lilo don't return 1 if no lilo executable is there. + Thanks "Peter D. St. Onge" for the report. + (closes: 386999) + + -- maximilian attems Mon, 11 Sep 2006 22:11:54 +0200 + initramfs-tools (0.78) unstable; urgency=medium * update-initramfs: Check in call_lilo() if /sbin/lilo is executable, diff --git a/update-initramfs b/update-initramfs index 5cd1e2e..fa6c837 100755 --- a/update-initramfs +++ b/update-initramfs @@ -15,7 +15,7 @@ usage() Usage: ${0} [OPTION]... Options: - -k [version] Specify kernel version or all + -k [version] Specify kernel version or 'all' -c Create a new initramfs -u Update an existing initramfs -d Remove an existing initramfs @@ -86,7 +86,7 @@ generate_initramfs() run_lilo() { if [ ! -x /sbin/lilo ]; then - return 1 + return 0 fi lilo -t > /dev/null if [ $? -eq 0 ]; then @@ -138,6 +138,17 @@ delete_sha1() rm -f "${STATEDIR}/${version}" } +# ro /boot is not modified +ro_boot_check() +{ + boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) + if [ -n "${boot_opts}" ]; then + echo "WARNING: /boot is ro mounted." + echo "update-initramfs: Not updating ${initramfs}" + exit 0 + fi +} + get_sorted_versions() { version_list="" @@ -236,27 +247,10 @@ update() exit 0 fi - if [ "${version}" = "all" ]; then - : FIXME check for --yes, and if not ask are you sure - get_sorted_versions - if [ -z "${version_list}" ]; then - verbose "Nothing to do, exiting." - exit 0 - fi - 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}" -u -k "${u_version}" ${vflag} - set -e - done - exit 0 - fi - set_initramfs + ro_boot_check + altered_check generate_initramfs @@ -283,6 +277,8 @@ delete() altered_check + echo "update-initramfs: Deleting ${initramfs}" + delete_sha1 rm -f "${initramfs}" @@ -344,11 +340,38 @@ while getopts "k:cudyvtb:h?" flag; do done # Validate arguments - if [ -z "${mode}" ]; then usage "You must specify at least one of -c, -u, or -d." fi +if [ "${version}" = "all" ]; then + : FIXME check for --yes, and if not ask are you sure + get_sorted_versions + if [ -z "${version_list}" ]; then + verbose "Nothing to do, exiting." + exit 0 + fi + + OPTS="-b ${BOOTDIR}" + if [ "${verbose}" = "1" ]; then + OPTS="${OPTS} -v" + fi + if [ "${takeover}" = "1" ]; then + OPTS="${OPTS} -t" + fi + if [ "${yes}" = "1" ]; then + OPTS="${OPTS} -y" + fi + for u_version in ${version_list}; do + # Don't stop if one version doesn't work. + set +e + verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}" + "${0}" -${mode} -k "${u_version}" ${OPTS} + set -e + done + exit 0 +fi + case "${mode}" in c) create @@ -360,5 +383,3 @@ case "${mode}" in update ;; esac - - diff --git a/update-initramfs.8 b/update-initramfs.8 index fa1728a..871e9a5 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,10 +1,10 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/02" $" "" "update-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/06" $" "" "update\-initramfs manual" .SH NAME -update-initramfs \- generate an initramfs image +update\-initramfs \- generate an initramfs image .SH SYNOPSIS -.B update-initramfs +.B update\-initramfs .RB [ \-k .IR version ] .RB [ \-c ] @@ -15,7 +15,7 @@ update-initramfs \- generate an initramfs image .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. @@ -29,8 +29,17 @@ happens in this early userspace. .SH OPTIONS .TP \fB \-k \fI version -Set the kernel version for whom the initramfs will be generated. +Set the specific kernel version for whom the initramfs will be generated. For example the output of uname -r for your currently running kernel. +This argument is optional for update. The default is the latest kernel version. + +The use of "all" for the +.I version +string specifies +.B update\-initramfs +to execute the chosen action for all kernel versions, that are already known +to +.B update\-initramfs. .TP \fB \-c @@ -60,7 +69,20 @@ Set an different bootdir for the image creation. .TP \fB \-h Print a short help page describing the available options in -.B update-initramfs. +.B update\-initramfs. + +.SH EXAMPLES + +Update the initramfs of the newest kernel: + +.PP +.B update\-initramfs -u + + +Create the initramfs for a specific kernel: + +.PP +.B update\-initramfs -c -k 2.6.18-1-686 .SH AUTHOR The initramfs-tools are written by Jeff Bailey . -- cgit v1.2.3 From d4105f86b31e2c0fd35d060982a3f50e9eb9baf1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Sep 2006 16:54:36 +0200 Subject: - another run_lilo improvement --- debian/changelog | 7 +++++++ update-initramfs | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6c06903..51987c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.80) unstable; urgency=low + + * update-initramfs: Test for lilo executable earlier otherwise an warning + would be issued with grub installed and left over lilo config. + + -- maximilian attems Tue, 12 Sep 2006 15:59:14 +0200 + initramfs-tools (0.79) unstable; urgency=high * update-initramfs: Allow create and delete to work on "all" kernelversions. diff --git a/update-initramfs b/update-initramfs index fa6c837..d1b7026 100755 --- a/update-initramfs +++ b/update-initramfs @@ -85,9 +85,6 @@ generate_initramfs() # lilo call run_lilo() { - if [ ! -x /sbin/lilo ]; then - return 0 - fi lilo -t > /dev/null if [ $? -eq 0 ]; then lilo @@ -99,7 +96,7 @@ run_lilo() run_bootloader() { if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then - if [ -e /etc/lilo.conf ]; then + if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ -- cgit v1.2.3 From 681dc7a7566afa2de5fa7d1edf8aa1c25ec451a6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 19 Sep 2006 23:56:24 +0200 Subject: - more nfs work (timeout, parsing, typo) - lilo codeflow - add lasi700 scsi module --- debian/changelog | 17 +++++++++++++++-- hook-functions | 10 +++++----- scripts/nfs | 14 ++++++-------- update-initramfs | 3 ++- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 51987c7..d4033ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,22 @@ -initramfs-tools (0.80) unstable; urgency=low +initramfs-tools (0.80) unstable; urgency=high + + Release "O partigiano, portami via, che mi sento di morir." * update-initramfs: Test for lilo executable earlier otherwise an warning would be issued with grub installed and left over lilo config. - -- maximilian attems Tue, 12 Sep 2006 15:59:14 +0200 + * hook-functions: Add lasi700 to the scsi modules. (closes: 387909) Thanks + Nagilum . Thus urgency high. + + * scripts/nfs: Fix typo in ipconfig protocol handling, fix dhcp server + passing ser-ip as part of root-path, retry every second to not hammer + an FAI'ed nfs initramfs network. Thanks for input and patches + Vagrant Cascadian . While we are there refactor + the loop. (closes: 387841, 387808, 387809) + + * update-initramfs: Check if /proc is mounted for ro_boot_check. + + -- maximilian attems Tue, 19 Sep 2006 07:56:47 +0200 initramfs-tools (0.79) unstable; urgency=high diff --git a/hook-functions b/hook-functions index bfbe56a..9f4d890 100644 --- a/hook-functions +++ b/hook-functions @@ -170,11 +170,11 @@ auto_add_modules() for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ cciss ch cpqarray DAC960 dc395x dmx3191d dpt_i2o eata fdomain \ - gdth hptiop ibmvscsic initio ipr ips isp1020 lpfc max_scsi \ - mac53c94 megaraid megaraid_mbox megaraid_mm megaraid_sas \ - mesh mptfc mptscsih mptsas mptspi nsp32 osst qla1280 \ - qla2100 qla2200 qla2300 qla2322 qla2xxx qla6312 \ - qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ + gdth hptiop ibmvscsic initio ipr ips isp1020 lasi700 lpfc \ + max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm \ + megaraid_sas mesh mptfc mptscsih mptsas mptspi nsp32 \ + osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ + qla6312 qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ diff --git a/scripts/nfs b/scripts/nfs index c66e2a1..b3ac06f 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -16,7 +16,7 @@ do_nfsmount() # Bring up device ipconfig ${DEVICE} ;; - dhcp|bootb|rarp|both) + dhcp|bootp|rarp|both) ipconfig -c ${IPOPTS} -d ${DEVICE} ;; *) @@ -49,7 +49,7 @@ do_nfsmount() NFSOPTS="-o ${NFSROOT#*,}" fi NFSROOT=${NFSROOT%%,*} - if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then + if [ "${NFSROOT#:*}" = "$NFSROOT" ]; then NFSROOT=${ROOTSERVER}:${NFSROOT} fi fi @@ -83,7 +83,7 @@ mountroot() modprobe -q af_packet # Default delay is around 180s - # FIXME: add usplash info + # FIXME: add usplash_write info if [ -z "${ROOTDELAY}" ]; then delay=180 else @@ -91,15 +91,13 @@ mountroot() fi # loop until nfsmount succeds - while [ ${delay} -gt 0 ] && [ ! -e ${rootmnt}${init} ]; do + while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do [ ${retry_nr} -gt 0 ] && \ [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" do_nfsmount - # FIXME: ipconfig loops every min at least - better param?? - delay=$(( ${delay} - 1 )) - [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg - [ ! -e ${rootmnt}/sbin/init ] && /bin/sleep 0.1 retry_nr=$(( ${retry_nr} + 1 )) + [ ! -e ${rootmnt}${init} ] && /bin/sleep 1 + [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" diff --git a/update-initramfs b/update-initramfs index d1b7026..4a03614 100755 --- a/update-initramfs +++ b/update-initramfs @@ -113,7 +113,7 @@ run_bootloader() fi return 0 fi - if [ -e /etc/lilo.conf ]; then + if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then run_lilo fi } @@ -138,6 +138,7 @@ delete_sha1() # ro /boot is not modified ro_boot_check() { + [ -d /proc ] || return 0 boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." -- cgit v1.2.3 From b8c8f676a5f0da208b27e4d9bac71ae3814a1b97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 27 Sep 2006 16:03:30 +0200 Subject: - mkinitramfs: allow umask setting paranoid - revert an nfs changes small fixes over the place --- debian/changelog | 27 +++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 6 ++++-- hook-functions | 20 +++++++++++--------- mkinitramfs | 10 ++++++++-- scripts/nfs | 2 +- update-initramfs | 4 ++-- 6 files changed, 53 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index d4033ac..6efe40c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +initramfs-tools (0.81) unstable; urgency=low + + Release quick and happy spin j = l + s + + * update-initramfs: Really check for mounted /proc on use. (closes: 388241) + Thanks Alex Owen . While beeing in this business, + check for mounted proc in initramfs-tools.preinst too. + + * hook-functions: Add new scsi drivers aic94xx and stex. Add new net drivers + ehea, ep93xx_eth and qla3xxx. Thus urgency high. + + * update-initramfs: Use set ``--'' to change positional paramaters. Thanks + Jörg Sommer . (closes: 389726) + + * scripts/nfs: Revert to previous handling of dhcp server passing server-ip. + (closes: 387808) + + * debian/initramfs-tools.preinst: Fix comment typo, thanks + shaulka@012.net.il for the patch. (closes: 389486) + + * mkinitramfs: Allow an hook script to set an paranoid umask, considered + useful for shipping gpg keys inside of initramfs. Thanks Max Vozeler + and Lionel Elie Mamane for the + patch. (closes: 381677) + + -- maximilian attems Wed, 27 Sep 2006 15:56:46 +0200 + initramfs-tools (0.80) unstable; urgency=high Release "O partigiano, portami via, che mi sento di morir." diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index b92d393..7b02612 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -8,9 +8,11 @@ case "$1" in mkdir -p /etc/initramfs-tools/conf.d # First time install. Can we autodetect the RESUME partition? - RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + if [ -r /proc/swaps ]; then + RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + fi - # Inhertic initrd-tools settings if possible. + # Inherit initrd-tools settings if possible. if [ -e /etc/mkinitrd/mkinitrd.conf ]; then . /etc/mkinitrd/mkinitrd.conf fi diff --git a/hook-functions b/hook-functions index 9f4d890..9cb9712 100644 --- a/hook-functions +++ b/hook-functions @@ -148,9 +148,10 @@ auto_add_modules() ;; net) for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ - dl2k e1000 e100 epic100 eql fealnx famachi forcedeth \ - hp100 mace mv643xx_eth myri10ge natsemi ne2k-pci netconsole \ - ns83820 pcnet32 r8169 s2io sis900 skge slhc smc911x starfire \ + dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ + famachi forcedeth hp100 mace mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ + r8169 s2io sis900 skge slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do @@ -168,17 +169,18 @@ auto_add_modules() ;; scsi) for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx arcmsr ata_piix atari_scsi atp870u BusLogic \ - cciss ch cpqarray DAC960 dc395x dmx3191d dpt_i2o eata fdomain \ - gdth hptiop ibmvscsic initio ipr ips isp1020 lasi700 lpfc \ - max_scsi mac53c94 megaraid megaraid_mbox megaraid_mm \ - megaraid_sas mesh mptfc mptscsih mptsas mptspi nsp32 \ + aic79xx aic7xxx aic94xx arcmsr ata_piix atari_scsi \ + atp870u BusLogic cciss ch cpqarray DAC960 dc395x \ + dmx3191d dpt_i2o eata fdomain gdth hptiop ibmvscsic \ + initio ipr ips isp1020 lasi700 lpfc max_scsi mac53c94 \ + megaraid megaraid_mbox megaraid_mm megaraid_sas \ + mesh mptfc mptscsih mptsas mptspi nsp32 \ osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ qla6312 qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ - sd_mod sym53c8xx tmscsim zfcp; do + sd_mod stex sym53c8xx tmscsim zfcp; do manual_add_modules "${x}" done ;; diff --git a/mkinitramfs b/mkinitramfs index 8d5911d..f667c53 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -28,8 +28,7 @@ while true; do fi ;; -o) - touch $2 - outfile="$(readlink -f "$2")" + outfile="$2" shift 2 ;; -k) @@ -94,6 +93,13 @@ for i in ${EXTRA_CONF}; do fi done +if [ -n "${UMASK}" ]; then + umask "${UMASK}" +fi + +touch $outfile +outfile="$(readlink -f "$outfile")" + if [ -z "${outfile}" ]; then usage fi diff --git a/scripts/nfs b/scripts/nfs index b3ac06f..fc869cc 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -49,7 +49,7 @@ do_nfsmount() NFSOPTS="-o ${NFSROOT#*,}" fi NFSROOT=${NFSROOT%%,*} - if [ "${NFSROOT#:*}" = "$NFSROOT" ]; then + if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then NFSROOT=${ROOTSERVER}:${NFSROOT} fi fi diff --git a/update-initramfs b/update-initramfs index 4a03614..45d4631 100755 --- a/update-initramfs +++ b/update-initramfs @@ -138,7 +138,7 @@ delete_sha1() # ro /boot is not modified ro_boot_check() { - [ -d /proc ] || return 0 + [ -r /proc/mounts ] || return 0 boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." @@ -201,7 +201,7 @@ set_linked_version() set_highest_version() { get_sorted_versions - set - ${version_list} + set -- ${version_list} version=${1} } -- cgit v1.2.3 From f49c698f4838b09794ebdd129e7eee14de2aad54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Oct 2006 16:22:08 +0200 Subject: add ide jmicron module + ubuntu changelogs add scsi qla4xxx module --- debian/changelog | 30 ++++++++++++++++++++++++++++++ hook-functions | 11 ++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6efe40c..2990625 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.82) unstable; urgency=high + + * Merge 0.69ubuntu15, plus 0.69ubuntu14 and 0.69ubuntu11 changelog entries + as not affected or already fixed. + + * hook-initramfs: Add qla4xxx support, thus urgency high. + + -- maximilian attems Thu, 5 Oct 2006 16:12:06 +0200 + initramfs-tools (0.81) unstable; urgency=low Release quick and happy spin j = l + s @@ -388,6 +397,27 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu15) edgy; urgency=low + + * Add jmicron module to ide list. + - Malone #63085 + + -- Ben Collins Wed, 4 Oct 2006 09:21:08 -0400 + +initramfs-tools (0.69ubuntu14) edgy; urgency=low + + * Remove stray "set -x" from scripts/local-premount/suspend. + + -- Adam Conrad Wed, 20 Sep 2006 08:35:05 +1000 + +initramfs-tools (0.69ubuntu11) edgy; urgency=low + + * since we ship /usr/share/initramfs-tools/conf.d as well as + /etc/initramfs-tools/conf.d, make sure mkinitramfs also reads from both, + not only from the /etc location + + -- Oliver Grawert Sun, 10 Sep 2006 11:50:14 +0200 + initramfs-tools (0.69ubuntu4) edgy; urgency=low * scripts/local-premount/suspend: Check for UUID= or LABEL= on the diff --git a/hook-functions b/hook-functions index 9cb9712..98c88a2 100644 --- a/hook-functions +++ b/hook-functions @@ -161,9 +161,10 @@ auto_add_modules() ide) for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ - generic hpt34x hpt366 it821x ns87415 opti621 pdc202xx_new \ - pdc202xx_old piix rz1000 sc1200 serverworks siimage \ - sis5513 slc82c105 slc90e66 triflex trm290 via82cxxx; do + generic hpt34x hpt366 it821x jmicron ns87415 opti621 \ + pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks \ + siimage sis5513 slc82c105 slc90e66 triflex trm290 \ + via82cxxx; do manual_add_modules "${x}" done ;; @@ -176,8 +177,8 @@ auto_add_modules() megaraid megaraid_mbox megaraid_mm megaraid_sas \ mesh mptfc mptscsih mptsas mptspi nsp32 \ osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ - qla6312 qlogicfas408 qlogicfc sata_mv sata_nv sata_promise \ - sata_qstor sata_sil sata_sis sata_svw \ + qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ + sata_promise sata_qstor sata_sil sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ sd_mod stex sym53c8xx tmscsim zfcp; do -- cgit v1.2.3 From 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 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 abb7b4e13f1fab5b6d9c4ea0682429c474931fa0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Oct 2006 09:11:54 +0200 Subject: whitespace policy --- update-initramfs | 3 +-- update-initramfs.8 | 8 ++++---- update-initramfs.conf.5 | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/update-initramfs b/update-initramfs index 4995553..11d48be 100755 --- a/update-initramfs +++ b/update-initramfs @@ -7,7 +7,7 @@ KPKGCONF=/etc/kernel-img.conf set -e -[ -r ${CONF} ] && . ${CONF} +[ -r ${CONF} ] && . ${CONF} usage() { @@ -89,7 +89,6 @@ backup_booted_initramfs() verbose "Backup ${initramfs}.bak" return 0 fi - # keep booted initramfs uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) diff --git a/update-initramfs.8 b/update-initramfs.8 index a562349..0db2609 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -33,12 +33,12 @@ Set the specific kernel version for whom the initramfs will be generated. For example the output of uname -r for your currently running kernel. This argument is optional for update. The default is the latest kernel version. -The use of "all" for the +The use of "all" for the .I version -string specifies -.B update\-initramfs +string specifies +.B update\-initramfs to execute the chosen action for all kernel versions, that are already known -to +to .B update\-initramfs. .TP diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 551f6c9..30ef6d0 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -21,6 +21,7 @@ The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO .BR +.IR initramfs.conf (5), .IR initramfs-tools (8), .IR mkinitramfs (8), .IR update-initramfs (8). -- cgit v1.2.3 From 63f337b6a8cfa058bb2ed9fcf0de6a71f3ffb9ab Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Oct 2006 09:44:20 +0200 Subject: last minute fixes update-initramfs: - find against the correct backup - check if initramfs _really_ exists --- debian/changelog | 5 ++++- update-initramfs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1eaf2f9..49d07a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,7 +34,10 @@ initramfs-tools (0.83) unstable; urgency=high * manpages: Get a banana and mark myself as author. - -- maximilian attems Fri, 13 Oct 2006 08:12:40 +0200 + * update-initramfs: version_exists needs not only to check for existing + sha1sum, but also initramfs. (closes: 382472) + + -- maximilian attems Fri, 13 Oct 2006 09:38:27 +0200 initramfs-tools (0.82) unstable; urgency=high diff --git a/update-initramfs b/update-initramfs index 11d48be..151e47a 100755 --- a/update-initramfs +++ b/update-initramfs @@ -56,7 +56,7 @@ verbose() version_exists() { - [ -e "${STATEDIR}/${1}" ] + [ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ] return $? } @@ -93,7 +93,7 @@ backup_booted_initramfs() # 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}) + boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days}) fi if [ -n "${boot_initramfs}" ]; then mv -f "${initramfs_bak}" "${initramfs}.bak" -- 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(-) diff --git a/debian/changelog b/debian/changelog index 49d07a9..022e167 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +initramfs-tools (0.84) unstable; urgency=high + + Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" + + * hook-functions: Use modprobe --ignore-install arg to put all listed + modules on initramfs. Thanks Mario Izquierdo + for report. (closes: 384043) + + * update-initramfs: If elilo is around run it on initramfs update, add + zipl run. + + * scripts/local: Use vol_id too if around to set FSTYPE. Thanks for the + patch to "Alex Owen" (closes: 380004) + + * hooks/thermal: Add many of the windfarm modules for powerpc boxes. + + * initramfs-tools.preinst: merge bits of 0.69ubuntu16. (closes: 393773) + urgency high as fixes upgrade from sarge - thanks Federico Grau + . + + * scripts/init-top/framebuffer: Fix mknod call. (closes: 393543) + Thanks for the patch Kiro Zimmer . + + * mkinitramfs: Create modulesdir even on monolithic linux. (closes: 393688) + Thanks for the patch Ian Campbell . + + -- maximilian attems Wed, 18 Oct 2006 11:04:50 +0200 + initramfs-tools (0.83) unstable; urgency=high Release "Ois was du verzapfst is a koida Kaffee" @@ -438,6 +466,18 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu16) edgy; urgency=low + + * Bring in preinst fixes from Debian, including s/configure/install/ in + preinst, since preinst is never called with "configure", and checking + for /proc/swaps before we blindly try to read it to determine RESUME. + * Do away with the bogus '-n "$2"' test in preinst, since "install" can + be called without any arguments at all (and often is, on a clean setup) + * On upgrades, revert the RESUME mangling that dapper's d-i did to our + config file, avoiding spurious conffile prompts (launchpad.net/63693) + + -- Adam Conrad Mon, 16 Oct 2006 17:23:41 +1000 + initramfs-tools (0.69ubuntu15) edgy; urgency=low * Add jmicron module to ide list. diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index fc1fd06..aa8c8ca 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -4,7 +4,6 @@ set -e case "$1" in install) - if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d # First time install. Can we autodetect the RESUME partition? @@ -29,7 +28,7 @@ case "$1" in -e '/# This file should/,/one per line\./d' \ -e 's/Comments begin with.*/Syntax: module_name [args ...]/' \ -e 's/^# ext2$/# raid1/' \ - -e 's/^# wd io=0x300$/# sd_mod/' + -e 's/^# wd io=0x300$/# sd_mod/' \ -e '/^ide-generic/d' \ -e '/^ide-disk/d' \ -e '/^ext2/d' \ @@ -40,7 +39,6 @@ case "$1" in if [ -e /etc/mkinitrd/DSDT ]; then cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi - fi ;; upgrade) if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then diff --git a/hook-functions b/hook-functions index 98c88a2..8df30f2 100644 --- a/hook-functions +++ b/hook-functions @@ -40,7 +40,8 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --ignore-install \ + --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue diff --git a/hooks/thermal b/hooks/thermal index 9bfd323..ece7243 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -23,6 +23,17 @@ case "$DPKG_ARCH" in # copy the right modules powerpc|ppc64) manual_add_modules therm_pm72 + manual_add_modules windfarm_core + manual_add_modules windfarm_cpufreq_clamp + manual_add_modules windfarm_lm75_sensor + manual_add_modules windfarm_max6690_sensor + manual_add_modules windfarm_pid + manual_add_modules windfarm_pm112 + manual_add_modules windfarm_pm81 + manual_add_modules windfarm_pm91 + manual_add_modules windfarm_smu_controls + manual_add_modules windfarm_smu_sat + manual_add_modules windfarm_smu_sensors manual_add_modules i2c-powermac ;; i386|amd64|ia64) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 4ce53d3..690505f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/14" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -438,7 +438,7 @@ to double-check if it contains the relevant binaries, libs or modules: .nf mkdir tmp/initramfs cd tmp/initramfs -gunzip -c -9 /boot/initrd.img-2.6.17-2-686 | \\ +gunzip -c -9 /boot/initrd.img-2.6.18-1-686 | \\ cpio -i -d -H newc --no-absolute-filenames .fi .RE diff --git a/mkinitramfs b/mkinitramfs index f667c53..2fd0cc8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -166,7 +166,7 @@ export verbose # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf/conf.d etc lib modules sbin scripts; do +for d in bin conf/conf.d etc lib modules sbin scripts ${MODULESDIR}; do mkdir -p "${DESTDIR}/${d}" done diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index bafbe19..8382b20 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -82,7 +82,7 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno 29 $fbno + mknod /dev/fb$fbno c 29 $fbno done < /proc/fb mknod /dev/fb0 c 29 0 diff --git a/scripts/local b/scripts/local index 299fc65..f4079d5 100644 --- a/scripts/local +++ b/scripts/local @@ -51,6 +51,10 @@ mountroot () else FSTYPE=${ROOTFSTYPE} fi + if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then + FSTYPE=$(/lib/udev/vol_id -t ${ROOT}) + [ -z "$FSTYPE" ] && FSTYPE="unknown" + fi [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount diff --git a/update-initramfs b/update-initramfs index 151e47a..c112211 100755 --- a/update-initramfs +++ b/update-initramfs @@ -148,10 +148,11 @@ mbr_check() echo } -# only run lilo if no grub is around -# or if "do_bootloader = yes" is set +# Invoke bootloader run_bootloader() { + # only run lilo if no grub is around + # or if "do_bootloader = yes" is set if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then @@ -168,8 +169,16 @@ run_bootloader() fi return 0 fi - if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then + if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then run_lilo + return 0 + fi + if [ -x /sbin/elilo ]; then + elilo + return 0 + fi + if [ -r /etc/zipl.conf ]; then + zipl fi } -- cgit v1.2.3 From efa60794a8a0290ec3972aca23b3ab5f92c3175a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Nov 2006 09:30:03 +0100 Subject: - enhance mbr_check() - fix /boot ro check - create fb devices unconditionaly --- debian/changelog | 32 ++++++++++++++++++++++++++++++++ hook-functions | 2 +- scripts/init-top/framebuffer | 17 +++++++++-------- update-initramfs | 40 +++++++++++++++++++++++++++++++++------- 4 files changed, 75 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 022e167..991ff6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +initramfs-tools (0.85) unstable; urgency=high + + Release "Nichts ist getan, wenn noch etwas zu tun übrig ist." + + * update-initramfs: Fix ro /boot check to not trigger on other mounts + having a /boot string. (closes: 393906) Thanks for the patch + Olli Helenius + + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + 0.69ubuntu10 solution. Thanks Benjamin Leipold + for the report. (closes: 393890) + + * update-initramfs: Fix mbr_check() for installed lilo and used grub. Thanks + for the patch by Michel Casabona . Also be + stricter about do_bootloader match, use negative info and add check for + grub on mbr before throwing error. (closes: 394559) urgency high. + + * hook-functions: Add sata_sil24 to scsi modules. (closes: 395907) + Thanks Vadim S. Solomi" for the patch. + + * update-initramfs: Fix lilo detection in mbr_check() for rootraid. + Based on a patch by Michael Prokop . Suppress lilo warning + messages on test run. + + -- maximilian attems Mon, 30 Oct 2006 10:12:58 +0100 + initramfs-tools (0.84) unstable; urgency=high Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" @@ -499,6 +525,12 @@ initramfs-tools (0.69ubuntu11) edgy; urgency=low -- Oliver Grawert Sun, 10 Sep 2006 11:50:14 +0200 +initramfs-tools (0.69ubuntu10) edgy; urgency=low + + * Create framebuffer device nodes unconditionally + + -- Matthew Garrett Tue, 5 Sep 2006 17:50:53 +0100 + initramfs-tools (0.69ubuntu4) edgy; urgency=low * scripts/local-premount/suspend: Check for UUID= or LABEL= on the diff --git a/hook-functions b/hook-functions index 8df30f2..c6a42a6 100644 --- a/hook-functions +++ b/hook-functions @@ -179,7 +179,7 @@ auto_add_modules() mesh mptfc mptscsih mptsas mptspi nsp32 \ osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sis sata_svw \ + sata_promise sata_qstor sata_sil sata_sil24 sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ sd_mod stex sym53c8xx tmscsim zfcp; do diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 8382b20..1d5e375 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,17 +76,18 @@ for x in $(cat /proc/cmdline); do esac done -if [ -n "$FB" ]; then - modprobe -q $FB $OPTS -fi - if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno done < /proc/fb - +else mknod /dev/fb0 c 29 0 - for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i - done +fi +for i in 0 1 2 3 4 5 6 7 8; do + mknod /dev/tty$i c 4 $i +done + +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS fi diff --git a/update-initramfs b/update-initramfs index c112211..0fea63c 100755 --- a/update-initramfs +++ b/update-initramfs @@ -127,7 +127,8 @@ generate_initramfs() # lilo call run_lilo() { - lilo -t > /dev/null + # suppress errors on test run + lilo -t > /dev/null 2>&1 if [ $? -eq 0 ]; then lilo fi @@ -136,11 +137,33 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 + case ${boot} in + /dev/md*) + if [ -r /proc/mdstat ]; then + MD=${boot#/dev/} + boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \ + /proc/mdstat)" + fi + ;; + esac [ ! -r "${boot}" ] && return 0 - dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO - [ $? -eq 0 ] && run_lilo && return 0 + dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ + && run_lilo && return 0 + + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + + # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." echo "If you use grub as bootloader everything is fine." @@ -151,17 +174,19 @@ mbr_check() # Invoke bootloader run_bootloader() { - # only run lilo if no grub is around - # or if "do_bootloader = yes" is set + # if both lilo and grub around, figure out if lilo needs to be run if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ - do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") + do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ || [ "${do_b}" = "YES" ]; then run_lilo return 0 + elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ + || [ "${do_b}" = "NO" ]; then + return 0 else mbr_check return 0 @@ -203,7 +228,8 @@ delete_sha1() ro_boot_check() { [ -r /proc/mounts ] || return 0 - boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) + boot_opts=$(awk '/boot/{if (match($4, /ro/) && $2 == "/boot") + print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." echo "update-initramfs: Not updating ${initramfs}" -- cgit v1.2.3 From 3c1412b1312c4b12d953aa8413d928bc8c9ad031 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 4 Nov 2006 12:20:05 +0100 Subject: - check that an initrd is around before trying to backup --- debian/changelog | 6 ++++++ update-initramfs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 991ff6f..f6ef12c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.85a) unstable; urgency=high + + * On first time run backup_booted_initramfs() has nothing to back up. + + -- maximilian attems Fri, 3 Nov 2006 09:03:46 +0100 + initramfs-tools (0.85) unstable; urgency=high Release "Nichts ist getan, wenn noch etwas zu tun übrig ist." diff --git a/update-initramfs b/update-initramfs index 0fea63c..e694093 100755 --- a/update-initramfs +++ b/update-initramfs @@ -82,8 +82,11 @@ backup_booted_initramfs() # chroot [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 - # no backup yet + # first time run initramfs_bak="${initramfs}.dpkg-bak" + [ ! -r "${initramfs_bak}" ] && return 0 + + # no backup yet if [ ! -r "${initramfs}.bak" ]; then mv -f ${initramfs_bak} "${initramfs}.bak" verbose "Backup ${initramfs}.bak" -- cgit v1.2.3 From 78fe68bcad9d0850e6b9877903719cab7c73b475 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 2 Dec 2006 18:51:54 +0100 Subject: - allow to disable backup - new bzr location - functional copy_dir_modules() - modprobe a bunch of ppc windfarm modules in thermal - provide output on error --- conf/update-initramfs.conf | 8 ++++++++ debian/changelog | 42 ++++++++++++++++++++++++++++++++++++++++++ debian/copyright | 2 +- hook-functions | 18 +++++++++++++++--- mkinitramfs | 6 +++--- scripts/init-premount/thermal | 9 +++++++++ scripts/init-top/framebuffer | 10 +++++----- update-initramfs | 12 ++++++++---- 8 files changed, 91 insertions(+), 16 deletions(-) diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 36c3dde..278c51c 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -9,3 +9,11 @@ # If set to no disables any update to initramfs beside kernel upgrade update_initramfs=yes + +# +# backup_initramfs [ yes | no ] +# +# Default is yes +# If set to no leaves no .bak backup files. + +backup_initramfs=yes diff --git a/debian/changelog b/debian/changelog index f6ef12c..acfa6f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,38 @@ +initramfs-tools (0.85c) unstable; urgency=medium + + Release "Pour être heureux vraiment Faut plus d'gouvernement" + + * hook-funcions: Show on verbose mode the added binaries and libraries. + + * update-initramfs: Don't silently fail, user won't be able to reboot. + Thanks Mario Aeby for his blog entry. + + * debian/copyright: Moved to bzr.d.o repo location. + + * hook-functions: Merge 0.69ubuntu22 copy_module_dir fixes, we'll use it + too postetch. Fix the bashism. Thanks to Jurij Smakov + + * scripts/init-premount/thermal: Load blindly a bunch of thermal modules + on powerpc as they are not hotpluggable. Might be ugly, but is a safe bet. + Kernel plattform fix is scheduled for 2.6.20. Push with medium urgency. + (closes: 401269) + + -- maximilian attems Sat, 2 Dec 2006 18:06:34 +0100 + +initramfs-tools (0.85b) unstable; urgency=medium + + * mkinitramfs: Test for ${outfile} before touching anything. (closes: 381677) + + * update-initramfs.conf, update-initramfs: Allow to disable backup strategy. + While we are it fix logic of backup_booted_initramfs(). (closes: 397787) + urgency medium. + + * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, + modprobe fb before creating device. Thanks to Otavio Salvador + for patch. + + -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 + initramfs-tools (0.85a) unstable; urgency=high * On first time run backup_booted_initramfs() has nothing to back up. @@ -498,6 +533,13 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu22) feisty; urgency=low + + * For copy_module_dir, actually call manual_module for each one, so deps are + taken care of. + + -- Ben Collins Thu, 23 Nov 2006 02:10:29 -0500 + initramfs-tools (0.69ubuntu16) edgy; urgency=low * Bring in preinst fixes from Debian, including s/configure/install/ in diff --git a/debian/copyright b/debian/copyright index 2c681c2..396499f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -10,7 +10,7 @@ The current ubuntu release can be found at: http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ The Debian tree is maintained with "bzr" at: -http://debian.stro.at/bzr-test/initramfs-tools/ +http://bzr.debian.org/kernel/initramfs-tools/ Authors: Jeff Bailey , Adam Conrad , Scott James Remnant , diff --git a/hook-functions b/hook-functions index c6a42a6..b4cd58d 100644 --- a/hook-functions +++ b/hook-functions @@ -66,6 +66,9 @@ copy_exec() { fi else ln -s ${1} ${DESTDIR}/${2} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding binary ${1}" + fi fi # Copy the dependant libraries @@ -89,6 +92,9 @@ copy_exec() { mkdir -p ${DESTDIR}/${dirname} if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then ln -s ${x} ${DESTDIR}/${dirname} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding library ${x}" + fi fi done } @@ -96,9 +102,15 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase="${DESTDIR}/lib/modules/${version}" - mkdir -p "$(dirname "${tmpdir_modbase}/${1}")" - cp -a "${MODULESDIR}/${1}" "${tmpdir_modbase}/${1}" + if ! [ -d "${MODULESDIR}/${1}" ]; then + return; + fi + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Copying module directory ${1}" + fi + for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do + manual_add_modules `basename ${x_mod} .ko` + done } dep_add_modules() diff --git a/mkinitramfs b/mkinitramfs index 2fd0cc8..694f423 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -97,13 +97,13 @@ if [ -n "${UMASK}" ]; then umask "${UMASK}" fi -touch $outfile -outfile="$(readlink -f "$outfile")" - if [ -z "${outfile}" ]; then usage fi +touch "$outfile" +outfile="$(readlink -f "$outfile")" + # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd if [ ${#} -ne 1 ]; then diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index 3518e7c..bfea1fc 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -20,6 +20,15 @@ case "$DPKG_ARCH" in powerpc|ppc64) modprobe -q i2c-powermac modprobe -q therm_pm72 + modprobe -q windfarm_cpufreq_clamp + modprobe -q windfarm_lm75_sensor + modprobe -q windfarm_max6690_sensor + modprobe -q windfarm_pm112 + modprobe -q windfarm_pm81 + modprobe -q windfarm_pm91 + modprobe -q windfarm_smu_controls + modprobe -q windfarm_smu_sat + modprobe -q windfarm_smu_sensors ;; i386|amd64|ia64) modprobe -q fan diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 1d5e375..044b247 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,6 +76,11 @@ for x in $(cat /proc/cmdline); do esac done +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS +fi + if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno @@ -86,8 +91,3 @@ fi for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty$i c 4 $i done - -if [ -n "$FB" ]; then - modprobe -q fbcon - modprobe -q $FB $OPTS -fi diff --git a/update-initramfs b/update-initramfs index e694093..4b230d0 100755 --- a/update-initramfs +++ b/update-initramfs @@ -79,12 +79,16 @@ backup_initramfs() # keep booted initramfs backup_booted_initramfs() { + initramfs_bak="${initramfs}.dpkg-bak" + + # first time run thus no backup + [ ! -r "${initramfs_bak}" ] && return 0 + # chroot [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 - # first time run - initramfs_bak="${initramfs}.dpkg-bak" - [ ! -r "${initramfs_bak}" ] && return 0 + # no kept backup wanted + [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0 # no backup yet if [ ! -r "${initramfs}.bak" ]; then @@ -122,7 +126,7 @@ generate_initramfs() # minversion wasn't met, exit 0 exit 0 fi - verbose "mkinitramfs failed for ${initramfs}" + echo "update-initramfs: failed for ${initramfs}" exit $mkinitramfs_return fi } -- cgit v1.2.3 From c03e70312632212c516acac750cb5ec0ef4b33cb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 14 Dec 2006 23:16:15 +0100 Subject: - show lilo error on lilo failure - add hppa zalon module - reduce size due to keeping only 1 busybox copy - warn on update mode when no initramfs exist and takeover not specified --- debian/changelog | 22 ++++++++++++++++++++++ hook-functions | 2 +- mkinitramfs | 7 ++++++- update-initramfs | 24 ++++++++++++++---------- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index acfa6f0..394179a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +initramfs-tools (0.85d) unstable; urgency=high + + Release "Le gros ventre qu'engraisse L'suffrage universel" + + * update-initramfs: run_lilo() needs to show errors of lilo -t on failure + and exit with failure message. Thanks David Anselmi + for report. (closes: 401331) Updated according to review by + Jurij Smakov . + + * hook-functions: Add hppa zalon scsi module. (closes: 401229) urgency high + + * update-initramfs: Add warning for missing initramfs on update mode without + takeover arg. Restructure altered_check, don't delete sha1sum on failure. + Thanks Jurij Smakov for noticing. + + * mkinitramfs: Reduce size of initramfs by keeping 1 busybox copy. + Thanks for the patch input to Russell Coker . + Thanks for the sed rework to Klaus Ita . + (closes: 338405) + + -- maximilian attems Thu, 14 Dec 2006 16:10:06 +0100 + initramfs-tools (0.85c) unstable; urgency=medium Release "Pour être heureux vraiment Faut plus d'gouvernement" diff --git a/hook-functions b/hook-functions index b4cd58d..67f5931 100644 --- a/hook-functions +++ b/hook-functions @@ -194,7 +194,7 @@ auto_add_modules() sata_promise sata_qstor sata_sil sata_sil24 sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ - sd_mod stex sym53c8xx tmscsim zfcp; do + sd_mod stex sym53c8xx tmscsim zalon zfcp; do manual_add_modules "${x}" done ;; diff --git a/mkinitramfs b/mkinitramfs index 694f423..d187de0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -228,7 +228,12 @@ if [ "x${BUSYBOX}" = "xn" ]; then else rm -f ${DESTDIR}/bin/sh copy_exec ${BUSYBOXDIR}/busybox /bin/busybox - ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh + rm -f ${DESTDIR}/bin/busybox + cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox + for cmd in `busybox | sed -n '/functions:$/,$p' \ + | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do + ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd} + done fi # Modutils diff --git a/update-initramfs b/update-initramfs index 4b230d0..52e603b 100755 --- a/update-initramfs +++ b/update-initramfs @@ -134,11 +134,13 @@ generate_initramfs() # lilo call run_lilo() { - # suppress errors on test run - lilo -t > /dev/null 2>&1 - if [ $? -eq 0 ]; then - lilo + # show lilo errors on failure + if ! lilo -t > /dev/null 2>&1 ; then + echo "update-initramfs: lilo run failed for ${initramfs}:" + echo + lilo -t fi + lilo } # check if lilo is on mbr @@ -387,14 +389,16 @@ delete() rm -f "${initramfs}" } - +# Check for update mode on existing and modified initramfs altered_check() { - if [ "${takeover}" = 0 ]; then - if ! compare_sha1; then - delete_sha1 - mild_panic "${initramfs} has been altered. Cannot update." - fi + # No check on takeover + [ "${takeover}" = 1 ] && return 0 + if [ ! -e "${initramfs}" ]; then + mild_panic "${initramfs} does not exist. Cannot update." + fi + if ! compare_sha1; then + mild_panic "${initramfs} has been altered. Cannot update." fi } -- cgit v1.2.3 From d21a00a23405d1db81ab05a12342145276ef2af0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Dec 2006 10:18:28 +0100 Subject: - revert busybox hardlinking it's utitilites - add drivers/ata - rework the framebuffer boot script - small docs changes --- debian/changelog | 24 ++++++++++++++++++++++++ hook-functions | 4 ++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 8 ++------ scripts/init-top/framebuffer | 34 +++++++++++++++++++++++----------- 5 files changed, 55 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index 394179a..c292a82 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.85e) unstable; urgency=high + + Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" + + * initramfs-tools.8: Correct copy_exec() example. (closes: 403122) + Add a better dir to copy_modules_dir() example. + + * mkinitramfs: Revert the sed magic busybox hardlinking for size reduction. + Go for functionality. The klibc binaries are better tested and superior + in some cases like sleep. Fixes several boot troubles. Thanks + Benjamí Villoslada for the report. (closes: 403224) + Thanks Jurij Smakov for pinpointing the trouble. + + * hook-functions: Add all drivers/ata drivers to initramfs that exist for + uname >= 2.6.19 (closes: 403309) urgency high. + + * scripts/init-top/framebuffer: Fix syntax by closing the brackets. Handle + options of the form key:value, map kernel bootarg to module name for + matroxfb. Thanks Rob Walker for the patches + (closes: 403667, 403669). Use posix regexes according to review by + Jurij Smakov . Also protect all variables. + + -- maximilian attems Wed, 20 Dec 2006 22:29:51 +0100 + initramfs-tools (0.85d) unstable; urgency=high Release "Le gros ventre qu'engraisse L'suffrage universel" diff --git a/hook-functions b/hook-functions index 67f5931..fe5d31e 100644 --- a/hook-functions +++ b/hook-functions @@ -198,6 +198,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + ata) + copy_modules_dir kernel/drivers/ata + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -218,6 +221,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules ata auto_add_modules i2o auto_add_modules dasd auto_add_modules ieee1394 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 690505f..e280ba4 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -189,7 +189,7 @@ initramfs image. .RS .PP .B Example: -copy_modules_dir kernel/drivers/pci/foobar +copy_modules_dir kernel/drivers/ata .RE .SS Including binaries @@ -197,7 +197,7 @@ If you need to copy binaries to the initramfs module, a command like this should be used: .PP .RS -copy_exec /sbin/mdadm "${DESTDIR}/sbin" +copy_exec /sbin/mdadm /sbin .RE mkinitramfs will automatically detect which libraries the executable depends on diff --git a/mkinitramfs b/mkinitramfs index d187de0..0c278d5 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -227,13 +227,9 @@ if [ "x${BUSYBOX}" = "xn" ]; then echo "Warning: Busybox is required for successful boot!" else rm -f ${DESTDIR}/bin/sh - copy_exec ${BUSYBOXDIR}/busybox /bin/busybox rm -f ${DESTDIR}/bin/busybox - cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox - for cmd in `busybox | sed -n '/functions:$/,$p' \ - | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do - ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd} - done + copy_exec ${BUSYBOXDIR}/busybox /bin/busybox + ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh fi # Modutils diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 044b247..7c080f9 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -35,20 +35,23 @@ parse_video_opts() local IFS="," # Must be a line like video=:,[opt2]... - if [ "$OPTS" = "${OPTS%%:*}" ]; then + if [ "${OPTS}" = "${OPTS%%:*}" ]; then return fi OPTS="${OPTS#*:}" - for opt in $OPTS; do + for opt in ${OPTS}; do # Already in the "=" form - if [ "$opt" != "${opt#*=}" ]; then + if [ "${opt}" != "${opt#*=}" ]; then echo -n "$opt " + # In the ":" form + elif [ "${opt}" != "${opt#*:}" ]; then + echo -n "${opt%:*}=${opt#*:} " # Presumably a modevalue without the "mode=" prefix - elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then echo -n "mode=$opt " # Presumably a boolean else - echo -n "$opt=1 " + echo -n "${opt}=1 " fi done } @@ -60,7 +63,7 @@ SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do - case $x in + case ${x} in splash*) FB="vga16fb"; OPTS=""; @@ -72,22 +75,31 @@ for x in $(cat /proc/cmdline); do video=*) FB=${x#*=} FB="${FB%%:*}" - OPTS="$(parse_video_opts "$TMP")" + OPTS="$(parse_video_opts "${x}")" esac done -if [ -n "$FB" ]; then +# Map command line name to module name +case ${FB} in +matroxfb) + FB=matroxfb_base + ;; +*) + ;; +esac + +if [ -n "${FB}" ]; then modprobe -q fbcon - modprobe -q $FB $OPTS + modprobe -q ${FB} ${OPTS} fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno c 29 $fbno + mknod /dev/fb${fbno} c 29 ${fbno} done < /proc/fb else mknod /dev/fb0 c 29 0 fi for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i + mknod /dev/tty${i} c 4 ${i} done -- cgit v1.2.3 From c4343742b3bf028e467ac8a58ead95c9bfefc628 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 13:29:25 +0200 Subject: first prerelease 0.86 + merge 0.85f * kick mdrun script * update control for lenny + ubuntu * add _all_ ide, block and drivers * use MODPROBE_OPTIONS and kill any modprobed arg * small doc + whitespace fixes --- debian/changelog | 60 +++++++++++++++++++++++++++++++++++++++++-- debian/control | 4 +-- debian/script | 2 +- hook-functions | 28 +++++--------------- init | 13 +++++++--- initramfs.conf.5 | 6 ++--- mkinitramfs.8 | 7 ++++- scripts/functions | 8 +++--- scripts/init-premount/thermal | 26 +++++++++---------- scripts/init-top/framebuffer | 7 ++--- scripts/local | 8 +++--- scripts/local-top/lvm | 6 ++--- scripts/local-top/mdrun | 46 --------------------------------- scripts/local-top/udev_helper | 2 +- scripts/nfs | 4 +-- update-initramfs | 24 +++++++++-------- update-initramfs.conf.5 | 4 +-- 17 files changed, 130 insertions(+), 125 deletions(-) delete mode 100755 scripts/local-top/mdrun diff --git a/debian/changelog b/debian/changelog index c292a82..07d28d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,59 @@ +initramfs-tools (0.86) experimental; urgency=low + + * update-initramfs: Bound the mode and version variable. (closes: 403905) + Thanks "Nikita V. Youshchenko" for report. + + * init: Set once the MODPROBE_OPTIONS environment variable and export it. + Don't forget to set -b to have the modprobe.d blacklists respected. + Thus remove everywhere the -q modprobe switch. + Thanks Ben Collins for the suggestion. + + * small trailing whitespace cleanup, display full path of kernel-img.conf + in bug script. + + * debian/control: change maintainer entry to new DD mail. :) + Add busybox-initramfs as Ubuntu busybox alternative to depends. + Dropp the sarge busybox-cvs-static entry. + + * scripts/local-top/mdrun: Drop, existed for partial upgrades from sarge. + + * scripts/local: Improve panic message and printed order. (closes: 414640) + Thanks Vincent.McIntyre@csiro.au for patch. + + * scripts/functions: Check if panic is set befor using it. (closes: 406107) + Thanks martin f krafft for report. + + * hook-functions: Copy all kernel/drivers/{block,ide,scsi} subdir modules + instead of hardcoding the list of "supported" drivers. As consequence + the initramfs might be larger, but none of those should be missed. + As bonus syncs with Ubuntu. + + * init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync. + + -- maximilian attems Sat, 17 Mar 2007 21:39:13 +0100 + +initramfs-tools (0.85f) unstable; urgency=high + + Release "Au lieu d'aller voter Casse leur la margoulette" + + * update-initramfs: Grub _doesn't_ clear LILO string in mbr, but the inverse + is done. Fix mbr_check() to first check for GRUB. Fixes accidental lilo + call in the case that Grub is the used bootloader. (closes: 409820) + Thanks Michael Prokop for bringing up the case. + + * initramfs.conf.5, mkinitramfs.5: Fix typos. Document version. + (closes: 405157, 405190, 405194) + + * update-initramfs: Be more screamy about lilo error, people seem to + overlook recent lilo failures. + + * scripts/init-top/framebuffer: Remove unused variables. + + * init: Export ROOTDELAY to let udev boot script handle eventual rootdelay. + downgrades 401916 + + -- maximilian attems Wed, 7 Mar 2007 23:34:17 +0100 + initramfs-tools (0.85e) unstable; urgency=high Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" @@ -74,7 +130,7 @@ initramfs-tools (0.85b) unstable; urgency=medium urgency medium. * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, - modprobe fb before creating device. Thanks to Otavio Salvador + modprobe fb before creating device. Thanks to Otavio Salvador for patch. -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 @@ -93,7 +149,7 @@ initramfs-tools (0.85) unstable; urgency=high having a /boot string. (closes: 393906) Thanks for the patch Olli Helenius - * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the 0.69ubuntu10 solution. Thanks Benjamin Leipold for the report. (closes: 393890) diff --git a/debian/control b/debian/control index dd4c3b3..9294ee7 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilian attems +Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-initramfs, cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 diff --git a/debian/script b/debian/script index a8e3dd9..7cfac12 100755 --- a/debian/script +++ b/debian/script @@ -15,7 +15,7 @@ lsmod echo if [ -r /etc/kernel-img.conf ]; then - echo "-- kernel-img.conf" + echo "-- /etc/kernel-img.conf" cat /etc/kernel-img.conf echo fi diff --git a/hook-functions b/hook-functions index fe5d31e..f506b49 100644 --- a/hook-functions +++ b/hook-functions @@ -172,35 +172,20 @@ auto_add_modules() done ;; ide) - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ - amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ - generic hpt34x hpt366 it821x jmicron ns87415 opti621 \ - pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks \ - siimage sis5513 slc82c105 slc90e66 triflex trm290 \ - via82cxxx; do - manual_add_modules "${x}" - done + copy_modules_dir kernel/drivers/ide ;; scsi) - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx aic94xx arcmsr ata_piix atari_scsi \ - atp870u BusLogic cciss ch cpqarray DAC960 dc395x \ - dmx3191d dpt_i2o eata fdomain gdth hptiop ibmvscsic \ - initio ipr ips isp1020 lasi700 lpfc max_scsi mac53c94 \ - megaraid megaraid_mbox megaraid_mm megaraid_sas \ - mesh mptfc mptscsih mptsas mptspi nsp32 \ - osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ - qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sil24 sata_sis sata_svw \ - sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ - scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ - sd_mod stex sym53c8xx tmscsim zalon zfcp; do + copy_modules_dir kernel/drivers/scsi + for x in mptfc mptsas mptscsih mptspi; do manual_add_modules "${x}" done ;; ata) copy_modules_dir kernel/drivers/ata ;; + block) + copy_modules_dir kernel/drivers/block + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -221,6 +206,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules block auto_add_modules ata auto_add_modules i2o auto_add_modules dasd diff --git a/init b/init index fbe32be..4c09fd7 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs none /sys -mount -t proc none /proc +mount -t sysfs none /sys -o nodev, noexec, nosuid +mount -t proc none /proc -o nodev, noexec, nosuid # Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out @@ -37,7 +37,10 @@ for i in conf/conf.d/*; do done . /scripts/functions -# Parse command line options +# Set modprobe env +export MODPROBE_OPTIONS="-qb" + +# Export relevant variables export break= export init=/sbin/init export quiet=n @@ -45,8 +48,10 @@ export readonly=y export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} -export panic +export ROOTDELAY= +export panic= +# Parse command line options for x in $(cat /proc/cmdline); do case $x in init=*) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index ca47a02..e685298 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2007/01/01 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -37,14 +37,14 @@ The default setting is \fImost\fP. Include busybox utilities for the boot scripts. If set to 'n' .B mkinitramfs -will build an initramfs whithout busybox. +will build an initramfs without busybox. Beware that many boot scripts need busybox utilities. .SH NFS VARIABLES .TP \fB BOOT Allows to use an nfs drive as the root of the drive. -The default is to boot of an \fIlocal\fP media (harddrive, USB stick). +The default is to boot from \fIlocal\fP media (harddrive, USB stick). Set to \fInfs\fP for an NFS root share. .TP diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 23e719f..6d81233 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2007/01/02 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -58,6 +58,11 @@ Override the setting in .IR initramfs.conf . +.TP +\fI version +Set the kernel version of the initramfs image +(defaults to the running kernel). + .TP \fB\-\-supported-host-version=\fIhversion This option queries if mkinitramfs can create ramdisks on a running kernel of version diff --git a/scripts/functions b/scripts/functions index 7e67771..7ae9c78 100644 --- a/scripts/functions +++ b/scripts/functions @@ -60,11 +60,11 @@ panic() /sbin/usplash_write "QUIT" fi # Disallow console access - if [ "${panic}" = 0 ]; then + if [ -n "${panic}" ] && [ "${panic}" = 0 ]; then reboot fi - modprobe -q i8042 - modprobe -q atkbd + modprobe i8042 + modprobe atkbd echo $@ PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } @@ -206,7 +206,7 @@ load_modules() if [ "$com" = "#" ]; then continue fi - modprobe -q $m + modprobe $m done fi } diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index bfea1fc..aa146ec 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,20 +18,20 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) - modprobe -q i2c-powermac - modprobe -q therm_pm72 - modprobe -q windfarm_cpufreq_clamp - modprobe -q windfarm_lm75_sensor - modprobe -q windfarm_max6690_sensor - modprobe -q windfarm_pm112 - modprobe -q windfarm_pm81 - modprobe -q windfarm_pm91 - modprobe -q windfarm_smu_controls - modprobe -q windfarm_smu_sat - modprobe -q windfarm_smu_sensors + modprobe i2c-powermac + modprobe therm_pm72 + modprobe windfarm_cpufreq_clamp + modprobe windfarm_lm75_sensor + modprobe windfarm_max6690_sensor + modprobe windfarm_pm112 + modprobe windfarm_pm81 + modprobe windfarm_pm91 + modprobe windfarm_smu_controls + modprobe windfarm_smu_sat + modprobe windfarm_smu_sensors ;; i386|amd64|ia64) - modprobe -q fan - modprobe -q thermal + modprobe fan + modprobe thermal ;; esac diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 7c080f9..c680409 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -59,9 +59,6 @@ parse_video_opts() FB="" OPTS="" -SPLASH=false; -VESA=false; - for x in $(cat /proc/cmdline); do case ${x} in splash*) @@ -89,8 +86,8 @@ matroxfb) esac if [ -n "${FB}" ]; then - modprobe -q fbcon - modprobe -q ${FB} ${OPTS} + modprobe fbcon + modprobe ${FB} ${OPTS} fi if [ -e /proc/fb ]; then diff --git a/scripts/local b/scripts/local index f4079d5..4e01472 100644 --- a/scripts/local +++ b/scripts/local @@ -40,9 +40,9 @@ mountroot () # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do - echo " Check root= bootarg cat /proc/cmdline" - echo " or missing modules, devices: cat /proc/modules ls /dev" - panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" + echo "ALERT! ${ROOT} does not exist. Dropping to a shell!" + echo " Check your root= boot argument (cat /proc/cmdline)" + panic " Check for missing modules (cat /proc/modules), or device files (ls /dev)" done # Get the root filesystem type if not set @@ -67,7 +67,7 @@ mountroot () fi # FIXME This has no error checking - modprobe -q ${FSTYPE} + modprobe ${FSTYPE} # FIXME This has no error checking # Mount root diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 27053de..4cf48ad 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -64,9 +64,9 @@ if [ ! -e /sbin/vgchange ]; then exit 0 fi -modprobe -q dm-mod -modprobe -q dm-snapshot -modprobe -q dm-mirror +modprobe dm-mod +modprobe dm-snapshot +modprobe dm-mirror activate_vg "$ROOT" activate_vg "$resume" diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun deleted file mode 100755 index f733656..0000000 --- a/scripts/local-top/mdrun +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ -e /scripts/local-top/mdadm ]; then - exit 0 -fi - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -# source the presumed root md and it's info -. ./conf/mdrun.conf - -# assemble root raid first due to initrd-tools compatibility -mdadm -A ${rootraiddev} -R -u $uuid $devices - -# assemble all raid devices -/sbin/mdrun /dev diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 2d4c209..c1694b7 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -19,5 +19,5 @@ esac # but might be an old fashioned ISA controller; in which case # we need to load ide-generic. if [ ! -e "${ROOT}" -o "${ROOT}" = "/dev/root" ]; then - modprobe -q ide-generic + modprobe ide-generic fi diff --git a/scripts/nfs b/scripts/nfs index fc869cc..5eb17bf 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -78,9 +78,9 @@ mountroot() run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe -q nfs + modprobe nfs # For DHCP - modprobe -q af_packet + modprobe af_packet # Default delay is around 180s # FIXME: add usplash_write info diff --git a/update-initramfs b/update-initramfs index 52e603b..a676fe9 100755 --- a/update-initramfs +++ b/update-initramfs @@ -4,6 +4,8 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf +mode="" +version="" set -e @@ -136,7 +138,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "update-initramfs: lilo run failed for ${initramfs}:" + echo "Error lilo fails for new ${initramfs}:" echo lilo -t fi @@ -146,6 +148,16 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 @@ -162,16 +174,6 @@ mbr_check() dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ && run_lilo && return 0 - # try to discover grub and be happy - [ -r /boot/grub/menu.lst ] \ - && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ - /boot/grub/menu.lst) - [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ - && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) - [ -n "${dev}" ] && [ -r ${dev} ] \ - && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ - | grep -q GRUB && return 0 - # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 30ef6d0..50e1f95 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/12/22 $" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -13,7 +13,7 @@ The configuration file allows to disable the update action from Default is \fIyes\fP for running the latest initramfs-tools hooks in the newest Linux image. It is possible to set it to \fIno\fP for remote servers or boxes where -conservative manners needs to be applied. This disables +conservative manners needs to be applied. This disables the \fBupdate_initramfs -u\fP call. .SH AUTHOR -- cgit v1.2.3 From 5dfd85f416a10b1c41ca7005de38b58715c04472 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 15:04:41 +0200 Subject: update-initramfs: restore_initramfs restore initramfs on failure path --- debian/changelog | 6 +++++- update-initramfs | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 07d28d0..3c7cdb8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,7 +30,11 @@ initramfs-tools (0.86) experimental; urgency=low * init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync. - -- maximilian attems Sat, 17 Mar 2007 21:39:13 +0100 + * update-initramfs: If update-initramfs fails, restore the backup. + Useful if a MINKVER set is not fulfilled. (LP: #101844) + Thanks Soren Hansen for patch. + + -- maximilian attems Mon, 2 Apr 2007 15:01:59 +0200 initramfs-tools (0.85f) unstable; urgency=high diff --git a/update-initramfs b/update-initramfs index a676fe9..9d2b03e 100755 --- a/update-initramfs +++ b/update-initramfs @@ -113,6 +113,15 @@ backup_booted_initramfs() rm -f ${initramfs_bak} } +# restore initramfs backup +restore_initramfs() +{ + [ -z "${initramfs_bak}" ] && return 0 + mv -f "${initramfs_bak}" "${initramfs}" + verbose "Restoring ${initramfs_bak}" +} + + generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" @@ -124,6 +133,7 @@ generate_initramfs() set_sha1 else mkinitramfs_return="$?" + restore_initramfs if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 exit 0 -- cgit v1.2.3 From 1eaf8424e56e3f52c60420ce68efdef5301a47d8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 20:21:34 +0200 Subject: bootfixes: mount args don't like spaces restore_initramfs(): verbose output before action --- debian/changelog | 2 +- init | 4 ++-- update-initramfs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3c7cdb8..e4c7b70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,7 +34,7 @@ initramfs-tools (0.86) experimental; urgency=low Useful if a MINKVER set is not fulfilled. (LP: #101844) Thanks Soren Hansen for patch. - -- maximilian attems Mon, 2 Apr 2007 15:01:59 +0200 + -- maximilian attems Mon, 2 Apr 2007 20:20:29 +0200 initramfs-tools (0.85f) unstable; urgency=high diff --git a/init b/init index 4c09fd7..00e0dcf 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs none /sys -o nodev, noexec, nosuid -mount -t proc none /proc -o nodev, noexec, nosuid +mount -t sysfs none /sys -o nodev,noexec,nosuid +mount -t proc none /proc -o nodev,noexec,nosuid # Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out diff --git a/update-initramfs b/update-initramfs index 9d2b03e..f4c637b 100755 --- a/update-initramfs +++ b/update-initramfs @@ -117,8 +117,8 @@ backup_booted_initramfs() restore_initramfs() { [ -z "${initramfs_bak}" ] && return 0 - mv -f "${initramfs_bak}" "${initramfs}" verbose "Restoring ${initramfs_bak}" + mv -f "${initramfs_bak}" "${initramfs}" } -- cgit v1.2.3 From e5bc704cb8be07ecdd419f3630f8ce98129615c0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 22:47:52 +0200 Subject: cleanup initramfs-tools.preinst from conffile move better test for $RESUME handling --- debian/changelog | 6 +++++- debian/initramfs-tools.preinst | 16 +--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index e4c7b70..509e41b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,7 +34,11 @@ initramfs-tools (0.86) experimental; urgency=low Useful if a MINKVER set is not fulfilled. (LP: #101844) Thanks Soren Hansen for patch. - -- maximilian attems Mon, 2 Apr 2007 20:20:29 +0200 + * initramfs-tools.preinst: Test if $RESUME is nonzero, not if it exists, + fixes issue of UUID resume dev. (LP: #67932) While there remove the + conffile mv handling of 0.61. + + -- maximilian attems Mon, 2 Apr 2007 22:43:33 +0200 initramfs-tools (0.85f) unstable; urgency=high diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index aa8c8ca..1379766 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -15,7 +15,7 @@ case "$1" in if [ -e /etc/mkinitrd/mkinitrd.conf ]; then . /etc/mkinitrd/mkinitrd.conf fi - if [ -e ${RESUME} ]; then + if [ -n "${RESUME}" ]; then echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume fi @@ -40,20 +40,6 @@ case "$1" in cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi ;; - upgrade) - if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then - if [ -d /etc/initramfs-tools ]; then - echo - echo "Warning: /etc/initramfs-tools already exists." - echo " Please remove it for upgrade." - echo - exit 1 - fi - if [ -d /etc/mkinitramfs ]; then - mv /etc/mkinitramfs /etc/initramfs-tools - fi - fi - ;; esac #DEBHELPER# -- cgit v1.2.3 From 60ee14df535436fc3dfc537017ba944f62e559ae Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Apr 2007 21:48:20 +0200 Subject: scripts/functions, mkinitramfs: better backup file handling * don't panick on backup files on boot, just ignore them * don't include backup file in initramfs * cleanup changelog this is quite a fundamental change need to double check that it works on nfs root too.. :) --- debian/changelog | 20 +++++++++++++++----- mkinitramfs | 20 ++++++++++++++------ scripts/functions | 12 ++++++++++++ update-initramfs | 2 +- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 509e41b..1f972ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,6 @@ -initramfs-tools (0.86) experimental; urgency=low +initramfs-tools (0.86) UNRELEASED; urgency=low * update-initramfs: Bound the mode and version variable. (closes: 403905) - Thanks "Nikita V. Youshchenko" for report. * init: Set once the MODPROBE_OPTIONS environment variable and export it. Don't forget to set -b to have the modprobe.d blacklists respected. @@ -20,12 +19,12 @@ initramfs-tools (0.86) experimental; urgency=low * scripts/local: Improve panic message and printed order. (closes: 414640) Thanks Vincent.McIntyre@csiro.au for patch. - * scripts/functions: Check if panic is set befor using it. (closes: 406107) + * scripts/functions: Check if panic is set before using it. (closes: 406107) Thanks martin f krafft for report. * hook-functions: Copy all kernel/drivers/{block,ide,scsi} subdir modules instead of hardcoding the list of "supported" drivers. As consequence - the initramfs might be larger, but none of those should be missed. + the initramfs might be larger, but none of those should be missed! As bonus syncs with Ubuntu. * init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync. @@ -38,7 +37,18 @@ initramfs-tools (0.86) experimental; urgency=low fixes issue of UUID resume dev. (LP: #67932) While there remove the conffile mv handling of 0.61. - -- maximilian attems Mon, 2 Apr 2007 22:43:33 +0200 + * scripts/functions: set_initlist() needs to add only script names with + alphabetics, numerics and underscores - skip any other. Bad enough + backup scripts get added, but they shouldn't lead to a panic. Also skip + directories that might lay around. (closes: 398347) (LP: #76131) + + * mkinitramfs: Don't add backup scripts to initramfs. (closes: 378682) + (LP: #78348) + + * scripts/functions: run_scripts() return immediately if passed dir + does not exist. Empty dirs without boot script aren't created anymore. + + -- maximilian attems Thu, 5 Apr 2007 21:16:45 +0200 initramfs-tools (0.85f) unstable; urgency=high diff --git a/mkinitramfs b/mkinitramfs index 0c278d5..c348516 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -199,13 +199,21 @@ 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 && \ - find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ - -o -type f -print); do - mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" -cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" + +# add existant boot scripts +for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ + -regex '.*/[a-z0-9_]+$' -type f); do + [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ + || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" + cp -p "/usr/share/initramfs-tools/scripts/${b}" \ + "${DESTDIR}/scripts/$(dirname "${b}")" +done +for b in $(cd "${CONFDIR}/scripts" && find . -regex '.*/[a-z0-9_]+$' -type f); do + [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ + || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" + cp -p "${CONFDIR}/scripts/${b}" "${DESTDIR}/scripts/$(dirname "${b}")" done + echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf copy_exec "${CONFDIR}/initramfs.conf" /conf for i in ${EXTRA_CONF}; do diff --git a/scripts/functions b/scripts/functions index 7ae9c78..d8e0411 100644 --- a/scripts/functions +++ b/scripts/functions @@ -85,9 +85,20 @@ set_initlist() { unset initlist for si_x in ${initdir}/*; do + # only allow variable name chars + case ${si_x#${initdir}/} in + *[!A-Za-z0-9_]*) + continue + ;; + esac + # skip non executable scripts if [ ! -x ${si_x} ]; then continue fi + # skip directories + if [ -d ${si_x} ]; then + continue + fi initlist="${initlist} ${si_x#${initdir}/}" done } @@ -187,6 +198,7 @@ call_scripts() run_scripts() { initdir=${1} + [ ! -d ${initdir} ] && return get_prereqs reduce_prereqs call_scripts diff --git a/update-initramfs b/update-initramfs index f4c637b..3c67f89 100755 --- a/update-initramfs +++ b/update-initramfs @@ -148,7 +148,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "Error lilo fails for new ${initramfs}:" + echo "ERROR lilo fails for new ${initramfs}:" echo lilo -t fi -- cgit v1.2.3 From b40436b200c024167cc289b63a2edb456a6cb258 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 6 Apr 2007 19:49:16 +0200 Subject: merge 0.85g security upload: fixes permissions of created device /dev/root for lilo boots: brw------- 1 root root 8, 1 2007-04-06 09:28 /dev/root note: this is on trunk aka master, need to create etch branch too. --- debian/changelog | 16 +++++++++++++--- scripts/functions | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f972ed..9e4031b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,9 +10,8 @@ initramfs-tools (0.86) UNRELEASED; urgency=low * small trailing whitespace cleanup, display full path of kernel-img.conf in bug script. - * debian/control: change maintainer entry to new DD mail. :) - Add busybox-initramfs as Ubuntu busybox alternative to depends. - Dropp the sarge busybox-cvs-static entry. + * debian/control: Add busybox-initramfs as Ubuntu busybox alternative + to depends. Drop the sarge busybox-cvs-static entry. * scripts/local-top/mdrun: Drop, existed for partial upgrades from sarge. @@ -50,6 +49,17 @@ initramfs-tools (0.86) UNRELEASED; urgency=low -- maximilian attems Thu, 5 Apr 2007 21:16:45 +0200 +initramfs-tools (0.85g) unstable; urgency=high + + * SECURITY scripts/functions: Set permission of created root dev in + parse_numeric() to 600. This bug only affects lilo boots. Thanks + Fabian Pietsch and Goswin von Brederlow + for patch input. (closes: 417995) + + * debian/control: Change Uploaders email. + + -- maximilian attems Fri, 6 Apr 2007 09:19:13 +0200 + initramfs-tools (0.85f) unstable; urgency=high Release "Au lieu d'aller voter Casse leur la margoulette" diff --git a/scripts/functions b/scripts/functions index d8e0411..183b9f2 100644 --- a/scripts/functions +++ b/scripts/functions @@ -244,5 +244,6 @@ parse_numeric() { esac mknod /dev/root b ${major} ${minor} + chmod 600 /dev/root ROOT=/dev/root } -- cgit v1.2.3 From 5182887b98795207caa1d2142cba0b4bc9e0aec0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 6 Apr 2007 23:00:58 +0200 Subject: mkinitramfs: set PATH with sbin allows non-root user creation of initramfs :) --- debian/changelog | 8 ++++++-- mkinitramfs | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9e4031b..73466c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,10 +44,14 @@ initramfs-tools (0.86) UNRELEASED; urgency=low * mkinitramfs: Don't add backup scripts to initramfs. (closes: 378682) (LP: #78348) - * scripts/functions: run_scripts() return immediately if passed dir + * scripts/functions: run_scripts() return immediately if passed dir does not exist. Empty dirs without boot script aren't created anymore. - -- maximilian attems Thu, 5 Apr 2007 21:16:45 +0200 + * mkinitramfs: Set PATH with /sbin to allow non-root user usage. + Thanks Bob Montgomery for the suggestion. + (closes: 409995) + + -- maximilian attems Fri, 6 Apr 2007 22:40:56 +0200 initramfs-tools (0.85g) unstable; urgency=high diff --git a/mkinitramfs b/mkinitramfs index c348516..17e1846 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,6 +1,7 @@ #!/bin/sh umask 0022 +export PATH='/usr/bin:/sbin:/bin' # Defaults keep="n" -- cgit v1.2.3 From 8fa4b2cc032423e0f93e3f6591d0676c2146e051 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 8 Apr 2007 00:25:11 +0200 Subject: debian/copyright: general update with current authors + git tree location --- debian/changelog | 5 ++++- debian/copyright | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 73466c0..c440f5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,11 +47,14 @@ initramfs-tools (0.86) UNRELEASED; urgency=low * scripts/functions: run_scripts() return immediately if passed dir does not exist. Empty dirs without boot script aren't created anymore. + * debian/copyright: Update my email, add Ben Collins, update years, + alphabetic authors sort + add new git tree location. + * mkinitramfs: Set PATH with /sbin to allow non-root user usage. Thanks Bob Montgomery for the suggestion. (closes: 409995) - -- maximilian attems Fri, 6 Apr 2007 22:40:56 +0200 + -- maximilian attems Sun, 8 Apr 2007 00:20:20 +0200 initramfs-tools (0.85g) unstable; urgency=high diff --git a/debian/copyright b/debian/copyright index 396499f..b75f009 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,7 @@ This package was debianized by Jeff Bailey on Thu, 27 Jan 2005 15:23:52 -0500. -The current Debian maintainer is maximilian attems +The current Debian maintainer is maximilian attems The source code up to 0.31 can be found by using "bzr" at: http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools @@ -9,17 +9,21 @@ http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools The current ubuntu release can be found at: http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ -The Debian tree is maintained with "bzr" at: -http://bzr.debian.org/kernel/initramfs-tools/ +The Debian tree is maintained with "git" at: +git://git.debian.org/git/kernel/initramfs-tools.git +http://git.debian.org/?p=kernel/initramfs-tools.git;a=shortlog -Authors: Jeff Bailey , Adam Conrad , +Authors: Adam Conrad , + Ben Collins , + Jeff Bailey , + maximilian attems Scott James Remnant , - maximilian attems -Copyright: 2005 Jeff Bailey - 2005 - 2006 Adam Conrad +Copyright: 2005 - 2006 Adam Conrad + 2006 Ben Collins + 2005 Jeff Bailey + 2005 - 2007 maximilian attems 2005 - 2006 Scott James Remnant - 2005 - 2006 maximilian attems License: -- cgit v1.2.3 From 1566c7599d021a09179bc59ef39e07f80e542c99 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 9 Apr 2007 00:10:24 +0200 Subject: man initramfs-tools document valid script names --- debian/changelog | 4 +++- initramfs-tools.8 | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c440f5d..37729e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -41,6 +41,8 @@ initramfs-tools (0.86) UNRELEASED; urgency=low backup scripts get added, but they shouldn't lead to a panic. Also skip directories that might lay around. (closes: 398347) (LP: #76131) + * initramfs-tools.8: Document valid script names. + * mkinitramfs: Don't add backup scripts to initramfs. (closes: 378682) (LP: #78348) @@ -54,7 +56,7 @@ initramfs-tools (0.86) UNRELEASED; urgency=low Thanks Bob Montgomery for the suggestion. (closes: 409995) - -- maximilian attems Sun, 8 Apr 2007 00:20:20 +0200 + -- maximilian attems Mon, 9 Apr 2007 00:08:11 +0200 initramfs-tools (0.85g) unstable; urgency=high diff --git a/initramfs-tools.8 b/initramfs-tools.8 index e280ba4..c102de0 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/10/14" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2007/04/09" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -9,6 +9,9 @@ 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. +Valid boot and hook scripts names consist solely of alphabetics, numerics +and underscores. Other scripts are discarded. + .SS Hook scripts 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. @@ -18,10 +21,6 @@ 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. -initramfs-tools uses shell variable names for handling dependencies. -Notice that `-' is not a valid shell variable name and thus should -not be used as script filename. - .SH INIT SCRIPT The script which is executed first and is in charge of running all other scripts can be found in /usr/share/initramfs-tools/init. It takes a number of -- cgit v1.2.3 From f2a9e65d56ffecb19a4615ff6c78c1f9ef0a336d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Apr 2007 21:52:30 +0200 Subject: 0.86 release --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 37729e2..6aa6359 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.86) UNRELEASED; urgency=low +initramfs-tools (0.86) unstable; urgency=low * update-initramfs: Bound the mode and version variable. (closes: 403905) @@ -56,7 +56,7 @@ initramfs-tools (0.86) UNRELEASED; urgency=low Thanks Bob Montgomery for the suggestion. (closes: 409995) - -- maximilian attems Mon, 9 Apr 2007 00:08:11 +0200 + -- maximilian attems Tue, 10 Apr 2007 21:45:36 +0200 initramfs-tools (0.85g) unstable; urgency=high -- cgit v1.2.3 From fdbdb7193427633c6ac8574f5416058b3b70e305 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 11 Apr 2007 00:16:23 +0200 Subject: scripts/functions: fix cicular dep panic due to non-working prereqs check prereqs with the same set of checks for valid boot scripts --- debian/changelog | 8 ++++++++ scripts/functions | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6aa6359..0da1fed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.87) UNRELEASED; urgency=low + + * 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 + initramfs-tools (0.86) unstable; urgency=low * update-initramfs: Bound the mode and version variable. (closes: 403905) diff --git a/scripts/functions b/scripts/functions index 183b9f2..00fcf3d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -108,7 +108,18 @@ reduce_satisfied() deplist="$(render array_${1})" unset tmpdeplist for rs_y in ${deplist}; do - if [ ! -f ${initdir}/${rs_y} ]; then + # only allow variable name chars + case ${rs_y} in + *[!A-Za-z0-9_]*) + continue + ;; + esac + # skip non executable scripts + if [ ! -x ${initdir}/${rs_y} ]; then + continue + fi + # skip directories + if [ -d ${initdir}/${rs_y} ]; then continue fi tmpdeplist="${tmpdeplist} ${rs_y}" -- 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 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 bd662c2122f6f63cadc2c4500a12ef671e0f74c1 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 12 Apr 2007 23:46:21 +0200 Subject: Remove trailing spaces --- initramfs.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 55d6629..2258cb7 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -42,9 +42,9 @@ 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 +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 -- cgit v1.2.3 From 976a23c3d0a4fb156f4e069ff2bbde7c3daa6927 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 12 Apr 2007 23:59:40 +0200 Subject: I am apparently supposed to add myself to the uploaders field... --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9294ee7..b515c49 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilian attems +Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.2.0 -- cgit v1.2.3 From 878b47192bc92fcfe78f34134a8aea70afc161f5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Apr 2007 01:25:53 +0200 Subject: Add support for a blacklist boot parameter. disallows modules loading inside of the initramfs. --- debian/changelog | 5 ++++- init | 4 ++++ initramfs-tools.8 | 5 +++++ scripts/init-premount/blacklist | 25 +++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 scripts/init-premount/blacklist diff --git a/debian/changelog b/debian/changelog index f224405..d86408d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,11 +4,14 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * 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) + * Add blacklist boot param, disabling the load of specific modules inside + the initramfs. Still needs to be passed via tmpfs to the rootfs. [ David Härdeman ] * Add support for loading keymaps. (closes: 337663) - -- David Härdeman Thu, 12 Apr 2007 21:28:45 +0200 + + -- maximilian attems Fri, 13 Apr 2007 01:22:56 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/init b/init index 00e0dcf..b115cd1 100755 --- a/init +++ b/init @@ -50,6 +50,7 @@ export debug= export cryptopts=${CRYPTOPTS} export ROOTDELAY= export panic= +export blacklist= # Parse command line options for x in $(cat /proc/cmdline); do @@ -125,6 +126,9 @@ for x in $(cat /proc/cmdline); do break) break=premount ;; + blacklist=*) + blacklist=${x#blacklist=} + ;; esac done diff --git a/initramfs-tools.8 b/initramfs-tools.8 index c102de0..526899f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -89,6 +89,11 @@ mounts the rootfs read-only. \fB \fI rw mounts the rootfs read-write. +.TP +\fB \fI blacklist +disables load of specific modules. +Use blacklist=module1,module2,module3 bootparameter. + .TP \fB \fI panic sets an timeout on panic. Currently only zero value supported. diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist new file mode 100755 index 0000000..1dd9dbc --- /dev/null +++ b/scripts/init-premount/blacklist @@ -0,0 +1,25 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# sanity check +[ -z "${blacklist}" ] && exit 0 + +# write blacklist to modprobe.d +IFS=',' +for b in ${blacklist}; do + echo "blacklist $b" >> /etc/modprobe.d/initramfs +done -- cgit v1.2.3 From 6dac8bef07f8c17c51bff282511c295fc25314ac Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 19:50:29 +0200 Subject: Update comment --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 7d73ba1..0197937 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -273,7 +273,7 @@ if [ -x /sbin/mdadm ] && [ ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then fi [ -x /sbin/mdrun ] && copy_exec /sbin/mdrun /sbin -# FIXME: Remove this LVM block after Etch releases +# 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 -- cgit v1.2.3 From 16fac6738535e973cfe1493f1b9b5c67c5150ffc Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 20:11:21 +0200 Subject: Use -Qb for for module loading to honor blacklists. --- debian/changelog | 5 +++-- scripts/init-premount/thermal | 4 ++-- scripts/local | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index d86408d..c0f652b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,9 +9,10 @@ initramfs-tools (0.87) UNRELEASED; urgency=low [ David Härdeman ] * Add support for loading keymaps. (closes: 337663) + * Ubuntu merge + - Use -Qb for for module loading to honor blacklists. - - -- maximilian attems Fri, 13 Apr 2007 01:22:56 +0200 + -- David Härdeman Fri, 13 Apr 2007 20:08:26 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index aa146ec..e8a6ae4 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -31,7 +31,7 @@ powerpc|ppc64) modprobe windfarm_smu_sensors ;; i386|amd64|ia64) - modprobe fan - modprobe thermal + modprobe -Qb fan + modprobe -Qb thermal ;; esac diff --git a/scripts/local b/scripts/local index 4e01472..47ef7fa 100644 --- a/scripts/local +++ b/scripts/local @@ -67,7 +67,7 @@ mountroot () fi # FIXME This has no error checking - modprobe ${FSTYPE} + modprobe -Qb ${FSTYPE} # FIXME This has no error checking # Mount root -- cgit v1.2.3 From 3f94f7f380f1a5fe9afd7e20d0796365c2da25c3 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 20:38:06 +0200 Subject: Add PS3 module loading functionality. --- debian/changelog | 1 + hook-functions | 8 +++++++- scripts/init-premount/ps3 | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 scripts/init-premount/ps3 diff --git a/debian/changelog b/debian/changelog index c0f652b..1476018 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * Add support for loading keymaps. (closes: 337663) * Ubuntu merge - Use -Qb for for module loading to honor blacklists. + - Add PS3 module loading functionality. -- David Härdeman Fri, 13 Apr 2007 20:08:26 +0200 diff --git a/hook-functions b/hook-functions index f506b49..f33d323 100644 --- a/hook-functions +++ b/hook-functions @@ -146,6 +146,12 @@ dep_add_modules() if [ -e /sys/bus/i2o/devices/ ]; then manual_add_modules i2o_block fi + + if [ -e /sys/bus/ps3_system_bus/ ]; then + for x in ps3_storage gelic_net ohci-hcd ehci-hcd; do + manual_add_modules "${x}" + done + fi } @@ -167,7 +173,7 @@ auto_add_modules() r8169 s2io sis900 skge slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ - typhon via-rhine via-velocity yellowfin; do + typhon via-rhine via-velocity yellowfin gelic_net; do manual_add_modules "${x}" done ;; diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 new file mode 100755 index 0000000..1fe65ae --- /dev/null +++ b/scripts/init-premount/ps3 @@ -0,0 +1,28 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +case "$DPKG_ARCH" in +powerpc|ppc64) + # For PS3's we know these devices will exist, and we'll need them + if grep -q PS3 /proc/cpuinfo; then + modprobe ps3_storage + modprobe gelic_net + modprobe ohci-hcd + modprobe ehci-hcd + fi + ;; +esac -- cgit v1.2.3 From 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 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 f1b65664af21300696de827b1b5bab70665091a1 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 21:07:13 +0200 Subject: Update copyright info --- debian/copyright | 4 +++- initramfs-tools.8 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/copyright b/debian/copyright index b75f009..44905db 100644 --- a/debian/copyright +++ b/debian/copyright @@ -15,12 +15,14 @@ http://git.debian.org/?p=kernel/initramfs-tools.git;a=shortlog Authors: Adam Conrad , Ben Collins , + David Härdeman , Jeff Bailey , maximilian attems - Scott James Remnant , + Scott James Remnant Copyright: 2005 - 2006 Adam Conrad 2006 Ben Collins + 2005 - 2007 David Härdeman 2005 Jeff Bailey 2005 - 2007 maximilian attems 2005 - 2006 Scott James Remnant diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 526899f..20b9755 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -452,7 +452,7 @@ cpio -i -d -H newc --no-absolute-filenames The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .PP -This manual was written by David H\[:a]rdeman , +This manual was written by David H\[:a]rdeman , updated by Maximilian Attems . .SH SEE ALSO -- cgit v1.2.3 From 8640586a5c7467a54ef1cc9cad77e5296aff26ae Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 13 Apr 2007 21:27:10 +0200 Subject: Bump standards version, no changes necessary. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index b515c49..da8730f 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs -Standards-Version: 3.7.2.0 +Standards-Version: 3.7.2.2 Package: initramfs-tools Architecture: all -- cgit v1.2.3 From 24973b26ba0b43594d6c2bdbc2680f51998b8294 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 14 Apr 2007 10:57:12 +0200 Subject: Revert NACK'ed change --- debian/changelog | 3 +-- scripts/init-premount/thermal | 4 ++-- scripts/local | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index a20ad86..838da0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,10 +11,9 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * 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 21:01:11 +0200 + -- David Härdeman Sat, 14 Apr 2007 10:53:56 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index e8a6ae4..aa146ec 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -31,7 +31,7 @@ powerpc|ppc64) modprobe windfarm_smu_sensors ;; i386|amd64|ia64) - modprobe -Qb fan - modprobe -Qb thermal + modprobe fan + modprobe thermal ;; esac diff --git a/scripts/local b/scripts/local index 47ef7fa..4e01472 100644 --- a/scripts/local +++ b/scripts/local @@ -67,7 +67,7 @@ mountroot () fi # FIXME This has no error checking - modprobe -Qb ${FSTYPE} + modprobe ${FSTYPE} # FIXME This has no error checking # Mount root -- cgit v1.2.3 From cf98d0b5ba3eb20d7ca7c4404dd404bedd5fc22b Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 14 Apr 2007 11:51:52 +0200 Subject: Replace grep use with shell equivalent --- scripts/init-premount/ps3 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 index 1fe65ae..d4b1609 100755 --- a/scripts/init-premount/ps3 +++ b/scripts/init-premount/ps3 @@ -17,12 +17,15 @@ esac case "$DPKG_ARCH" in powerpc|ppc64) - # For PS3's we know these devices will exist, and we'll need them - if grep -q PS3 /proc/cpuinfo; then - modprobe ps3_storage - modprobe gelic_net - modprobe ohci-hcd - modprobe ehci-hcd - fi + while read line; do + if [ "${line}" =! "${line#machine*PS3PF}" ]; then + # For PS3's we know these devices will exist, + # and that we'll need them + modprobe ps3_storage + modprobe gelic_net + modprobe ohci-hcd + modprobe ehci-hcd + fi + done < /proc/cpuinfo ;; esac -- 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 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 27d1b93ad381d09b4bcf39b4e1697c06cecf957e Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 15 Apr 2007 22:58:08 +0200 Subject: Also print settings from initramfs.conf in reportbug script (thanks to Maik Zumstrull for the suggestion) --- debian/script | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/script b/debian/script index 7cfac12..f9dfc37 100755 --- a/debian/script +++ b/debian/script @@ -1,6 +1,6 @@ #!/bin/sh -exec >&3 +#exec >&3 echo "-- /proc/cmdline" cat /proc/cmdline @@ -19,3 +19,9 @@ if [ -r /etc/kernel-img.conf ]; then cat /etc/kernel-img.conf echo fi + +if [ -r /etc/initramfs-tools/initramfs.conf ]; then + echo "-- /etc/initramfs-tools/initramfs.conf" + sed 's/#.*$//;/^[[:space:]]*$/d' /etc/initramfs-tools/initramfs.conf + echo +fi -- cgit v1.2.3 From b9e2f8e2aa33dd26914883c6ced457c12c171c1d Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Mon, 16 Apr 2007 02:08:07 +0200 Subject: Remove stray comment --- debian/script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/script b/debian/script index f9dfc37..5990db3 100755 --- a/debian/script +++ b/debian/script @@ -1,6 +1,6 @@ #!/bin/sh -#exec >&3 +exec >&3 echo "-- /proc/cmdline" cat /proc/cmdline -- cgit v1.2.3 From adda784dc1289b3ceb0ce207850ef9a93102febe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 20:05:00 +0200 Subject: minor cleanups to get 0.87 ready: - add changelog entries to david changes - change to my new debian.org email adresses in manpages too - module list is alphabetic --- debian/changelog | 7 +++++-- debian/copyright | 2 +- hook-functions | 4 ++-- initramfs-tools.8 | 4 ++-- initramfs.conf.5 | 2 +- mkinitramfs-kpkg.8 | 2 +- mkinitramfs.8 | 2 +- update-initramfs.8 | 2 +- update-initramfs.conf.5 | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 838da0c..c5a5e01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,9 +11,12 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * Add support for loading keymaps. (closes: 337663) * Move legacy code from mkinitramfs to separate hooks. * Ubuntu merge - - Add PS3 module loading functionality. + - Add PS3 module loading functionality without grep usage. + * debian/copyright: Update authors info. + * Bump standards version, no changes necessary. + * debian/scripts: Print settings from initramfs.conf in reportbug script. - -- David Härdeman Sat, 14 Apr 2007 10:53:56 +0200 + -- maximilian attems Mon, 16 Apr 2007 19:54:04 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/debian/copyright b/debian/copyright index 44905db..2b3581a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -17,7 +17,7 @@ Authors: Adam Conrad , Ben Collins , David Härdeman , Jeff Bailey , - maximilian attems + maximilian attems , Scott James Remnant Copyright: 2005 - 2006 Adam Conrad diff --git a/hook-functions b/hook-functions index f33d323..a5d1f61 100644 --- a/hook-functions +++ b/hook-functions @@ -168,12 +168,12 @@ auto_add_modules() net) for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ - famachi forcedeth hp100 mace mv643xx_eth myri10ge \ + famachi forcedeth gelic_net hp100 mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ r8169 s2io sis900 skge slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ - typhon via-rhine via-velocity yellowfin gelic_net; do + typhon via-rhine via-velocity yellowfin; do manual_add_modules "${x}" done ;; diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 20b9755..fd0a83f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -449,11 +449,11 @@ cpio -i -d -H newc --no-absolute-filenames .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .PP This manual was written by David H\[:a]rdeman , -updated by Maximilian Attems . +updated by Maximilian Attems . .SH SEE ALSO .BR diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 2258cb7..c7fee03 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -65,7 +65,7 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. Loosely based on mkinitrd.conf by Herbert Xu. diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 2a3072b..2d96465 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -43,7 +43,7 @@ This option queries if mkinitramfs can create ramdisks for kernel version .IR tversion . .SH AUTHOR -mkinitramfs-kpkg is maintained by Maximilian Attems . +mkinitramfs-kpkg is maintained by Maximilian Attems . .SH SEE ALSO .BR diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 6d81233..a35a561 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -100,7 +100,7 @@ it to be loaded by ACPI. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO diff --git a/update-initramfs.8 b/update-initramfs.8 index 0db2609..4ba12de 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -85,7 +85,7 @@ Create the initramfs for a specific kernel: .B update\-initramfs -c -k 2.6.18-1-686 .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 50e1f95..302cffe 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -17,7 +17,7 @@ conservative manners needs to be applied. This disables the \fBupdate_initramfs -u\fP call. .SH AUTHOR -The initramfs-tools are written by Maximilian Attems , +The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. .SH SEE ALSO .BR -- cgit v1.2.3 From 2b382bf18e47765e9f3bb1963008f8ee1a46cf97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 20:33:52 +0200 Subject: fix regexes to always use posix char classes and release 0.87 needs the -regextype posix-extended switch for find, also it seems 0.86 disgarded uselessly uppercase scripts (they might be distasteful ;) --- debian/changelog | 7 +++++-- mkinitramfs | 8 +++++--- scripts/functions | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index c5a5e01..0d77ff9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.87) UNRELEASED; urgency=low +initramfs-tools (0.87) unstable; urgency=low [ maximilian attems ] * scripts/functions: reduce_satisfied() needs to ignore the same set as @@ -6,6 +6,9 @@ initramfs-tools (0.87) UNRELEASED; urgency=low boot script may cause circular panic. (closes: 418509) * Add blacklist boot param, disabling the load of specific modules inside the initramfs. Still needs to be passed via tmpfs to the rootfs. + * mkinitramfs, scripts/functions: Fix regexes to always use posix character + classes. Based on a patch by Meelis Roos . + (closes: 419062) [ David Härdeman ] * Add support for loading keymaps. (closes: 337663) @@ -16,7 +19,7 @@ initramfs-tools (0.87) UNRELEASED; urgency=low * Bump standards version, no changes necessary. * debian/scripts: Print settings from initramfs.conf in reportbug script. - -- maximilian attems Mon, 16 Apr 2007 19:54:04 +0200 + -- maximilian attems Mon, 16 Apr 2007 20:21:30 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index b3514fc..e7b9b13 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -84,7 +84,8 @@ fi . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/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 '^[[:alnum:]][[:alnum:]\._-]*$' | grep -v '\.dpkg-.*$')"; done for i in ${EXTRA_CONF}; do if [ -e ${CONFDIR}/conf.d/${i} ]; then @@ -204,13 +205,14 @@ copy_exec /usr/share/initramfs-tools/init /init # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ - -regex '.*/[a-z0-9_]+$' -type f); do + -regextype posix-extended -regex '.*/[[:alnum:]_]+$' -type f); do [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" cp -p "/usr/share/initramfs-tools/scripts/${b}" \ "${DESTDIR}/scripts/$(dirname "${b}")" done -for b in $(cd "${CONFDIR}/scripts" && find . -regex '.*/[a-z0-9_]+$' -type f); do +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}")" diff --git a/scripts/functions b/scripts/functions index 00fcf3d..0b8d1e8 100644 --- a/scripts/functions +++ b/scripts/functions @@ -87,7 +87,7 @@ set_initlist() for si_x in ${initdir}/*; do # only allow variable name chars case ${si_x#${initdir}/} in - *[!A-Za-z0-9_]*) + *[![:alnum:]_]*) continue ;; esac @@ -110,7 +110,7 @@ reduce_satisfied() for rs_y in ${deplist}; do # only allow variable name chars case ${rs_y} in - *[!A-Za-z0-9_]*) + *[![:alnum:]_]*) continue ;; esac -- cgit v1.2.3 From 7e0470e3fe7ede0f846ff2e459aeec1650742e9b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 22:07:01 +0200 Subject: nice usplash experience tested both on my laptop as on qemu ubuntu merge --- debian/changelog | 7 +++++++ scripts/init-top/framebuffer | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0d77ff9..62fef53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.88) UNRELEASED; 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 + initramfs-tools (0.87) unstable; urgency=low [ maximilian attems ] diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index c680409..08e36d2 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -61,10 +61,6 @@ OPTS="" for x in $(cat /proc/cmdline); do case ${x} in - splash*) - FB="vga16fb"; - OPTS=""; - ;; vga=*) FB="vesafb"; OPTS=""; -- cgit v1.2.3 From e4fc12ec7db32e3b7844697ce248df3c61ff8e82 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 23:19:52 +0200 Subject: TODO: lvm2 has it's own hooks *phew* :) --- debian/TODO | 2 -- 1 file changed, 2 deletions(-) diff --git a/debian/TODO b/debian/TODO index 7b9bf0a..7ed390f 100644 --- a/debian/TODO +++ b/debian/TODO @@ -10,5 +10,3 @@ TODO o Default to dep for PPC - Possibly to detect newworld? o udevsettle timeouts handling - - o lvm2 hooks to their respective packages -- 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 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 27d498d8d190e67d51bc1a25a331acb805425721 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 22 Apr 2007 19:10:31 +0200 Subject: lintian: make package error/warning clean again - missing colon in closes --- debian/changelog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b36c9a6..e604463 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.88) UNRELEASED; urgency=low + + * Fix missing colons in closes. + + -- maximilian attems Sun, 22 Apr 2007 19:08:40 +0200 + initramfs-tools (0.87b) unstable; urgency=low * scripts/init-top/framebuffer: Remove vga16fb loading on splash bootarg. @@ -1160,7 +1166,7 @@ initramfs-tools (0.54) unstable; urgency=low * hook-functions: Add dasd class to auto_add_modules and dd zfcp module. Thanks to s390 support Bastian Blank . (closes: #355595) - * hook-functions: Add it821x. (closes #352460) + * hook-functions: Add it821x. (closes: #352460) -- maximilian attems Wed, 8 Mar 2006 17:34:25 +0100 -- cgit v1.2.3 From b71721f02b6b46fddfc624888f61aafbc2399129 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 1 May 2007 18:31:38 +0200 Subject: mkinitramfs: better heuristics for MODULES=dep * add a first shoot that survives ide, scsi boot testing nfs still needs work let's see what other testers have to say * next step is to cut on the added libs for smaller initramfs enhances boot speed due to smaller initramfs for tuning freaks, others might still be better off with safe MODULES=most setting. --- debian/TODO | 2 -- debian/changelog | 6 ++++-- hook-functions | 34 ++++++++++++++++++++++------------ 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/debian/TODO b/debian/TODO index 7ed390f..f62656f 100644 --- a/debian/TODO +++ b/debian/TODO @@ -5,8 +5,6 @@ TODO o Eliminate ?udev?, ?klibc?, busybox (-> glibc). - o Better heuristics for MODULES=dep option - o Default to dep for PPC - Possibly to detect newworld? o udevsettle timeouts handling diff --git a/debian/changelog b/debian/changelog index e604463..22b793b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ initramfs-tools (0.88) UNRELEASED; urgency=low - * Fix missing colons in closes. + * debian/changelog: Fix missing colons in closes. + * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal + initramfs on MODULES=dep. (closes: #395526) - -- maximilian attems Sun, 22 Apr 2007 19:08:40 +0200 + -- maximilian attems Tue, 01 May 2007 18:29:59 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index a5d1f61..12faeff 100644 --- a/hook-functions +++ b/hook-functions @@ -113,24 +113,34 @@ copy_modules_dir() done } +# only copy relevant modules dep_add_modules() { + # findout root block device + fstype + eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" + block=${root#/dev/} + block=${block%[0-9]*} - # Things that are too hard to autodetect. - for x in ext2 ext3 isofs jfs nfs reiserfs xfs af_packet; do - manual_add_modules "${x}" - done + # Error out if /sys lack block dev + if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then + echo "Error: missing ${block} root ${root} /sys entry" + exit 1 + fi - for x in /sys/bus/pci/devices/*; do - if [ -e "${x}/modalias" ]; then - manual_add_modules $(cat "${x}/modalias") - fi - done + # Add rootfs + force_load "${rootfs}" - for x in /sys/bus/usb/devices/*; do - if [ -e "${x}/modalias" ]; then - manual_add_modules $(cat "${x}/modalias") + # walk /sys for relevant modules + device_path=$(readlink -f /sys/block/${block}/device) + while [ "${device_path}" != "/sys" ]; do + driver_path="$(readlink -f ${device_path}/driver)" + if [ -e "$driver_path" ]; then + module="$(basename $(readlink -f $driver_path))" + if [ -n "${module}" ]; then + force_load "${module}" + fi fi + device_path="$(dirname ${device_path})" done if [ -e /proc/ide ]; then -- cgit v1.2.3 From b65e2e814325991ea130c3a176024f6a7e416c46 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 1 May 2007 18:49:42 +0200 Subject: mkinitramfs.8: improve docs * add example section * be more explicit that update-initramfs is a wrapper around mkinitramfs and what it does --- debian/changelog | 6 +++++- mkinitramfs.8 | 26 +++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 22b793b..b5eff37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,14 @@ initramfs-tools (0.88) UNRELEASED; urgency=low * debian/changelog: Fix missing colons in closes. + * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal initramfs on MODULES=dep. (closes: #395526) - -- maximilian attems Tue, 01 May 2007 18:29:59 +0200 + * mkinitramfs.8: Add examples section, plus improve description of the + low-level tool and how it fits with update-initramfs. + + -- maximilian attems Tue, 01 May 2007 18:48:03 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/mkinitramfs.8 b/mkinitramfs.8 index a35a561..64fcc8d 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,7 +1,7 @@ -.TH MKINITRAMFS 8 "$Date: 2007/01/02 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2007/05/01 $" "" "mkinitramfs manual" .SH NAME -mkinitramfs \- generate an initramfs image +mkinitramfs \- low-level tool for generating an initramfs image .SH SYNOPSIS .B mkinitramfs @@ -31,7 +31,12 @@ different box of the same arch with the corresponding Linux kernel. .B mkinitramfs is meant for advanced usage. On your local box .B update-initramfs -should do all necessary steps. +calls +.B mkinitramfs +with the relevant parameters. +.B update-initramfs +keeps sha1sum of generated initramfs. It takes care to generate backups +and eventually runs the bootloader. 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 @@ -98,6 +103,21 @@ This is especially useful for bootloaders, which do not pass an root bootarg. If this file exists, it will be appended to the initramfs in a way that causes it to be loaded by ACPI. +.SH EXAMPLES + +Create an initramfs for current running kernel: + +.PP +.B mkinitramfs -o ~/tmp/initramfs-$(uname -r) + +Create an initramfs for specific kernel and keep builddirs: + +.PP +.B mkinitramfs -k -o ~/tmp/initramfs-2.6.21-686 2.6.21-686 + +Debug initramfs creation (check out written logfile) +.PP +.B sh -x mkinitramfs -o ~/tmp/initramfs-$(uname -r) 2> ~/tmp/log .SH AUTHOR The initramfs-tools are written by Maximilian Attems , -- cgit v1.2.3 From 8800b09a519db23e0fefd32868a57c45c0a013e8 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 1 May 2007 18:59:39 +0200 Subject: init: Remove cryptopts parsing the cryptsetup scripts parse /proc/cmdline themselves (even in the Etch version). --- debian/changelog | 7 ++++++- init | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b5eff37..8932889 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ initramfs-tools (0.88) UNRELEASED; urgency=low + [ maximilian attems ] * debian/changelog: Fix missing colons in closes. * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal @@ -8,7 +9,11 @@ initramfs-tools (0.88) UNRELEASED; urgency=low * mkinitramfs.8: Add examples section, plus improve description of the low-level tool and how it fits with update-initramfs. - -- maximilian attems Tue, 01 May 2007 18:48:03 +0200 + [ David Härdeman ] + * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts + parse /proc/cmdline themselves (even in the Etch version). + + -- maximilian attems Tue, 01 May 2007 18:56:40 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/init b/init index b115cd1..7de409a 100755 --- a/init +++ b/init @@ -47,7 +47,6 @@ export quiet=n export readonly=y export rootmnt=/root export debug= -export cryptopts=${CRYPTOPTS} export ROOTDELAY= export panic= export blacklist= @@ -81,9 +80,6 @@ for x in $(cat /proc/cmdline); do rootdelay=*) ROOTDELAY="${x#rootdelay=}" ;; - cryptopts=*) - cryptopts="${x#cryptopts=}" - ;; nfsroot=*) NFSROOT="${x#nfsroot=}" ;; -- cgit v1.2.3 From 97463b8108d05b33a09d8847c7f4d7c1be7e41db Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 1 May 2007 19:25:27 +0200 Subject: hook-funtions: copy_exec work * Change copy_exec to use the same source and destination path if only one argument is given. * document how copy_exec determines the target path. This also fixes a minor bug, these two commands: copy_exec /some/thing /thing copy_exec /some/other/thing /thing Would previously print (note the incorrect path): W:copy_exec: Not copying /some/other/thing to $DESTDIR/thing/thing... --- debian/changelog | 7 +++--- hook-functions | 67 +++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8932889..40363ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,18 +2,19 @@ initramfs-tools (0.88) UNRELEASED; urgency=low [ maximilian attems ] * debian/changelog: Fix missing colons in closes. - * hook-functions: Add a proper /sys walking dep_add_modules() for a minimal initramfs on MODULES=dep. (closes: #395526) - * mkinitramfs.8: Add examples section, plus improve description of the low-level tool and how it fits with update-initramfs. [ David Härdeman ] * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts parse /proc/cmdline themselves (even in the Etch version). + * hook-functions: Change copy_exec to use the same source and + destination path if only one argument is given. + * hook-funcions: document how copy_exec determines the target path. - -- maximilian attems Tue, 01 May 2007 18:56:40 +0200 + -- maximilian attems Tue, 01 May 2007 19:23:10 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 12faeff..6c75b5f 100644 --- a/hook-functions +++ b/hook-functions @@ -55,24 +55,55 @@ manual_add_modules() done } -# $1 is source -# $2 is relative destination +# $1 is the source path (e.g. /usr/bin/time) +# $2 is the relative destination (e.g. /usr or /usr/time) +# +# The destination is interpreted in the same way "cp" would, meaning +# (assuming /bin is a directory): +# +# "copy_exec /usr/bin/time /bin" -> /bin/time +# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime +# +# If $2 is left out, the same destination path as for the source arg will +# be used and directories will be created as needed, so: +# +# "copy_exec /usr/bin/time" -> /usr/bin/time +# copy_exec() { - final_destination=${DESTDIR}/${2}/`basename ${1}` + local source target destination final_destination x nonoptlib + local libname dirname + + source="${1}" + if [ -n "${2}" ]; then + target="${2}" + else + if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then + mkdir -p "${DESTDIR}/$(dirname "${1}")" + fi + target="${1}" + fi + + if [ -d "${DESTDIR}/${target}" ]; then + destination="${target}/$(basename "${source}")" + else + destination="${target}" + fi + final_destination="${DESTDIR}/${destination}" + if [ -L "$final_destination" ]; then - if ! [ `readlink ${final_destination}` = "${1}" ]; then - echo "W:copy_exec: Not copying ${1} to \$DESTDIR${2}/`basename ${1}`, which is already a copy of `readlink ${final_destination}`" >&2 + if [ $(readlink "${final_destination}") != "${source}" ]; then + echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2 return fi else - ln -s ${1} ${DESTDIR}/${2} - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then - echo "Adding binary ${1}" + ln -s ${source} ${DESTDIR}/${destination} + if [ "${verbose}" = "y" ]; then + echo "Adding binary ${source}" fi fi # Copy the dependant libraries - for x in $(ldd ${1} 2>/dev/null | sed -e ' + for x in $(ldd ${source} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; @@ -80,19 +111,19 @@ copy_exec() { # Try to use non-optimised libraries where possible. # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + nonoptlib=$(echo "${x}" | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') - if [ -e ${nonoptlib} ]; then - x=${nonoptlib} + if [ -e "${nonoptlib}" ]; then + x="${nonoptlib}" fi - libname=$(basename ${x}) - dirname=$(dirname ${x}) + libname=$(basename "${x}") + dirname=$(dirname "${x}") - mkdir -p ${DESTDIR}/${dirname} - if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then - ln -s ${x} ${DESTDIR}/${dirname} - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + mkdir -p "${DESTDIR}/${dirname}" + if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then + ln -s "${x}" "${DESTDIR}/${dirname}" + if [ "${verbose}" = "y" ]; then echo "Adding library ${x}" fi fi -- cgit v1.2.3 From 6fd917d49cd09c5124df25c48e1458e1a87f2365 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 1 May 2007 19:35:45 +0200 Subject: init: ignore non-numeric rootdelay, panic bootargs they cause funny sleep error messages: aka you can't sleep "bar" time ;) take into account that subsecond sleeps are ok. thanks david for the idea, gone for the q&d regex check. --- debian/changelog | 3 ++- init | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 40363ad..b436b0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ initramfs-tools (0.88) UNRELEASED; urgency=low initramfs on MODULES=dep. (closes: #395526) * mkinitramfs.8: Add examples section, plus improve description of the low-level tool and how it fits with update-initramfs. + * init: Ignore non-numerical panic and rootdelay bootarg. [ David Härdeman ] * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts @@ -14,7 +15,7 @@ initramfs-tools (0.88) UNRELEASED; urgency=low destination path if only one argument is given. * hook-funcions: document how copy_exec determines the target path. - -- maximilian attems Tue, 01 May 2007 19:23:10 +0200 + -- maximilian attems Tue, 01 May 2007 19:31:41 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/init b/init index 7de409a..0da01d4 100755 --- a/init +++ b/init @@ -79,6 +79,11 @@ for x in $(cat /proc/cmdline); do ;; rootdelay=*) ROOTDELAY="${x#rootdelay=}" + case ${ROOTDELAY} in + *[![:digit:].]*) + ROOTDELAY= + ;; + esac ;; nfsroot=*) NFSROOT="${x#nfsroot=}" @@ -97,6 +102,11 @@ for x in $(cat /proc/cmdline); do ;; panic=*) panic="${x#panic=}" + case ${panic} in + *[![:digit:].]*) + panic= + ;; + esac ;; quiet) quiet=y -- cgit v1.2.3 From af88873884da184d98fffd08bf96f3b276b187a2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 May 2007 10:15:01 +0200 Subject: mkinitramfs: old linux-image interfaces deprecate them as they should get scrapped next release (keep them for backports.org and friends) --- mkinitramfs | 1 + mkinitramfs-kpkg | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mkinitramfs b/mkinitramfs index e7b9b13..a2e643c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -63,6 +63,7 @@ while true; do esac done +# FIXME: remove after Lenny (needed for Etch linux-images) if [ -n "$supported_host_version" ] || [ -n "$supported_target_version" ]; then if [ -n "$supported_host_version" ]; then host_upstream_version="${supported_host_version%%-*}" diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index df3dc0c..ea0e783 100755 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -6,6 +6,8 @@ supported_host_version="" supported_target_version="" outfile="" +# FIXME: drop script after Lenny (needed for Etch linux-images) + usage() { cat >&2 << EOF -- cgit v1.2.3 From f123993d1c73c906c50bcb8484e8abb5f9dd44f1 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 3 May 2007 18:47:00 +0200 Subject: hook-functions: add firmware loading support newer modinfo outputs firmware files corresponding to the modules MODULE_FIRMWARE() field. Take care to add them automaticaly. --- debian/changelog | 6 ++++-- hook-functions | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b436b0a..032fa85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,9 +13,11 @@ initramfs-tools (0.88) UNRELEASED; urgency=low parse /proc/cmdline themselves (even in the Etch version). * hook-functions: Change copy_exec to use the same source and destination path if only one argument is given. - * hook-funcions: document how copy_exec determines the target path. + * hook-functions: Document how copy_exec determines the target path. + * hook-functions: Add firmware loading support to manual_add_modules(). + (closes: #355881) - -- maximilian attems Tue, 01 May 2007 19:31:41 +0200 + -- maximilian attems Thu, 03 May 2007 18:43:14 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 6c75b5f..b3264ac 100644 --- a/hook-functions +++ b/hook-functions @@ -38,8 +38,11 @@ add_modules_from_file() done } +# Add dependent modules + eventual firmware manual_add_modules() { + local man_x firmwares firmware + for mam_x in $(modprobe --set-version="${version}" --ignore-install \ --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates @@ -49,9 +52,42 @@ manual_add_modules() mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + if [ "${verbose}" = "y" ]; then echo "Adding module ${mam_x}" fi + + # Add firmware files if necessary + firmwares=$(modinfo -F firmware "${mam_x}") + if [ -z "${firmwares}" ]; then + continue + fi + for firmware in $firmwares; do + if [ -e "${DESTDIR}/lib/firmware/${firmware}" ]; then + continue + fi + + # Only print warning for missing fw of loaded module + # or forced loaded module + if [ ! -e "/lib/firmware/${firmware}" ]; then + if grep -q "^$(basename "${mam_x}" .ko)" \ + /proc/modules \ + || grep -q "^$(basename "${mam_x}" .ko)" \ + "${CONFDIR}/modules"; then + echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2 + fi + continue + fi + + if [ ! -e "${DESTDIR}/lib/udev/firmware.agent" ] \ + && [ -e "/lib/udev/firmware.agent" ]; then + copy_exec /lib/udev/firmware.agent + fi + + copy_exec "/lib/firmware/${firmware}" + if [ "${verbose}" = "y" ]; then + echo "Adding firmware ${firmware}" + fi + done done } -- cgit v1.2.3 From 525008f4da3ddc32c83329dbb6322ae1660b8fc8 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 27 May 2007 00:29:27 +0200 Subject: scripts/local: check for fs on rootnode some device node will exist before they can be safely used --- debian/changelog | 10 ++++++++-- scripts/local | 36 +++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 032fa85..042cf8d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,14 @@ initramfs-tools (0.88) UNRELEASED; urgency=low * hook-functions: Document how copy_exec determines the target path. * hook-functions: Add firmware loading support to manual_add_modules(). (closes: #355881) - - -- maximilian attems Thu, 03 May 2007 18:43:14 +0200 + * scripts/local: Ubuntu merge + - As well as waiting for the existance of the root device node, also check + to see whether we have a filesystem of some kind on it. Some devices + nodes (devmapper/LVM/EVMS, mdadm) will exist before they can be safely + used. Patch by Scott James Remnant . Changed to + support both fstype and vol_id. + + -- maximilian attems Sun, 27 May 2007 00:26:17 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/scripts/local b/scripts/local index 4e01472..459ba8d 100644 --- a/scripts/local +++ b/scripts/local @@ -1,5 +1,29 @@ # Local filesystem mounting -*- shell-script -*- +# Parameter: device node to check +# Echos fstype to stdout +# Return value: indicates if an fs could be recognized +get_fstype () +{ + local FS FSTYPE FSSIZE RET + FS="${1}" + + # vol_id has a more complete list of file systems + if [ -x /lib/udev/vol_id ]; then + FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) + else + eval $(fstype < "${FS}" 2> /dev/null) + fi + RET=$? + + if [ -z "${FSTYPE}" ]; then + FSTYPE="unknown" + fi + + echo "${FSTYPE}" + return ${RET} +} + # Parameter: Where to mount the filesystem mountroot () { @@ -9,7 +33,7 @@ mountroot () # If the root device hasn't shown up yet, give it a little while # to deal with removable devices - if [ ! -e "${ROOT}" ]; then + if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then log_begin_msg "Waiting for root file system..." # Default delay is 180s @@ -23,9 +47,11 @@ mountroot () fi slumber=$(( ${slumber} * 10 )) - while [ ${slumber} -gt 0 ] && [ ! -e "${ROOT}" ]; do + while [ ! -e "${ROOT}" ] \ + || ! $(get_fstype "${ROOT}" >/dev/null); do /bin/sleep 0.1 slumber=$(( ${slumber} - 1 )) + [ ${slumber} -gt 0 ] || break done if [ ${slumber} -gt 0 ]; then @@ -47,14 +73,10 @@ mountroot () # Get the root filesystem type if not set if [ -z "${ROOTFSTYPE}" ]; then - eval $(fstype < ${ROOT}) + FSTYPE=$(get_fstype "${ROOT}") 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 -- cgit v1.2.3 From 0df638ec51ee9a8362f3c81ceb9070d8e2820381 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 27 May 2007 00:32:10 +0200 Subject: scripts/init-premount/ps3: typo fix --- debian/changelog | 3 ++- scripts/init-premount/ps3 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 042cf8d..86ba300 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ initramfs-tools (0.88) UNRELEASED; urgency=low * mkinitramfs.8: Add examples section, plus improve description of the low-level tool and how it fits with update-initramfs. * init: Ignore non-numerical panic and rootdelay bootarg. + * scripts/init-premount/ps3: Fix typo. (closes: #423469) [ David Härdeman ] * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts @@ -23,7 +24,7 @@ initramfs-tools (0.88) UNRELEASED; urgency=low used. Patch by Scott James Remnant . Changed to support both fstype and vol_id. - -- maximilian attems Sun, 27 May 2007 00:26:17 +0200 + -- maximilian attems Sun, 27 May 2007 00:31:13 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 index d4b1609..8f8ce1c 100755 --- a/scripts/init-premount/ps3 +++ b/scripts/init-premount/ps3 @@ -18,7 +18,7 @@ esac case "$DPKG_ARCH" in powerpc|ppc64) while read line; do - if [ "${line}" =! "${line#machine*PS3PF}" ]; then + if [ "${line}" != "${line#machine*PS3PF}" ]; then # For PS3's we know these devices will exist, # and that we'll need them modprobe ps3_storage -- cgit v1.2.3 From bb98536c4c1b597ed326c8729e048eac5526869b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 27 May 2007 00:43:18 +0200 Subject: scripts/nfs: fix when root-path includes server-ip --- debian/changelog | 4 +++- scripts/nfs | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 86ba300..622b109 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ initramfs-tools (0.88) UNRELEASED; urgency=low low-level tool and how it fits with update-initramfs. * init: Ignore non-numerical panic and rootdelay bootarg. * scripts/init-premount/ps3: Fix typo. (closes: #423469) + * scripts/nfs: Fix when root-path includes server-ip. (closes: #387808) + Thanks Vagrant Cascadian for patch. [ David Härdeman ] * init: Remove cryptopts parsing, not official bootparam. cryptsetup scripts @@ -24,7 +26,7 @@ initramfs-tools (0.88) UNRELEASED; urgency=low used. Patch by Scott James Remnant . Changed to support both fstype and vol_id. - -- maximilian attems Sun, 27 May 2007 00:31:13 +0200 + -- maximilian attems Sun, 27 May 2007 00:41:08 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/scripts/nfs b/scripts/nfs index 5eb17bf..717dfe8 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -41,7 +41,13 @@ do_nfsmount() # get nfs root from dhcp if [ "x${NFSROOT}" = "xauto" ]; then - NFSROOT=${ROOTSERVER}:${ROOTPATH} + # check if server ip is part of dhcp root-path + if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then + NFSROOT=${ROOTSERVER}:${ROOTPATH} + else + NFSROOT=${ROOTPATH} + fi + # nfsroot=[:][,] elif [ -n "${NFSROOT}" ]; then # nfs options are an optional arg -- cgit v1.2.3 From fa78f20fc86dabbd6e89485b755cb40f3918895a Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 27 May 2007 00:57:02 +0200 Subject: hook-functions: make version check in check_minkver more robust. --- debian/changelog | 5 +++-- hook-functions | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 622b109..4c0ff66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.88) UNRELEASED; urgency=low +initramfs-tools (0.88) unstable; urgency=low [ maximilian attems ] * debian/changelog: Fix missing colons in closes. @@ -25,8 +25,9 @@ initramfs-tools (0.88) UNRELEASED; urgency=low nodes (devmapper/LVM/EVMS, mdadm) will exist before they can be safely used. Patch by Scott James Remnant . Changed to support both fstype and vol_id. + * hook-functions: make version check in check_minkver more robust. - -- maximilian attems Sun, 27 May 2007 00:41:08 +0200 + -- maximilian attems Sun, 27 May 2007 00:52:38 +0200 initramfs-tools (0.87b) unstable; urgency=low diff --git a/hook-functions b/hook-functions index b3264ac..1b38931 100644 --- a/hook-functions +++ b/hook-functions @@ -340,9 +340,13 @@ check_minkver() fi set_initlist for cm_x in ${initlist}; do - tmp=$(eval echo $(grep ^MINKVER ${initdir}/${cm_x} | cut -d'=' -f2)) - if dpkg --compare-versions "${curversion}" lt "${tmp}"; then - echo "W: ${cm_x} hook script requires at least kernel version ${tmp}" >&2 + # sed: keep last line starting with MINKVER=, + # remove MINKVER= and trailing space + minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") + if [ -z "${tmp}" ]; then + continue + elif dpkg --compare-versions "${curversion}" lt "${minver}"; then + echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2 echo "W: not generating requested initramfs for kernel ${curversion}" >&2 exit 2 fi -- cgit v1.2.3 From ce60ba266ecf3724bede535b21cf61377ac52002 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 30 May 2007 13:27:09 +0200 Subject: document ROOT hardcoding only indirectly referenced in mkinitramfs.8 --- debian/changelog | 6 ++++++ initramfs.conf.5 | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4c0ff66..d413936 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.89) unstable; urgency=low + + * initramfs.conf.5: Document ROOT hardcoding. + + -- maximilian attems Wed, 30 May 2007 13:25:36 +0200 + initramfs-tools (0.88) unstable; urgency=low [ maximilian attems ] diff --git a/initramfs.conf.5 b/initramfs.conf.5 index c7fee03..d6c3f0e 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -58,6 +58,11 @@ Set to \fInfs\fP for an NFS root share. \fB DEVICE Specifies the network interface, like eth0. +.TP +\fB ROOT +Allows optional root bootarg hardcoding, when no root bootarg can be passed. +A root bootarg overrides that special setting. + .TP \fB NFSROOT Defaults to \fIauto\fP in order to pick up value from DHCP server. -- cgit v1.2.3 From ad5ae668b01884a4ef99d14bbfef7ce07f908801 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 11 Jun 2007 00:42:05 +0200 Subject: scripts/local: use simpler fstype invocation compatible with etch released klibc --- debian/changelog | 4 +++- scripts/local | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d413936..be82239 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,9 @@ initramfs-tools (0.89) unstable; urgency=low * initramfs.conf.5: Document ROOT hardcoding. - -- maximilian attems Wed, 30 May 2007 13:25:36 +0200 + * scripts/local: Use simpler fstype invocation. + + -- maximilian attems Mon, 11 Jun 2007 00:40:29 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/scripts/local b/scripts/local index 459ba8d..429d1f6 100644 --- a/scripts/local +++ b/scripts/local @@ -12,7 +12,7 @@ get_fstype () if [ -x /lib/udev/vol_id ]; then FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) else - eval $(fstype < "${FS}" 2> /dev/null) + eval $(fstype "${FS}" 2> /dev/null) fi RET=$? -- cgit v1.2.3 From ddef7d56a60dd4602f513450581d65a9def58920 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 20 Jun 2007 20:03:24 +0200 Subject: docs fix typos apply latest patches from bts. --- debian/changelog | 5 ++++- initramfs-tools.8 | 4 ++-- initramfs.conf.5 | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index be82239..b1bacac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,10 @@ initramfs-tools (0.89) unstable; urgency=low * scripts/local: Use simpler fstype invocation. - -- maximilian attems Mon, 11 Jun 2007 00:40:29 +0200 + * initramfs-tools.8, initramfs.conf.5: Fix typos. (closes: #427837, #427838) + Thanks "A. Costa" for the patch. + + -- maximilian attems Wed, 20 Jun 2007 20:01:20 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/initramfs-tools.8 b/initramfs-tools.8 index fd0a83f..be4de54 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -59,9 +59,9 @@ Use root=/dev/nfs for NFS to kick to in. .TP \fB \fI ip -tells how to configure the ip adress. Allows to specify an different +tells how to configure the ip address. Allows to specify an different NFS server than the DHCP server. See Documentation/nfsroot.txt in -any recent linux source for details. Optional paramater for NFS root. +any recent Linux source for details. Optional paramater for NFS root. .TP \fB \fI cryptopts diff --git a/initramfs.conf.5 b/initramfs.conf.5 index d6c3f0e..e5fcec9 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -51,7 +51,7 @@ should normally be no need to set this. .TP \fB BOOT Allows to use an nfs drive as the root of the drive. -The default is to boot from \fIlocal\fP media (harddrive, USB stick). +The default is to boot from \fIlocal\fP media (hard drive, USB stick). Set to \fInfs\fP for an NFS root share. .TP -- cgit v1.2.3 From 087dc49f30e7d94db10c0f0cd89020a56a04a918 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 20 Jun 2007 20:58:41 +0200 Subject: scripts/local: add a q&d crude method to warn about renamed root dev maybe this will reduce ration of bug reports, as further device renaming is in the pipes. :) --- debian/changelog | 5 ++++- scripts/local | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b1bacac..d506d71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,10 @@ initramfs-tools (0.89) unstable; urgency=low * initramfs-tools.8, initramfs.conf.5: Fix typos. (closes: #427837, #427838) Thanks "A. Costa" for the patch. - -- maximilian attems Wed, 20 Jun 2007 20:01:20 +0200 + * scripts/local: Try to warn for renamed root dev. (closes: #374611) + + + -- maximilian attems Wed, 20 Jun 2007 20:56:14 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/scripts/local b/scripts/local index 429d1f6..10e2f73 100644 --- a/scripts/local +++ b/scripts/local @@ -66,6 +66,25 @@ mountroot () # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do + # give hint about renamed root + case "${ROOT}" in + /dev/hd*) + suffix="${ROOT#/dev/hd}" + major="${suffix%[[:digit:]]}" + major="${major%[[:digit:]]}" + if [ -d "/sys/block/sd${major}" ]; then + echo "WARNING bootdevice may be renamed. Try root=/dev/sd${suffix}" + fi + ;; + /dev/sd*) + suffix="${ROOT#/dev/sd}" + major="${suffix%[[:digit:]]}" + major="${major%[[:digit:]]}" + if [ -d "/sys/block/hd${major}" ]; then + echo "WARNING bootdevice may be renamed. Try root=/dev/hd${suffix}" + fi + ;; + esac echo "ALERT! ${ROOT} does not exist. Dropping to a shell!" echo " Check your root= boot argument (cat /proc/cmdline)" panic " Check for missing modules (cat /proc/modules), or device files (ls /dev)" -- cgit v1.2.3 From ea411290cf026aa07d8cf4c2a0f8154e0dbde977 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 20 Jun 2007 21:14:49 +0200 Subject: mkinitramfs: on wrong MODULES setting fallback to most this setting is known to be bootable, currently we would just create an unbootable initramfs. *bad* --- debian/changelog | 7 +++++-- mkinitramfs | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index d506d71..4993f97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,9 +8,12 @@ initramfs-tools (0.89) unstable; urgency=low Thanks "A. Costa" for the patch. * scripts/local: Try to warn for renamed root dev. (closes: #374611) - - -- maximilian attems Wed, 20 Jun 2007 20:56:14 +0200 + * minitramfs: Fall back to bootable default MODULES=most if unsupported + MODULES setting is passed. Thanks Henning Sprang + for report. (closes: #429144) + + -- maximilian attems Wed, 20 Jun 2007 21:06:43 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index a2e643c..d8a24fe 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -181,18 +181,27 @@ for x in "${CONFDIR}/modules" /usr/share/initramfs-tools/modules.d/*; do fi done -if [ "${MODULES}" = "dep" ]; then +# MODULES=most is default +case "${MODULES}" in +dep) dep_add_modules -fi - -if [ "${MODULES}" = "most" ]; then + ;; +most) auto_add_modules -fi - -if [ "${MODULES}" = "netboot" ]; then + ;; +netboot) auto_add_modules base auto_add_modules net -fi + ;; +list) + # nothing to add + ;; +*) + echo "mkinitramfs: Warning unsupported MODULES setting: ${MODULES}." + echo "mkinitramfs: Falling back to MODULES=most." + auto_add_modules + ;; +esac # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -- cgit v1.2.3 From 879602b218973fc7a5f92874bbaf41ea818fae31 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Jun 2007 11:51:08 +0200 Subject: mkinitramfs: add patch from joeyh fixing arm boot acked by aurel32: 11:07 maks: I ack the fact to always add libgcc to arm, init needs libgcc1 for _Unwind_* functions --- debian/changelog | 12 +++++++----- mkinitramfs | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4993f97..e1aa7c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,19 +1,21 @@ initramfs-tools (0.89) unstable; urgency=low + [ maximilian attems ] * initramfs.conf.5: Document ROOT hardcoding. - * scripts/local: Use simpler fstype invocation. - * initramfs-tools.8, initramfs.conf.5: Fix typos. (closes: #427837, #427838) Thanks "A. Costa" for the patch. - * scripts/local: Try to warn for renamed root dev. (closes: #374611) - * minitramfs: Fall back to bootable default MODULES=most if unsupported MODULES setting is passed. Thanks Henning Sprang for report. (closes: #429144) - -- maximilian attems Wed, 20 Jun 2007 21:06:43 +0200 + [ Joey Hess ] + * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load + it for the SJLJ exception handling on that architecture. (closes: #426395) + Thanks to Aurelien Jarno for ack and review. + + -- maximilian attems Thu, 21 Jun 2007 11:49:23 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/mkinitramfs b/mkinitramfs index d8a24fe..e1cf857 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -261,6 +261,11 @@ copy_exec /sbin/rmmod /sbin mkdir -p "${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" +fi + run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks -- cgit v1.2.3 From 728d6fc95b28254b982395e73153c5c422c81768 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Jun 2007 11:58:14 +0200 Subject: hook-functions: fix variable typo --- debian/changelog | 3 ++- hook-functions | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e1aa7c8..6a17083 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,13 +9,14 @@ initramfs-tools (0.89) unstable; urgency=low * minitramfs: Fall back to bootable default MODULES=most if unsupported MODULES setting is passed. Thanks Henning Sprang for report. (closes: #429144) + * hook-functions: Fix variable typo. Thanks Emanuele Rocca . [ Joey Hess ] * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load it for the SJLJ exception handling on that architecture. (closes: #426395) Thanks to Aurelien Jarno for ack and review. - -- maximilian attems Thu, 21 Jun 2007 11:49:23 +0200 + -- maximilian attems Thu, 21 Jun 2007 11:57:20 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 1b38931..a133a0b 100644 --- a/hook-functions +++ b/hook-functions @@ -41,7 +41,7 @@ add_modules_from_file() # Add dependent modules + eventual firmware manual_add_modules() { - local man_x firmwares firmware + local mam_x firmwares firmware for mam_x in $(modprobe --set-version="${version}" --ignore-install \ --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do -- cgit v1.2.3 From 5ac61dd320ed9616a7e986fa824f804dbbd626af Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jul 2007 00:34:42 +0200 Subject: revert vol_id usage for now, when more matured this can be easily rechanged. --- debian/changelog | 17 +++++++++++------ scripts/local | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a17083..3141edf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,11 @@ initramfs-tools (0.89) unstable; urgency=low + + Release "L'lecteur c'est notoire N'a pas tout' sa raison" + + [ Joey Hess ] + * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load + it for the SJLJ exception handling on that architecture. (closes: #426395) + Thanks to Aurelien Jarno for ack and review. [ maximilian attems ] * initramfs.conf.5: Document ROOT hardcoding. @@ -10,13 +17,11 @@ initramfs-tools (0.89) unstable; urgency=low MODULES setting is passed. Thanks Henning Sprang for report. (closes: #429144) * hook-functions: Fix variable typo. Thanks Emanuele Rocca . + * scripts/local: Revert change to use udev vol_id before fstype, + there are too many "wrongly" formated fs out there. fstype supports less, + but is more robust. - [ Joey Hess ] - * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load - it for the SJLJ exception handling on that architecture. (closes: #426395) - Thanks to Aurelien Jarno for ack and review. - - -- maximilian attems Thu, 21 Jun 2007 11:57:20 +0200 + -- maximilian attems Wed, 04 Jul 2007 00:28:34 +0200 initramfs-tools (0.88) unstable; urgency=low diff --git a/scripts/local b/scripts/local index 10e2f73..b06ca63 100644 --- a/scripts/local +++ b/scripts/local @@ -10,9 +10,9 @@ get_fstype () # vol_id has a more complete list of file systems if [ -x /lib/udev/vol_id ]; then - FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) - else eval $(fstype "${FS}" 2> /dev/null) + else + FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) fi RET=$? -- cgit v1.2.3 From 02b76d4d71a6e5c9cae1c0acaba281e3def583e0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jul 2007 00:49:14 +0200 Subject: hook-functions: fix Xen boot --- debian/changelog | 7 +++++++ hook-functions | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3141edf..bf883bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.90) UNRELEASED; urgency=low + + * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) + Thanks Marco Nenciarini for patch. + + -- maximilian attems Wed, 04 Jul 2007 00:45:20 +0200 + initramfs-tools (0.89) unstable; urgency=low Release "L'lecteur c'est notoire N'a pas tout' sa raison" diff --git a/hook-functions b/hook-functions index a133a0b..131f132 100644 --- a/hook-functions +++ b/hook-functions @@ -147,7 +147,7 @@ copy_exec() { # Try to use non-optimised libraries where possible. # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo "${x}" | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\).*/\(lib.*\)#/lib/\2#') if [ -e "${nonoptlib}" ]; then x="${nonoptlib}" -- cgit v1.2.3 From ee93d17783dc32d03faf99c29bdcd4fcc30abc43 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 4 Jul 2007 10:15:53 +0200 Subject: scripts/local: make sure that fstype is always invoked --- scripts/local | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/local b/scripts/local index b06ca63..55d4c46 100644 --- a/scripts/local +++ b/scripts/local @@ -8,10 +8,10 @@ get_fstype () local FS FSTYPE FSSIZE RET FS="${1}" - # vol_id has a more complete list of file systems - if [ -x /lib/udev/vol_id ]; then - eval $(fstype "${FS}" 2> /dev/null) - else + # vol_id has a more complete list of file systems, + # but fstype is more robust + eval $(fstype "${FS}" 2> /dev/null) + if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) fi RET=$? -- cgit v1.2.3 From b7ccd08326806dd1c46448610a77f6a2e015c5d4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 28 Jul 2007 18:10:25 +0200 Subject: copyright: old bzr tree gone kill dangling link. changes are imported into git. --- debian/copyright | 3 --- 1 file changed, 3 deletions(-) diff --git a/debian/copyright b/debian/copyright index 2b3581a..b473ab4 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,9 +3,6 @@ Thu, 27 Jan 2005 15:23:52 -0500. The current Debian maintainer is maximilian attems -The source code up to 0.31 can be found by using "bzr" at: -http://people.ubuntu.com/~jbailey/bzrtree/initramfs-tools - The current ubuntu release can be found at: http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ -- cgit v1.2.3 From bc7a264c033d8236a7e2672b0165493f59878b54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 28 Jul 2007 18:57:55 +0200 Subject: control: tighten dep on klibc-utils we need the etch version at least, so bump. --- debian/changelog | 6 ++++-- debian/control | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf883bc..d3b579d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,11 +3,13 @@ initramfs-tools (0.90) UNRELEASED; urgency=low * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini for patch. - -- maximilian attems Wed, 04 Jul 2007 00:45:20 +0200 + * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) + + -- maximilian attems Sat, 28 Jul 2007 18:56:36 +0200 initramfs-tools (0.89) unstable; urgency=low - Release "L'lecteur c'est notoire N'a pas tout' sa raison" + Release "L'\xE9lecteur c'est notoire N'a pas tout' sa raison" [ Joey Hess ] * mkinitramfs: Include libgcc_s.so.1 on arm since glibc always tries to load diff --git a/debian/control b/debian/control index da8730f..6a621e9 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.2 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-initramfs, cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.34-1), busybox (>= 1:1.01-3) | busybox-initramfs, cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 494e8cf2560b3d139273513899164219c7c2ae98 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 28 Jul 2007 19:06:11 +0200 Subject: hook-functions: Protect variables with local usage bonus minor coding style cleanup --- debian/changelog | 7 +++++-- hook-functions | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index d3b579d..c37028a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,14 @@ initramfs-tools (0.90) UNRELEASED; urgency=low + [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini for patch. - * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) - -- maximilian attems Sat, 28 Jul 2007 18:56:36 +0200 + [ David Härdeman ] + * hook-functions: Protect all variable with local, plus coding style fixes. + + -- maximilian attems Sat, 28 Jul 2007 19:03:35 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 131f132..b371cbb 100644 --- a/hook-functions +++ b/hook-functions @@ -169,20 +169,24 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { + local x_mod + if ! [ -d "${MODULESDIR}/${1}" ]; then return; fi - if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + if [ "${verbose}" = "y" ]; then echo "Copying module directory ${1}" fi for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do - manual_add_modules `basename ${x_mod} .ko` + manual_add_modules $(basename ${x_mod} .ko) done } # only copy relevant modules dep_add_modules() { + local x + # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" block=${root#/dev/} @@ -319,10 +323,12 @@ EOF # minimal supported kernel version check_minkver() { - curversion=${1} - initdir=${2} - if [ -z ${initdir} ]; then - DPKG_ARCH=`dpkg --print-installation-architecture` + local curversion initdir DPKG_ARCH minversion cm_x tmp + + curversion="${1}" + initdir="${2}" + if [ -z "${initdir}" ]; then + DPKG_ARCH=$(dpkg --print-installation-architecture) case ${DPKG_ARCH} in ia64|hppa) minversion="2.6.15" -- cgit v1.2.3 From e23c0a34f51d053357fd6c171cd8edfd38bc3df0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 7 Aug 2007 01:19:38 +0200 Subject: scripts/functions: Implement non-zero panic boot arg sleep the passed time and then call reboot. works as arg can only be numeric. --- debian/changelog | 3 ++- initramfs-tools.8 | 4 ++-- scripts/functions | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index c37028a..91f7ec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,11 +4,12 @@ initramfs-tools (0.90) UNRELEASED; urgency=low * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini for patch. * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) + * scripts/functions: Implement non-zero panic bootarg. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Sat, 28 Jul 2007 19:03:35 +0200 + -- maximilian attems Tue, 07 Aug 2007 01:18:25 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/initramfs-tools.8 b/initramfs-tools.8 index be4de54..3708575 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2007/04/09" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2007/07/07" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -96,7 +96,7 @@ Use blacklist=module1,module2,module3 bootparameter. .TP \fB \fI panic -sets an timeout on panic. Currently only zero value supported. +sets an timeout on panic. .TP \fB \fI debug diff --git a/scripts/functions b/scripts/functions index 0b8d1e8..e73874d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -62,6 +62,9 @@ panic() # Disallow console access if [ -n "${panic}" ] && [ "${panic}" = 0 ]; then reboot + elif [ -n "${panic}" ]; then + sleep ${panic} + reboot fi modprobe i8042 modprobe atkbd @@ -71,7 +74,7 @@ panic() maybe_break() { - if [ x$1 = x${break} ]; then + if [ -n "${break}" ]; then panic "Spawning shell within the initramfs" fi } -- cgit v1.2.3 From f917408f4bb541f44973be3f7ef4a48ba6528e9a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 7 Aug 2007 14:10:17 +0200 Subject: scripts/functions: style fix for maybe_break() recover func from previous bogus change.. --- debian/changelog | 5 +++-- scripts/functions | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 91f7ec9..60f216b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,12 +4,13 @@ initramfs-tools (0.90) UNRELEASED; urgency=low * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini for patch. * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) - * scripts/functions: Implement non-zero panic bootarg. + * scripts/functions: Implement non-zero panic bootarg. Style fix for + maybe_break(). [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Tue, 07 Aug 2007 01:18:25 +0200 + -- maximilian attems Tue, 07 Aug 2007 14:09:18 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index e73874d..2914aea 100644 --- a/scripts/functions +++ b/scripts/functions @@ -74,7 +74,7 @@ panic() maybe_break() { - if [ -n "${break}" ]; then + if [ "${break}" = "$1" ]; then panic "Spawning shell within the initramfs" fi } -- cgit v1.2.3 From ccb150b16473ce974a0fbbb236c0dd95a022ec43 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:02:16 +0200 Subject: hook-functions: fix dep_add_modules() for lvm, md and luks root a better shot and try for finding the underlying root devices in the case of MODULES=dep and /sys walk. dep_add_modules() should be splitted.. --- debian/changelog | 6 ++++-- hook-functions | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 60f216b..f0da4a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.90) UNRELEASED; urgency=low +initramfs-tools (0.90~beta1) UNRELEASED; urgency=low [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) @@ -6,11 +6,13 @@ initramfs-tools (0.90) UNRELEASED; urgency=low * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) * scripts/functions: Implement non-zero panic bootarg. Style fix for maybe_break(). + * hook-functions: dep_add_modules() fix for md, lv, luks root. + (closes: #426917, #429237, #426446) [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Tue, 07 Aug 2007 14:09:18 +0200 + -- maximilian attems Wed, 08 Aug 2007 00:50:22 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/hook-functions b/hook-functions index b371cbb..ef4a94e 100644 --- a/hook-functions +++ b/hook-functions @@ -185,16 +185,34 @@ copy_modules_dir() # only copy relevant modules dep_add_modules() { - local x + local root rootfs block minor device_path module x # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" - block=${root#/dev/} - block=${block%[0-9]*} + + # lvm luks root + if [ "${root#/dev/mapper/}" != "${root}" ]; then + minor=$((0x$(stat --format "%T" ${root}) % 256)) + block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) + if [ "${block#dm-}" != "${block}" ]; then + block=$(ls -1 /sys/block/${block}/slaves | head -n 1) + fi + block=${block%[0-9]*} + # md root + elif [ "${root#/dev/md}" != "${root}" ]; then + root=${root#/dev/} + block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ + /proc/mdstat) + # classical root device + else + block=${root#/dev/} + block=${block%[0-9]*} + fi # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "Error: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: Error use MODULES=most" exit 1 fi -- cgit v1.2.3 From 0b7e1a0bf6a45479301c5364c9888a4c6745227d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:19:23 +0200 Subject: debian/scripts: Add /etc/crypttab to reportbug script a big share of bugreports concern encrypted usage, that output is useful for /etc/fstab parsing. --- debian/changelog | 3 ++- debian/script | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f0da4a9..e54a808 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,11 +8,12 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low maybe_break(). * hook-functions: dep_add_modules() fix for md, lv, luks root. (closes: #426917, #429237, #426446) + * debian/scripts: Add /etc/crypttab to reportbug script. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 00:50:22 +0200 + -- maximilian attems Wed, 08 Aug 2007 01:17:29 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/debian/script b/debian/script index 5990db3..129513b 100755 --- a/debian/script +++ b/debian/script @@ -25,3 +25,9 @@ if [ -r /etc/initramfs-tools/initramfs.conf ]; then sed 's/#.*$//;/^[[:space:]]*$/d' /etc/initramfs-tools/initramfs.conf echo fi + +if [ -r /etc/crypttab ]; then + echo "-- /etc/crypttab" + cat /etc/crypttab + echo +fi -- cgit v1.2.3 From 665af22852513601ad93eb54d97542f7ab255a4c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:24:01 +0200 Subject: debian/script: add list of /sys/block on MODULES=dep a find might be a bit to verbose, so be happy for now with a q&d list. --- debian/changelog | 5 +++-- debian/script | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e54a808..87ffed4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,12 +8,13 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low maybe_break(). * hook-functions: dep_add_modules() fix for md, lv, luks root. (closes: #426917, #429237, #426446) - * debian/scripts: Add /etc/crypttab to reportbug script. + * debian/scripts: Add /etc/crypttab to reportbug script. Add /sys/block + list for MODULES=dep to reportbug script. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 01:17:29 +0200 + -- maximilian attems Wed, 08 Aug 2007 01:22:00 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/debian/script b/debian/script index 129513b..3aaacd0 100755 --- a/debian/script +++ b/debian/script @@ -31,3 +31,9 @@ if [ -r /etc/crypttab ]; then cat /etc/crypttab echo fi + +if [ grep -q "MODULES=dep" /etc/initramfs-tools/initramfs.conf ]; then + echo "-- /sys/block" + ls /sys/block + echo +fi -- cgit v1.2.3 From 89bff5c412013a982f8c06b70cd6a80df5e2846d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 01:31:17 +0200 Subject: hook-functions rephrase slightly the MODULES=dep error condition goal is to get the space down for lenny. --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index ef4a94e..0f66aa2 100644 --- a/hook-functions +++ b/hook-functions @@ -212,7 +212,8 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then echo "mkinitramfs: missing ${block} root ${root} /sys entry" - echo "mkinitramfs: Error use MODULES=most" + echo "mkinitramfs: workaround is MODULES=most" + echo "mkinitramfs: Error please report the bug" exit 1 fi -- cgit v1.2.3 From a951e89170510a6877aaa0fd281a30f08106008e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 19:04:49 +0200 Subject: scripts/funtions: run_scripts() on verbose mode add error messages * add the error messages * fix double call to set_initlist * skip empty dirs at start --- debian/changelog | 6 +++++- scripts/functions | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 87ffed4..05b837b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,11 +10,15 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low (closes: #426917, #429237, #426446) * debian/scripts: Add /etc/crypttab to reportbug script. Add /sys/block list for MODULES=dep to reportbug script. + * scripts/functions: Add error message on verbose mode about ignored files + in boot/hooks dir. Thanks Kornilios Kourtis + for the initial patch. Fixes a double set_initlist call too. Ignore empty + dirs earlier too. (closes: #433459) [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 01:22:00 +0200 + -- maximilian attems Wed, 08 Aug 2007 18:57:20 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/scripts/functions b/scripts/functions index 2914aea..81174bf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -88,20 +88,32 @@ set_initlist() { unset initlist for si_x in ${initdir}/*; do + # skip empty dirs without warning + [ "${si_x}" = "${initdir}/*" ] && return + # only allow variable name chars case ${si_x#${initdir}/} in *[![:alnum:]_]*) + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: not alphanumeric or '_' file" continue ;; esac + # skip non executable scripts if [ ! -x ${si_x} ]; then + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: not executable" continue fi + # skip directories if [ -d ${si_x} ]; then + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: a directory" continue fi + initlist="${initlist} ${si_x#${initdir}/}" done } @@ -171,7 +183,6 @@ pop_list_item() reduce_prereqs() { unset runlist - set_initlist set -- ${initlist} i=$# # Loop until there's no more in the queue to loop through -- cgit v1.2.3 From 788877833dc1e5201030927742f75b41bec324d7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 19:09:35 +0200 Subject: mkinitramfs.8: Document verbose mode. Strange forgot about the interface almost as not seen in manpage.. --- debian/changelog | 3 ++- mkinitramfs.8 | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 05b837b..4dfa781 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,11 +14,12 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low in boot/hooks dir. Thanks Kornilios Kourtis for the initial patch. Fixes a double set_initlist call too. Ignore empty dirs earlier too. (closes: #433459) + * mkinitramfs.8: Document verbose mode. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 18:57:20 +0200 + -- maximilian attems Wed, 08 Aug 2007 19:08:15 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 64fcc8d..a40de53 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2007/05/01 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2007/08/08 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image @@ -12,6 +12,7 @@ mkinitramfs \- low-level tool for generating an initramfs image .IR outfile ] .RB [ \-r .IR root ] +.RB [ \-v ] .RI [ version ] .B mkinitramfs @@ -63,6 +64,10 @@ Override the setting in .IR initramfs.conf . +.TP +\fB \-v +Set the verbose mode output. + .TP \fI version Set the kernel version of the initramfs image -- cgit v1.2.3 From 9102a2d94ffd7b74ba8afc678836480f018b0d42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 8 Aug 2007 19:32:33 +0200 Subject: initramfs-tools.preinst: Inhibit resume var creation. don't create /etc/initramfs-tools/conf.d/resume in chroot for debian-live and other custom debian distributions which build their systems in a chroot. --- debian/changelog | 7 +++++-- debian/initramfs-tools.preinst | 14 +++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4dfa781..70685fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,13 +13,16 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low * scripts/functions: Add error message on verbose mode about ignored files in boot/hooks dir. Thanks Kornilios Kourtis for the initial patch. Fixes a double set_initlist call too. Ignore empty - dirs earlier too. (closes: #433459) + dirs earlier too. (closes: #428729, #433459) * mkinitramfs.8: Document verbose mode. + * debian/initramfs-tools.preinst: Inhibit /etc/initramfs-tools/conf.d/resume + creation in chroot for debian-live and other. (closes: #433190) + Thanks Kel Modderman for the patch. [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 19:08:15 +0200 + -- maximilian attems Wed, 08 Aug 2007 19:29:23 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 1379766..6a8b88f 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -2,6 +2,17 @@ set -e +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 +} + case "$1" in install) mkdir -p /etc/initramfs-tools/conf.d @@ -15,7 +26,8 @@ case "$1" in if [ -e /etc/mkinitrd/mkinitrd.conf ]; then . /etc/mkinitrd/mkinitrd.conf fi - if [ -n "${RESUME}" ]; then + # write conf.d/resume if not in a chroot + if [ -n "${RESUME}" ] && ! chrooted; then echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume fi -- cgit v1.2.3 From b6c5123351ce61299532e10ab933d21704e8a30b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 9 Aug 2007 20:45:31 +0200 Subject: update-initramfs: enhance altered error message. --- debian/changelog | 3 ++- update-initramfs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 70685fd..1097e16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,11 +18,12 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low * debian/initramfs-tools.preinst: Inhibit /etc/initramfs-tools/conf.d/resume creation in chroot for debian-live and other. (closes: #433190) Thanks Kel Modderman for the patch. + * update-initramfs: Improve "altered" error message. (closes: #436752) [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Wed, 08 Aug 2007 19:29:23 +0200 + -- maximilian attems Thu, 09 Aug 2007 20:44:27 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/update-initramfs b/update-initramfs index 3c67f89..61f809e 100755 --- a/update-initramfs +++ b/update-initramfs @@ -410,7 +410,8 @@ altered_check() mild_panic "${initramfs} does not exist. Cannot update." fi if ! compare_sha1; then - mild_panic "${initramfs} has been altered. Cannot update." + echo "update-initramfs: ${initramfs} has been altered." >&2 + mild_panic "update-initramfs: Cannot update. Override with -t option." fi } -- cgit v1.2.3 From aad955549a7f103ff92520f37726344cc08797ec Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 9 Aug 2007 21:22:10 +0200 Subject: update_initramfs tristate variable "all" allow admin to set that an update-initramfs postinst call should update any known initramfs. --- conf/update-initramfs.conf | 3 ++- debian/changelog | 5 ++++- update-initramfs | 4 +++- update-initramfs.conf.5 | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 278c51c..c08c6ed 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -3,9 +3,10 @@ # # -# update_initramfs [ yes | no ] +# update_initramfs [ yes | all | no ] # # Default is yes +# If set to all update-initramfs will update all initramfs # If set to no disables any update to initramfs beside kernel upgrade update_initramfs=yes diff --git a/debian/changelog b/debian/changelog index 1097e16..97d9f26 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,11 +19,14 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low creation in chroot for debian-live and other. (closes: #433190) Thanks Kel Modderman for the patch. * update-initramfs: Improve "altered" error message. (closes: #436752) + * update-initramfs, update-initramfs.conf: update_initramfs config variable + is tristate. Set to 'all' to update any initramfs: $(update-initramfs -u). + Allows specific admin setting. (closes: #425050) [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Thu, 09 Aug 2007 20:44:27 +0200 + -- maximilian attems Thu, 09 Aug 2007 21:20:34 +0200 initramfs-tools (0.89) unstable; urgency=low diff --git a/update-initramfs b/update-initramfs index 61f809e..774da61 100755 --- a/update-initramfs +++ b/update-initramfs @@ -464,7 +464,8 @@ if [ -z "${mode}" ]; then usage "You must specify at least one of -c, -u, or -d." fi -if [ "${version}" = "all" ]; then +if [ "${version}" = "all" ] \ + || ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then : FIXME check for --yes, and if not ask are you sure get_sorted_versions if [ -z "${version_list}" ]; then @@ -492,6 +493,7 @@ if [ "${version}" = "all" ]; then exit 0 fi + case "${mode}" in c) create diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 302cffe..58e3cc4 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/12/22 $" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2007/08/09 $" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -12,6 +12,7 @@ The configuration file allows to disable the update action from \fB update_initramfs Default is \fIyes\fP for running the latest initramfs-tools hooks in the newest Linux image. +Setting it to \fIall\fP updates any known initramfs. 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. -- cgit v1.2.3 From 8b4b8b0ced679130f768cb10df8f78c1bb513281 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 9 Aug 2007 21:41:08 +0200 Subject: release 0.90 push out enough pending stuff. --- debian/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 97d9f26..32992b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,6 @@ -initramfs-tools (0.90~beta1) UNRELEASED; urgency=low +initramfs-tools (0.90) unstable; urgency=low + + Release "J'aim' pas le fataliste Je n'ai ni foi ni loi" [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) @@ -26,7 +28,7 @@ initramfs-tools (0.90~beta1) UNRELEASED; urgency=low [ David Härdeman ] * hook-functions: Protect all variable with local, plus coding style fixes. - -- maximilian attems Thu, 09 Aug 2007 21:20:34 +0200 + -- maximilian attems Thu, 09 Aug 2007 21:30:29 +0200 initramfs-tools (0.89) unstable; urgency=low -- cgit v1.2.3 From 7b0e6ab2ff392502d195de90536395189dc93856 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 15 Aug 2007 23:25:28 +0200 Subject: scripts/functions: simplify panic() sleep can take arg 0 --- scripts/functions | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index 81174bf..db223cd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -60,9 +60,7 @@ panic() /sbin/usplash_write "QUIT" fi # Disallow console access - if [ -n "${panic}" ] && [ "${panic}" = 0 ]; then - reboot - elif [ -n "${panic}" ]; then + if [ -n "${panic}" ]; then sleep ${panic} reboot fi -- cgit v1.2.3 From 45e9e24621bb7833ef20cc4c0a8ee1c4f2c8eefa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 16 Aug 2007 00:26:25 +0200 Subject: mkinitramfs: kick empty modules dir assume a s/ /\// was meant ;) --- debian/changelog | 7 +++++++ mkinitramfs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 32992b8..34f7103 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.91) unstable; urgency=low + + * scripts/functions: simplify panic() + * mkinitramfs: Kick empty dir modules. + + -- maximilian attems Thu, 16 Aug 2007 00:25:22 +0200 + initramfs-tools (0.90) unstable; urgency=low Release "J'aim' pas le fataliste Je n'ai ni foi ni loi" diff --git a/mkinitramfs b/mkinitramfs index e1cf857..c7a4598 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -170,7 +170,7 @@ export KEYMAP # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf/conf.d etc lib modules sbin scripts ${MODULESDIR}; do +for d in bin conf/conf.d etc lib/modules sbin scripts ${MODULESDIR}; do mkdir -p "${DESTDIR}/${d}" done -- cgit v1.2.3 From 286148ccc99630bb60168e27b6aba1b14c1f737f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 16 Aug 2007 10:07:42 +0200 Subject: hook-functions factor out sys_walk_mod_add() add it as a function of it's own --- debian/changelog | 3 ++- hook-functions | 36 ++++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 34f7103..da0b63e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ initramfs-tools (0.91) unstable; urgency=low * scripts/functions: simplify panic() * mkinitramfs: Kick empty dir modules. + * hook-functions: Factor sys_walk_mod_add() out of dep_add_modules(). - -- maximilian attems Thu, 16 Aug 2007 00:25:22 +0200 + -- maximilian attems Thu, 16 Aug 2007 10:06:09 +0200 initramfs-tools (0.90) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 0f66aa2..0a50051 100644 --- a/hook-functions +++ b/hook-functions @@ -182,10 +182,28 @@ copy_modules_dir() done } -# only copy relevant modules +# walk /sys for relevant modules +sys_walk_mod_add() +{ + local driver_path module + device_path="$1" + + while [ "${device_path}" != "/sys" ]; do + driver_path="$(readlink -f ${device_path}/driver)" + if [ -e "$driver_path" ]; then + module="$(basename $(readlink -f $driver_path))" + if [ -n "${module}" ]; then + force_load "${module}" + fi + fi + device_path="$(dirname ${device_path})" + done +} + +# find and only copy root relevant modules dep_add_modules() { - local root rootfs block minor device_path module x + local block minor root rootfs root_dev_path x # findout root block device + fstype eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" @@ -220,18 +238,8 @@ dep_add_modules() # Add rootfs force_load "${rootfs}" - # walk /sys for relevant modules - device_path=$(readlink -f /sys/block/${block}/device) - while [ "${device_path}" != "/sys" ]; do - driver_path="$(readlink -f ${device_path}/driver)" - if [ -e "$driver_path" ]; then - module="$(basename $(readlink -f $driver_path))" - if [ -n "${module}" ]; then - force_load "${module}" - fi - fi - device_path="$(dirname ${device_path})" - done + root_dev_path=$(readlink -f /sys/block/${block}/device) + sys_walk_mod_add ${root_dev_path} if [ -e /proc/ide ]; then for x in ide-generic ide-disk ide-cd; do -- cgit v1.2.3 From 5489c2f911a1259e9ad7ccdb5b90af529f912ffa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Aug 2007 17:09:32 +0200 Subject: init: Fix mount options invocation for klibc mount. --- debian/changelog | 3 ++- init | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index da0b63e..5d42ec6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,9 @@ initramfs-tools (0.91) unstable; urgency=low * scripts/functions: simplify panic() * mkinitramfs: Kick empty dir modules. * hook-functions: Factor sys_walk_mod_add() out of dep_add_modules(). + * init: Fix mount options invocation for klibc mount. - -- maximilian attems Thu, 16 Aug 2007 10:06:09 +0200 + -- maximilian attems Tue, 21 Aug 2007 17:08:48 +0200 initramfs-tools (0.90) unstable; urgency=low diff --git a/init b/init index 0da01d4..3ea9ef4 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs none /sys -o nodev,noexec,nosuid -mount -t proc none /proc -o nodev,noexec,nosuid +mount -t sysfs -o nodev,noexec,nosuid none /sys +mount -t proc -o nodev,noexec,nosuid none /proc # Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out -- cgit v1.2.3 From b15ec51af8521331dc74814d3582fdbb492589d0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 23 Aug 2007 14:32:55 +0200 Subject: hook-functions: Add the new firewire modules. --- debian/changelog | 3 ++- hook-functions | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5d42ec6..a60168d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ initramfs-tools (0.91) unstable; urgency=low * mkinitramfs: Kick empty dir modules. * hook-functions: Factor sys_walk_mod_add() out of dep_add_modules(). * init: Fix mount options invocation for klibc mount. + * hook-functions: Add the new firewire modules. - -- maximilian attems Tue, 21 Aug 2007 17:08:48 +0200 + -- maximilian attems Thu, 23 Aug 2007 14:31:59 +0200 initramfs-tools (0.90) unstable; urgency=low diff --git a/hook-functions b/hook-functions index 0a50051..61af0a5 100644 --- a/hook-functions +++ b/hook-functions @@ -300,11 +300,17 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; + # FIXME: can be removed after Lenny release ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" done ;; + firewire) + for x in firewire-ohci firewire-sbp2; do + manual_add_modules "${x}" + done + ;; i2o) for x in i2o_block; do manual_add_modules "${x}" @@ -325,6 +331,7 @@ auto_add_modules() auto_add_modules i2o auto_add_modules dasd auto_add_modules ieee1394 + auto_add_modules firewire ;; esac } -- cgit v1.2.3 From 0c76f85851b7c15a24776c74813e29052357f15d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 23 Aug 2007 15:05:05 +0200 Subject: release 0.90a --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a60168d..ed6b6d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.91) unstable; urgency=low +initramfs-tools (0.90a) unstable; urgency=high * scripts/functions: simplify panic() * mkinitramfs: Kick empty dir modules. @@ -6,7 +6,7 @@ initramfs-tools (0.91) unstable; urgency=low * init: Fix mount options invocation for klibc mount. * hook-functions: Add the new firewire modules. - -- maximilian attems Thu, 23 Aug 2007 14:31:59 +0200 + -- maximilian attems Thu, 23 Aug 2007 14:37:51 +0200 initramfs-tools (0.90) unstable; urgency=low -- cgit v1.2.3 From 0d04c24d798c34d00faf812cc82b80df5e6360c6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 25 Aug 2007 13:38:54 +0200 Subject: initramfs-tools: axe udev_helper --- debian/changelog | 7 +++++++ scripts/local-top/udev_helper | 23 ----------------------- 2 files changed, 7 insertions(+), 23 deletions(-) delete mode 100755 scripts/local-top/udev_helper diff --git a/debian/changelog b/debian/changelog index ed6b6d3..dc62b5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.91) UNRELEASED; urgency=low + + * udev_helper: Axe the modprobe ide-generic should no longer be needed + for kernel since Etch. + + -- maximilian attems Sat, 25 Aug 2007 13:37:15 +0200 + initramfs-tools (0.90a) unstable; urgency=high * scripts/functions: simplify panic() diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper deleted file mode 100755 index c1694b7..0000000 --- a/scripts/local-top/udev_helper +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 ide-generic -fi -- cgit v1.2.3 From f0942dc8aceb12e2e802a80e81a62f596424c407 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 25 Aug 2007 14:21:26 +0200 Subject: debian/control: updates * add vcs fields * mv busybox from depends to recommneds, as should be found in all but unusual installations * tighten dep on latest klibc --- debian/changelog | 4 +++- debian/control | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc62b5a..1d1fc29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * udev_helper: Axe the modprobe ide-generic should no longer be needed for kernel since Etch. + * debian/control: Tighten dep on latest klibc for BUSYBOX=n usage. + Add XS-Vcs-* fields. Mv busybox from Depends to Recommends. - -- maximilian attems Sat, 25 Aug 2007 13:37:15 +0200 + -- maximilian attems Sat, 25 Aug 2007 14:04:17 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/debian/control b/debian/control index 6a621e9..4a3be89 100644 --- a/debian/control +++ b/debian/control @@ -5,10 +5,13 @@ Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.2.2 +XS-Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git +XS-Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.34-1), busybox (>= 1:1.01-3) | busybox-initramfs, cpio, module-init-tools, udev (>= 0.086-1) +Recommends: busybox (>= 1:1.01-3) | busybox-initramfs +Depends: klibc-utils (>= 1.5.6-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 packaged 2.6 -- cgit v1.2.3 From 45aa4bb4bf35e8577c5de25cf3bf9b80f72f9b8e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 25 Aug 2007 14:32:07 +0200 Subject: mkinitramfs: cope when no busybox is around only warn on cases where we know that busybox is needed. --- debian/changelog | 3 ++- mkinitramfs | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1d1fc29..bba283d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low for kernel since Etch. * debian/control: Tighten dep on latest klibc for BUSYBOX=n usage. Add XS-Vcs-* fields. Mv busybox from Depends to Recommends. + * mkinitramfs: Cope when no busybox is around warn on md/lvm root. - -- maximilian attems Sat, 25 Aug 2007 14:04:17 +0200 + -- maximilian attems Sat, 25 Aug 2007 14:29:42 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/mkinitramfs b/mkinitramfs index c7a4598..71c1332 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -244,9 +244,14 @@ if [ -n "${ROOT}" ]; then fi # Busybox -if [ "x${BUSYBOX}" = "xn" ]; then - ln -s ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh - echo "Warning: Busybox is required for successful boot!" +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}" ] \ + || [ "${r_dev#/dev/md}" != "${r_dev}" ]; then + echo "Warning: Busybox is required for successful boot!" + fi else rm -f ${DESTDIR}/bin/sh rm -f ${DESTDIR}/bin/busybox -- cgit v1.2.3 From 6119c2636fc78af4049a5facc584325521ca19f8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 25 Aug 2007 14:36:20 +0200 Subject: mkinitramfs: kill kinit.shared too --- debian/changelog | 3 ++- mkinitramfs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bba283d..26a76aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * debian/control: Tighten dep on latest klibc for BUSYBOX=n usage. Add XS-Vcs-* fields. Mv busybox from Depends to Recommends. * mkinitramfs: Cope when no busybox is around warn on md/lvm root. + * mkinitramfs: Kill kinit.shared too. - -- maximilian attems Sat, 25 Aug 2007 14:29:42 +0200 + -- maximilian attems Sat, 25 Aug 2007 14:35:38 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/mkinitramfs b/mkinitramfs index 71c1332..90a7702 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -209,7 +209,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 +rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip copy_exec /usr/share/initramfs-tools/init /init -- cgit v1.2.3 From cd3e97b5b87380e8d1700c6f86d907ad40a1179d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 25 Aug 2007 19:11:44 +0200 Subject: scripts/local: small CodingStyle quote readonly variable --- debian/changelog | 3 ++- scripts/local | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 26a76aa..1031a50 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Add XS-Vcs-* fields. Mv busybox from Depends to Recommends. * mkinitramfs: Cope when no busybox is around warn on md/lvm root. * mkinitramfs: Kill kinit.shared too. + * scripts/local: Quote readonly variable. (LP: #115807) - -- maximilian attems Sat, 25 Aug 2007 14:35:38 +0200 + -- maximilian attems Sat, 25 Aug 2007 19:10:20 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/scripts/local b/scripts/local index 55d4c46..b55212e 100644 --- a/scripts/local +++ b/scripts/local @@ -101,7 +101,7 @@ mountroot () run_scripts /scripts/local-premount [ "$quiet" != "y" ] && log_end_msg - if [ ${readonly} = y ]; then + if [ "${readonly}" = "y" ]; then roflag=-r else roflag=-w -- 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(-) 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 928ed0689705f52a757e23478783b4ade1423944 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Sep 2007 10:48:03 +0200 Subject: init: call panic if run-init fails --- debian/changelog | 3 ++- init | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 07bf916..36a3b81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * mkinitramfs: Kill kinit.shared too. * scripts/local: Quote readonly variable. (LP: #115807) * mkinitramfs, scripts/keymap: Add trailing slash on cp destination for dir. + * init: Call panic for debug sh if run-init fails. - -- maximilian attems Mon, 27 Aug 2007 10:09:25 +0200 + -- maximilian attems Sat, 01 Sep 2007 10:45:04 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/init b/init index 3ea9ef4..53c228a 100755 --- a/init +++ b/init @@ -186,3 +186,4 @@ fi # Chain to real filesystem maybe_break init exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console +panic "Could not execute run-init." -- cgit v1.2.3 From 971f6f778035b49afaea9be8408f90cccb6b548b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Sep 2007 10:56:59 +0200 Subject: init-top/framebuffer: Check that fb minor is below 32. you can only have up to 32 fb devices going from fb0 to fb31. --- debian/changelog | 3 ++- scripts/init-top/framebuffer | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 36a3b81..6a1d1f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * scripts/local: Quote readonly variable. (LP: #115807) * mkinitramfs, scripts/keymap: Add trailing slash on cp destination for dir. * init: Call panic for debug sh if run-init fails. + * init-top/framebuffer: Check that fb minor is below 32. - -- maximilian attems Sat, 01 Sep 2007 10:45:04 +0200 + -- maximilian attems Sat, 01 Sep 2007 10:55:33 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 08e36d2..9292024 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -88,7 +88,9 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb${fbno} c 29 ${fbno} + if [ $(($fbnum < 32)) ]; then + mknod /dev/fb${fbno} c 29 ${fbno} + fi done < /proc/fb else mknod /dev/fb0 c 29 0 -- cgit v1.2.3 From f2f808cfeaf4350f4f300c689eccea88a327793d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Sep 2007 13:42:16 +0200 Subject: init: export noresume fo uswsusp and kdump --- debian/changelog | 3 ++- init | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a1d1f3..66dceea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * mkinitramfs, scripts/keymap: Add trailing slash on cp destination for dir. * init: Call panic for debug sh if run-init fails. * init-top/framebuffer: Check that fb minor is below 32. + * init: Export noresume if set. uswsusp and kdump need it. - -- maximilian attems Sat, 01 Sep 2007 10:55:33 +0200 + -- maximilian attems Sat, 01 Sep 2007 13:40:24 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/init b/init index 53c228a..72b59f2 100755 --- a/init +++ b/init @@ -95,10 +95,10 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - RESUME="${x#resume=}" + resume="${x#resume=}" ;; noresume) - NORESUME=y + noresume=y ;; panic=*) panic="${x#panic=}" @@ -138,8 +138,10 @@ for x in $(cat /proc/cmdline); do esac done -if [ -z "${NORESUME}" ]; then - export resume=${RESUME} +if [ -z "${noresume}" ]; then + export resume=${resume} +else + export noresume fi depmod -a -- cgit v1.2.3 From a2086c2f2344f3db4fbcbfb707317655e173058a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 3 Sep 2007 11:41:55 +0200 Subject: init: s/i/conf/ i is a bad name for a conf, rename. --- init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init b/init index 72b59f2..6d06bc1 100755 --- a/init +++ b/init @@ -32,8 +32,8 @@ export ROOT= # Bring in the main config . /conf/initramfs.conf -for i in conf/conf.d/*; do - [ -f ${i} ] && . ${i} +for conf in conf/conf.d/*; do + [ -f ${conf} ] && . ${conf} done . /scripts/functions -- cgit v1.2.3 From 748cff514e9033e1a7984f26ece7ed25079e3535 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 3 Sep 2007 11:45:39 +0200 Subject: init: search for valid init Fixes bootfailure on bogus init bootarg too. Plus there may be a rootfs without init, but with sh. --- debian/changelog | 4 +++- init | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 66dceea..0bdb6b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * init: Call panic for debug sh if run-init fails. * init-top/framebuffer: Check that fb minor is below 32. * init: Export noresume if set. uswsusp and kdump need it. + * init: Try harder to find a valid init on rootmnt. Fixes bootfailure on + bogus init bootarg too. - -- maximilian attems Sat, 01 Sep 2007 13:40:24 +0200 + -- maximilian attems Mon, 03 Sep 2007 11:44:04 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/init b/init index 6d06bc1..e66cac2 100755 --- a/init +++ b/init @@ -176,9 +176,26 @@ run_scripts /scripts/init-bottom mount -n -o move /sys ${rootmnt}/sys mount -n -o move /proc ${rootmnt}/proc -while [ ! -x ${rootmnt}${init} ]; do - panic "Target filesystem doesn't have ${init}" -done +# Check init bootarg +if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then + init= + echo "Target filesystem doesn't have ${init}." +fi + +# Search for valid init +if [ -z "${init}" ] ; then + for init in /sbin/init /etc/init /bin/init /bin/sh; do + if [ ! -x "${rootmnt}${i}" ]; then + continue + fi + break + done +fi + +# No init on rootmount +if [ ! -x "${rootmnt}${init}" ]; then + panic "No init found. Try passing init= bootarg." +fi # Confuses /etc/init.d/rc if [ -n ${debug} ]; then -- cgit v1.2.3 From e2094587495879e34285018ff6f2b9f46c34ca45 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 3 Sep 2007 11:48:20 +0200 Subject: init: fix typo from initial implementation --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index e66cac2..df4e181 100755 --- a/init +++ b/init @@ -185,7 +185,7 @@ fi # Search for valid init if [ -z "${init}" ] ; then for init in /sbin/init /etc/init /bin/init /bin/sh; do - if [ ! -x "${rootmnt}${i}" ]; then + if [ ! -x "${rootmnt}${init}" ]; then continue fi break -- cgit v1.2.3 From 5ac8a35ffa7db1c1295f46c75e6b8cc7cd698546 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Tue, 4 Sep 2007 10:41:07 +0200 Subject: initramfs-tools: split networking code into separate function ltsp in ubuntu started using NBD+unionfs+squashfs instead of NFS, and debian-live uses has a network boot methods using cifs in addition to a different way of using NFS (i think it also uses unionfs and maybe squashfs, not just a plain NFS/cifs mount)... so splitting out the networking related code into a separate function would move towards not having forked code for all of these different network boot methods. at least, that's my hope. --- debian/changelog | 4 +++- scripts/functions | 35 +++++++++++++++++++++++++++++++++++ scripts/nfs | 33 ++------------------------------- 3 files changed, 40 insertions(+), 32 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0bdb6b9..f5ace4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * init: Export noresume if set. uswsusp and kdump need it. * init: Try harder to find a valid init on rootmnt. Fixes bootfailure on bogus init bootarg too. + * scripts/{functions,nfs}: Split networking code in separate function. + Thanks Vagrant Cascadian for the patch. - -- maximilian attems Mon, 03 Sep 2007 11:44:04 +0200 + -- maximilian attems Tue, 04 Sep 2007 10:39:07 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/scripts/functions b/scripts/functions index db223cd..fdd808f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -270,3 +270,38 @@ parse_numeric() { chmod 600 /dev/root ROOT=/dev/root } + +configure_networking() +{ + # support ip options see linux sources Documentation/nfsroot.txt + case ${IPOPTS} in + none|off) + # Do nothing + ;; + ""|on|any) + # Bring up device + ipconfig ${DEVICE} + ;; + dhcp|bootp|rarp|both) + ipconfig -c ${IPOPTS} -d ${DEVICE} + ;; + *) + ipconfig -d $IPOPTS + + # grab device entry from ip option + NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} + if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then + NEW_DEVICE=${NEW_DEVICE%:*} + else + # wrong parse, possibly only a partial string + NEW_DEVICE= + fi + if [ -n "${NEW_DEVICE}" ]; then + DEVICE="${NEW_DEVICE}" + fi + ;; + esac + + # source relevant ipconfig output + . /tmp/net-${DEVICE}.conf +} diff --git a/scripts/nfs b/scripts/nfs index 717dfe8..b9c2522 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -4,40 +4,11 @@ retry_nr=0 -# parse nfs bootargs + launch ipconfig and nfsmount +# parse nfs bootargs and mount nfs do_nfsmount() { - # support ip options see linux sources Documentation/nfsroot.txt - case ${IPOPTS} in - none|off) - # Do nothing - ;; - ""|on|any) - # Bring up device - ipconfig ${DEVICE} - ;; - dhcp|bootp|rarp|both) - ipconfig -c ${IPOPTS} -d ${DEVICE} - ;; - *) - ipconfig -d $IPOPTS - # grab device entry from ip option - NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} - if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then - NEW_DEVICE=${NEW_DEVICE%:*} - else - # wrong parse, possibly only a partial string - NEW_DEVICE= - fi - if [ -n "${NEW_DEVICE}" ]; then - DEVICE="${NEW_DEVICE}" - fi - ;; - esac - - # source relevant ipconfig output - . /tmp/net-${DEVICE}.conf + configure_networking # get nfs root from dhcp if [ "x${NFSROOT}" = "xauto" ]; then -- cgit v1.2.3 From 803cf67dabfe32516f2ed08ba76dc9de7f9311cb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 4 Sep 2007 11:35:32 +0200 Subject: update-initramfs: Don't check for ro /boot inside of a chroot. debian-live may as well be build on a host with ro /boot --- debian/changelog | 3 ++- update-initramfs | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index f5ace4e..f479eb9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low bogus init bootarg too. * scripts/{functions,nfs}: Split networking code in separate function. Thanks Vagrant Cascadian for the patch. + * update-initramfs: Don't check for ro /boot inside of a chroot. - -- maximilian attems Tue, 04 Sep 2007 10:39:07 +0200 + -- maximilian attems Tue, 04 Sep 2007 11:34:15 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/update-initramfs b/update-initramfs index 774da61..a257f1c 100755 --- a/update-initramfs +++ b/update-initramfs @@ -33,6 +33,19 @@ EOF exit 1 } +# 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 +} + mild_panic() { if [ -n "${1}" ]; then @@ -86,7 +99,7 @@ backup_booted_initramfs() # first time run thus no backup [ ! -r "${initramfs_bak}" ] && return 0 - # chroot + # chroot with no /proc [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 # no kept backup wanted @@ -248,7 +261,11 @@ delete_sha1() # ro /boot is not modified ro_boot_check() { - [ -r /proc/mounts ] || return 0 + # check irrelevant inside of a chroot + if [ ! -r /proc/mounts ] || chrooted; then + return 0 + fi + boot_opts=$(awk '/boot/{if (match($4, /ro/) && $2 == "/boot") print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then -- cgit v1.2.3 From fd0b67f392bc351dacf6b29532fc478d1ff9f118 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 5 Sep 2007 22:22:20 +0200 Subject: scripts/init-top/framebuffer: fix variable name s/fbnum/fbno/ --- scripts/init-top/framebuffer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 9292024..2427b47 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -88,7 +88,7 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - if [ $(($fbnum < 32)) ]; then + if [ $(($fbno < 32)) ]; then mknod /dev/fb${fbno} c 29 ${fbno} fi done < /proc/fb -- cgit v1.2.3 From c559ab5d603454e9d3281e4e399bf5cc9f0f1ce3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 7 Sep 2007 15:11:13 +0200 Subject: debian/script: Fix syntax of MODULES=dep block. thanks madduck for reporting the error: [: 39: -q: unexpected operator --- debian/changelog | 3 ++- debian/script | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f479eb9..78a6922 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * scripts/{functions,nfs}: Split networking code in separate function. Thanks Vagrant Cascadian for the patch. * update-initramfs: Don't check for ro /boot inside of a chroot. + * debian/script: Fix syntax of MODULES=dep block. - -- maximilian attems Tue, 04 Sep 2007 11:34:15 +0200 + -- maximilian attems Fri, 07 Sep 2007 15:10:11 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/debian/script b/debian/script index 3aaacd0..706a84d 100755 --- a/debian/script +++ b/debian/script @@ -32,7 +32,7 @@ if [ -r /etc/crypttab ]; then echo fi -if [ grep -q "MODULES=dep" /etc/initramfs-tools/initramfs.conf ]; then +if grep -q "MODULES=dep" /etc/initramfs-tools/initramfs.conf ; then echo "-- /sys/block" ls /sys/block echo -- cgit v1.2.3 From 41f9c1621e502a4af2f00f063d42e0f4ac53d6c2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 7 Sep 2007 18:29:36 +0200 Subject: hook-functions: probe rootfs on auto type fix dep_add_modules(), as bonus check rootfs output so that eventual unkown rootfs get reported. --- debian/changelog | 4 +++- hook-functions | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 78a6922..6d8b335 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks Vagrant Cascadian for the patch. * update-initramfs: Don't check for ro /boot inside of a chroot. * debian/script: Fix syntax of MODULES=dep block. + * hook-functions: Add rootfs detection for the "auto" mount output. + Thanks martin f krafft for report. (closes: #441211) - -- maximilian attems Fri, 07 Sep 2007 15:10:11 +0200 + -- maximilian attems Fri, 07 Sep 2007 18:24:40 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 61af0a5..cb2c75d 100644 --- a/hook-functions +++ b/hook-functions @@ -203,10 +203,23 @@ sys_walk_mod_add() # find and only copy root relevant modules dep_add_modules() { - local block minor root rootfs root_dev_path x + local block minor root FSTYPE root_dev_path x # findout root block device + fstype - eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" + eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')" + + # find out real rootfs on auto type + if [ "${FSTYPE}" = "auto" ]; then + eval "$(/usr/lib/klibc/bin/fstype ${root})" + fi + + # check that fstype rootfs recognition + if [ "${FSTYPE}" = "unknown" ]; then + echo "mkinitramfs: unkown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "mkinitramfs: Error please report bug against klibc" + exit 1 + fi # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then @@ -236,7 +249,7 @@ dep_add_modules() fi # Add rootfs - force_load "${rootfs}" + force_load "${FSTYPE}" root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} -- cgit v1.2.3 From 6303982cbb523988b95fd79a10534ba7de81e703 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 8 Sep 2007 19:53:01 +0200 Subject: fix init error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You’ll notice a strange error message due to an empty $init if the rootfs can’t be found. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index df4e181..845bac1 100755 --- a/init +++ b/init @@ -178,8 +178,8 @@ mount -n -o move /proc ${rootmnt}/proc # Check init bootarg if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then - init= echo "Target filesystem doesn't have ${init}." + init= fi # Search for valid init -- cgit v1.2.3 From d85d8755ce0d8a84524a64cf32887fd9bd21e65f Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 8 Sep 2007 19:53:01 +0200 Subject: disable quiet on debug bootarg If you have quiet in your /proc/cmdline you can never reach any debug bootoption anymore. --- init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init b/init index 845bac1..9afc87a 100755 --- a/init +++ b/init @@ -119,11 +119,13 @@ for x in $(cat /proc/cmdline); do ;; debug) debug=y + quiet=n exec >/tmp/initramfs.debug 2>&1 set -x ;; debug=*) debug=y + quiet=n set -x ;; break=*) -- cgit v1.2.3 From 156f5a6ee96ee8f507523c2b75604c4ed124e138 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 19:58:51 +0200 Subject: changelog: add entry for mika's patches almost ready for release, just missing the hook-conf only dir. --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6d8b335..3002e75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,8 +19,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * debian/script: Fix syntax of MODULES=dep block. * hook-functions: Add rootfs detection for the "auto" mount output. Thanks martin f krafft for report. (closes: #441211) + * init: Disable quiet on debug bootarg. Fix new init error message. + Thanks Michael Prokop for the patches. - -- maximilian attems Fri, 07 Sep 2007 18:24:40 +0200 + -- maximilian attems Sat, 08 Sep 2007 19:56:22 +0200 initramfs-tools (0.90a) unstable; urgency=high -- cgit v1.2.3 From 4b1ed160ed49e8ba7959a4e699fdb16dcb0accc0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 21:49:42 +0200 Subject: hook-functions: reorder dep_add_modules() do fstype stuff on top. --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index cb2c75d..07e5cda 100644 --- a/hook-functions +++ b/hook-functions @@ -221,6 +221,9 @@ dep_add_modules() exit 1 fi + # Add rootfs + force_load "${FSTYPE}" + # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) @@ -248,9 +251,6 @@ dep_add_modules() exit 1 fi - # Add rootfs - force_load "${FSTYPE}" - root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} -- cgit v1.2.3 From 742bdfa1407b2b030720934ab877b84e15dbb368 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 21:56:44 +0200 Subject: hook-functions: don't force load rootfs fstype just detects fine the fs, even when running without udev. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 07e5cda..0c27755 100644 --- a/hook-functions +++ b/hook-functions @@ -222,7 +222,7 @@ dep_add_modules() fi # Add rootfs - force_load "${FSTYPE}" + manual_add_modules "${FSTYPE}" # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then -- cgit v1.2.3 From 937188e01273de536b02f7fa782a8bb4045a009c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 22:03:16 +0200 Subject: hook-functions: MODULES=dep fix I2O detection. * missing i2o_block * force_load when !udev --- debian/changelog | 3 ++- hook-functions | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3002e75..c7f7ea1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,8 +21,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks martin f krafft for report. (closes: #441211) * init: Disable quiet on debug bootarg. Fix new init error message. Thanks Michael Prokop for the patches. + * hook-functions: MODULES=dep fix I2O detection. - -- maximilian attems Sat, 08 Sep 2007 19:56:22 +0200 + -- maximilian attems Sat, 08 Sep 2007 22:01:15 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 0c27755..628811b 100644 --- a/hook-functions +++ b/hook-functions @@ -265,7 +265,8 @@ dep_add_modules() fi if [ -e /sys/bus/i2o/devices/ ]; then - manual_add_modules i2o_block + force_load i2o_block + force_load i2o_config fi if [ -e /sys/bus/ps3_system_bus/ ]; then -- cgit v1.2.3 From c371cfa72e473518a9ff0540b0b1d2eae83dd7aa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 22:33:12 +0200 Subject: hook-functions: Add sys_walk_modalias() for IDE instead of searching non matching sysfs modules strings PIIX_IDE != piix, just look up the modalias. modprobe likes it too ;) --- debian/changelog | 5 +++-- hook-functions | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c7f7ea1..431cf50 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,9 +21,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks martin f krafft for report. (closes: #441211) * init: Disable quiet on debug bootarg. Fix new init error message. Thanks Michael Prokop for the patches. - * hook-functions: MODULES=dep fix I2O detection. + * hook-functions: MODULES=dep fix I2O detection. Add sys_walk_modalias() + to catch old style IDE. - -- maximilian attems Sat, 08 Sep 2007 22:01:15 +0200 + -- maximilian attems Sat, 08 Sep 2007 22:29:42 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 628811b..9becfe2 100644 --- a/hook-functions +++ b/hook-functions @@ -200,6 +200,20 @@ sys_walk_mod_add() done } +# walk /sys for relevant modalias +sys_walk_modalias() +{ + local device_path modalias + + device_path="$(dirname "${1}")" + device_path="$(dirname "${device_path}")" + modalias=$(cat "${device_path}/modalias") + + if [ -n "${modalias}" ]; then + force_load "${modalias}" + fi +} + # find and only copy root relevant modules dep_add_modules() { @@ -251,13 +265,15 @@ dep_add_modules() exit 1 fi + # sys walk ATA root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} - if [ -e /proc/ide ]; then - for x in ide-generic ide-disk ide-cd; do - manual_add_modules "${x}" - done + # catch old-style IDE + if [ -e /sys/bus/ide/devices/ ]; then + sys_walk_modalias ${root_dev_path} + manual_add_modules ide-disk + manual_add_modules ide-cd fi if [ -e /sys/bus/scsi/devices/ ]; then -- cgit v1.2.3 From c09f8e45cb6740561f1a4f657acc591fa7ceb16e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Sep 2007 23:29:59 +0200 Subject: mkinitramfs: Export MODULES, allows hook script to act accordingly. this is better then passing some strange prereqs param, as the prereqs is intermixed with boot/hook scripts. --- debian/changelog | 5 ++++- mkinitramfs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 431cf50..cb49ebf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ initramfs-tools (0.91) UNRELEASED; urgency=low bogus init bootarg too. * scripts/{functions,nfs}: Split networking code in separate function. Thanks Vagrant Cascadian for the patch. + (closes: #439397) * update-initramfs: Don't check for ro /boot inside of a chroot. * debian/script: Fix syntax of MODULES=dep block. * hook-functions: Add rootfs detection for the "auto" mount output. @@ -23,8 +24,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks Michael Prokop for the patches. * hook-functions: MODULES=dep fix I2O detection. Add sys_walk_modalias() to catch old style IDE. + * mkinitramfs: Export MODULES, allows hook script to act accordingly. + (closes: #421658) - -- maximilian attems Sat, 08 Sep 2007 22:29:42 +0200 + -- maximilian attems Sat, 08 Sep 2007 23:28:37 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/mkinitramfs b/mkinitramfs index 4ba9cd4..0064963 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -166,6 +166,7 @@ export DESTDIR export DPKG_ARCH export verbose export KEYMAP +export MODULES # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -- cgit v1.2.3 From 475b09a738d329624e34e5f82e01ebaf3c16a708 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 9 Sep 2007 12:34:44 +0200 Subject: mkinitramfs: Add /usr/share/initramfs-tools/conf-hooks.d this allows to seperate conf files which needs to land on initramfs and those that should only be run on mkinitramfs. --- debian/changelog | 9 +++++---- debian/initramfs-tools.dirs | 1 + mkinitramfs | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index cb49ebf..499d316 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.91) UNRELEASED; urgency=low +initramfs-tools (0.91) unstable; urgency=low * udev_helper: Axe the modprobe ide-generic should no longer be needed for kernel since Etch. @@ -24,10 +24,11 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks Michael Prokop for the patches. * hook-functions: MODULES=dep fix I2O detection. Add sys_walk_modalias() to catch old style IDE. - * mkinitramfs: Export MODULES, allows hook script to act accordingly. - (closes: #421658) + * mkinitramfs: Export MODULES, allows hook scripts to act accordingly. + (closes: #421658) Add /usr/share/initramfs-tools/conf-hooks.d for hooks + options on mkinitramfs run. Do not land in initramfs. - -- maximilian attems Sat, 08 Sep 2007 23:28:37 +0200 + -- maximilian attems Sun, 09 Sep 2007 12:26:16 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index 2c6a83a..a11bf32 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -10,5 +10,6 @@ etc/initramfs-tools/scripts/nfs-top etc/initramfs-tools/hooks etc/initramfs-tools/conf.d usr/share/initramfs-tools/conf.d +usr/share/initramfs-tools/hooksconf.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/mkinitramfs b/mkinitramfs index 0064963..06d2149 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -88,6 +88,8 @@ for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/conf.d/*; do EXTRA_CONF="${EXTRA_CONF} $(basename $i \ | 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 for i in ${EXTRA_CONF}; do if [ -e ${CONFDIR}/conf.d/${i} ]; then . ${CONFDIR}/conf.d/${i} @@ -96,6 +98,13 @@ for i in ${EXTRA_CONF}; do fi done +# source package confs +for i in /usr/share/initramfs-tools/conf-hooks.d/*; do + if [ -e "${i}" ]; then + . "${i}" + fi +done + if [ -n "${UMASK}" ]; then umask "${UMASK}" fi -- cgit v1.2.3 From adeba36e5baeefa704eaa18fa6a1edb2acfc1783 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 9 Sep 2007 12:36:49 +0200 Subject: hook-functions: protect sys_walk_modalias() check that the modalias really exists, otherwise no need to add anything. --- hook-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 9becfe2..55fb342 100644 --- a/hook-functions +++ b/hook-functions @@ -207,7 +207,9 @@ sys_walk_modalias() device_path="$(dirname "${1}")" device_path="$(dirname "${device_path}")" - modalias=$(cat "${device_path}/modalias") + if [ -e "${device_path}/modalias" ]; then + modalias=$(cat "${device_path}/modalias") + fi if [ -n "${modalias}" ]; then force_load "${modalias}" -- cgit v1.2.3 From 1c2d02dc513346876464434ae422d499642e6a16 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 12 Sep 2007 19:07:36 +0200 Subject: init: fix RESUME hardcoding --- debian/changelog | 7 +++++++ init | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 499d316..bf48bff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.91a) unstable; urgency=low + + * init: Fix resuming with hardcoded uppercase RESUME variable. + Thanks Raphael Hertzog for the report. + + -- maximilian attems Wed, 12 Sep 2007 19:06:19 +0200 + initramfs-tools (0.91) unstable; urgency=low * udev_helper: Axe the modprobe ide-generic should no longer be needed diff --git a/init b/init index 9afc87a..52e3f45 100755 --- a/init +++ b/init @@ -95,7 +95,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - resume="${x#resume=}" + RESUME="${x#resume=}" ;; noresume) noresume=y @@ -141,7 +141,7 @@ for x in $(cat /proc/cmdline); do done if [ -z "${noresume}" ]; then - export resume=${resume} + export resume=${RESUME} else export noresume fi -- 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 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 3e65988cf97c7d9a07970dd87595d315ee47df7f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Nov 2007 19:43:15 +0100 Subject: update-initramfs: Fix ro /boot partition check (closes: #451151) Newer kernel in the effort of killing /etc/mtab show mount options, like errors=remount-ro, that is matched for read only. Thanks Jan Niehusmann for report. --- update-initramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index a257f1c..eb1db44 100755 --- a/update-initramfs +++ b/update-initramfs @@ -266,8 +266,8 @@ ro_boot_check() return 0 fi - boot_opts=$(awk '/boot/{if (match($4, /ro/) && $2 == "/boot") - print "ro"}' /proc/mounts) + boot_opts=$(awk '/boot/{if (match($4, /^ro/) || match($4, /,ro/) \ + && $2 == "/boot") print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." echo "update-initramfs: Not updating ${initramfs}" -- cgit v1.2.3 From bcb1a3ef0c165bb80838415ea484babe10081dc1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Nov 2007 19:45:02 +0100 Subject: init: Don't overwrite boot cmdline arg (closes: #453294) root nfs needs to check that the boot is not set before setting it. Thanks Thomas Lange for report! --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index 52e3f45..607d2c7 100755 --- a/init +++ b/init @@ -67,7 +67,7 @@ for x in $(cat /proc/cmdline); do ROOT="/dev/disk/by-uuid/${ROOT#UUID=}" ;; /dev/nfs) - BOOT=nfs + [ -z "${BOOT}" ] && BOOT=nfs ;; esac ;; -- cgit v1.2.3 From ed852bbb20fac3b38e86eecd4e078151f4ea4809 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Nov 2007 19:51:20 +0100 Subject: release 0.91c --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2916413..c581efb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.91c) unstable; urgency=low + + * update-initramfs: Fix ro /boot partition check (closes: #451151) + * init: Don't overwrite boot cmdline arg (closes: #453294) + + -- maximilian attems Wed, 28 Nov 2007 19:49:41 +0100 + initramfs-tools (0.91b) unstable; urgency=low * hooks/udevhelper: Adding all /lib/udev on initramfs if missing. Due to -- cgit v1.2.3 From 1b59ebff6e7ea5e7ff58129362e127cf2fb81c6f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:40:50 +0100 Subject: MODULES=dep fix for new /dev/md/X naming scheme (closes: #440694). Using mkinitramfs-kpkg to build the ramdisk. awk: /^md/0/{print substr($5, 1, 3); exit} awk: ^ syntax error mkinitramfs-kpkg failed to create initrd image. Failed to create initrd image. /proc/mdstat naming unchanged, thuse use same awk parsing. --- hook-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 55fb342..f39e7e4 100644 --- a/hook-functions +++ b/hook-functions @@ -248,7 +248,12 @@ dep_add_modules() block=$(ls -1 /sys/block/${block}/slaves | head -n 1) fi block=${block%[0-9]*} - # md root + # md root new naming scheme /dev/md/X + elif [ "${root#/dev/md/}" != "${root}" ]; then + root=${root#/dev/md/} + block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \ + /proc/mdstat) + # md root /dev/mdX elif [ "${root#/dev/md}" != "${root}" ]; then root=${root#/dev/} block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ -- cgit v1.2.3 From 7f89641f3d32dbad8b2367cad26b4d2b9f249e15 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:44:13 +0100 Subject: debian/control: Add versioned depends on findutils. (closes: #450888) it seems backport of current iniramfs-toosl together with linux-images is more frequent then expected. thus just declare that you need newer findutils then sarge available. this can be kicked after lenny release. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4a3be89..d27fe03 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ XS-Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs -Depends: klibc-utils (>= 1.5.6-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.5.6-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 5d264012d5a8de41124ca81eaef1b95a932eda6c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:44:40 +0100 Subject: Update to newer standards version without changes. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index d27fe03..a5f1248 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs -Standards-Version: 3.7.2.2 +Standards-Version: 3.7.3 XS-Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git XS-Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git -- cgit v1.2.3 From e9434de886aa77f0d8019c9e8bddc8b7883c9b4a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:46:36 +0100 Subject: local-premount/resume: coding style fixes. --- scripts/local-premount/resume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 881af90..d997f81 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -15,8 +15,8 @@ prereqs) ;; esac -if [ "x${resume}" = "x" ]; then - exit +if [ -z "${resume}" ]; then + exit 0 fi case $resume in @@ -29,7 +29,7 @@ case $resume in esac if [ ! -e "${resume}" ]; then - exit + exit 0 fi if [ -e /sys/power/resume ]; then -- cgit v1.2.3 From 7e40a0b28df5f0aef150b9b7244cba35857b2b99 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 26 Dec 2007 00:55:41 +0100 Subject: release 0.91d --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index c581efb..92fff4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +initramfs-tools (0.91d) unstable; urgency=low + + * MODULES=dep fix for new /dev/md/X naming scheme (closes: #440694). + * debian/control: Add versioned depends on findutils (closes: #450888). + * Update to newer standards version without changes. + * local-premount/resume: coding style fixes. + + -- maximilian attems Wed, 26 Dec 2007 00:53:48 +0100 + initramfs-tools (0.91c) unstable; urgency=low * update-initramfs: Fix ro /boot partition check (closes: #451151) -- cgit v1.2.3 From 894c4c19e05a12b783345700dedf68184930747d Mon Sep 17 00:00:00 2001 From: Daniel Reichelt Date: Wed, 2 Jan 2008 19:57:32 +0100 Subject: update-initramfs: fix ro-mounted /boot check (closes: #458772) Hi Kernel-Team, i stumbled over this bug when I wanted to update my initrd while I had some isos loop-mounted like this: $ cat /proc/mounts |grep boot /dev/hda1 /boot ext2 rw 0 0 /dev/loop57 /srv/pub/iso_loop/sys/bootrescue-cd-20071129-59 iso9660 ro 0 0 /dev/loop58 /srv/pub/iso_loop/sys/bootrescue-cd-dev iso9660 ro 0 0 /dev/loop59 /srv/pub/iso_loop/sys/bootrescue-dvd-20071129-59 iso9660 ro 0 0 /dev/loop60 /srv/pub/iso_loop/sys/bootrescue-dvd-dev iso9660 ro 0 0 The check for a ro-mounted /boot partition was falsly triggered by the mount targets of the iso-images. As you can see in the patch attached, for the conditional awk output to work as desired, another pair of hyphen enclosing the awk match calls is required. HTH, Daniel Reichelt --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index eb1db44..42f2831 100755 --- a/update-initramfs +++ b/update-initramfs @@ -266,7 +266,7 @@ ro_boot_check() return 0 fi - boot_opts=$(awk '/boot/{if (match($4, /^ro/) || match($4, /,ro/) \ + boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \ && $2 == "/boot") print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." -- cgit v1.2.3 From caa6893258b4262c898807227a7d2a03b9ba6f4a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Feb 2008 18:34:33 +0100 Subject: release 0.91e --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 92fff4d..dd24385 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.91e) unstable; urgency=medium + + [ Daniel Reichelt ] + * update-initramfs: fix ro-mounted /boot check (closes: #458772) + + -- maximilian attems Tue, 12 Feb 2008 18:23:34 +0100 + initramfs-tools (0.91d) unstable; urgency=low * MODULES=dep fix for new /dev/md/X naming scheme (closes: #440694). -- cgit v1.2.3 From 4ad8c497de815693d06e94c77e1abd5fe5b6a2cb Mon Sep 17 00:00:00 2001 From: "debian@x.ray.net" Date: Fri, 15 Feb 2008 19:41:33 +0100 Subject: configure_network(): do nothing if device already configured This patch is part of three patches (initramfs-tools, cryptsetup, dropbear) which enable mkinitramfs to create initramfs that provide the ability to log in and unlock a cryptroot during the boot process from remote via ssh. Calling configure_networking from /scripts/functions might appear more than once, so just try if it hasn't been done/wasn't successful yet. Check that by testing for existence of /tmp/net-$DEVICE.conf which is created by ipconfig. --- scripts/functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/functions b/scripts/functions index fdd808f..b4bd8cd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -273,6 +273,9 @@ parse_numeric() { configure_networking() { + # networking already configured thus bail out + [ -e /tmp/net-${DEVICE}.conf ] && return 0 + # support ip options see linux sources Documentation/nfsroot.txt case ${IPOPTS} in none|off) -- cgit v1.2.3 From 3c8ba4b38085157d0c54c02ba9d3edf56aaf26c1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 16 Mar 2008 18:37:57 +0100 Subject: init: export ROOTFLAGS + ROOTFSTYPE. be more consistent on exporting *all* relevant ROOT* variables, thanks to Sten Spans for pointing that out. --- init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init b/init index 607d2c7..0ec0d00 100755 --- a/init +++ b/init @@ -27,9 +27,6 @@ mkdir /dev/.initramfs export DPKG_ARCH= . /conf/arch.conf -# Export it for root hardcoding -export ROOT= - # Bring in the main config . /conf/initramfs.conf for conf in conf/conf.d/*; do @@ -41,13 +38,16 @@ done export MODPROBE_OPTIONS="-qb" # Export relevant variables +export ROOT= +export ROOTDELAY= +export ROOTFLAGS= +export ROOTFSTYPE= export break= export init=/sbin/init export quiet=n export readonly=y export rootmnt=/root export debug= -export ROOTDELAY= export panic= export blacklist= -- cgit v1.2.3 From bf4c07348b91597d96764ba8a484678845a58cd7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 16 Mar 2008 18:41:11 +0100 Subject: debian/control: s/XS-Vcs/Vcs/ Those fields are official dpkg supported, so just use them. --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index a5f1248..3f56a0e 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.3 -XS-Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -XS-Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git +Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git +Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git Package: initramfs-tools Architecture: all -- cgit v1.2.3 From 5703bc0c449f5cde88b3e4597e33d81ad6f42ea1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 16 Mar 2008 20:55:42 +0100 Subject: mkinitramfs: Drop gzip -9 option. Doubles the speed of mkinitramfs small size loss ~ 1%. Suggested since some time by waldi and found in Ubuntu too now. --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 06d2149..312b99e 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -290,7 +290,7 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then fi [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" -(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") || exit 1 +(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}") || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 -- cgit v1.2.3 From e4b83628580eb117cd3759f10d4882802cad203c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 22 Mar 2008 15:09:44 +0100 Subject: Ignore lintian warnings about empty directories. These warnings are harmless and initramfs-tools wants to provide this directory structure for other users. scripts are to be placed there and dir existence is assumed. --- debian/initramfs-tools.install | 1 + debian/lintian/initramfs-tools | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 debian/lintian/initramfs-tools diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 5b3d8a6..fb1c088 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -9,3 +9,4 @@ hook-functions usr/share/initramfs-tools conf/modules usr/share/initramfs-tools update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools +debian/lintian/initramfs-tools usr/share/lintian/overrides diff --git a/debian/lintian/initramfs-tools b/debian/lintian/initramfs-tools new file mode 100644 index 0000000..6d1b9c8 --- /dev/null +++ b/debian/lintian/initramfs-tools @@ -0,0 +1,3 @@ +initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/conf.d/ +initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/hooksconf.d/ +initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/modules.d/ -- cgit v1.2.3 From 0aec8b0c22b7622841c4ab7a3b492b4d2657456f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 25 Mar 2008 14:40:45 +0100 Subject: framebuffer: Let udev create fb devices. nuke fb device mknod creation as udev creates the fb device nodes. suggested by waldi. positive test on qemu with usplash. let's see if we get a bad interaction with usplash and vga=XXX boots. --- scripts/init-top/framebuffer | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 2427b47..cb1ea2c 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -86,15 +86,6 @@ if [ -n "${FB}" ]; then modprobe ${FB} ${OPTS} fi -if [ -e /proc/fb ]; then - while read fbno desc; do - if [ $(($fbno < 32)) ]; then - mknod /dev/fb${fbno} c 29 ${fbno} - fi - done < /proc/fb -else - mknod /dev/fb0 c 29 0 -fi for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty${i} c 4 ${i} done -- cgit v1.2.3 From d377e38823d06d8e79341fba44ce8ea9c42daff6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 25 Mar 2008 14:47:17 +0100 Subject: framebuffer: Leave tty devices for udev too. udev creates tty devices too, in the case of not using udev, we need to ship more anyway, so no need to worry about that right now. --- scripts/init-top/framebuffer | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index cb1ea2c..21a6b19 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -85,7 +85,3 @@ if [ -n "${FB}" ]; then modprobe fbcon modprobe ${FB} ${OPTS} fi - -for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty${i} c 4 ${i} -done -- cgit v1.2.3 From 701f56e007030e64f117fb3ff06ed6d394bfc86e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 29 Mar 2008 12:24:22 +0100 Subject: manpages: fix hyphen-used-as-minus-sign properly escape minus signs to make them easily pastable. --- initramfs-tools.8 | 10 +++++----- update-initramfs.8 | 2 +- update-initramfs.conf.5 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 3708575..317fdc8 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -387,7 +387,7 @@ esac . /usr/share/initramfs-tools/hook-functions # Begin real processing below this line -if [ ! -x "/sbin/frobnicate" ]; then +if [ ! \-x "/sbin/frobnicate" ]; then exit 0 fi @@ -419,11 +419,11 @@ prereqs) esac # Begin real processing below this line -if [ ! -x "/sbin/frobnicate" ]; then +if [ ! \-x "/sbin/frobnicate" ]; then panic "Frobnication executable not found" fi -if [ ! -e "/dev/mapper/frobb" ]; then +if [ ! \-e "/dev/mapper/frobb" ]; then panic "Frobnication device not found" fi @@ -442,8 +442,8 @@ 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.18-1-686 | \\ -cpio -i -d -H newc --no-absolute-filenames +gunzip \-c \-9 /boot/initrd.img\-2.6.18\-1\-686 | \\ +cpio \-i \-d \-H newc \-\-no\-absolute\-filenames .fi .RE diff --git a/update-initramfs.8 b/update-initramfs.8 index 4ba12de..84f0b14 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -30,7 +30,7 @@ happens in this early userspace. .TP \fB \-k \fI version Set the specific kernel version for whom the initramfs will be generated. -For example the output of uname -r for your currently running kernel. +For example the output of uname \-r for your currently running kernel. This argument is optional for update. The default is the latest kernel version. The use of "all" for the diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 58e3cc4..fcba12f 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -15,7 +15,7 @@ newest Linux image. Setting it to \fIall\fP updates any known initramfs. 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. +the \fBupdate_initramfs \-u\fP call. .SH AUTHOR The initramfs-tools are written by Maximilian Attems , -- cgit v1.2.3 From 6c25b07c692fb34f735b049be6cac4da33125b6d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 30 Mar 2008 03:57:45 +0200 Subject: init: fix mkdir usage. klibc mkdir has only the short option, use that. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index 0ec0d00..bb61bb6 100755 --- a/init +++ b/init @@ -3,7 +3,7 @@ echo "Loading, please wait..." [ -d /dev ] || mkdir -m 0755 /dev -[ -d /root ] || mkdir --mode=0700 /root +[ -d /root ] || mkdir -m 0700 /root [ -d /sys ] || mkdir /sys [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp -- cgit v1.2.3 From 0da6088ae11f77ef6fc2a9180c805d491f8bb8c4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 30 Mar 2008 04:01:06 +0200 Subject: init: Set proper permissions of /dev/console mknod fallback. if /dev/console doesn't yet exist it should be created with proper permissions. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index bb61bb6..3a93ef8 100755 --- a/init +++ b/init @@ -18,7 +18,7 @@ if [ -e /etc/udev/udev.conf ]; then . /etc/udev/udev.conf fi mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev -[ -e /dev/console ] || mknod /dev/console c 5 1 +[ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1 [ -e /dev/null ] || mknod /dev/null c 1 3 > /dev/.initramfs-tools mkdir /dev/.initramfs -- cgit v1.2.3 From 24031b44c4862f557a634eadbe532757a797de8f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 30 Mar 2008 04:02:10 +0200 Subject: scripts/function: Use mknod directly. No need to call chmod later on, now that klibc mknod can set permissions. --- scripts/functions | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index b4bd8cd..0648701 100644 --- a/scripts/functions +++ b/scripts/functions @@ -266,8 +266,7 @@ parse_numeric() { ;; esac - mknod /dev/root b ${major} ${minor} - chmod 600 /dev/root + mknod -m 600 /dev/root b ${major} ${minor} ROOT=/dev/root } -- cgit v1.2.3 From 265ba0ac08d5cb33f7013c2820d9c8823165df54 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 30 Mar 2008 04:03:24 +0200 Subject: debian/control: Depend on latest klibc for mknod usage. Previsous changes depend on the latest klibc, thus bump dependency version. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 3f56a0e..39a1134 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs -Depends: klibc-utils (>= 1.5.6-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24) +Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 2506a84db53eb95e5616c5b572f82ef4760a773a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 31 Mar 2008 22:38:15 +0200 Subject: scripts/functions: fix configure_networking() for multiple interfaces. IPOPTS can be assumed to get passed :::::: and thus configure any possible interface. we have thus also to source the relevant ipconfig output :) based on a patch by Michal Sojka : "If I want several computers to boot from the same ramdisk (with NFS root) and some computers have multiple network interfaces, the DEVICE variable can't be set to a specific value (e.g. eth0). Ipconfig from klibc supports a mode, where DHCP request is sent to all interfaces and the one receiving the first DHCP offer is used. This perfectly suits my needs, but it can't be used with initramfs scripts because the interface name in not known in advance and the DEVICE variable is set to something like ::::::." --- scripts/functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 0648701..588e324 100644 --- a/scripts/functions +++ b/scripts/functions @@ -304,6 +304,12 @@ configure_networking() ;; esac - # source relevant ipconfig output - . /tmp/net-${DEVICE}.conf + # source ipconfig output + if [ -n "${DEVICE}" ]; then + # source specific bootdevice + . /tmp/net-${DEVICE}.conf + else + # source any interface as not exaclty specified + . /tmp/net-*.conf + fi } -- cgit v1.2.3 From a5a87b52156774a2c01039e80ad2f7706ac8f7e4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 31 Mar 2008 22:47:58 +0200 Subject: ps3: load the newer modules. based on a patch by Luke Yelavich . --- scripts/init-premount/ps3 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 index 8f8ce1c..97fc662 100755 --- a/scripts/init-premount/ps3 +++ b/scripts/init-premount/ps3 @@ -17,14 +17,20 @@ esac case "$DPKG_ARCH" in powerpc|ppc64) + # For PS3's we know these devices will exist,and that we'll need them while read line; do if [ "${line}" != "${line#machine*PS3PF}" ]; then - # For PS3's we know these devices will exist, - # and that we'll need them + # New style + modprobe ps3disk + modprobe ps3rom + modprobe ps3-gelic + + # Old style modprobe ps3_storage modprobe gelic_net modprobe ohci-hcd modprobe ehci-hcd + modprobe sys-manager fi done < /proc/cpuinfo ;; -- cgit v1.2.3 From e5f8a9faad64438852a6657ed1afcc0d45f30926 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Apr 2008 03:18:10 +0200 Subject: ps3 nuke useless hardcoded initramfs script. udev takes care to load the relevant modules. also PS3PF never had landed in debian thus pretty useless to take care of it just nuke it and be happy that udev loading is fixed since 2.6.23-rc1. --- scripts/init-premount/ps3 | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 scripts/init-premount/ps3 diff --git a/scripts/init-premount/ps3 b/scripts/init-premount/ps3 deleted file mode 100755 index 97fc662..0000000 --- a/scripts/init-premount/ps3 +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -case "$DPKG_ARCH" in -powerpc|ppc64) - # For PS3's we know these devices will exist,and that we'll need them - while read line; do - if [ "${line}" != "${line#machine*PS3PF}" ]; then - # New style - modprobe ps3disk - modprobe ps3rom - modprobe ps3-gelic - - # Old style - modprobe ps3_storage - modprobe gelic_net - modprobe ohci-hcd - modprobe ehci-hcd - modprobe sys-manager - fi - done < /proc/cpuinfo - ;; -esac -- cgit v1.2.3 From 5dfdae9ae274c271943c9bee9ddc3db7fd255695 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Apr 2008 15:26:52 -0400 Subject: update-initramfs: use dpkg-trigger This is a lightly modified version of Ian Jackson's original patch, incorporating maximilian attems's comments. dh_installdeb automatically installs the triggers file, so the rules file does not need to be changed. --- debian/initramfs-tools.postinst | 11 +++++++++-- debian/initramfs-tools.triggers | 1 + update-initramfs | 13 +++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 debian/initramfs-tools.triggers diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 2f36f3f..6ecfe2e 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -6,9 +6,16 @@ if [ ! -e /etc/initramfs-tools/modules ]; then cp /usr/share/initramfs-tools/modules /etc/initramfs-tools/ fi -# Regenerate initramfs on upgrade -if [ "$1" = "configure" ] && [ -n "$2" ]; then +# Regenerate initramfs whenever we go to dpkg state `installed' + +if [ "x$1" != xtriggered ] && \ + dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.5ubuntu10~~' +then + # this activates the trigger, if triggers are working update-initramfs -u +else + # force it to actually happen + DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs -u fi #DEBHELPER# diff --git a/debian/initramfs-tools.triggers b/debian/initramfs-tools.triggers new file mode 100644 index 0000000..860c664 --- /dev/null +++ b/debian/initramfs-tools.triggers @@ -0,0 +1 @@ +interest update-initramfs diff --git a/update-initramfs b/update-initramfs index 42f2831..6e8e7aa 100755 --- a/update-initramfs +++ b/update-initramfs @@ -4,6 +4,7 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf +USETRIGGERS=true mode="" version="" @@ -11,6 +12,18 @@ set -e [ -r ${CONF} ] && . ${CONF} +if $USETRIGGERS \ + && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \ + && [ $# = 1 ] \ + && [ x"$1" = x-u ] \ + && dpkg-trigger --check-supported 2>/dev/null +then + if dpkg-trigger --no-await update-initramfs; then + echo "update-initramfs: deferring update (trigger activated)" + exit 0 + fi +fi + usage() { if [ -n "${1}" ]; then -- cgit v1.2.3 From c1fd9aa6213613fed140da7fe68c67a91f478509 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 2 Apr 2008 22:19:59 +0200 Subject: configure_networking(): guard against unset "${DEVICE}" found on testing that configure_networking() shouldn't make assumption that ${DEVICE} is really already set. this still allows to bail out if device is passed and set. --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 588e324..d36884c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -273,7 +273,7 @@ parse_numeric() { configure_networking() { # networking already configured thus bail out - [ -e /tmp/net-${DEVICE}.conf ] && return 0 + [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0 # support ip options see linux sources Documentation/nfsroot.txt case ${IPOPTS} in -- cgit v1.2.3 From aaf9b600c8ed9055b4e283e6cf1394b6f9f6ac8e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 7 Apr 2008 11:51:00 +0200 Subject: resume: Add support for resume_offset swap file suspend to disk. Parse cmdline for resume_offset, export it and pass it to the klibc resume binary. Based on a patch by Alan Jenkins . Bonus small codingstyle clean up of local-premount/resume. --- init | 4 ++++ scripts/local-premount/resume | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/init b/init index 3a93ef8..70f4384 100755 --- a/init +++ b/init @@ -50,6 +50,7 @@ export rootmnt=/root export debug= export panic= export blacklist= +export resume_offset= # Parse command line options for x in $(cat /proc/cmdline); do @@ -97,6 +98,9 @@ for x in $(cat /proc/cmdline); do resume=*) RESUME="${x#resume=}" ;; + resume_offset=*) + resume_offset="${x#resume_offset=}" + ;; noresume) noresume=y ;; diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index d997f81..6bf95e5 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -28,11 +28,13 @@ case $resume in ;; esac -if [ ! -e "${resume}" ]; then - exit 0 -fi +[ ! -e "${resume}" ] && exit 0 + +[ ! -e /sys/power/resume ] && exit 0 -if [ -e /sys/power/resume ]; then - # hardcode path, uswsusp ships an resume binary too +# hardcode path, uswsusp ships an resume binary too +if [ -n "${resume_offset}" ]; then + /bin/resume ${resume} ${resume_offset} +else /bin/resume ${resume} fi -- cgit v1.2.3 From cf1cb624d74422f64fb68c28fa99039b9f716c9c Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 8 Apr 2008 16:52:23 +1000 Subject: update-initramfs: Initramfs generation reliability fixes. Attached is a patch to improve the way update-initramfs handles the generating of new or updated initramfs images for kernels. It puts in place a few measures to ensure that if there is not enough disk space on /boot, a previous initramfs is still in tact, to allow the booting of that kernel. The patch applies against current git head. See the Ubuntu specification found at the following URL for more information: https://wiki.ubuntu.com/HardyInitramfsErrorHandling This patch does the following: * When generating a new initramfs, instead of copying the old initramfs to a backup file, it hard links it instead, so no more space is used than necessary. it only copies to the backup file in the event that the filesystem on /boot doesn't support hard links, eg FAT32 partitions. * A new file is used to generate the initramfs. If the generation succeeds, it is moved to the original initramfs's location, ready to use. If it fails, the original initramfs is not affected, allowing it to be used at boot. [ wrap on long line -maks ] --- update-initramfs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 6e8e7aa..a4947bf 100755 --- a/update-initramfs +++ b/update-initramfs @@ -100,7 +100,8 @@ backup_initramfs() [ ! -r "${initramfs}" ] && return 0 initramfs_bak="${initramfs}.dpkg-bak" [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}" - mv -f "${initramfs}" "${initramfs_bak}" + ln -f "${initramfs}" "${initramfs_bak}" \ + || cp -a "${initramfs}" "${initramfs_bak}" verbose "Keeping ${initramfs_bak}" } @@ -143,8 +144,8 @@ backup_booted_initramfs() restore_initramfs() { [ -z "${initramfs_bak}" ] && return 0 + rm -f "${initramfs_bak}" verbose "Restoring ${initramfs_bak}" - mv -f "${initramfs_bak}" "${initramfs}" } @@ -155,11 +156,13 @@ generate_initramfs() if [ "${verbose}" = 1 ]; then OPTS="-v ${OPTS}" fi - if mkinitramfs ${OPTS} "${initramfs}" "${version}"; then + if mkinitramfs ${OPTS} "${initramfs}.new" "${version}"; then + mv -f "${initramfs}.new" "${initramfs}" set_sha1 else mkinitramfs_return="$?" restore_initramfs + rm -f "${initramfs}.new" if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 exit 0 -- cgit v1.2.3 From a8584be941e67818cf062663badc040c8e68309f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 11:02:17 +0200 Subject: update-initramfs: Rename function according to reliability fix. purpose of function changed, now we keep the old initramfs on the real path until mkinitramfs run finished. --- update-initramfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-initramfs b/update-initramfs index a4947bf..90a66b4 100755 --- a/update-initramfs +++ b/update-initramfs @@ -140,12 +140,12 @@ backup_booted_initramfs() rm -f ${initramfs_bak} } -# restore initramfs backup -restore_initramfs() +# nuke generated copy +remove_initramfs() { [ -z "${initramfs_bak}" ] && return 0 rm -f "${initramfs_bak}" - verbose "Restoring ${initramfs_bak}" + verbose "Removing ${initramfs_bak}" } @@ -161,7 +161,7 @@ generate_initramfs() set_sha1 else mkinitramfs_return="$?" - restore_initramfs + remove_initramfs rm -f "${initramfs}.new" if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 -- cgit v1.2.3 From 4843c922a862303c3212b40da160e874cbfd33c6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 11:43:38 +0200 Subject: hook-functions: Add atl1, cxgb3, e1000e, igb, ipg, niu, sky2 list of net modules added to MODULES=most the net section was missing quite a lot of the newer net driver, add them all per hand. as we can't just ship drivers/net. --- hook-functions | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hook-functions b/hook-functions index f39e7e4..4cf916a 100644 --- a/hook-functions +++ b/hook-functions @@ -311,11 +311,12 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 b44 bmac bnx2 defxx \ - dl2k e1000 e100 ehea epic100 ep93xx_eth eql fealnx \ - famachi forcedeth gelic_net hp100 mace mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole ns83820 pcnet32 qla3xxx \ - r8169 s2io sis900 skge slhc smc911x starfire \ + for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ + bnx2 cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \ + ep93xx_eth eql fealnx famachi forcedeth gelic_net \ + hp100 igb ipg mace mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ + r8169 s2io sis900 skge sky2 slhc smc911x starfire \ sundance sungem sungem_phy sunhme tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do -- cgit v1.2.3 From bd052d092afbfd145fe5c22fcfdc407f2b9c2b84 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 16:51:02 +0200 Subject: MODULES=dep fix ps3 support Debian never shipped the PS3PF legacy plattform, only retain the relevant upstream accepted ps3 plattform drivers. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 4cf916a..1f98cba 100644 --- a/hook-functions +++ b/hook-functions @@ -293,7 +293,7 @@ dep_add_modules() fi if [ -e /sys/bus/ps3_system_bus/ ]; then - for x in ps3_storage gelic_net ohci-hcd ehci-hcd; do + for x in ps3disk ps3rom ps3-gelic; do manual_add_modules "${x}" done fi -- cgit v1.2.3 From 5eb8ef34b87581964e35bed17877085a334a8f5b Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 8 Apr 2008 16:54:56 +0200 Subject: hook-function: Add support for sunvnet and sunvdc in hook-functions. [ Ubuntu merge of better sparc support -maks ] --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 1f98cba..d271c58 100644 --- a/hook-functions +++ b/hook-functions @@ -297,6 +297,12 @@ dep_add_modules() manual_add_modules "${x}" done fi + + if [ -e /sys/bus/vio/ ]; then + for x in sunvnet sunvdc; do + manual_add_modules "${x}" + done + fi } @@ -317,7 +323,7 @@ auto_add_modules() hp100 igb ipg mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme tg3 tlan de2104x \ + sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \ de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ typhon via-rhine via-velocity yellowfin; do manual_add_modules "${x}" -- cgit v1.2.3 From c404a3d7ebdd9df4ebaad0d9321cdf8f275ec356 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 8 Apr 2008 17:17:59 +0200 Subject: initramfs-tools.8: Small documentation fixes. * document panic= 0 behaviour * simplify debug cmd --- initramfs-tools.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 317fdc8..66565f5 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -97,6 +97,7 @@ Use blacklist=module1,module2,module3 bootparameter. .TP \fB \fI panic sets an timeout on panic. +panic=0 is a documented security feature: it disables the debug shell. .TP \fB \fI debug @@ -442,7 +443,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.18\-1\-686 | \\ +gunzip \-c /boot/initrd.img\-2.6.18\-1\-686 | \\ cpio \-i \-d \-H newc \-\-no\-absolute\-filenames .fi .RE -- cgit v1.2.3 From 78f8afdedbc0fca0f0523d3c4c67996ce814cd57 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 9 Apr 2008 10:44:11 +0200 Subject: release 0.92 * add changelog with bug closures * new release song "Fischia il vento" --- debian/changelog | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/debian/changelog b/debian/changelog index dd24385..a01d699 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,47 @@ +initramfs-tools (0.92) unstable; urgency=low + + Release "Ogni contrada è patria del ribelle" + + [ maximilian attems ] + * init: export ROOTFLAGS + ROOTFSTYPE. + * debian/control: s/XS-Vcs/Vcs/ + * mkinitramfs: Drop gzip -9 option. (closes: #470869) + Thanks Tollef Fog Heen . + * Ignore lintian warnings about empty directories. + * framebuffer: Let udev create fb devices. + * framebuffer: Leave tty devices for udev too. + * manpages: fix hyphen-used-as-minus-sign + * init: fix mkdir usage. + * init: Set proper permissions of /dev/console mknod fallback. + * scripts/function: Use mknod directly. + * debian/control: Depend on latest klibc for mknod usage. + * scripts/functions: fix configure_networking() for multiple interfaces. + (closes: #467078) Thanks Michal Sojka . + * ps3 nuke useless hardcoded initramfs script. (closes: #468113) + * resume: Add support for resume_offset swap file suspend to disk. + (closes: #474691) Thanks Alan Jenkins . + * update-initramfs: Rename function according to reliability fix. + * hook-functions: Add atl1, cxgb3, e1000e, igb, ipg, niu, sky2 to + net section of initramfs modules. (closes: #463607) + * hook-functions: MODULES=dep fix ps3 support. + * initramfs-tools.8: Small documentation fixes. (closes: #467627) + + [ debian@x.ray.net ] + * configure_network(): do nothing if device already configured. + (closes: #465901) + + [ Joey Hess ] + * update-initramfs: use dpkg-trigger. (closes: #447611) + + [ Luke Yelavich ] + * update-initramfs: Initramfs generation reliability fixes. + (closes: #468112) + + [ Fabio M. Di Nitto ] + * hook-functions: Add support for sunvnet and sunvdc. + + -- maximilian attems Wed, 09 Apr 2008 10:42:49 +0200 + initramfs-tools (0.91e) unstable; urgency=medium [ Daniel Reichelt ] -- cgit v1.2.3 From 11ec6b75ce098ef0708b8d4bc5849ffef789efbe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 9 Apr 2008 12:10:45 +0200 Subject: initramfs-tools.8: Document resume_offset bootparam. addition missed the entry in the manpage. --- initramfs-tools.8 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 66565f5..83884b7 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -77,6 +77,11 @@ On install initramfs-tools tries to autodetect the resume partition. On success the RESUME variable is written to /etc/initramfs-tools/conf.d/resume. The boot variable noresume overrides it. +.TP +\fB \fI resume_offset +Specify the offset from the partition given by "resume=" at which the swap +header of the swap file is located. + .TP \fB \fI quiet reduces the amount of text output to the console during boot. -- cgit v1.2.3 From 6a4e2130950d3505bf664177747a6a11220f3460 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 10 Apr 2008 13:41:40 +0200 Subject: ps3: Add ps3_sys_manager to MODULES=dep ps3 modules. "ps3_sys_manager handles system shutdown, so having it in initramfs allows the user to properly shutdown the system with the power button if the root file system can not be mounted at boot. Without it the user must do a forced poweroff." Geoff Levand --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index d271c58..b427dab 100644 --- a/hook-functions +++ b/hook-functions @@ -293,7 +293,7 @@ dep_add_modules() fi if [ -e /sys/bus/ps3_system_bus/ ]; then - for x in ps3disk ps3rom ps3-gelic; do + for x in ps3disk ps3rom ps3-gelic ps3_sys_manager; do manual_add_modules "${x}" done fi -- cgit v1.2.3 From 74be87d35841eae3c3febf00b568df5232c85f06 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Thu, 10 Apr 2008 14:25:47 +0200 Subject: init: Add 2>&1 to the run-init exec, fixes init without stderr. long outstanding bug. [ note: seems fixed in fedora mkinitrd, but not in opensuse. they simply call run-init like anyone else. -maks] --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index 70f4384..7f1d348 100755 --- a/init +++ b/init @@ -210,5 +210,5 @@ fi # Chain to real filesystem maybe_break init -exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console +exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1 panic "Could not execute run-init." -- cgit v1.2.3 From da6b1999565d8d7d6504b21cb26f786166509f7a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 29 Apr 2008 20:29:36 +0200 Subject: init: Fix hardcoded ROOT bootcase. grave bug as makes a Debian slug unbootable. Thanks Kevin Price for report and Martin Michlmayr for debugging. The cause was the reordering of the ROOT export *after* it had been sourced in init. Fix it by allowing all exported variables to be ovverriden aka hardcoded. --- init | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init b/init index 7f1d348..3fe1fab 100755 --- a/init +++ b/init @@ -27,13 +27,6 @@ mkdir /dev/.initramfs export DPKG_ARCH= . /conf/arch.conf -# Bring in the main config -. /conf/initramfs.conf -for conf in conf/conf.d/*; do - [ -f ${conf} ] && . ${conf} -done -. /scripts/functions - # Set modprobe env export MODPROBE_OPTIONS="-qb" @@ -52,6 +45,13 @@ export panic= export blacklist= export resume_offset= +# Bring in the main config +. /conf/initramfs.conf +for conf in conf/conf.d/*; do + [ -f ${conf} ] && . ${conf} +done +. /scripts/functions + # Parse command line options for x in $(cat /proc/cmdline); do case $x in -- cgit v1.2.3 From 61f005efdb6f3b182fd12c365b1dd5d8e77f9e40 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 29 Apr 2008 20:31:35 +0200 Subject: Revert "init: Add 2>&1 to the run-init exec, fixes init without stderr." This reverts commit 74be87d35841eae3c3febf00b568df5232c85f06. talked to hpa and he seemed quite unconvinced about that report. the run-init code doesn't also seem to backup that claim. so nuke it for now until better analysis shows up. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index 3fe1fab..885f240 100755 --- a/init +++ b/init @@ -210,5 +210,5 @@ fi # Chain to real filesystem maybe_break init -exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1 +exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console panic "Could not execute run-init." -- cgit v1.2.3 From 5133e1f923511a0fdb3665f0efd302bd32b23e42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 29 Apr 2008 20:34:09 +0200 Subject: Documentation typo fixes addition. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MODULES=list loads modules very early, when the firmware loader udev might not be there yet. thanks David Martínez Moreno for report. --- hook-functions | 2 +- initramfs.conf.5 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index b427dab..8c90d37 100644 --- a/hook-functions +++ b/hook-functions @@ -231,7 +231,7 @@ dep_add_modules() # check that fstype rootfs recognition if [ "${FSTYPE}" = "unknown" ]; then - echo "mkinitramfs: unkown fstype on root ${root}" + echo "mkinitramfs: unknown fstype on root ${root}" echo "mkinitramfs: workaround is MODULES=most" echo "mkinitramfs: Error please report bug against klibc" exit 1 diff --git a/initramfs.conf.5 b/initramfs.conf.5 index e5fcec9..8957ba6 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -30,7 +30,8 @@ The default setting is \fImost\fP. \fInetboot\fP adds the base modules, network modules, but skips block devices. -\fIlist\fP includes only modules from the additional modules list. +\fIlist\fP includes only modules from the additional modules list to load them +early. .TP \fB BUSYBOX -- cgit v1.2.3 From 8db2495b6d17f1e8d1f114a4105548f5d0d53dc5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 30 Apr 2008 09:54:00 +0200 Subject: release 0.92a --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index a01d699..d0710eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +initramfs-tools (0.92a) unstable; urgency=high + + * ps3: Add ps3_sys_manager to MODULES=dep ps3 modules. + * initramfs-tools.8: Document resume_offset bootparam. + * Documentation typo fixes and additions. + * init: Fix hardcoded ROOT bootcase. (closes: #478236) + Thanks Kevin Price for report and + Martin Michlmayr for debugging. + + -- maximilian attems Tue, 29 Apr 2008 21:18:55 +0200 + initramfs-tools (0.92) unstable; urgency=low Release "Ogni contrada è patria del ribelle" -- cgit v1.2.3 From 40c56de6f25ad179700d38604a27844d3a770a3c Mon Sep 17 00:00:00 2001 From: Glennie Vignarajah Date: Mon, 26 May 2008 23:41:15 +0200 Subject: initramfs-tools: Fix UUID rootfs detection with 'MODULES=dep' When MODULES is set to 'dep' in /etc/initramfs-tools/initramfs.conf, update-initramfs fails to detect correctly the root filesystem(device and fs used). When called, this command fails with: ---------- mkinitramfs: missing rootfs root rootfs /sys entry mkinitramfs: workaround is MODULES=most mkinitramfs: Error please report the bug update-initramfs: failed for /boot/initrd.img-2.6.25-2-amd64 ---------- So we have 3 cases here. eval "$(mount | awk '/"... returns * an UUID when the rootfs is mounted with the 'LABEL=' or 'UUID='. The UUID is a relative symbolic link located in /dev/disk/by-uuid/ pointing to the real device. * the real disk device. * /dev/root When "root=/dev/root", we have to figure out what it is, which is done in the "if" block. Also changing the matching regex in front to catch that type. Once we got the symlink to the root device, we can use 'readlink' to get the real device. Using 'readlink' on a file which is not a symlink doesn't matters(case 2). --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 8c90d37..c48416a 100644 --- a/hook-functions +++ b/hook-functions @@ -222,7 +222,11 @@ dep_add_modules() local block minor root FSTYPE root_dev_path x # findout root block device + fstype - eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')" + eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + if [ "${root}" = "/dev/root" ] ; then + root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null + fi + root="$(readlink -f ${root})" # find out real rootfs on auto type if [ "${FSTYPE}" = "auto" ]; then -- cgit v1.2.3 From 3d2a4940078b2cf041fed35233449e7cd6e57a0a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 May 2008 00:10:46 +0200 Subject: hook-functions: MODULES=dep fix error message must not be a klibc bug, initramfs-tools is first suspect. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index c48416a..80db840 100644 --- a/hook-functions +++ b/hook-functions @@ -237,7 +237,7 @@ dep_add_modules() if [ "${FSTYPE}" = "unknown" ]; then echo "mkinitramfs: unknown fstype on root ${root}" echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report bug against klibc" + echo "mkinitramfs: Error please report bug on initramfs-tools" exit 1 fi -- cgit v1.2.3 From a1ba5db6eec1c8181a2a06500479a22eae242afa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 30 May 2008 14:05:22 +0200 Subject: update-initramfs: mbr_check() fix for /dev/md/X naming (closes: #469312) update-initramfs: Generating /boot/initrd.img-2.6.22-3-k7 awk: /^md/2/{print substr($5, 1, 3)} thuse the initramfs will not be generated properly --- update-initramfs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/update-initramfs b/update-initramfs index 90a66b4..6f978f3 100755 --- a/update-initramfs +++ b/update-initramfs @@ -201,6 +201,13 @@ mbr_check() boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 case ${boot} in + /dev/md/*) + if [ -r /proc/mdstat ]; then + MD=${boot#/dev/md/} + boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \ + /proc/mdstat)" + fi + ;; /dev/md*) if [ -r /proc/mdstat ]; then MD=${boot#/dev/} -- cgit v1.2.3 From 7941455289174b1f53bfa91c11cf9747a95a3a99 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 30 May 2008 16:36:49 +0200 Subject: release 0.92b --- debian/changelog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index d0710eb..9a07600 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +initramfs-tools (0.92b) unstable; urgency=low + + [ maximilian attems ] + * update-initramfs: mbr_check() fix for /dev/md/X naming. (closes: #469312) + Thanks to Axel Beckert for report. + * hook-functions: MODULES=dep fix error message. + + [ Glennie Vignarajah ] + * initramfs-tools: Fix UUID rootfs detection with 'MODULES=dep'. + (closes: #483082) + + -- maximilian attems Fri, 30 May 2008 16:31:42 +0200 + initramfs-tools (0.92a) unstable; urgency=high * ps3: Add ps3_sys_manager to MODULES=dep ps3 modules. -- cgit v1.2.3 From 7e5cad4b55f4e3ca20bb0f4dbaeaf3d6b9e7b8d7 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 2 Jul 2008 16:50:14 +0200 Subject: init: Remove extra ellipses log_begin_msg already puts ... at the end of the stuff it prints, so no need to have it in there explicitly. Signed-off-by: martin f. krafft Signed-off-by: maximilian attems --- init | 4 ++-- scripts/local | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init b/init index 885f240..4c72eab 100755 --- a/init +++ b/init @@ -157,7 +157,7 @@ maybe_break top run_scripts /scripts/init-top maybe_break modules -log_begin_msg "Loading essential drivers..." +log_begin_msg "Loading essential drivers" load_modules log_end_msg @@ -167,7 +167,7 @@ run_scripts /scripts/init-premount [ "$quiet" != "y" ] && log_end_msg maybe_break mount -log_begin_msg "Mounting root file system..." +log_begin_msg "Mounting root file system" . /scripts/${BOOT} parse_numeric ${ROOT} mountroot diff --git a/scripts/local b/scripts/local index b55212e..d28917b 100644 --- a/scripts/local +++ b/scripts/local @@ -34,7 +34,7 @@ mountroot () # If the root device hasn't shown up yet, give it a little while # to deal with removable devices if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then - log_begin_msg "Waiting for root file system..." + log_begin_msg "Waiting for root file system" # Default delay is 180s if [ -z "${ROOTDELAY}" ]; then -- cgit v1.2.3 From fc24059a296ecba82475debde0eff2330c92a2cd Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 2 Jul 2008 16:50:15 +0200 Subject: Wait for udevsettle after $BOOT-top scripts ran udev may be busy creating links for the root device by the time mountroot is called. udevsettle makes sure these are processed. I thus call udevsettle with a timeout of 10 seconds after the $BOOT-top scripts have run and before the ROOTDELAY hack kicks in. I thought about doing this with a local-top script instead, but there is no way to ensure that it'll run last; cryptsetup uses a hack to make sure it runs last, if we also use the same hack, there'll be a dependency loop. Signed-off-by: martin f. krafft Signed-off-by: maximilian attems --- scripts/functions | 9 +++++++++ scripts/local | 2 ++ scripts/nfs | 2 ++ 3 files changed, 13 insertions(+) diff --git a/scripts/functions b/scripts/functions index d36884c..558f521 100644 --- a/scripts/functions +++ b/scripts/functions @@ -313,3 +313,12 @@ configure_networking() . /tmp/net-*.conf fi } + +wait_for_udev() +{ + if [ -x "$(command -v udevsettle)" ]; then + [ "$quiet" != "y" ] && log_begin_msg "Waiting for udev to process events" + udevsettle ${1:+--timeout=$1} + [ "$quiet" != "y" ] && log_end_msg + fi +} diff --git a/scripts/local b/scripts/local index d28917b..dc0745d 100644 --- a/scripts/local +++ b/scripts/local @@ -31,6 +31,8 @@ mountroot () run_scripts /scripts/local-top [ "$quiet" != "y" ] && log_end_msg + wait_for_udev 10 + # If the root device hasn't shown up yet, give it a little while # to deal with removable devices if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then diff --git a/scripts/nfs b/scripts/nfs index b9c2522..435d2d0 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -59,6 +59,8 @@ mountroot() # For DHCP modprobe af_packet + wait_for_udev 10 + # Default delay is around 180s # FIXME: add usplash_write info if [ -z "${ROOTDELAY}" ]; then -- cgit v1.2.3 From 0d2613de43f952a0ef8b74bd4594ea1c0e910ad3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 4 Jul 2008 00:09:35 +0200 Subject: doc: fix date string of manual pages. thanks to jidanni@jidanni.org Signed-off-by: maximilian attems --- initramfs-tools.8 | 2 +- initramfs.conf.5 | 2 +- mkinitramfs-kpkg.8 | 2 +- mkinitramfs.8 | 2 +- update-initramfs.8 | 2 +- update-initramfs.conf.5 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 83884b7..d096e80 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2007/07/07" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2007/07/07" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 8957ba6..ac3b959 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2007/01/01 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "2007/01/01" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 2d96465..482a49b 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS-KPKG 8 "$Date: 2006/02/17 $" "" "mkinitramfs-kpkg manual" +.TH MKINITRAMFS-KPKG 8 "2006/02/17" "" "mkinitramfs-kpkg manual" .SH NAME mkinitramfs-kpkg \- generates an initramfs image for kernel-package diff --git a/mkinitramfs.8 b/mkinitramfs.8 index a40de53..8d94a8c 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2007/08/08 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2007/08/08" "" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image diff --git a/update-initramfs.8 b/update-initramfs.8 index 84f0b14..77ebe17 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/10/12" $" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "2006/10/12" "" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index fcba12f..331ad25 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2007/08/09 $" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "2007/08/09" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs -- cgit v1.2.3 From fbd70a775e50615d3d88555e96b073cba22d8fad Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 4 Jul 2008 23:44:11 +0200 Subject: MODULES=most add mmc host and card drivers this allows OLPC root, as root on mmc cards. (closes: #483431) Thanks for initial patch to Robert Millan . Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index 80db840..bec5b62 100644 --- a/hook-functions +++ b/hook-functions @@ -336,6 +336,9 @@ auto_add_modules() ide) copy_modules_dir kernel/drivers/ide ;; + mmc) + copy_modules_dir kernel/drivers/mmc + ;; scsi) copy_modules_dir kernel/drivers/scsi for x in mptfc mptsas mptscsih mptspi; do @@ -380,6 +383,7 @@ auto_add_modules() auto_add_modules dasd auto_add_modules ieee1394 auto_add_modules firewire + auto_add_modules mmc ;; esac } -- cgit v1.2.3 From 41c8c7f6823ccebf04e54de4adcf15d129c1799b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 4 Jul 2008 23:52:17 +0200 Subject: update-initramfs.conf.5: document backup_initramfs variable. closes #475430 Signed-off-by: maximilian attems --- update-initramfs.conf.5 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 331ad25..fa28ee0 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "2007/08/09" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "2008/07/03" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -16,6 +16,9 @@ Setting it to \fIall\fP updates any known initramfs. 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. +.TP +\fB backup_initramfs +By default \fBupdate_initramfs\fP keeps an .bak file of the previous initramfs. If set to \fIno\fP the backup initramfs will not be kept. .SH AUTHOR The initramfs-tools are written by Maximilian Attems , -- cgit v1.2.3 From 501e5d0dafeb5bc204585848f551b26287e40654 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 00:16:48 +0200 Subject: initramfs-tools.8: Document "break" and "panic" behaviour thanks Luca Capello for initial patch. closes: #481196 Signed-off-by: maximilian attems --- initramfs-tools.8 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index d096e80..b564e2c 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2007/07/07" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2008/07/05" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -102,7 +102,7 @@ Use blacklist=module1,module2,module3 bootparameter. .TP \fB \fI panic sets an timeout on panic. -panic=0 is a documented security feature: it disables the debug shell. +panic= is a documented security feature: it disables the debug shell. .TP \fB \fI debug @@ -115,6 +115,8 @@ Use for example "debug=vc". spawns a shell in the initramfs image at chosen run-time (top, modules, premount, mount, bottom, init). The default is premount without any arg. +Beware that if both "panic" and "break" are present, +initramfs will not spawn any shells but reboot instead. .SH HOOK SCRIPTS -- cgit v1.2.3 From b12197b4d9f01575b897e7a3b653363d926927b8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 00:29:46 +0200 Subject: wait_for_udev(): simplify, no need for logging. add small comment on top, what for we need it. Signed-off-by: maximilian attems --- scripts/functions | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/functions b/scripts/functions index 558f521..c29a314 100644 --- a/scripts/functions +++ b/scripts/functions @@ -314,11 +314,9 @@ configure_networking() fi } +# Wait for queued kernel/udev events wait_for_udev() { - if [ -x "$(command -v udevsettle)" ]; then - [ "$quiet" != "y" ] && log_begin_msg "Waiting for udev to process events" - udevsettle ${1:+--timeout=$1} - [ "$quiet" != "y" ] && log_end_msg - fi + [ -x "$(command -v udevsettle)" ] && return 0 + udevsettle ${1:+--timeout=$1} } -- cgit v1.2.3 From f7d97ceae4000b9a08e7f04765beacd68b3bebb4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 00:34:56 +0200 Subject: release 0.92c Signed-off-by: maximilian attems --- debian/changelog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9a07600..90e50a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.92c) unstable; urgency=low + + [ maximilian attems ] + * doc: fix date string of manual pages. + * MODULES=most add mmc host and card drivers for OLPC. (closes: #483431) + * update-initramfs.conf.5: document backup_initramfs variable. + (closes: #475430) + * initramfs-tools.8: Document "break" and "panic" behaviour. + (closes: #481196) + * wait_for_udev(): simplify, no need for logging. + + [ martin f. krafft ] + * Wait for udevsettle after -top scripts ran + * init: Remove extra ellipses + + -- maximilian attems Sat, 05 Jul 2008 00:31:06 +0200 + initramfs-tools (0.92b) unstable; urgency=low [ maximilian attems ] -- cgit v1.2.3 From b1c5ca97da3bf6053412f1e159db09a48b44a6c5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 01:46:31 +0200 Subject: Merge more meaningful text for no root device panic from Ubuntu. Debian users were pasting that without getting the real trouble, thanks for the better rephrasing. --- scripts/local | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/local b/scripts/local index dc0745d..85d62af 100644 --- a/scripts/local +++ b/scripts/local @@ -87,9 +87,12 @@ mountroot () fi ;; esac - echo "ALERT! ${ROOT} does not exist. Dropping to a shell!" - echo " Check your root= boot argument (cat /proc/cmdline)" - panic " Check for missing modules (cat /proc/modules), or device files (ls /dev)" + echo "Gave up waiting for root device. Common problems:" + echo " - Boot args (cat /proc/cmdline)" + echo " - Check rootdelay= (did the system wait long enough?)" + echo " - Check root= (did the system wait for the right device?)" + echo " - Missing modules (cat /proc/modules; ls /dev)" + panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done # Get the root filesystem type if not set -- cgit v1.2.3 From 7658bb55a237cee7663bdcdc452899d7ab3a23b6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 01:49:34 +0200 Subject: Add virtio_pci for MODULES=most ubuntu merge --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index bec5b62..ad7a4b2 100644 --- a/hook-functions +++ b/hook-functions @@ -316,7 +316,8 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042; do + ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042 \ + virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 8bba9c14e6f887ae7300250b816697aa7e3441fa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 01:52:37 +0200 Subject: Add udf for MODULES=most ubuntu merge --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index ad7a4b2..3975cd9 100644 --- a/hook-functions +++ b/hook-functions @@ -316,7 +316,7 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs xfs af_packet atkbd i8042 \ + ext3 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \ virtio_pci; do manual_add_modules "${x}" done -- cgit v1.2.3 From 72a013043b785642d125bcba6698b460f82e97f2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:03:23 +0200 Subject: add boot script loading ide-generic on all_generic_ide cmdline thanks to Frans Pop for report, idea stolen from Ubuntu, adapted their boot script same boot param. closes: #485786 Signed-off-by: maximilian attems --- scripts/init-top/all_generic_ide | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/init-top/all_generic_ide diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide new file mode 100644 index 0000000..28b519a --- /dev/null +++ b/scripts/init-top/all_generic_ide @@ -0,0 +1,22 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +for x in $(cat /proc/cmdline); do + case ${x} in + all_generic_ide) + modprobe ide-generic + ;; + esac +done -- cgit v1.2.3 From 02def425ba404c5cde8c8e59207961d6b3fddd8f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:10:10 +0200 Subject: usplash pulsates: drop code to increment a progress bar after each message. ubuntu sync --- scripts/functions | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/scripts/functions b/scripts/functions index c29a314..a004c9e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -35,23 +35,6 @@ log_end_msg() /sbin/usplash_write "SUCCESS ok" fi _log_msg "Done." - update_progress -} - -update_progress() -{ - [ -d /dev/.initramfs ] || return - - 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() -- cgit v1.2.3 From 6d6f6125e9b165b296f437c788d981ef749a91e8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:15:14 +0200 Subject: initramfs-tools.preinst: Try to use UUID for resume device. ubuntu merge. --- debian/initramfs-tools.preinst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 6a8b88f..3c8a9b0 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -20,6 +20,10 @@ case "$1" in # First time install. Can we autodetect the RESUME partition? if [ -r /proc/swaps ]; then RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') + UUID=$(/sbin/vol_id -u "$RESUME" || true) + if [ -n "$UUID" ]; then + RESUME="UUID=$UUID" + fi fi # Inherit initrd-tools settings if possible. -- cgit v1.2.3 From 08fe39090957b17a395691914d31ff90ec722689 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:19:28 +0200 Subject: add possible mountroot break useful for debug cases closes: #488963 --- init | 1 + initramfs-tools.8 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/init b/init index 4c72eab..e287739 100755 --- a/init +++ b/init @@ -170,6 +170,7 @@ maybe_break mount log_begin_msg "Mounting root file system" . /scripts/${BOOT} parse_numeric ${ROOT} +maybe_break mountroot mountroot log_end_msg diff --git a/initramfs-tools.8 b/initramfs-tools.8 index b564e2c..75c7827 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -113,7 +113,7 @@ Use for example "debug=vc". .TP \fB \fI break spawns a shell in the initramfs image at chosen run-time -(top, modules, premount, mount, bottom, init). +(top, modules, premount, mount, mountroot, bottom, init). The default is premount without any arg. Beware that if both "panic" and "break" are present, initramfs will not spawn any shells but reboot instead. -- cgit v1.2.3 From de49ed4bcab097563031b24f24d7f5c5d149e20f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:30:18 +0200 Subject: initramfs-tools.8: document UUID usage for root and all_generic_ide closes: #489186 Signed-off-by: maximilian attems --- initramfs-tools.8 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 75c7827..4c4aeb4 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -38,6 +38,9 @@ the binary to hand over execution to on the root fs after the initramfs scripts .TP \fB \fI root the device node to mount as the root file system. +The recommended usage is to specify the UUID as followed "root=UUID=xxx". +As normal device names are not stable and may change depending on the +boot order. .TP \fB \fI rootdelay @@ -118,6 +121,10 @@ The default is premount without any arg. Beware that if both "panic" and "break" are present, initramfs will not spawn any shells but reboot instead. +.TP +\fB \fI all_generic_ide +loads generic IDE/ATA chipset support on boot. + .SH HOOK SCRIPTS -- cgit v1.2.3 From f2725289fe635947d0ebcab0259c7e597281682b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:34:54 +0200 Subject: debian/initramfs-tools.preinst: accomodate with different vol_id pathes Signed-off-by: maximilian attems --- debian/initramfs-tools.preinst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 3c8a9b0..3cf477e 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -20,7 +20,11 @@ case "$1" in # First time install. Can we autodetect the RESUME partition? if [ -r /proc/swaps ]; then RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') - UUID=$(/sbin/vol_id -u "$RESUME" || true) + if [ -x /sbin/vol_id ]; then + UUID=$(/sbin/vol_id -u "$RESUME" || true) + elif [ -x /lib/udev/vol_id ]; then + UUID=$(/sbin/vol_id -u "$RESUME" || true) + fi if [ -n "$UUID" ]; then RESUME="UUID=$UUID" fi -- cgit v1.2.3 From 6244406a9cd195d2867c72662ce632c2a2d2f653 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:46:04 +0200 Subject: release 0.92d --- debian/changelog | 17 +++++++++++++++++ scripts/init-top/all_generic_ide | 0 2 files changed, 17 insertions(+) mode change 100644 => 100755 scripts/init-top/all_generic_ide diff --git a/debian/changelog b/debian/changelog index 90e50a6..2d8029b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.92d) unstable; urgency=low + + * Ubuntu merge + - More meaningful text for no root device panic from Ubuntu. + - Add virtio_pci, udf for MODULES=most root device support. + - usplash pulsates: drop code to increment a progress bar after + each message. + - initramfs-tools.preinst: Try to use UUID for resume device. + - add boot script loading ide-generic on all_generic_ide cmdline. + Thanks Frans Pop for report. (closes: #485786) + * init: add possible mountroot break (closes: #488963) + * initramfs-tools.8: document UUID usage for root and all_generic_ide. + (closes: #489186) + * debian/initramfs-tools.preinst: try with different vol_id pathes. + + -- maximilian attems Sat, 05 Jul 2008 02:36:10 +0200 + initramfs-tools (0.92c) unstable; urgency=low [ maximilian attems ] diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide old mode 100644 new mode 100755 -- 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(-) 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 2bcd4eceb4fb75762807455cbc128bd969fa8bee Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 7 Jul 2008 13:54:46 +0200 Subject: release 0.92e --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2d8029b..968f32f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.92e) unstable; urgency=medium + + * udevhelper hook: drop ide.agent. + + -- maximilian attems Mon, 07 Jul 2008 13:52:54 +0200 + initramfs-tools (0.92d) unstable; urgency=low * Ubuntu merge -- cgit v1.2.3 From b42067f385b97ac76ae43eaa414ef35c39880e3c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 16 Jul 2008 01:21:48 +0200 Subject: mkinitramfs: only lvm2 initramfs has busybox dep. thus remove warning on case of md root, closes #490875. --- mkinitramfs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 312b99e..0fc45db 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -258,8 +258,7 @@ 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}" ] \ - || [ "${r_dev#/dev/md}" != "${r_dev}" ]; then + if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then echo "Warning: Busybox is required for successful boot!" fi else -- cgit v1.2.3 From 07d29f7d0b2b4dd22213d03f6edfd2147b3f4e0f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 10:52:25 +0200 Subject: mkinitramfs: Fix usage and man outfile arg is not optional. Thanks to Jens Seidel (closes: #493238) --- hook-functions | 2 +- mkinitramfs.8 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hook-functions b/hook-functions index 3975cd9..01f33c4 100644 --- a/hook-functions +++ b/hook-functions @@ -393,7 +393,7 @@ usage() { cat >&2 << EOF -Usage: ${0} [OPTION]... <-o outfile> [version] +Usage: ${0} [OPTION]... -o outfile [version] Options: -d confdir Specify an alternative configuration directory. diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 8d94a8c..abb3f39 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "2007/08/08" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2008/08/12" "" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image @@ -8,8 +8,8 @@ mkinitramfs \- low-level tool for generating an initramfs image .RB [ \-d .IR confdir ] .RB [ \-k ] -.RB [ \-o -.IR outfile ] +.RB \-o +.IR outfile .RB [ \-r .IR root ] .RB [ \-v ] -- cgit v1.2.3 From 33c41ca99c834ffac0a1e007dcd113d6e884bccd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 10:54:04 +0200 Subject: preinst fix vol_id path thanks Michael Tautschnig (closes: #494433) --- debian/initramfs-tools.preinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 3cf477e..758b504 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -23,7 +23,7 @@ case "$1" in if [ -x /sbin/vol_id ]; then UUID=$(/sbin/vol_id -u "$RESUME" || true) elif [ -x /lib/udev/vol_id ]; then - UUID=$(/sbin/vol_id -u "$RESUME" || true) + UUID=$(/lib/udev/vol_id -u "$RESUME" || true) fi if [ -n "$UUID" ]; then RESUME="UUID=$UUID" -- cgit v1.2.3 From 6b01325aadd949b451dd201667a3f0d088337208 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Fri, 8 Aug 2008 03:49:51 +0100 Subject: make log_begin_msg not emit trailing newline Please make log_begin_msg not emit a trailing newline - this makes the non- "quiet" output cleaner and results in half as many lines being emitted. For example: Begin: Finding root filesytem ... Done. Becomes: Begin: Finding root filesytem ... done. Patch attached - it also adds a space and alters the case of "done" for symmetry. This would be especially useful in Debian Live where we show a large number of these messages by default. (closes: #494257) --- scripts/functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/functions b/scripts/functions index a004c9e..5a896f1 100644 --- a/scripts/functions +++ b/scripts/functions @@ -3,22 +3,22 @@ _log_msg() { if [ "$quiet" = "y" ]; then return; fi - echo "$@" + printf "$@" } log_success_msg() { - _log_msg "Success: $@" + _log_msg "Success: $@\n" } log_failure_msg() { - _log_msg "Failure: $@" + _log_msg "Failure: $@\n" } log_warning_msg() { - _log_msg "Warning: $@" + _log_msg "Warning: $@\n" } log_begin_msg() @@ -26,7 +26,7 @@ log_begin_msg() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "TEXT $@" fi - _log_msg "Begin: $@ ..." + _log_msg "Begin: $@ ... " } log_end_msg() @@ -34,7 +34,7 @@ log_end_msg() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "SUCCESS ok" fi - _log_msg "Done." + _log_msg "done.\n" } panic() -- cgit v1.2.3 From e45c4b24062a490d01c8a3556f09d140bf1a88fe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 11:03:22 +0200 Subject: update-initramfs: run_bootloader() invoke flash-kernel and glantank-update-kernel in case of triggered update-initramfs the latest initramfs should get flashed. thanks to Joey Hess --- update-initramfs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/update-initramfs b/update-initramfs index 6f978f3..9830a7d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -262,6 +262,12 @@ run_bootloader() if [ -r /etc/zipl.conf ]; then zipl fi + if flash-kernel --supported >/dev/null 2>&1; then + flash-kernel + fi + if glantank-update-kernel --supported >/dev/null 2>&1; then + glantank-update-kernel + fi } compare_sha1() -- cgit v1.2.3 From e0d242989d3ceb6cf8747c07d916e0fa854a810c Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 7 Aug 2008 22:45:40 +0300 Subject: MODULES=dep fix for Orion Thanks to Kevin Price who sent me logs from the NSLU2, I know why it works there. The difference is that on the NSLU2 USB is a PCI device whereas on my Orion machine it's not. (closes: #494027) --- hook-functions | 1 + 1 file changed, 1 insertion(+) diff --git a/hook-functions b/hook-functions index 01f33c4..7d2e6da 100644 --- a/hook-functions +++ b/hook-functions @@ -189,6 +189,7 @@ sys_walk_mod_add() device_path="$1" while [ "${device_path}" != "/sys" ]; do + sys_walk_modalias ${device_path} driver_path="$(readlink -f ${device_path}/driver)" if [ -e "$driver_path" ]; then module="$(basename $(readlink -f $driver_path))" -- cgit v1.2.3 From d3e81429fdee2e02aeaee914cc09c9e952362530 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 11:31:47 +0200 Subject: Update to newer standards version without changes. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 39a1134..4986dea 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs -Standards-Version: 3.7.3 +Standards-Version: 3.8.0 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From ab8a9ab6ca271a4244a275c7fc0074a2bdd7b986 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 12 Aug 2008 11:35:52 +0200 Subject: release 0.92f --- debian/changelog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 968f32f..f0bd7d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.92f) unstable; urgency=medium + + [ maximilian attems ] + * mkinitramfs: only lvm2 initramfs has busybox dep. (closes: #490875) + * mkinitramfs: Fix usage and man outfile arg is not optional. + (closes: #493238) + * preinst fix vol_id path. (closes: #494433) + * update-initramfs: run_bootloader() invoke flash-kernel and glantank- + update-kernel in order to have latest initramfs flashed on triggered + update. Thanks to Joey Hess . + * debian/control: Newer standards version without changes. + + [ Chris Lamb ] + * make log_begin_msg not emit trailing newline (closes: #494257) + + [ Martin Michlmayr ] + * MODULES=dep boot fix for Orion. (closes: #494027) + + -- maximilian attems Tue, 12 Aug 2008 11:09:11 +0200 + initramfs-tools (0.92e) unstable; urgency=medium * udevhelper hook: drop ide.agent. -- cgit v1.2.3 From 08f65e23a7fb7d4c4915b1381e3251e3b7d89098 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 15 Aug 2008 18:45:51 +0200 Subject: auto_add_modules: Add ext4 and ext4dev currently ext4 is named ext4dev, doesn't matter if it doesn't exit, just list it to be future proof for the lenny release. klibc fstype has already ext4dev support (closes: #494922) --- hook-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index 7d2e6da..8bbbbd4 100644 --- a/hook-functions +++ b/hook-functions @@ -317,8 +317,8 @@ auto_add_modules() case "$1" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ - ext3 isofs jfs nfs reiserfs udf xfs af_packet atkbd i8042 \ - virtio_pci; do + ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ + atkbd i8042 virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 88643d542f0be841f840d749d11f5e969b2cb0fe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 15 Aug 2008 18:51:00 +0200 Subject: wait_for_udev: s/udevsettle/udevadm/ for upgrades after Lenny after lenny the symlink of udev is meant to be gone, support partial upgrades from lenny. --- scripts/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 5a896f1..5d81afd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -300,6 +300,6 @@ configure_networking() # Wait for queued kernel/udev events wait_for_udev() { - [ -x "$(command -v udevsettle)" ] && return 0 - udevsettle ${1:+--timeout=$1} + [ -x "$(command -v udevadm)" ] && return 0 + udevadm settle ${1:+--timeout=$1} } -- cgit v1.2.3 From 115d0aa6a71e89888765fac12c5135c97aef12c6 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Mon, 1 Sep 2008 11:22:34 -0400 Subject: Fix parse_numeric() to ignore non hex root string prefixes On OLPC machines, root is a nand device that is mounted as mtd0 (it is neither a block device nor a char device). The arguments passed to the kernel are "ro root=mtd0 rootfstype=jffs2". Unfortunately, attempting to use an initrd based upon initramfs-tools on such a machine results in a kernel panic and a syntax error. Begin: Mounting root file system ... /init: line 172: syntax error: 0xmtd0 The probably appears to be in parse_numeric(); the init scripts assume that normal devices are always prefixed with /, and root= strings that aren't are raw device numbers (prefixing them with 0x). I'm not sure if there are other devices similar to mtd that don't begin with a /. How about something like the following patch? It's not foolproof, but it at least ignores things that can't possibly be hex strings. fixes partially #497133 --- scripts/functions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 5d81afd..299c29c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -242,11 +242,14 @@ parse_numeric() { minor=${1#*:} major=${1%:*} ;; - *) + [A-Fa-f0-9]*) value=$(( 0x${1} )) minor=$(( ${value} % 256 )) major=$(( ${value} / 256 )) ;; + *) + return + ;; esac mknod -m 600 /dev/root b ${major} ${minor} -- cgit v1.2.3 From 1c5e3dd3801d9d142d2502fc550f6407b54f83b2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 2 Sep 2008 17:56:56 +0200 Subject: release 0.92g --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index f0bd7d3..60f4cc4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +initramfs-tools (0.92g) unstable; urgency=high + + [ maximilian attems ] + * wait_for_udev: s/udevsettle/udevadm/ for upgrades after Lenny. + * auto_add_modules: Add ext4 and ext4dev. (closes: #494922) + + [ Andres Salomon ] + * Fix parse_numeric() to ignore non hex root string prefixes aka + root=mtd0 on OLPC. see #497133 + + -- maximilian attems Tue, 02 Sep 2008 17:50:32 +0200 + initramfs-tools (0.92f) unstable; urgency=medium [ maximilian attems ] -- cgit v1.2.3 From b2019d165312d6a6020086904bf37e6d3cc84388 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 8 Sep 2008 14:08:06 +0200 Subject: MODULES=dep fix for root lvm on md mkinitramfs MODULES=dep detection didn't account for lvm on md, fixes mkinitramfs: missing md root /dev/mapper/ts409-root /sys entry (closes: #498237) thanks for report to Rod Whitby --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 8bbbbd4..6a5aebf 100644 --- a/hook-functions +++ b/hook-functions @@ -245,13 +245,19 @@ dep_add_modules() # Add rootfs manual_add_modules "${FSTYPE}" - # lvm luks root + # lvm or luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) + # lvm on luks or luks on lvm if [ "${block#dm-}" != "${block}" ]; then block=$(ls -1 /sys/block/${block}/slaves | head -n 1) fi + # lvm on md or luks on md + if [ "${block#md}" != "${block}" ]; then + block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ + /proc/mdstat) + fi block=${block%[0-9]*} # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then -- cgit v1.2.3 From 4d36335297a3c41f24e206e5727f210149a94911 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 8 Sep 2008 16:21:10 +0200 Subject: release 0.92i --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 60f4cc4..036a27b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.92i) unstable; urgency=high + + * MODULES=dep fix for root lvm on md. (closes: #498237) + Thanks Rod Whitby for report and test. + + -- maximilian attems Mon, 08 Sep 2008 16:13:24 +0200 + initramfs-tools (0.92g) unstable; urgency=high [ maximilian attems ] -- cgit v1.2.3 From 830639c3e51a5d035fad18c0fcc9ca817382452d Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Mon, 8 Sep 2008 16:39:23 +0200 Subject: initramfs-tools.8: Fix manpage-has-errors-from-man `/usr/share/initramfs-tools/hook-functions' would not show up. --- initramfs-tools.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 4c4aeb4..e19d562 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -153,7 +153,7 @@ prereqs) ;; esac -. /usr/share/initramfs-tools/hook-functions +\fR. /usr/share/initramfs-tools/hook-functions # Begin real processing below this line .fi .RE @@ -399,7 +399,7 @@ prereqs) ;; esac -. /usr/share/initramfs-tools/hook-functions +\fR. /usr/share/initramfs-tools/hook-functions # Begin real processing below this line if [ ! \-x "/sbin/frobnicate" ]; then -- cgit v1.2.3 From d6bc092c81e122caef3209074835d99e1ce4e4d5 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Mon, 8 Sep 2008 16:40:55 +0200 Subject: initramfs-tools.8: Nuke useless bold spaces. --- initramfs-tools.8 | 72 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index e19d562..5e1f083 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -32,89 +32,89 @@ The init and root are usually passed by the boot loader for local boot. The other parameters are optional. .TP -\fB \fI init +\fB\fI init the binary to hand over execution to on the root fs after the initramfs scripts are done. .TP -\fB \fI root +\fB\fI root the device node to mount as the root file system. The recommended usage is to specify the UUID as followed "root=UUID=xxx". As normal device names are not stable and may change depending on the boot order. .TP -\fB \fI rootdelay +\fB\fI rootdelay set delay in seconds. Determines how long mountroot waits for root to appear. .TP -\fB \fI rootflags +\fB\fI rootflags set the file system mount option string. .TP -\fB \fI rootfstype +\fB\fI rootfstype set the root file system type. .TP -\fB \fI nfsroot +\fB\fI nfsroot can be either "auto" to try to get the relevant information from DHCP or a string of the form NFSSERVER:NFSPATH or NFSSERVER:NFSPATH:NFSOPTS. Use root=/dev/nfs for NFS to kick to in. .TP -\fB \fI ip +\fB\fI ip tells how to configure the ip address. Allows to specify an different NFS server than the DHCP server. See Documentation/nfsroot.txt in any recent Linux source for details. Optional paramater for NFS root. .TP -\fB \fI cryptopts +\fB\fI cryptopts passes the args for cryptoroot. Set by the cryptsetup boot hooks. .TP -\fB \fI boot +\fB\fI boot either local or NFS (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). .TP -\fB \fI resume +\fB\fI resume On install initramfs-tools tries to autodetect the resume partition. On success the RESUME variable is written to /etc/initramfs-tools/conf.d/resume. The boot variable noresume overrides it. .TP -\fB \fI resume_offset +\fB\fI resume_offset Specify the offset from the partition given by "resume=" at which the swap header of the swap file is located. .TP -\fB \fI quiet +\fB\fI quiet reduces the amount of text output to the console during boot. .TP -\fB \fI ro +\fB\fI ro mounts the rootfs read-only. .TP -\fB \fI rw +\fB\fI rw mounts the rootfs read-write. .TP -\fB \fI blacklist +\fB\fI blacklist disables load of specific modules. Use blacklist=module1,module2,module3 bootparameter. .TP -\fB \fI panic +\fB\fI panic sets an timeout on panic. panic= is a documented security feature: it disables the debug shell. .TP -\fB \fI debug +\fB\fI 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 +\fB\fI break spawns a shell in the initramfs image at chosen run-time (top, modules, premount, mount, mountroot, bottom, init). The default is premount without any arg. @@ -122,7 +122,7 @@ Beware that if both "panic" and "break" are present, initramfs will not spawn any shells but reboot instead. .TP -\fB \fI all_generic_ide +\fB\fI all_generic_ide loads generic IDE/ATA chipset support on boot. @@ -166,7 +166,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 @@ -176,7 +176,7 @@ manual_add_modules isofs .RE .TP -\fB \fI +\fB\fI add_modules_from_file reads a file containing a list of modules (one per line) to be added to the initramfs image. The file can contain comments (lines starting with #) and @@ -189,7 +189,7 @@ add_modules_from_file /tmp/modlist .RE .TP -\fB \fI +\fB\fI force_load adds a module (and its dependencies) to the initramfs image and also unconditionally loads the module during boot. Also supports passing arguments @@ -201,7 +201,7 @@ force_load cdrom debug=1 .RE .TP -\fB \fI +\fB\fI copy_modules_dir copies an entire module directory from /lib/modules/KERNELVERSION/ into the initramfs image. @@ -262,7 +262,7 @@ Where PREREQ is modified to list other scripts in the same subdirectory if neces A number of functions (mostly dealing with output) are provided to boot scripts: .TP -\fB \fI +\fB\fI log_success_msg Logs a success message .RS @@ -272,7 +272,7 @@ log_success_msg "Frobnication successful" .RE .TP -\fB \fI +\fB\fI log_failure_msg Logs a failure message .RS @@ -282,7 +282,7 @@ log_failure_msg "Frobnication component froobz missing" .RE .TP -\fB \fI +\fB\fI log_warning_msg Logs a warning message .RS @@ -292,12 +292,12 @@ log_warning_msg "Only partial frobnication possible" .RE .TP -\fB \fI +\fB\fI log_begin_msg Logs a message that some processing step has begun .TP -\fB \fI +\fB\fI log_end_msg Logs a message that some processing step is finished .RS @@ -314,7 +314,7 @@ log_end_msg .RE .TP -\fB \fI +\fB\fI panic Logs an error message and executes a shell in the initramfs image to allow the user to investigate the situation. @@ -329,40 +329,40 @@ Both /usr/share/initramfs-tools/scripts and /etc/initramfs-tools/scripts contains the following subdirectories. .TP -\fB \fI +\fB\fI init-top the scripts in this directory are the first scripts to be executed after sysfs and procfs have been mounted and /dev/console and /dev/null have been created. No other device files are present yet. .TP -\fB \fI +\fB\fI init-premount runs the udev hooks for populating the /dev tree (udev will keep running until init-bottom) after modules specified by hooks and /etc/initramfs-tools/modules have been loaded. .TP -\fB \fI +\fB\fI local-top OR nfs-top After these scripts have been executed, the root device node is expected to be present (local) or the network interface is expected to be usable (NFS). .TP -\fB \fI +\fB\fI local-premount OR nfs-premount are run after the sanity of the root device has been verified (local) or the network interface has been brought up (NFS), but before the actual root fs has been mounted. .TP -\fB \fI +\fB\fI local-bottom OR nfs-bottom are run after the rootfs has been mounted (local) or the NFS root share has been mounted. udev is stopped. .TP -\fB \fI +\fB\fI init-bottom are the last scripts to be executed before procfs and sysfs are moved to the real rootfs and execution is turned over to the init binary which should now be @@ -370,7 +370,7 @@ found in the mounted rootfs. .SS Boot parameters .TP -\fB \fI +\fB\fI /conf/param.conf allows boot scripts to change exported variables that are listed on top of init. Write the new values to it. It will be sourced after an boot script run if it exists. -- cgit v1.2.3 From 7c4bfab2f4aa6e627151eddcf4df07d91a4d754e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 12 Sep 2008 14:53:07 +0200 Subject: readd zfcp to auto_add_modules lives under drivers/s390/scsi and not drivers/scsi (closes: #498698) --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 6a5aebf..1c8694c 100644 --- a/hook-functions +++ b/hook-functions @@ -349,7 +349,7 @@ auto_add_modules() ;; scsi) copy_modules_dir kernel/drivers/scsi - for x in mptfc mptsas mptscsih mptspi; do + for x in mptfc mptsas mptscsih mptspi zfcp; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 37d092c66b8a45b26b88d7cad73dab65703d5c91 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 12 Sep 2008 15:37:50 +0200 Subject: add dasd_diag_mod to auto_add_modules block section found under drivers/s390/block instead drivers/block location. "allows to access disks under VM" request by s390 porter Bastian Blank --- hook-functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hook-functions b/hook-functions index 1c8694c..e9f2368 100644 --- a/hook-functions +++ b/hook-functions @@ -358,6 +358,9 @@ auto_add_modules() ;; block) copy_modules_dir kernel/drivers/block + for x in dasd_diag_mod; do + manual_add_modules "${x}" + done ;; # FIXME: can be removed after Lenny release ieee1394) -- cgit v1.2.3 From 261ce5623c84c971abbeaccba756c4fdf1042d03 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Fri, 12 Sep 2008 16:26:57 +0300 Subject: initramfs.conf: Mention possible value overriding by d-i for example. Please mention in initramfs.conf that the values specified there can be overriden via /etc/mkinitramfs/conf.d. This is important since d-i will now use /etc/initramfs-tools/conf.d/driver-policy to set MODULES. --- conf/initramfs.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 0620d26..4a89a89 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -2,6 +2,10 @@ # initramfs.conf # Configuration file for mkinitramfs(8). See initramfs.conf(5). # +# Note that configuration options from this file can be overriden +# by config files in the /etc/initramfs-tools/conf.d directory. +# In particular, Debian installer may set MODULES in the file +# /etc/initramfs-tools/conf.d/driver-policy. # # MODULES: [ most | netboot | dep | list ] -- cgit v1.2.3 From 5b77bbc7e0d1b3e429fa13b8c54d08e235774709 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 13 Sep 2008 12:10:50 +0200 Subject: release 0.92j --- debian/changelog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 036a27b..1ab7e6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.92j) unstable; urgency=high + + [ Gerfried Fuchs ] + * initramfs-tools.8: Nuke useless bold spaces. + * initramfs-tools.8: Fix manpage-has-errors-from-man. + + [ maximilian attems ] + * Readd zfcp to auto_add_modules. (closes: #498698) + * Add dasd_diag_mod to auto_add_modules block section + Thanks Bastian Blank . + + [ Martin Michlmayr ] + * initramfs.conf: Mention possible value overriding by d-i for + example. (closes: #498712) + + -- maximilian attems Sat, 13 Sep 2008 12:12:02 +0200 + initramfs-tools (0.92i) unstable; urgency=high * MODULES=dep fix for root lvm on md. (closes: #498237) -- cgit v1.2.3 From aac6f31e93a578b0d415a4658adfc3e39110d8ef Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 15 Sep 2008 10:44:42 +0300 Subject: update-initramfs: don't run glantank-update-kernel glantank-update-kernel has been merged into flash-kernel and glantank-update-kernel will now call flash-kernel for compatibility. So there's no need to run glantank-update-kernel anymore. In case you do another upload for lenny, please include this patch. But there's no reason just to upload for this since nothing will break with the current initramfs-tools (although flash-kernel will be ran twice). --- update-initramfs | 3 --- 1 file changed, 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 9830a7d..11f630f 100755 --- a/update-initramfs +++ b/update-initramfs @@ -265,9 +265,6 @@ run_bootloader() if flash-kernel --supported >/dev/null 2>&1; then flash-kernel fi - if glantank-update-kernel --supported >/dev/null 2>&1; then - glantank-update-kernel - fi } compare_sha1() -- cgit v1.2.3 From 33c9958a544919b486534cba531134f400ca663f Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 15 Sep 2008 13:22:01 +0300 Subject: update initramfs.conf Now that d-i won't create /etc/initramfs-tools/conf.d/driver-policy in all cases, I think reference to is mostly useless. --- conf/initramfs.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 4a89a89..a2bd8db 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -4,8 +4,6 @@ # # Note that configuration options from this file can be overriden # by config files in the /etc/initramfs-tools/conf.d directory. -# In particular, Debian installer may set MODULES in the file -# /etc/initramfs-tools/conf.d/driver-policy. # # MODULES: [ most | netboot | dep | list ] -- cgit v1.2.3 From 203f66bd11db9ab01e49cd4b496391e95d3eb34f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Sep 2008 18:08:51 +0200 Subject: auto_add_modules: add dasd_diag_mod to dasd section --- hook-functions | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hook-functions b/hook-functions index e9f2368..53867da 100644 --- a/hook-functions +++ b/hook-functions @@ -358,9 +358,6 @@ auto_add_modules() ;; block) copy_modules_dir kernel/drivers/block - for x in dasd_diag_mod; do - manual_add_modules "${x}" - done ;; # FIXME: can be removed after Lenny release ieee1394) @@ -379,7 +376,7 @@ auto_add_modules() done ;; dasd) - for x in dasd_eckd_mod dasd_fba_mod; do + for x in dasd_diag_mod dasd_eckd_mod dasd_fba_mod; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From c5a45496b9c72e41333e213979d43fbcff34da9f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 16 Sep 2008 14:51:30 +0200 Subject: initramfs-tools: Add support for linux-2.6 make deb-pkg target it generates linux images that look into this directories for maintainer script action. make sure to generate an intramfs and also to remove it. --- debian/initramfs-tools.install | 1 + debian/rules | 2 +- kernel/postinst.d/update-initramfs | 7 +++++++ kernel/postrm.d/update-initramfs | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 kernel/postinst.d/update-initramfs create mode 100755 kernel/postrm.d/update-initramfs diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index fb1c088..71670ef 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -10,3 +10,4 @@ conf/modules usr/share/initramfs-tools update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools debian/lintian/initramfs-tools usr/share/lintian/overrides +kernel etc diff --git a/debian/rules b/debian/rules index 2a5ae55..1376aa9 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk pre-build:: chmod +x init mkinitramfs chmod +x hooks/* - for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \ + for x in `find scripts/ kernel/ -maxdepth 1 -type d | tail -n+2`; do \ chmod -R +x $$x; \ done diff --git a/kernel/postinst.d/update-initramfs b/kernel/postinst.d/update-initramfs new file mode 100755 index 0000000..2d3b391 --- /dev/null +++ b/kernel/postinst.d/update-initramfs @@ -0,0 +1,7 @@ +#!/bin/sh +# + +[ -z "$1" ] && exit 0 + +# create initramfs - update runs do_bootloader +update-initramfs -t -u -k "$1" diff --git a/kernel/postrm.d/update-initramfs b/kernel/postrm.d/update-initramfs new file mode 100755 index 0000000..432d672 --- /dev/null +++ b/kernel/postrm.d/update-initramfs @@ -0,0 +1,7 @@ +#!/bin/sh +# + +[ -z "$1" ] && exit 0 + +# delete initramfs +update-initramfs -d -k "$1" -- cgit v1.2.3 From 01988cc40c445aba8f592d01f2ce38857e34e205 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 16 Sep 2008 15:03:09 +0200 Subject: release 0.92k --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1ab7e6e..44f6103 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +initramfs-tools (0.92k) unstable; urgency=high + + [ Martin Michlmayr ] + * update initramfs.conf according to latest Debian Installer. + * update-initramfs: don't run glantank-update-kernel. + + [ maximilian attems ] + * auto_add_modules: add dasd_diag_mod to dasd section. + * initramfs-tools: Add support for linux-2.6 make deb-pkg target. + + -- maximilian attems Tue, 16 Sep 2008 14:55:04 +0200 + initramfs-tools (0.92j) unstable; urgency=high [ Gerfried Fuchs ] -- cgit v1.2.3 From 04356cfcee60b2ff3a57a6942c2cebfdb088d04c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 17 Sep 2008 15:36:16 +0200 Subject: Revert "initramfs-tools: Add support for linux-2.6 make deb-pkg target" This reverts commit c5a45496b9c72e41333e213979d43fbcff34da9f. hinders removal of other package linux-image postinst call also the /etc/kernel structure, thus delete needs a takeover and this is postlenny material. thanks Vincent Danjean for report. (closes: #499270) --- debian/initramfs-tools.install | 1 - debian/rules | 2 +- kernel/postinst.d/update-initramfs | 7 ------- kernel/postrm.d/update-initramfs | 7 ------- 4 files changed, 1 insertion(+), 16 deletions(-) delete mode 100755 kernel/postinst.d/update-initramfs delete mode 100755 kernel/postrm.d/update-initramfs diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 71670ef..fb1c088 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -10,4 +10,3 @@ conf/modules usr/share/initramfs-tools update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools debian/lintian/initramfs-tools usr/share/lintian/overrides -kernel etc diff --git a/debian/rules b/debian/rules index 1376aa9..2a5ae55 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk pre-build:: chmod +x init mkinitramfs chmod +x hooks/* - for x in `find scripts/ kernel/ -maxdepth 1 -type d | tail -n+2`; do \ + for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \ chmod -R +x $$x; \ done diff --git a/kernel/postinst.d/update-initramfs b/kernel/postinst.d/update-initramfs deleted file mode 100755 index 2d3b391..0000000 --- a/kernel/postinst.d/update-initramfs +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# - -[ -z "$1" ] && exit 0 - -# create initramfs - update runs do_bootloader -update-initramfs -t -u -k "$1" diff --git a/kernel/postrm.d/update-initramfs b/kernel/postrm.d/update-initramfs deleted file mode 100755 index 432d672..0000000 --- a/kernel/postrm.d/update-initramfs +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# - -[ -z "$1" ] && exit 0 - -# delete initramfs -update-initramfs -d -k "$1" -- cgit v1.2.3 From ed4f203aceb2af1355e25142b2849598c867ffdd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 17 Sep 2008 15:50:16 +0200 Subject: release 0.92l have to clean up goof up from 0.92k too.. --- debian/changelog | 7 +++++++ debian/initramfs-tools.preinst | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 44f6103..1d73a4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.92l) unstable; urgency=high + + * Revert "initramfs-tools: Add support for linux-2.6 make deb-pkg + target" (closes: #499270) thanks Vincent Danjean . + + -- maximilian attems Wed, 17 Sep 2008 15:38:05 +0200 + initramfs-tools (0.92k) unstable; urgency=high [ Martin Michlmayr ] diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 758b504..11e9057 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -60,6 +60,12 @@ case "$1" in cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi ;; + upgrade) + if dpkg --compare-versions "$2" eq "0.92k"; then + rm -f /etc/kernel/postinst.d/update-initramfs + rm -f /etc/kernel/postrm.d/update-initramfs + fi + ;; esac #DEBHELPER# -- cgit v1.2.3 From f15c3530c08e95f3270cbd073b5f83df81f06bbf Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 14 Dec 2008 18:59:49 +0100 Subject: scripts/functions: Call ipconfig with a one-minute timeout rather than waiting forever (LP: #182940). --- scripts/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index 299c29c..560184b 100644 --- a/scripts/functions +++ b/scripts/functions @@ -268,13 +268,13 @@ configure_networking() ;; ""|on|any) # Bring up device - ipconfig ${DEVICE} + ipconfig -t 60 ${DEVICE} ;; dhcp|bootp|rarp|both) - ipconfig -c ${IPOPTS} -d ${DEVICE} + ipconfig -t 60 -c ${IPOPTS} -d ${DEVICE} ;; *) - ipconfig -d $IPOPTS + ipconfig -t 60 -d $IPOPTS # grab device entry from ip option NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} -- cgit v1.2.3 From ca53be13ebbb8e00ead2d170c10e66cdb6fc91f3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 14 Dec 2008 19:11:41 +0100 Subject: scripts/functions: Wrong check for udevadm in functions --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 560184b..758dd4f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -303,6 +303,6 @@ configure_networking() # Wait for queued kernel/udev events wait_for_udev() { - [ -x "$(command -v udevadm)" ] && return 0 + [ -x "$(command -v udevadm)" ] || return 0 udevadm settle ${1:+--timeout=$1} } -- cgit v1.2.3 From e0ff2bedbd4da0c0638c21b2c2736d9a47415f73 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 14 Dec 2008 19:19:32 +0100 Subject: scripts/functions: fix not set break variable thanks martin f krafft closes: #502058 --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 758dd4f..85a5138 100644 --- a/scripts/functions +++ b/scripts/functions @@ -55,7 +55,7 @@ panic() maybe_break() { - if [ "${break}" = "$1" ]; then + if [ "${break:-}" = "$1" ]; then panic "Spawning shell within the initramfs" fi } -- cgit v1.2.3 From 10ac5c60e51125d45f3923edd1dd1f560ad0df1f Mon Sep 17 00:00:00 2001 From: dann frazier Date: Sun, 14 Dec 2008 19:24:11 +0100 Subject: Fix MODULES=dep for cciss devices A coworker reported a lenny install failure today. Turns out he had asked the installer to run mkinitramfs w/ MODULES=dep, which I'd never tried before: dl380g5:/home/dannf# mkinitramfs-kpkg -o /boot/initrd.img-2.6.26-1-686 2.6.26-1-686 mkinitramfs: missing cciss/c0d0p root /dev/cciss/c0d0p1 /sys entry mkinitramfs: workaround is MODULES=most mkinitramfs: Error please report the bug dep_add_modules() expects to find a /sys/block/cciss/c0d0p file, but it should be trying /sys/block/cciss!c0d0: (closes: #507619) --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index 53867da..d8875b7 100644 --- a/hook-functions +++ b/hook-functions @@ -269,6 +269,10 @@ dep_add_modules() root=${root#/dev/} block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ /proc/mdstat) + # cciss device + elif [ "${root#/dev/cciss/}" != "${root}" ]; then + block=${root#/dev/cciss/*} + block="cciss!${block%p*}" # classical root device else block=${root#/dev/} -- cgit v1.2.3 From acae751d2af11ceb05deab13dbc9c111140c9f58 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 14 Dec 2008 19:26:00 +0100 Subject: MODULES=dep fix for ida devices same fix as cciss, see #507619 --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index d8875b7..0dc3e22 100644 --- a/hook-functions +++ b/hook-functions @@ -273,6 +273,10 @@ dep_add_modules() elif [ "${root#/dev/cciss/}" != "${root}" ]; then block=${root#/dev/cciss/*} block="cciss!${block%p*}" + # ida device + elif [ "${root#/dev/ida/}" != "${root}" ]; then + block=${root#/dev/ida/*} + block="ida!${block%p*}" # classical root device else block=${root#/dev/} -- cgit v1.2.3 From e950d624a7ed8584ba543b523b8ca104ce58af41 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 00:03:36 +0100 Subject: hook-functions: alphebetize net drivers, fix typhoon typo --- hook-functions | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hook-functions b/hook-functions index 0dc3e22..8eb9906 100644 --- a/hook-functions +++ b/hook-functions @@ -338,14 +338,15 @@ auto_add_modules() ;; net) for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ - bnx2 cxgb3 defxx dl2k e100 e1000 e1000e ehea epic100 \ + bnx2 cxgb3 de2104x de4x5 defxx dl2k dmfe \ + e100 e1000 e1000e ehea epic100 \ ep93xx_eth eql fealnx famachi forcedeth gelic_net \ hp100 igb ipg mace mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme sunvnet tg3 tlan de2104x \ - de4x5 dmfe tulip winbond-840 xircom_cb xircom_tulip_cb \ - typhon via-rhine via-velocity yellowfin; do + sundance sungem sungem_phy sunhme sunvnet tg3 tlan \ + tulip typhoon via-rhine via-velocity winbond-840 \ + xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 9c67d426a3c39ca0c9fa6e0e676c1740e9ddbf5b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 00:08:08 +0100 Subject: Add atl1e, cxgb, ixgb, ixgbe, mlx4_core, netxen_nic, sfc, tehuti to net module list closes: #503216 --- hook-functions | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hook-functions b/hook-functions index 8eb9906..5b6230a 100644 --- a/hook-functions +++ b/hook-functions @@ -337,14 +337,15 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 atl1 b44 bmac \ - bnx2 cxgb3 de2104x de4x5 defxx dl2k dmfe \ + for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \ + bnx2 cxgb cxgb3 de2104x de4x5 defxx dl2k dmfe \ e100 e1000 e1000e ehea epic100 \ ep93xx_eth eql fealnx famachi forcedeth gelic_net \ - hp100 igb ipg mace mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole niu ns83820 pcnet32 qla3xxx \ - r8169 s2io sis900 skge sky2 slhc smc911x starfire \ - sundance sungem sungem_phy sunhme sunvnet tg3 tlan \ + hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ + natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ + pcnet32 qla3xxx \ + r8169 s2io sfc sis900 skge sky2 slhc smc911x starfire \ + sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ tulip typhoon via-rhine via-velocity winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" -- cgit v1.2.3 From dea1e93a1783c40463663619ecd55ab26aa890e3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 01:12:14 +0100 Subject: nuke 0.92k goof clean up --- debian/initramfs-tools.preinst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 11e9057..758b504 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -60,12 +60,6 @@ case "$1" in cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi ;; - upgrade) - if dpkg --compare-versions "$2" eq "0.92k"; then - rm -f /etc/kernel/postinst.d/update-initramfs - rm -f /etc/kernel/postrm.d/update-initramfs - fi - ;; esac #DEBHELPER# -- cgit v1.2.3 From 3c620c38f29a7372e544f17a4fa5da55eabe30bf Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 11:09:21 +0100 Subject: postrm: set -e flag harmless as the postrm is small, but better be clean. --- debian/initramfs-tools.postrm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index 6896636..f66e01a 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -1,5 +1,7 @@ #!/bin/sh +set -e + if [ "x${1}" = "xpurge" ]; then rm -f /etc/initramfs-tools/conf.d/resume rm -f /etc/initramfs-tools/modules -- cgit v1.2.3 From 87461ea463b943a9ccff96b2b36fcfbd66691a1a Mon Sep 17 00:00:00 2001 From: Michal Pokrywka Date: Mon, 13 Oct 2008 02:08:52 +0200 Subject: framebuffer: Add support for uvesafb Uvesafb framebuffer driver needs v86d userspace program but when fb driver is modprobed at init-top stage of initrd, /dev/zero and /dev/mem are missing because udev have not been run yet. --- scripts/init-top/framebuffer | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 21a6b19..4375dca 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -72,11 +72,16 @@ for x in $(cat /proc/cmdline); do esac done -# Map command line name to module name +# Map command line name to module name and other tweaks case ${FB} in matroxfb) FB=matroxfb_base ;; +uvesafb) + # v86d requires /dev/zero and dev/mem, but udev haven't been started yet + [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 + [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 + ;; *) ;; esac -- cgit v1.2.3 From 6e5eab4ecdba250653b1572f09624c20bf98a09e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 15 Dec 2008 11:23:03 +0100 Subject: Make debug option write to /dev/.initramfs/initramfs.debug rather than /tmp/initramfs.debug, so that it can be retrieved after boot. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index e287739..5b9dfb1 100755 --- a/init +++ b/init @@ -124,7 +124,7 @@ for x in $(cat /proc/cmdline); do debug) debug=y quiet=n - exec >/tmp/initramfs.debug 2>&1 + exec >/dev/.initramfs/initramfs.debug 2>&1 set -x ;; debug=*) -- cgit v1.2.3 From 7e82cbb4ff425ef0201e215566f17826311197c1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 11:31:15 +0100 Subject: Revert "framebuffer: Let udev create fb devices." udev isn't started at this point and therefore can't create framebuffer devices. This causes usplash not to run on PS3. set sane permissions will making the char files. This reverts commit 0aec8b0c22b7622841c4ab7a3b492b4d2657456f. --- scripts/init-top/framebuffer | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 4375dca..0ed798e 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -90,3 +90,13 @@ if [ -n "${FB}" ]; then modprobe fbcon modprobe ${FB} ${OPTS} fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + if [ $(($fbno < 32)) ]; then + mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} + fi + done < /proc/fb +else + mknod -m 0640 /dev/fb0 c 29 0 +fi -- cgit v1.2.3 From 6eac119e508d7de61dcfd8c1214ab834a8ce8075 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 14:52:31 +0100 Subject: scripts/functions: comment fix path to moved linux-2.6 Documentation. --- scripts/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 85a5138..697ce89 100644 --- a/scripts/functions +++ b/scripts/functions @@ -261,7 +261,8 @@ configure_networking() # networking already configured thus bail out [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0 - # support ip options see linux sources Documentation/nfsroot.txt + # support ip options see linux sources + # Documentation/filesystems/nfsroot.txt case ${IPOPTS} in none|off) # Do nothing -- cgit v1.2.3 From bda6f1ad11516683dc6cac2bc1196c590bd38806 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Fri, 17 Oct 2008 17:56:22 -0400 Subject: fix redboot partition support Fix buglet in parse_numeric where *:* would match mtd:root. We only want to match numbers. This fixes redboot partition support. Signed-off-by: Andres Salomon --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 697ce89..ca2b831 100644 --- a/scripts/functions +++ b/scripts/functions @@ -238,7 +238,7 @@ parse_numeric() { /*) return ;; - *:*) + [0-9]*:[0-9]*) minor=${1#*:} major=${1%:*} ;; -- cgit v1.2.3 From 54c28b9c9a7ed7b97db9161cd047735ae160d319 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 16 Dec 2008 15:52:32 +0100 Subject: init: Don't leak initramfs-tools exported variables. no need to check if the string of the corresponding variable exists, just unset all of them, but 2 that we need to pass on for calling init. --- init | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/init b/init index 5b9dfb1..102eda2 100755 --- a/init +++ b/init @@ -204,10 +204,23 @@ if [ ! -x "${rootmnt}${init}" ]; then panic "No init found. Try passing init= bootarg." fi -# Confuses /etc/init.d/rc -if [ -n ${debug} ]; then - unset debug -fi +# don't leak too much of env - some init(8) don't clear it +# (keep init, rootmnt) +unset debug +unset MODPROBE_OPTIONS +unset DPKG_ARCH +unset ROOTFLAGS +unset ROOTFSTYPE +unset ROOTDELAY +unset ROOT +unset blacklist +unset break +unset noresume +unset panic +unset quiet +unset readonly +unset resume +unset resume_offset # Chain to real filesystem maybe_break init -- cgit v1.2.3 From 5180b033fc6172c1354647d74754119d6cd94d76 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 16 Dec 2008 16:13:37 +0100 Subject: release 0.92m --- debian/changelog | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1d73a4a..9acbfcc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,38 @@ +initramfs-tools (0.92m) unstable; urgency=medium + + [ Colin Watson ] + * scripts/functions: Call ipconfig with a one-minute timeout. + * Make debug option write to /dev/.initramfs/initramfs.debug, + so that it can be retrieved after boot. + + [ Julien Danjou ] + * scripts/functions: Wrong check for udevadm in functions. (closes: #507059) + + [ maximilian attems ] + * scripts/functions: fix not set break variable. (closes: #502058) + * MODULES=dep fix for ida devices. + * hook-functions: alphebetize net drivers, fix typhoon typo. + * Add atl1e, cxgb, ixgb, ixgbe, mlx4_core, netxen_nic, sfc, tehuti to + net module list. (closes: #503216) + * nuke 0.92k goof clean up. + * postrm: set -e flag. + * Revert "framebuffer: Let udev create fb devices." + * scripts/functions: comment fix path to moved linux-2.6 + Documentation. + * init: Don't leak initramfs-tools exported variables. + (closes: #426465, #505440) + + [ dann frazier ] + * Fix MODULES=dep for cciss devices. (closes: #507619) + + [ Michal Pokrywka ] + * framebuffer: Add support for uvesafb. (closes: #502056) + + [ Andres Salomon ] + * fix redboot partition support. (closes: #504555) + + -- maximilian attems Tue, 16 Dec 2008 16:01:44 +0100 + initramfs-tools (0.92l) unstable; urgency=high * Revert "initramfs-tools: Add support for linux-2.6 make deb-pkg -- cgit v1.2.3 From a776485a1cd51b2541877537471e4809889609ef Mon Sep 17 00:00:00 2001 From: Eugene Paskevich Date: Wed, 17 Dec 2008 12:43:46 +0100 Subject: hook-functions: Fix MODULES=dep for lvm LABEL fstab notation The root fs is located on LVM and is described in /etc/fstab with LABEL= notation, which leads to the following mount output for root filesystem: mount | grep "on / " /dev/dm-0 on / type ext3 (rw,noatime,errors=remount-ro) The /dev/dm-0 itself isn't a symlink to /dev/mapper/, therefore root var remains /dev/dm-0 after readlink -f attempt. fix the consequent root detection failure. (closes: #508906) --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 5b6230a..0863122 100644 --- a/hook-functions +++ b/hook-functions @@ -246,7 +246,8 @@ dep_add_modules() manual_add_modules "${FSTYPE}" # lvm or luks root - if [ "${root#/dev/mapper/}" != "${root}" ]; then + if [ "${root#/dev/mapper/}" != "${root}" ] \ + || [ "${root#/dev/dm-}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) # lvm on luks or luks on lvm -- cgit v1.2.3 From b11f308d10ff9de4bb2a8fef44e1ec98d5e950e7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 18 Dec 2008 00:40:36 +0100 Subject: all_generic_ide: Also parse boolean bootoption d-i uses to pass it with the value 1 Reported-by: Frans Pop --- scripts/init-top/all_generic_ide | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide index 28b519a..3274ee8 100755 --- a/scripts/init-top/all_generic_ide +++ b/scripts/init-top/all_generic_ide @@ -18,5 +18,10 @@ for x in $(cat /proc/cmdline); do all_generic_ide) modprobe ide-generic ;; + all_generic_ide=*) + if [ ${x#all_generic_ide=} ]; then + modprobe ide-generic + fi + ;; esac done -- cgit v1.2.3 From 3ad23cbea9da45fecb931b2fec9c79edc23004a1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 18 Dec 2008 17:03:42 +0100 Subject: initramfs-tools.8: Document where to look up NFSOPTS NFSOPTS is no longer sourced in initramfs.conf, so it should only be documented at the place of use aka boot cmdline. (closes: #502927) Co-Author: Gerfried Fuchs --- initramfs-tools.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 5e1f083..ea0952b 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2008/07/05" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2008/12/18" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -58,7 +58,8 @@ set the root file system type. \fB\fI nfsroot can be either "auto" to try to get the relevant information from DHCP or a string of the form NFSSERVER:NFSPATH or NFSSERVER:NFSPATH:NFSOPTS. -Use root=/dev/nfs for NFS to kick to in. +Use root=/dev/nfs for NFS to kick to in. NFSOPTS can be looked up in +\fInfs(5)\fP. .TP \fB\fI ip -- cgit v1.2.3 From ce1c64736aa741df012e93ca0bae5a9399c58909 Mon Sep 17 00:00:00 2001 From: "S. Sakar" Date: Sun, 21 Sep 2008 08:55:09 +0200 Subject: hook-functions: MODULES=dep fix encrypted loop device i've set up an encrypted loop-AES device as the root partition (boot paramter dev=/dev/loopX) and update-initramfs fails with : mkinitramfs: missing loop root /dev/loop2 /sys entry --- hook-functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hook-functions b/hook-functions index 0863122..6a68910 100644 --- a/hook-functions +++ b/hook-functions @@ -278,6 +278,11 @@ dep_add_modules() elif [ "${root#/dev/ida/}" != "${root}" ]; then block=${root#/dev/ida/*} block="ida!${block%p*}" + # loop root /dev/loopX + elif [ "${root#/dev/loop}" != "${root}" ]; then + root=${root#/dev/} + block=$(losetup -a \ + | awk "/${root}/{print substr(\$3, 7, 3); exit}") # classical root device else block=${root#/dev/} -- cgit v1.2.3 From c9df41aa3214887d2f306a493778a3cf8965060f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Dec 2008 01:57:01 +0100 Subject: update-initramfs.8: List -d and mark the non-optional as such. -d was missing in synopsis. -c or -d or -u are not optional. --- update-initramfs.8 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/update-initramfs.8 b/update-initramfs.8 index 77ebe17..a01ba06 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,14 +1,13 @@ -.TH UPDATE-INITRAMFS 8 "2006/10/12" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "2008/12/19" "" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image .SH SYNOPSIS .B update\-initramfs +.RB \-c | \-d | \-u .RB [ \-k .IR version ] -.RB [ \-c ] -.RB [ \-u ] .RB [ \-t ] .RB [ \-v ] .RB [ \-b ] -- cgit v1.2.3 From 15dea23a41c24c07c2ea36deb49c8cbf478bb32b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Dec 2008 14:09:44 +0100 Subject: release 0.92n d-i fix, thus high urgency. --- debian/changelog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9acbfcc..4edb150 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.92n) unstable; urgency=high + + [ Eugene Paskevich ] + * hook-functions: Fix MODULES=dep for lvm LABEL fstab notation. + (closes: #508906) + + [ maximilian attems ] + * all_generic_ide: Also parse boolean bootoption. (closes: #507805) + * initramfs-tools.8: Document where to look up NFSOPTS. (closes: #502927) + * update-initramfs.8: List -d and mark the non-optional as such. + + [ S. Sakar ] + * hook-functions: MODULES=dep fix encrypted loop device. + (closes: #499666) + + -- maximilian attems Fri, 19 Dec 2008 14:03:13 +0100 + initramfs-tools (0.92m) unstable; urgency=medium [ Colin Watson ] -- cgit v1.2.3 From 6966048d94e1951fc7699a004bd6e1f602c2ec3e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Dec 2008 14:25:48 +0100 Subject: manpages: Set Linux as necessary OS. thanks to jidanni@jidanni.org for pointing out the missed field. --- initramfs-tools.8 | 2 +- initramfs.conf.5 | 2 +- mkinitramfs-kpkg.8 | 2 +- mkinitramfs.8 | 2 +- update-initramfs.8 | 2 +- update-initramfs.conf.5 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index ea0952b..05c7734 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2008/12/18" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2008/12/19" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs diff --git a/initramfs.conf.5 b/initramfs.conf.5 index ac3b959..6f6ee06 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "2007/01/01" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "2008/12/19" "Linux" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs diff --git a/mkinitramfs-kpkg.8 b/mkinitramfs-kpkg.8 index 482a49b..0e8783e 100644 --- a/mkinitramfs-kpkg.8 +++ b/mkinitramfs-kpkg.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS-KPKG 8 "2006/02/17" "" "mkinitramfs-kpkg manual" +.TH MKINITRAMFS-KPKG 8 "2008/12/19" "Linux" "mkinitramfs-kpkg manual" .SH NAME mkinitramfs-kpkg \- generates an initramfs image for kernel-package diff --git a/mkinitramfs.8 b/mkinitramfs.8 index abb3f39..5d3c42b 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "2008/08/12" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2008/12/19" "Linux" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image diff --git a/update-initramfs.8 b/update-initramfs.8 index a01ba06..efc1c2e 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "2008/12/19" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "2008/12/19" "Linux" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index fa28ee0..30e1a97 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "2008/07/03" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "2008/12/19" "Linux" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs -- cgit v1.2.3 From 71c6b1c173931725b1a2eb480450f5f5b198d364 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Dec 2008 14:29:30 +0100 Subject: initramfs-tools.8: Fix path of debug log - now kept after boot. and no we can't write into /var/log itself. (closes: #488804) --- initramfs-tools.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 05c7734..c5928d9 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -110,7 +110,7 @@ panic= is a documented security feature: it disables the debug shell. .TP \fB\fI debug -generates lots of output. It writes a log to /tmp/initramfs.debug. +generates lots of output. It writes a log to /dev/.initramfs/initramfs.debug. Instead when invoked with an arbitrary argument output is written to console. Use for example "debug=vc". -- cgit v1.2.3 From c5e4c28ef9e1b205a8a69c5c663ab00a1dfc97f3 Mon Sep 17 00:00:00 2001 From: e2xbegqsdyt21hfc Date: Mon, 18 Feb 2008 19:01:48 -0800 Subject: update-initramfs.8: mentions the specific conf file adds FILES section. --- update-initramfs.8 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update-initramfs.8 b/update-initramfs.8 index efc1c2e..bf5080b 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -83,6 +83,9 @@ Create the initramfs for a specific kernel: .PP .B update\-initramfs -c -k 2.6.18-1-686 +.SH FILES +/etc/initramfs-tools/update-initramfs.conf + .SH AUTHOR The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. -- cgit v1.2.3 From 90ad6ff31f66112e863ea86c9960b9770a0a245e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Dec 2008 18:44:34 +0100 Subject: init: Try to use old style sda1 if no root cmldine got specified. with bad luck that might still be on hda1, but then you get a warning about missing root boot param. --- init | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init b/init index 102eda2..69cbeed 100755 --- a/init +++ b/init @@ -70,6 +70,10 @@ for x in $(cat /proc/cmdline); do /dev/nfs) [ -z "${BOOT}" ] && BOOT=nfs ;; + "") + ROOT="/dev/sda1" + log_warning_msg "No root specified - trying /dev/sda1." + ;; esac ;; rootflags=*) -- cgit v1.2.3 From d2791a8fa458d473ff92d0710fe4d71487c76d6b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 21 Dec 2008 01:25:44 +0100 Subject: mkinitramfs: Use cp instead of copy_exec for configs. should be just a bit faster and fixes relative path for -d option. (closes: 472409) --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 0fc45db..355ec9c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -221,7 +221,7 @@ 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 -p /usr/share/initramfs-tools/init /init # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ @@ -239,7 +239,7 @@ for b in $(cd "${CONFDIR}/scripts" && find . \ done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf -copy_exec "${CONFDIR}/initramfs.conf" /conf +cp -p "${CONFDIR}/initramfs.conf" /conf for i in ${EXTRA_CONF}; do if [ -e "${CONFDIR}/conf.d/${i}" ]; then copy_exec "${CONFDIR}/conf.d/${i}" /conf/conf.d -- cgit v1.2.3 From ce17342cc5d0395108c8fe4150ad8849104029e7 Mon Sep 17 00:00:00 2001 From: Kel Modderman Date: Wed, 24 Dec 2008 09:56:07 +1000 Subject: init: variable `break' unset before `maybe_break init' is evaluated The cmdline parameter `break=init' failed to work. It looks like the variable `break' is unset before `maybe_break init' is evaluated. (closes: #509637) --- init | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init b/init index 69cbeed..4e7fdd3 100755 --- a/init +++ b/init @@ -208,6 +208,8 @@ if [ ! -x "${rootmnt}${init}" ]; then panic "No init found. Try passing init= bootarg." fi +maybe_break init + # don't leak too much of env - some init(8) don't clear it # (keep init, rootmnt) unset debug @@ -227,6 +229,5 @@ unset resume unset resume_offset # Chain to real filesystem -maybe_break init exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console panic "Could not execute run-init." -- cgit v1.2.3 From 8dcc1ffb9c6b17925aa5fa4883fef2a1ee85fef4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Jan 2009 15:10:32 +0100 Subject: initramfs-tools.8: Document default 180s rootdelay. --- initramfs-tools.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index c5928d9..6bdd5fe 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2008/12/19" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2009/01/07" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -45,6 +45,7 @@ boot order. .TP \fB\fI rootdelay set delay in seconds. Determines how long mountroot waits for root to appear. +The default is 180 seconds. .TP \fB\fI rootflags -- cgit v1.2.3 From 115134f07a0dd042355a2a6fb5a5ca987b000f5d Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Jan 2009 15:12:05 +0100 Subject: configure_networking: Raise ipconfig timeout to 180 seconds. in 0.92m, the timeout for ipconfig in scripts/functions was set to 60 seconds. This broke our iscsi-rootfs setups. It took me a while to debug this, but it seems that 60 seconds is not enough for switches which have spanning-tree enabled, they need some more time before they take up a port, in our case between 62 and 65 seconds. (closes: #511085) --- scripts/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index ca2b831..f715e68 100644 --- a/scripts/functions +++ b/scripts/functions @@ -269,13 +269,13 @@ configure_networking() ;; ""|on|any) # Bring up device - ipconfig -t 60 ${DEVICE} + ipconfig -t 180 ${DEVICE} ;; dhcp|bootp|rarp|both) - ipconfig -t 60 -c ${IPOPTS} -d ${DEVICE} + ipconfig -t 180 -c ${IPOPTS} -d ${DEVICE} ;; *) - ipconfig -t 60 -d $IPOPTS + ipconfig -t 180 -d $IPOPTS # grab device entry from ip option NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} -- cgit v1.2.3 From 9c3ec61b1a5e2feaa8d9c6de737eaa00eb446a9c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Jan 2009 15:12:05 +0100 Subject: configure_networking: Raise ipconfig timeout to 180 seconds. in 0.92m, the timeout for ipconfig in scripts/functions was set to 60 seconds. This broke our iscsi-rootfs setups. It took me a while to debug this, but it seems that 60 seconds is not enough for switches which have spanning-tree enabled, they need some more time before they take up a port, in our case between 62 and 65 seconds. (closes: #511085) --- scripts/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index ca2b831..f715e68 100644 --- a/scripts/functions +++ b/scripts/functions @@ -269,13 +269,13 @@ configure_networking() ;; ""|on|any) # Bring up device - ipconfig -t 60 ${DEVICE} + ipconfig -t 180 ${DEVICE} ;; dhcp|bootp|rarp|both) - ipconfig -t 60 -c ${IPOPTS} -d ${DEVICE} + ipconfig -t 180 -c ${IPOPTS} -d ${DEVICE} ;; *) - ipconfig -t 60 -d $IPOPTS + ipconfig -t 180 -d $IPOPTS # grab device entry from ip option NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} -- cgit v1.2.3 From bec0c23de01fd6fc690e84ed81c8b9ebe51bd95f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Jan 2009 15:45:28 +0100 Subject: release 0.92o --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4edb150..85ce872 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.92o) unstable; urgency=high + + * configure_networking: Raise ipconfig timeout to 180 seconds. + Thanks Norbert Tretkowski for report. + (closes: #511085) + + -- maximilian attems Wed, 07 Jan 2009 15:16:14 +0100 + initramfs-tools (0.92n) unstable; urgency=high [ Eugene Paskevich ] -- cgit v1.2.3 From 79c0badcec17942a869ef992ceda2335cfa1d7b2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 9 Jan 2009 12:44:30 +0100 Subject: Revert "init: Try to use old style sda1 if no root cmldine got specified." we have boot scripts that search for root if none is passed. usage by grml.org and debian-live. This reverts commit 90ad6ff31f66112e863ea86c9960b9770a0a245e. Reported-by: Michael Prokop --- init | 4 ---- 1 file changed, 4 deletions(-) diff --git a/init b/init index 4e7fdd3..072d82c 100755 --- a/init +++ b/init @@ -70,10 +70,6 @@ for x in $(cat /proc/cmdline); do /dev/nfs) [ -z "${BOOT}" ] && BOOT=nfs ;; - "") - ROOT="/dev/sda1" - log_warning_msg "No root specified - trying /dev/sda1." - ;; esac ;; rootflags=*) -- cgit v1.2.3 From 254a54d61d3e2c5463798fa29280c3d1d24c49bf Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 11 Jan 2009 23:56:50 +0100 Subject: update-initramfs: Fix run_bootloader() to check for grub2 makes it respect "do_bootloader = no" if both lilo and grub2 are installed. simplify grub check as both grub2 and grub have an update-grub script. based on patch and report by Clint Adams (closes: #511514) --- update-initramfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index 11f630f..b5f6f53 100755 --- a/update-initramfs +++ b/update-initramfs @@ -188,6 +188,7 @@ run_lilo() mbr_check() { # try to discover grub and be happy + # FIXME: check grub2 /boot/grub/grub.cfg [ -r /boot/grub/menu.lst ] \ && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ /boot/grub/menu.lst) @@ -232,8 +233,8 @@ mbr_check() run_bootloader() { # if both lilo and grub around, figure out if lilo needs to be run - if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ - || [ -x /usr/sbin/grub ]; then + if [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \ + || [ -e /boot/grub/grub.cfg ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") -- cgit v1.2.3 From dd84494afe697a5ff12ab002cf64b1281dcc3b40 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 18 Jan 2009 15:15:32 +0100 Subject: control: Add ${misc:Depends} depends clears debhelper-but-no-misc-depends lintian warning. don't know if we really need it, but better be safe and referenced in debhelper(7) manpage. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4986dea..0c359bf 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs -Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24) +Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- 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 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 7810a813a81cb13b6ae425fc10935270a37d72c7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 20:04:46 +0100 Subject: mkinitramfs-kpkg: deprecate it's usage. update-initramfs is the desired caller. --- mkinitramfs-kpkg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index ea0e783..07cbd44 100755 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -95,6 +95,8 @@ case "${version}" in ;; esac +echo "Depreciation WARNING: use update-initramfs(8)" >&2 + # linux-image installs latest version mkinitramfs -o ${outfile} ${version} sha1sum "${outfile}" | sed -e 's/\.new//' > "${STATEDIR}/${version}" -- cgit v1.2.3 From 75475db4e8d55fe79bc8a0e9d944a1eef493b5e2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 20:06:10 +0100 Subject: hook-functions: just ship old iee1394 if around. no need to deprecate it in initramfs-tools. Lenny ships due to userspace with it and Juju firewire not yet feature complete.. --- hook-functions | 1 - 1 file changed, 1 deletion(-) diff --git a/hook-functions b/hook-functions index 6a68910..f6e4814 100644 --- a/hook-functions +++ b/hook-functions @@ -375,7 +375,6 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; - # FIXME: can be removed after Lenny release ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" -- cgit v1.2.3 From 87240bc73a6a4c6e9fbeb55a1b168a87bac99457 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 5 Feb 2009 20:07:13 +0100 Subject: mkinitramfs: Post-Lenny cleanup. no need to support callers that were unofficial and never released as such in Lenny. --- mkinitramfs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 355ec9c..17c7925 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -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,21 +55,6 @@ while true; do esac done -# FIXME: remove after Lenny (needed for Etch linux-images) -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 - echo "Depreciation warning: use ramdisk=mkinitramfs-kpkg." - exit 0 -fi - # For dependency ordered mkinitramfs hook scripts. . /usr/share/initramfs-tools/scripts/functions . /usr/share/initramfs-tools/hook-functions -- 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 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 6a8c246803f170948e8e7ebf17d5590838cb19db Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Feb 2009 17:00:36 +0100 Subject: mkinitramfs: fix cp DESTDIR destination. uncovered due to tests with harden cpio failures. bug got introduced postlenny in d2791a8fa458d473ff92d0710fe4d71487c76d6b. --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 17c7925..70ff0fe 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -198,7 +198,7 @@ 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 /init +cp -p /usr/share/initramfs-tools/init ${DESTDIR}/init # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ @@ -216,7 +216,7 @@ for b in $(cd "${CONFDIR}/scripts" && find . \ done echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf -cp -p "${CONFDIR}/initramfs.conf" /conf +cp -p "${CONFDIR}/initramfs.conf" ${DESTDIR}/conf for i in ${EXTRA_CONF}; do if [ -e "${CONFDIR}/conf.d/${i}" ]; then copy_exec "${CONFDIR}/conf.d/${i}" /conf/conf.d -- cgit v1.2.3 From 63cc7b9216d69f413cd5414c96cf2c9a403e03ae Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 11 Feb 2009 20:15:48 -0800 Subject: minitramfs: find/cpio exit codes ignored while building initramfs The final stage of mkinitramfs that builds the image does not verify the exit codes of find or cpio: (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}") || exit 1 Once bug 514936 is solved, this will be even more important, since cpio will actually return errors. Attached is a gross alternative to depending on bash... Current behavior: $ find /fail | cpio --quiet --dereference -o -H newc | gzip > /tmp/archive.gz find: `/fail': No such file or directory $ echo $? 0 Desired behavior: $ set -o pipefail $ find /fail | cpio --quiet --dereference -o -H newc | gzip > /tmp/archive.gz find: `/fail': No such file or directory $ echo $? 1 (closes: #514938) [ already useful in finding stupid mkinitramfs path errors -maks ] --- mkinitramfs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 70ff0fe..0aa2ba7 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -266,7 +266,24 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then fi [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" -(cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}") || exit 1 +( +# work around lack of "set -o pipefail" for the following pipe: +# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" +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 + } | gzip >"${outfile}" + echo "ec3=$?;" >&4 +` +if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi +if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi +if [ "$ec3" -ne 0 ]; then exit "$ec3"; fi +) || exit $? if [ -s "${__TMPCPIOGZ}" ]; then cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 -- cgit v1.2.3 From 93654c9230d3817fa57069012a0b06ccb1df09e4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Feb 2009 17:09:35 +0100 Subject: mkinitramfs: Fix new pipe construct to really work inside "${DESTDIR}" trivial fix on top of previous change. afais cpio doesn't really give sensible return errors, so this fall through the cracks. --- mkinitramfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 0aa2ba7..2f5112c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -273,8 +273,9 @@ exec 3>&1 eval ` # http://cfaj.freeshell.org/shell/cus-faq-2.html exec 4>&1 >&3 3>&- + cd "${DESTDIR}" { - cd "${DESTDIR}" && find . 4>&-; echo "ec1=$?;" >&4 + find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 } | gzip >"${outfile}" -- cgit v1.2.3 From d144b88e29e390c43d7ce15f8cb0548c0ae576e1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Feb 2009 17:18:59 +0100 Subject: thermal boot script: Don't load thermal+fan on acpi=off (closes: #514997) Reported-by: Michael Prokop --- scripts/init-premount/thermal | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index aa146ec..0215edb 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -31,6 +31,13 @@ powerpc|ppc64) 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 ;; -- cgit v1.2.3 From 7d28901223a8f5fa47ddb0b0d39b34b04d43b8e9 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Thu, 29 Jan 2009 07:00:07 +1100 Subject: hook-functions: Add hid_* modules. since some keyboards will not be usable at the initramfs/busybox prompt without them. [ Ubuntu sync for 0.92bubuntu19 port it to Debian - maks ] --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index f6e4814..f9e5bc7 100644 --- a/hook-functions +++ b/hook-functions @@ -336,7 +336,11 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \ + hid_apple hid_belkin hid_bright hid_cherry hid_chicony \ + hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \ + hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \ + hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 8d21dcff7cef34c4f9a854deebdabb02503a3dae Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Sun, 15 Feb 2009 09:56:42 -0800 Subject: mkinitramfs: Do not pass exit code through on pipe failure Since "exit 2" has a special meaning, we must "exit 1" when the find/cpio/gzip pipe fails, otherwise "update-initramfs" will potentially ignore failures (it ignores return code "2" from mkinitramfs). Signed-off-by: Kees Cook --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 2f5112c..d1d46b0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -268,7 +268,7 @@ fi [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( # work around lack of "set -o pipefail" for the following pipe: -# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" +# 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 @@ -284,7 +284,7 @@ eval ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi if [ "$ec3" -ne 0 ]; then exit "$ec3"; fi -) || exit $? +) || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 -- cgit v1.2.3 From 06f880229b8f632cbfa699c7af9beee13d0dddea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Feb 2009 12:34:55 +0100 Subject: MODULES=dep fix for minor partitions > 9 always remove the largest possible suffix pattern on the block device. (closes: #513958) Reported-by: Nicola Canepa --- hook-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index f9e5bc7..0ddfcec 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,7 @@ dep_add_modules() block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ /proc/mdstat) fi - block=${block%[0-9]*} + block=${block%%[0-9]*} # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} @@ -286,7 +286,7 @@ dep_add_modules() # classical root device else block=${root#/dev/} - block=${block%[0-9]*} + block=${block%%[0-9]*} fi # Error out if /sys lack block dev -- cgit v1.2.3 From 13df18822a697053e10e8f42397e5237a15590f6 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 14 Oct 2008 18:04:09 -0400 Subject: allow root=mtd0 to be used; skip root checks if ROOT doesn't start with /dev. The attached patch is needed for booting with root=mtd0. Basically, the init scripts assume the root device should have a special device file somewhere, and if not will wait for it to appear. This patch changes it so that it only waits for a device file to appear if $ROOT starts with "/dev". In the case of things like ROOT=LABEL=foo, the init scripts will translate that to a device. With ROOT=mtd0, the init scripts will not check for a device, and will successfully mount the root filesystem. Signed-off-by: Andres Salomon --- scripts/local | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/local b/scripts/local index 85d62af..b6bd192 100644 --- a/scripts/local +++ b/scripts/local @@ -24,8 +24,7 @@ get_fstype () return ${RET} } -# Parameter: Where to mount the filesystem -mountroot () +pre_mountroot() { [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top" run_scripts /scripts/local-top @@ -33,6 +32,12 @@ mountroot () wait_for_udev 10 + # Don't wait for a root device that doesn't have a corresponding + # device in /dev (ie, mtd0) + if [ "${ROOT#/dev}" = "${ROOT}" ]; then + return + fi + # If the root device hasn't shown up yet, give it a little while # to deal with removable devices if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then @@ -94,6 +99,11 @@ mountroot () echo " - Missing modules (cat /proc/modules; ls /dev)" panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done +} + +mountroot() +{ + pre_mountroot # Get the root filesystem type if not set if [ -z "${ROOTFSTYPE}" ]; then -- cgit v1.2.3 From 7812c98ccaf731b0d76909f924639af4e9554ed3 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 14 Oct 2008 15:02:17 -0400 Subject: initramfs-tools: Readd support for linux-2.6 make deb-pkg target. ..via /etc/kernel Signed-off-by: Andres Salomon (closes: #504551) [ fixed update-initramfs postinst call s/-u/-c/ -maks ] Signed-off-by: maximilian attems --- debian/initramfs-tools.install | 1 + debian/rules | 2 +- kernel/postinst.d/initramfs-tools | 10 ++++++++++ kernel/postrm.d/initramfs-tools | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 kernel/postinst.d/initramfs-tools create mode 100755 kernel/postrm.d/initramfs-tools diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index fb1c088..71670ef 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -10,3 +10,4 @@ conf/modules usr/share/initramfs-tools update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools debian/lintian/initramfs-tools usr/share/lintian/overrides +kernel etc diff --git a/debian/rules b/debian/rules index 2a5ae55..1376aa9 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk pre-build:: chmod +x init mkinitramfs chmod +x hooks/* - for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \ + for x in `find scripts/ kernel/ -maxdepth 1 -type d | tail -n+2`; do \ chmod -R +x $$x; \ done diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools new file mode 100755 index 0000000..1cb72a8 --- /dev/null +++ b/kernel/postinst.d/initramfs-tools @@ -0,0 +1,10 @@ +#!/bin/sh + +# passing the kernel version is required +[ -z "$1" ] && exit 0 + +# kernel-package passes an extra arg; hack to not run under kernel-package +[ -z "$2" ] || exit 0 + +# we're good - create initramfs. update runs do_bootloader +update-initramfs -c -t -k "$1" diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools new file mode 100755 index 0000000..278a6fc --- /dev/null +++ b/kernel/postrm.d/initramfs-tools @@ -0,0 +1,10 @@ +#!/bin/sh + +# passing the kernel version is required +[ -z "$1" ] && exit 0 + +# kernel-package passes an extra arg; hack to not run under kernel-package +[ -z "$2" ] || exit 0 + +# delete initramfs +update-initramfs -d -k "$1" -- cgit v1.2.3 From e0cf94677002f7dd2d427ce0ebfe9412b2e45c47 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 15:55:11 +0100 Subject: mkinitramfs: Complete postlenny cleanup the supported-host long call feature was already dropped before lenny, thus just kick it. no other long calling getopt strings yet.. --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index d1d46b0..a1d7afe 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -11,7 +11,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 -- cgit v1.2.3 From 29dd116363aeaac22c54e1aef24020b6d26674af Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 16:36:40 +0100 Subject: initramfs-tools.8: Document mkinitramfs and init env variables. Documentation currently lacked a list of exported variables for boot or hook scripts. (closes: #512453) Reported-by: Arnaud Fontaine --- initramfs-tools.8 | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 6bdd5fe..9ef8063 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2009/01/07" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2009/02/17" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -226,6 +226,36 @@ and copy them to the initramfs. This means that most executables, unless compiled with klibc, will automatically include glibc in the image which will increase its size by several hundred kilobytes. +.SS Exported variables +mkinitramfs sets several variables for the hook scripts environment. + +.TP +\fB\fI MODULESDIR +corresponds to the linux-2.6 modules dir. +.TP +\fB\fI version +is the $(uname -r) linux-2.6 version against mkinitramfs is run. +.TP +\fB\fI CONFDIR +is the path of the used initramfs-tools configurations. +.TP +\fB\fI DESTDIR +is the root path of the newly build initramfs. +.TP +\fB\fI DPKG_ARCH +allows arch specific hook additions. +.TP +\fB\fI verbose +corresponds to the verbosity of the update-initramfs run. +.TP +\fB\fI KEYMAP +sets if a keymap needs to be added to initramfs. +.TP +\fB\fI MODULES +specifies which kind of modules should land on initramfs. +This setting shouldn't be overriden by hook script, but can guide them +on how much they need to include on initramfs. + .SH BOOT SCRIPTS @@ -452,6 +482,41 @@ exit 0 .fi .RE +.SS Exported variables +init sets several variables for the boot scripts environment. + +.TP +\fB\fI ROOT +correponds to the root boot option. +Advanced boot scripts like cryptsetup or live-initramfs need to play tricks. +Otherwise keep it alone. +.TP +\fB\fI ROOTDELAY, ROOTFLAGS, ROOTFSTYPE +correponds to the rootdelay, rootflags or rootfstype boot option. +.TP +\fB\fI DPKG_ARCH +allows arch specific boot actions. +.TP +\fB\fI blacklist, panic, quiet, resume, noresume, resume_offset +set according relevant boot option. +.TP +\fB\fI break +Useful for manual intervention during setup and coding an boot script. +.TP +\fB\fI init +passes the path to init(8) usually /sbin/init. +.TP +\fB\fI readonly +is the default for mounting the root corresponds to the ro bootarg. +Overriden by rw bootarg. +.TP +\fB\fI rootmnt +is the path where root gets mounted usualy /root. +.TP +\fB\fI debug +indicates that a debug log is captured for further investigation. + + .SH DEBUG 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: -- cgit v1.2.3 From 70ff74f8b3d378d7153f9211bbe0e73713a87259 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 18:00:16 +0100 Subject: Fix boot with LABEL containting one or several '/' As there is no /dev/disk/by-label//, we need to follow udev on escape the '/' character with \x2f don't rely on sed, as we might not have it in initramfs. (closes: #489008) Reported-by: Josh Triplett Tested-by: Andres Salomon thanks for dilinger to pushing the first easy solution to a complete, so we don't have to revisit the case. --- init | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/init b/init index 072d82c..7f549b1 100755 --- a/init +++ b/init @@ -62,7 +62,34 @@ for x in $(cat /proc/cmdline); do ROOT=${x#root=} case $ROOT in LABEL=*) - ROOT="/dev/disk/by-label/${ROOT#LABEL=}" + ROOT="${ROOT#LABEL=}" + + # support / in LABEL= paths (escape to \x2f) + case "${ROOT}" in + *[/]*) + if [ -x "$(command -v sed)" ]; then + ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')" + else + if [ "${ROOT}" != "${ROOT#/}" ]; then + ROOT="\x2f${ROOT#/}" + fi + if [ "${ROOT}" != "${ROOT%/}" ]; then + ROOT="${ROOT%/}\x2f" + fi + IFS='/' + newroot= + for s in $ROOT; do + if [ -z "${newroot}" ]; then + newroot="${s}" + else + newroot="${newroot}\\x2f${s}" + fi + done + unset IFS + ROOT="${newroot}" + fi + esac + ROOT="/dev/disk/by-label/${ROOT}" ;; UUID=*) ROOT="/dev/disk/by-uuid/${ROOT#UUID=}" -- cgit v1.2.3 From f91fdf2b9763f2774ff237d3fd04e8cc7b8aaa10 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 18:12:25 +0100 Subject: init: slightly reword comment --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index 7f549b1..ee006b5 100755 --- a/init +++ b/init @@ -64,7 +64,7 @@ for x in $(cat /proc/cmdline); do LABEL=*) ROOT="${ROOT#LABEL=}" - # support / in LABEL= paths (escape to \x2f) + # support any / in LABEL= path (escape to \x2f) case "${ROOT}" in *[/]*) if [ -x "$(command -v sed)" ]; then -- cgit v1.2.3 From 9e5ff69508479c10548e0fcf4d6f3ee043cff1fe Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 17 Feb 2009 18:12:56 +0100 Subject: scripts/local-premount/resume: Fix resume with LABEL containing '/'. do the same dance here, same code, just slightly renamed variables. --- scripts/local-premount/resume | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index 6bf95e5..b2b0e1d 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -20,10 +20,37 @@ if [ -z "${resume}" ]; then fi case $resume in - LABEL=*) - resume="/dev/disk/by-label/${resume#LABEL=}" +LABEL=*) + resume="${resume#LABEL=}" + + # support any / in LABEL= path (escape to \x2f) + case "${resume}" in + *[/]*) + if [ -x "$(command -v sed)" ]; then + resume="$(echo ${resume} | sed 's,/,\\x2f,g')" + else + if [ "${resume}" != "${resume#/}" ]; then + resume="\x2f${resume#/}" + fi + if [ "${resume}" != "${resume%/}" ]; then + resume="${resume%/}\x2f" + fi + IFS='/' + newresume= + for s in $resume; do + if [ -z "${newresume}" ]; then + newresume="${s}" + else + newresume="${newresume}\\x2f${s}" + fi + done + unset IFS + resume="${newresume}" + fi + esac + resume="/dev/disk/by-label/${resume}" ;; - UUID=*) +UUID=*) resume="/dev/disk/by-uuid/${resume#UUID=}" ;; esac -- cgit v1.2.3 From 8260223ae409b3ca29e27628c5c572993dbcba76 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 22 Dec 2008 09:07:42 +0000 Subject: MODULES=dep fix for Xen virtual block devices Ferenc seems to be using the xvda1=img1,xvda2=img2 scheme of Xen disks (this is what xentools gets you) rather than the whole disk with partition scheme. In the xvda1/xvda2 scheme /sys/block contains: # ls /sys/block/ ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda1 xvda2 In the whole disk scheme it contains xvda as you would expect: # ls /sys/block/ loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7 ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda I've attached a patch which takes care of this difference. [ remove largest suffix pattern, so that we don't stumble on big minors -maks ] Signed-off-by: maximilian attems --- hook-functions | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hook-functions b/hook-functions index 0ddfcec..da6ddf9 100644 --- a/hook-functions +++ b/hook-functions @@ -283,6 +283,15 @@ dep_add_modules() root=${root#/dev/} block=$(losetup -a \ | awk "/${root}/{print substr(\$3, 7, 3); exit}") + # Xen virtual device /dev/xvdX + elif [ "${root#/dev/xvd}" != "${root}" ]; then + block=${root#/dev/} + # Xen has a mode where only the individual partitions are + # registered with the kernel as well as the usual full disk + # with partition table scheme. + if [ ! -e /sys/block/${block} ] ; then + block=${block%%[0-9]*} + fi # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 21ccf36d1ff1f39cbefce34de7287cf99307c93c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Feb 2009 19:11:09 +0100 Subject: release 0.93 release string from "Fischia il vento" :) --- debian/changelog | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/debian/changelog b/debian/changelog index 85ce872..9edc37d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,59 @@ +initramfs-tools (0.93) unstable; urgency=low + + Release "Fischia il vento e infuria la bufera" + + [ maximilian attems ] + * manpages: Set Linux as necessary OS. + * initramfs-tools.8: Fix path of debug log - now kept after boot. + (closes: #488804) + * mkinitramfs: Use cp with correct DESTDIR instead of copy_exec for configs. + Fixes relative pathes for -d option. (closes: #472409) + * initramfs-tools.8: Document default 180s rootdelay. + * update-initramfs: Fix run_bootloader() to check for grub2. + (closes: #511514) + * control: Add ${misc:Depends} depends. + * nuke old lvm hook scripts. + * mkinitramfs-kpkg: deprecate it's usage. + * hook-functions: just ship old iee1394 if around. + * mkinitramfs: Post-Lenny cleanup. + * udevhelper: nuke as need for partial upgrades between etch/lenny. + * mkinitramfs: Fix new pipe construct to really work inside + "${DESTDIR}". + * thermal boot script: Don't load thermal+fan on acpi=off. (closes: #514997) + * MODULES=dep fix for minor partitions > 9. (closes: #513958) + * initramfs-tools.8: Document mkinitramfs and init env variables. + (closes: #512453) + * init: Fix boot with LABEL containting one or several '/'. Thanks to + Andres Salomon for testing. (closes: #489008) + * scripts/local-premount/resume: Fix resume with LABEL containing '/'. + + [ e2xbegqsdyt21hfc ] + * update-initramfs.8: mentions the specific conf file. + + [ Kel Modderman ] + * init: variable `break' unset before `maybe_break init' is evaluated. + (closes: #509637) + + [ Kees Cook ] + * minitramfs: find/cpio exit codes ignored while building initramfs. + (closes: #514938) + * mkinitramfs: Do not pass exit code through on pipe failure. + + [ Luke Yelavich ] + * hook-functions: Add hid_* modules, since some keyboards will not be + usable at the initramfs/busybox prompt without them. (closes: #515866) + + [ Andres Salomon ] + * allow root=mtd0 to be used; skip root checks if ROOT doesn't start + with /dev. (closes: #497133) + * initramfs-tools: Readd support for linux-2.6 make deb-pkg target. + (closes: #504551) + + [ Ian Campbell ] + * MODULES=dep fix for Xen virtual block devices. + + -- maximilian attems Wed, 18 Feb 2009 19:10:23 +0100 + initramfs-tools (0.92o) unstable; urgency=high * configure_networking: Raise ipconfig timeout to 180 seconds. -- cgit v1.2.3 From b458a270b7335b9a8b137ec0ac69b21a33bf58c3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Feb 2009 15:10:21 +0100 Subject: init: export ip root param for configure_networking() while at it cleanup the variable name that came due to legacy naming nfsopts in a very early initramfs-tools release. "The local-top/iscsi initramfs integration script uses the configure_networking function, which depends on the IPOPTS environmental variable set by the init script. However, this variable is not available, because it's not exported from init, and local-top/iscsi is not sourced but executed. Thus static IP configuration on the kernel command line is not communicated to the script." (closes: #516746) Reported-by: Ferenc Wagner --- init | 4 +++- scripts/functions | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/init b/init index ee006b5..a149c2b 100755 --- a/init +++ b/init @@ -35,6 +35,7 @@ export ROOT= export ROOTDELAY= export ROOTFLAGS= export ROOTFSTYPE= +export IP= export break= export init=/sbin/init export quiet=n @@ -117,7 +118,7 @@ for x in $(cat /proc/cmdline); do NFSROOT="${x#nfsroot=}" ;; ip=*) - IPOPTS="${x#ip=}" + IP="${x#ip=}" ;; boot=*) BOOT=${x#boot=} @@ -242,6 +243,7 @@ unset ROOTFLAGS unset ROOTFSTYPE unset ROOTDELAY unset ROOT +unset IP unset blacklist unset break unset noresume diff --git a/scripts/functions b/scripts/functions index f715e68..c024eeb 100644 --- a/scripts/functions +++ b/scripts/functions @@ -263,7 +263,7 @@ configure_networking() # support ip options see linux sources # Documentation/filesystems/nfsroot.txt - case ${IPOPTS} in + case ${IP} in none|off) # Do nothing ;; @@ -272,14 +272,14 @@ configure_networking() ipconfig -t 180 ${DEVICE} ;; dhcp|bootp|rarp|both) - ipconfig -t 180 -c ${IPOPTS} -d ${DEVICE} + ipconfig -t 180 -c ${IP} -d ${DEVICE} ;; *) - ipconfig -t 180 -d $IPOPTS + ipconfig -t 180 -d $IP # grab device entry from ip option - NEW_DEVICE=${IPOPTS#*:*:*:*:*:*} - if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then + NEW_DEVICE=${IP#*:*:*:*:*:*} + if [ "${NEW_DEVICE}" != "${IP}" ]; then NEW_DEVICE=${NEW_DEVICE%:*} else # wrong parse, possibly only a partial string -- cgit v1.2.3 From f82d8e325a61f3a9308398fd5504536a7a96610c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Feb 2009 15:12:46 +0100 Subject: initramfs-tools.8: Document exported IP kernel parameter. --- initramfs-tools.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 9ef8063..15210d5 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2009/02/17" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2009/02/23" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -491,8 +491,8 @@ correponds to the root boot option. Advanced boot scripts like cryptsetup or live-initramfs need to play tricks. Otherwise keep it alone. .TP -\fB\fI ROOTDELAY, ROOTFLAGS, ROOTFSTYPE -correponds to the rootdelay, rootflags or rootfstype boot option. +\fB\fI ROOTDELAY, ROOTFLAGS, ROOTFSTYPE, IP +correponds to the rootdelay, rootflags, rootfstype or ip boot option. .TP \fB\fI DPKG_ARCH allows arch specific boot actions. -- cgit v1.2.3 From 0a8c484f6341229054865ba8e1467c9b21e5c2a0 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Thu, 26 Feb 2009 20:38:58 -0800 Subject: mkinitramfs-kpkg misspells "deprecation" as "depreciation" mkinitramfs-kpkg outputs the following warning: Depreciation WARNING: use update-initramfs(8) "Depreciation" should be "Deprecation". (closes: #517344) Signed-off-by: maximilian attems --- mkinitramfs-kpkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs-kpkg b/mkinitramfs-kpkg index 07cbd44..6beaad5 100755 --- a/mkinitramfs-kpkg +++ b/mkinitramfs-kpkg @@ -95,7 +95,7 @@ case "${version}" in ;; esac -echo "Depreciation WARNING: use update-initramfs(8)" >&2 +echo "Deprecation WARNING: use update-initramfs(8)" >&2 # linux-image installs latest version mkinitramfs -o ${outfile} ${version} -- cgit v1.2.3 From 82eb87958a73cc50c45cad21f0450c21bdec4888 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 18:11:59 +0100 Subject: initramfs-tools.preinst: Nuke initrd-tools related migration path. initrd-tools was last shipped in etch and was sarge default. we no longer need to care about it. only came to light while grepping for ide-disk. --- debian/initramfs-tools.preinst | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 758b504..8095b88 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -30,35 +30,11 @@ case "$1" in fi fi - # Inherit initrd-tools settings if possible. - if [ -e /etc/mkinitrd/mkinitrd.conf ]; then - . /etc/mkinitrd/mkinitrd.conf - fi # write conf.d/resume if not in a chroot if [ -n "${RESUME}" ] && ! chrooted; then echo "RESUME=${RESUME}" > /etc/initramfs-tools/conf.d/resume fi - # Add initrd-tools modules, while trying to minimize prompting - if [ -e /etc/mkinitrd/modules ]; then - cp /etc/mkinitrd/modules /etc/initramfs-tools/ - sed -i \ - -e 's/\/etc\/mkinitrd\/modules: Kernel modules to load for initrd./List of modules that you want to include in your initramfs./g' \ - -e 's/mkinitrd/update-initramfs/g' \ - -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 '/^ide-generic/d' \ - -e '/^ide-disk/d' \ - -e '/^ext2/d' \ - -e '/^ext3/d' \ - /etc/initramfs-tools/modules - fi - - if [ -e /etc/mkinitrd/DSDT ]; then - cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml - fi ;; esac -- cgit v1.2.3 From 37d28de262b206d8eda37634a0bfd05062aa705b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 18:13:25 +0100 Subject: MODULES=dep: ide-disk got renamed to ide-gd_mod since 2.6.28. try to add one or the other. --- hook-functions | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hook-functions b/hook-functions index da6ddf9..038bda1 100644 --- a/hook-functions +++ b/hook-functions @@ -313,6 +313,8 @@ dep_add_modules() # catch old-style IDE if [ -e /sys/bus/ide/devices/ ]; then sys_walk_modalias ${root_dev_path} + manual_add_modules ide-gd_mod + # FIXME: remove post Squeeze manual_add_modules ide-disk manual_add_modules ide-cd fi -- cgit v1.2.3 From cbc5fd3ab5a87e142466b5f48f0646da0f4bb7df Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 18:32:14 +0100 Subject: mkinitramfs: usage() fix conffile name. woow that went unnoticed for some years now. people seem really to use update-initramfs(8). --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 038bda1..c0064e1 100644 --- a/hook-functions +++ b/hook-functions @@ -436,7 +436,7 @@ Options: -d confdir Specify an alternative configuration directory. -k Keep temporary directory used to make the image. -o outfile Write to outfile. - -r root Override ROOT setting in mkinitrd.conf. + -r root Override ROOT setting in initramfs.conf. See mkinitramfs(8) for further details. EOF -- cgit v1.2.3 From 86785b990c64d08014b735eeb588236a17bb35f4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 10 Mar 2009 21:54:05 +0100 Subject: update copyright year of my contributions --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index b473ab4..ddbb70f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -21,7 +21,7 @@ Copyright: 2005 - 2006 Adam Conrad 2006 Ben Collins 2005 - 2007 David Härdeman 2005 Jeff Bailey - 2005 - 2007 maximilian attems + 2005 - 2009 maximilian attems 2005 - 2006 Scott James Remnant License: -- cgit v1.2.3 From 97f393b68e67b602bcb33a3681551ae6fd51b680 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 12 Mar 2009 15:12:28 +0100 Subject: control: conform to latest policy without changes --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 0c359bf..5551acb 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs -Standards-Version: 3.8.0 +Standards-Version: 3.8.1 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From 227d20ec6946cb9aa2f2378bf7bae49575e24167 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Mar 2009 13:08:01 +0100 Subject: hook-functions: reword MODULES=dep error message seems confusing for users.. --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index c0064e1..353495f 100644 --- a/hook-functions +++ b/hook-functions @@ -300,7 +300,7 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "mkinitramfs: missing ${block} root ${root} /sys entry" + echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" echo "mkinitramfs: workaround is MODULES=most" echo "mkinitramfs: Error please report the bug" exit 1 -- cgit v1.2.3 From b61ca06a848dd73b57c837fb27cafde3115c9157 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Mar 2009 10:25:42 +0100 Subject: update-initramfs: set_linked_version() check if the links point to an existing initrd.img [ first test existence before link and don't use bashism -maks ] Ubuntu merge 0.92bubuntu24 --- update-initramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index b5f6f53..3235437 100755 --- a/update-initramfs +++ b/update-initramfs @@ -338,11 +338,11 @@ set_current_version() set_linked_version() { - if [ -L /initrd.img ]; then + if [ -e /initrd.img ] && [ -L /initrd.img ]; then linktarget="$(basename "$(readlink /initrd.img)")" fi - if [ -L /boot/initrd.img ]; then + if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then linktarget="$(basename "$(readlink /boot/initrd.img)")" fi -- cgit v1.2.3 From c2010deab9b936c566a543864ecd85abc36568bb Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Fri, 13 Mar 2009 16:11:49 +0000 Subject: mkinitramfs: include the modules.order file. i've made an install of new kernel on Intrepid: 2.6.27-8-generic (32 bits) and kernel.log have a warning about load order of ehci_hcd: Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after LP: #296710. --- mkinitramfs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkinitramfs b/mkinitramfs index a1d7afe..5d38f16 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -161,6 +161,12 @@ for d in bin conf/conf.d etc lib/modules sbin scripts ${MODULESDIR}; do mkdir -p "${DESTDIR}/${d}" done +# Copy the modules.order file in +if [ -f "${MODULESDIR}/modules.order" ]; then + cp -p "${MODULESDIR}/modules.order" \ + "${DESTDIR}${MODULESDIR}/modules.order" +fi + # MODULES=list case. Always honour. for x in "${CONFDIR}/modules" /usr/share/initramfs-tools/modules.d/*; do if [ -f "${x}" ]; then -- cgit v1.2.3 From 966fb31cdcae2bb9f47c9f5a1f39b37514a81b7b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 20 Mar 2009 22:33:30 +0100 Subject: hook-functions: MODULES=dep fix for mmc root update-initramfs: Generating /boot/initrd.img-2.6.26-1-versatile mkinitramfs: missing mmcblk root /dev/mmcblk0p3 /sys entry (closes: #520198) Tested-by: Paul Malishev --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index 353495f..4b69827 100644 --- a/hook-functions +++ b/hook-functions @@ -292,6 +292,10 @@ dep_add_modules() if [ ! -e /sys/block/${block} ] ; then block=${block%%[0-9]*} fi + # mmc root /dev/mmcblkXpX + elif [ "${root#/dev/mmcblk}" != "${root}" ]; then + block=${root#/dev/} + block=${block%%p[0-9]*} # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 7e3f1f2ef6477cf9ab93793d12168ee9ae8c5571 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Tue, 18 Mar 2008 11:46:44 -0400 Subject: init-top/framebuffer: ignore blacklist for forced vga= usage. DO NOT USE -Qb for framebuffer. Blank ttys when using vesafb (vga=xxx) LP: #129910 [ s/-Q/-q/ for modprobe options -maks ] --- scripts/init-top/framebuffer | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 0ed798e..c5c18b9 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -87,8 +87,9 @@ uvesafb) esac if [ -n "${FB}" ]; then - modprobe fbcon - modprobe ${FB} ${OPTS} + unset MODPROBE_OPTIONS + modprobe -q fbcon + modprobe -q ${FB} ${OPTS} fi if [ -e /proc/fb ]; then -- cgit v1.2.3 From 3002fdd76cc22f1137afeb2b8a1a45bc1e5123b7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Mar 2009 07:52:45 +0100 Subject: debian/compat: Set debhelper compatibility version 5 gets rid of lintian warning: package-uses-deprecated-debhelper-compat-version 4 --- debian/compat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/compat b/debian/compat index b8626c4..7ed6ff8 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -4 +5 -- cgit v1.2.3 From 055fa3e34ee5edda2e99aec8f265b0958475989a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 23 Mar 2009 08:04:27 +0100 Subject: release 0.93.1 new naming scheme for stable releases. no longer adding a letter, but a maintenance number. --- debian/changelog | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9edc37d..af127db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +initramfs-tools (0.93.1) unstable; urgency=low + + [ maximilian attems ] + * init: export ip root param for configure_networking(). (closes: #516746) + * initramfs-tools.8: Document exported IP kernel parameter. + * initramfs-tools.preinst: Nuke initrd-tools related migration path. + * MODULES=dep: ide-disk got renamed to ide-gd_mod since 2.6.28. + * mkinitramfs: usage() fix conffile name. + * update copyright year of my contributions. + * control: conform to latest policy without changes. + * hook-functions: reword MODULES=dep error message. + * hook-functions: MODULES=dep fix for mmc root. (closes: #520198) + * debian/compat: Set debhelper compatibility version 5. + + [ Matt Kraai ] + * mkinitramfs-kpkg misspells "deprecation" as "depreciation". + (closes: #517344) + + [ Michael Vogt ] + * update-initramfs: set_linked_version() check if the links point to + an existing initrd.img. + + [ Scott James Remnant ] + * mkinitramfs: include the modules.order file. + + [ Ben Collins ] + * init-top/framebuffer: ignore blacklist for forced vga= usage. + + -- maximilian attems Mon, 23 Mar 2009 07:55:16 +0100 + initramfs-tools (0.93) unstable; urgency=low Release "Fischia il vento e infuria la bufera" -- cgit v1.2.3 From 2a0fee1aa8aa8dabc69380f861e7d1c8d35ec5f4 Mon Sep 17 00:00:00 2001 From: François Delawarde Date: Wed, 25 Feb 2009 14:04:53 +0100 Subject: hook-functions: MODULES=dep fix for luks over cciss devices I needed to run update-initramfs w/ MODULES=dep (for some 15M BIOS size limitation w/ lilo on an HP server), turns out that I found the same bug as #507619 (please refer to it for details), except that I have a LUKS format over the cciss device. As bug #507619 describes: "dep_add_modules() expects to find a /sys/block/cciss/c0d0p file, but it should be trying /sys/block/cciss!c0d0" It also mentions: "fyi, I suspect this may also apply to old-style smart array devices, where device names are similar, but use 'ida' intead of 'cciss' - e.g. /dev/ida/c0d0p1." The following patch fixes it for me (on cciss) and should also fix it for ida devices. [ patch got checked and tested life on #debian-boot channel, see below -maks ] fixed warning: mkinitramfs: missing cciss!c0d0p2 root /dev/mapper/quakelive-root /sys entry of course, since the new value of block comes out of /sys/block/dm-${minor}/slaves, it makes sense that it would already be in sysfs syntax. Tested-by: Timothee Besset --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 4b69827..2368b8d 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,13 @@ dep_add_modules() block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ /proc/mdstat) fi - block=${block%%[0-9]*} + # luks or lvm on cciss or ida + if [ "${block#cciss}" != "${block}" ] \ + || [ "${block#ida}" != "${block}" ]; then + block="${block%p*}" + else + block=${block%%[0-9]*} + fi # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} -- cgit v1.2.3 From 198f3485f2858e882e0cc4eb449a5c471fb0b543 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 27 Mar 2009 09:59:05 +0100 Subject: hook-functions: stricter match on loaded module for firmware warning. Otherwise it likes to warn for e100 even if e1000e is in use: grep e100 /proc/modules e1000e 110896 0 - Live 0xffffffffa0028000 --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 2368b8d..d24df58 100644 --- a/hook-functions +++ b/hook-functions @@ -69,7 +69,7 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ]; then - if grep -q "^$(basename "${mam_x}" .ko)" \ + if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ "${CONFDIR}/modules"; then -- cgit v1.2.3 From d8d52f030f8efc16447cf834fabfc8923fcdf407 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 27 Mar 2009 10:35:20 +0100 Subject: hook-functions: Add firmware from versioned directories too. First see if there is a $(uname -r) versioned firmware around and if there is add it first. should make ubuntu sync easier too, as they shipp their firmware there. (closes: #521370) --- hook-functions | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index d24df58..e549c81 100644 --- a/hook-functions +++ b/hook-functions @@ -62,13 +62,15 @@ manual_add_modules() continue fi for firmware in $firmwares; do - if [ -e "${DESTDIR}/lib/firmware/${firmware}" ]; then + if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \ + || [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then continue fi # Only print warning for missing fw of loaded module # or forced loaded module - if [ ! -e "/lib/firmware/${firmware}" ]; then + if [ ! -e "/lib/firmware/${firmware}" ] \ + && [ ! -e "/lib/firmware/${version}/${firmware}" ]; then if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ @@ -83,7 +85,11 @@ manual_add_modules() copy_exec /lib/udev/firmware.agent fi - copy_exec "/lib/firmware/${firmware}" + if [ -e "/lib/firmware/${version}/${firmware}" ]; then + copy_exec "/lib/firmware/${version}/${firmware}" + else + copy_exec "/lib/firmware/${firmware}" + fi if [ "${verbose}" = "y" ]; then echo "Adding firmware ${firmware}" fi -- cgit v1.2.3 From f40e826287d2776094f48302c196652f2ba8326b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 29 Mar 2009 23:58:08 +0200 Subject: hook-functions: MODULES=most add all fb modules per default "with kernel mode setting, i'd imagine that including framebuffer drivers becomes even more important, too" -dilinger this is basedon a patch by Maik Zumstrull , but instead of hardcoding a list just copy over all fb from the relevant driver directory. first part of #416063. --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index e549c81..368924d 100644 --- a/hook-functions +++ b/hook-functions @@ -388,6 +388,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + fb) + copy_modules_dir kernel/drivers/video + ;; ide) copy_modules_dir kernel/drivers/ide ;; @@ -429,6 +432,7 @@ auto_add_modules() *) auto_add_modules base auto_add_modules net + auto_add_modules fb auto_add_modules ide auto_add_modules scsi auto_add_modules block -- cgit v1.2.3 From ff34476ecd5de0da1104b13e6b42e6cc9eff8792 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 00:13:39 +0200 Subject: update-initramfs: Cleanup run_bootloader() rework it's logic, instead of 2 nested top ifs use one if with 2 "&&" connected checks. gets us rid of one nested level. simplify codeflow inside too as bonus. make clear why mbr_check() is run. --- update-initramfs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/update-initramfs b/update-initramfs index 3235437..2eed8cb 100755 --- a/update-initramfs +++ b/update-initramfs @@ -233,23 +233,22 @@ mbr_check() run_bootloader() { # if both lilo and grub around, figure out if lilo needs to be run - if [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \ - || [ -e /boot/grub/grub.cfg ]; then - if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then - [ -r "${KPKGCONF}" ] && \ - do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") - if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ - || [ "${do_b}" = "YES" ]; then - run_lilo - return 0 - elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ - || [ "${do_b}" = "NO" ]; then - return 0 - else - mbr_check - return 0 - fi + if ( [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \ + || [ -e /boot/grub/grub.cfg ] ) \ + && ( [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ] ); then + [ -r "${KPKGCONF}" ] && \ + do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") + if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ + || [ "${do_b}" = "YES" ]; then + run_lilo + return 0 + elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ + || [ "${do_b}" = "NO" ]; then + return 0 fi + + # do_bootloader unconfigured + mbr_check return 0 fi if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then -- cgit v1.2.3 From 89257a84d0bfcd46d5514c65245b7b3f57f67ddf Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 00:23:54 +0200 Subject: update-initramfs: mbr_check() use /boot/grub/grub.cfg for grub2 search. only comes into play if lilo is installed too and usage is not configured by do_bootloader in /etc/kernel-img.conf. (closes: #427509) --- update-initramfs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index 2eed8cb..8c085a5 100755 --- a/update-initramfs +++ b/update-initramfs @@ -187,8 +187,10 @@ run_lilo() # check if lilo is on mbr mbr_check() { - # try to discover grub and be happy - # FIXME: check grub2 /boot/grub/grub.cfg + # try to discover grub|grub2 and be happy + [ -r /boot/grub/grub.cfg ] \ + && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \ + /boot/grub/grub.cfg) [ -r /boot/grub/menu.lst ] \ && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ /boot/grub/menu.lst) -- cgit v1.2.3 From ac6626f75f60e3d765985043b546247e50265d39 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 00:54:34 +0200 Subject: update-initramfs: Run update on highest version instead of /initrd.img link "Ah. there were symlinks in / - tho they were never ever used on this system. Seems pretty broken to rely on symlinks that might (and are) years out of date." Reported-by: Peter Palfrader so no longer rely on this links like since 0.65, but use the "latest" according the dpkg higher heuristic check. that should make people more happy! also the symlinks should be phased out, only fallback to them if set_highest_version() finds nothing. (closes: #493863) --- update-initramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index 8c085a5..ad65ef2 100755 --- a/update-initramfs +++ b/update-initramfs @@ -390,11 +390,11 @@ update() fi if [ -z "${version}" ]; then - set_linked_version + set_highest_version fi if [ -z "${version}" ]; then - set_highest_version + set_linked_version fi if [ -z "${version}" ]; then -- cgit v1.2.3 From e0dd249ede887d762b691e90abdc3dfe4ca5ed1f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 11:48:26 +0200 Subject: hook-functions: MODULES=most fb add all available agp modules this was proposed in patch on #416063 by Maik Zumstrull but don't hardcode the list, just add all build ones: ls /lib/modules/2.6.29-1-amd64/kernel/drivers/char/agp/ intel-agp.ko sis-agp.ko via-agp.ko --- hook-functions | 1 + 1 file changed, 1 insertion(+) diff --git a/hook-functions b/hook-functions index 368924d..b869ce6 100644 --- a/hook-functions +++ b/hook-functions @@ -390,6 +390,7 @@ auto_add_modules() ;; fb) copy_modules_dir kernel/drivers/video + copy_modules_dir kernel/drivers/char/agp ;; ide) copy_modules_dir kernel/drivers/ide -- cgit v1.2.3 From 0cdf39d601750d25e7db39d32a6e654026f001df Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 30 Mar 2009 18:29:05 +0200 Subject: update-initramfs: Fix error message on wrong -k version argument update-initramfs -k $(uname -a) -t -u You must specify at least one of -c, -u, or -d. [..] which is wrong as -u was reported. Reported-by: Michael Prokop --- update-initramfs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/update-initramfs b/update-initramfs index ad65ef2..be0616a 100755 --- a/update-initramfs +++ b/update-initramfs @@ -504,6 +504,13 @@ while getopts "k:cudyvtb:h?" flag; do esac done +shift $((${OPTIND} - 1)) + +if [ $# -ne 0 ]; then + echo "Invalid argument for option -k." + usage +fi + # Validate arguments if [ -z "${mode}" ]; then usage "You must specify at least one of -c, -u, or -d." -- cgit v1.2.3 From e184c8c2a9ad4520cf0cf4536301c6ae6206e911 Mon Sep 17 00:00:00 2001 From: Maik Zumstrull Date: Sat, 24 Mar 2007 23:48:16 +0100 Subject: init-top/framebuffer: Load intel-agp for intelfb After further experimentation, I discovered additional problems that my first patch did not address, namely that 1) Some FB drivers need the AGP subsystem up and running before they are loaded and 2) intelfb needs intel-agp.ko, but does not have a dependency on it. intelfb does not actually *work* on my testsystem after this (it crashes), but unlike with plain initramfs-tools, it loads (and prints something useful if loaded with the probeonly option). I'll try to find out why it fails to work tomorrow; it's probably an unrelated issue. [ make the patch applyable, probably whitespace damaged, fix comments, no need to pass -q to modprobe that is set globaly -maks ] (closes: #416063, #455876) Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index c5c18b9..37456ae 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -72,11 +72,15 @@ for x in $(cat /proc/cmdline); do esac done -# Map command line name to module name and other tweaks +# Module-specific workarounds case ${FB} in matroxfb) + # Map command line name to module name FB=matroxfb_base ;; +intelfb|i810fb) + # Needs AGP driver loaded + modprobe intel-agp uvesafb) # v86d requires /dev/zero and dev/mem, but udev haven't been started yet [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 -- 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(+) 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 f3049298fec182252dc76c75202454bb324bc682 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Apr 2009 01:54:46 +0200 Subject: init-top/framebuffer: syntax fix. fix wrong merge of e184c8c2a9ad4520cf0cf4536301c6ae6206e911 scripts/init-top/framebuffer: 84: Syntax error: ")" unexpected (expecting ";;") --- scripts/init-top/framebuffer | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 37456ae..e0028f7 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -81,6 +81,7 @@ matroxfb) intelfb|i810fb) # Needs AGP driver loaded modprobe intel-agp + ;; uvesafb) # v86d requires /dev/zero and dev/mem, but udev haven't been started yet [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 -- cgit v1.2.3 From 97f26c6e0d61a4ff700b8f79c61a41320f317e2e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Apr 2009 12:41:17 +0200 Subject: mkinitramfs: Allow dots in boot and script filenames. the regex was overly severe not allowing dots althoug they are useful as word ending. based on a patch in launchpad, that didn't get all occurences right, but was a good start. (LP: #305837) --- mkinitramfs | 4 ++-- scripts/functions | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 5d38f16..8f8e428 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -208,14 +208,14 @@ cp -p /usr/share/initramfs-tools/init ${DESTDIR}/init # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ - -regextype posix-extended -regex '.*/[[:alnum:]_]+$' -type f); do + -regextype posix-extended -regex '.*/[[:alnum:]_.]+$' -type f); do [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" cp -p "/usr/share/initramfs-tools/scripts/${b}" \ "${DESTDIR}/scripts/$(dirname "${b}")/" done for b in $(cd "${CONFDIR}/scripts" && find . \ - -regextype posix-extended -regex '.*/[[:alnum:]_]+$' -type f); do + -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}")/" diff --git a/scripts/functions b/scripts/functions index c024eeb..b813529 100644 --- a/scripts/functions +++ b/scripts/functions @@ -74,7 +74,7 @@ set_initlist() # only allow variable name chars case ${si_x#${initdir}/} in - *[![:alnum:]_]*) + *[![:alnum:]_.]*) [ "${verbose}" = "y" ] \ && echo "$si_x ignored: not alphanumeric or '_' file" continue @@ -106,7 +106,7 @@ reduce_satisfied() for rs_y in ${deplist}; do # only allow variable name chars case ${rs_y} in - *[![:alnum:]_]*) + *[![:alnum:]_.]*) continue ;; esac -- cgit v1.2.3 From e939f98f684326ddc06d54fe0379c552fb94010f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Apr 2009 12:56:06 +0200 Subject: release 0.93.2 --- debian/changelog | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/debian/changelog b/debian/changelog index af127db..46de96f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +initramfs-tools (0.93.2) unstable; urgency=low + + [ François Delawarde ] + * hook-functions: MODULES=dep fix for luks over cciss devices. + (closes: #517072, #522030) + + [ maximilian attems ] + * hook-functions: stricter match on loaded module for firmware + warning. + * hook-functions: Add first firmware from $(uname -r) versioned + directories. (closes: #521370) + * hook-functions: MODULES=most add all fb modules per default. + * update-initramfs: Cleanup run_bootloader() + * update-initramfs: mbr_check() use /boot/grub/grub.cfg for grub2 + search. (closes: #427509) + * update-initramfs: Run update on highest version instead of + /initrd.img link. (closes: #493863) + * hook-functions: MODULES=most fb add all available agp modules. + * update-initramfs: Fix error message on wrong -k version argument. + * hooks/thermal: Prevent inclusion of windfarm modules on PS3. + * mkinitramfs: Allow dots in boot and script filenames. + + [ Maik Zumstrull ] + * init-top/framebuffer: Load intel-agp for intelfb. + (closes: #416063, #455876) + + -- maximilian attems Thu, 02 Apr 2009 12:44:33 +0200 + initramfs-tools (0.93.1) unstable; urgency=low [ maximilian attems ] -- cgit v1.2.3 From d703b8ca26ac5230d7ffeae1891334791d8dab31 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 3 Apr 2009 14:48:44 +0200 Subject: cleanup LABEL handling code make it more concise: * use POSIX ${parameter:+word} * replace *[/]*) by just */*) * test exit code of command -v rather then running test -x on it while we are at it fix another command -v usage in scripts/functions. Reviewed-by: Colin Watson Signed-off-by: maximilian attems --- init | 10 +++------- scripts/functions | 2 +- scripts/local-premount/resume | 10 +++------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/init b/init index a149c2b..e8c97a5 100755 --- a/init +++ b/init @@ -67,8 +67,8 @@ for x in $(cat /proc/cmdline); do # support any / in LABEL= path (escape to \x2f) case "${ROOT}" in - *[/]*) - if [ -x "$(command -v sed)" ]; then + */*) + if command -v sed >/dev/null 2>&1; then ROOT="$(echo ${ROOT} | sed 's,/,\\x2f,g')" else if [ "${ROOT}" != "${ROOT#/}" ]; then @@ -80,11 +80,7 @@ for x in $(cat /proc/cmdline); do IFS='/' newroot= for s in $ROOT; do - if [ -z "${newroot}" ]; then - newroot="${s}" - else - newroot="${newroot}\\x2f${s}" - fi + newroot="${newroot:+${newroot}\\x2f}${s}" done unset IFS ROOT="${newroot}" diff --git a/scripts/functions b/scripts/functions index b813529..77de8f3 100644 --- a/scripts/functions +++ b/scripts/functions @@ -304,6 +304,6 @@ configure_networking() # Wait for queued kernel/udev events wait_for_udev() { - [ -x "$(command -v udevadm)" ] || return 0 + command -v udevadm >/dev/null 2>&1 || return 0 udevadm settle ${1:+--timeout=$1} } diff --git a/scripts/local-premount/resume b/scripts/local-premount/resume index b2b0e1d..11acfc7 100755 --- a/scripts/local-premount/resume +++ b/scripts/local-premount/resume @@ -25,8 +25,8 @@ LABEL=*) # support any / in LABEL= path (escape to \x2f) case "${resume}" in - *[/]*) - if [ -x "$(command -v sed)" ]; then + */*) + if command -v sed >/dev/null 2>&1; then resume="$(echo ${resume} | sed 's,/,\\x2f,g')" else if [ "${resume}" != "${resume#/}" ]; then @@ -38,11 +38,7 @@ LABEL=*) IFS='/' newresume= for s in $resume; do - if [ -z "${newresume}" ]; then - newresume="${s}" - else - newresume="${newresume}\\x2f${s}" - fi + newresume="${newresume:+${newresume}\\x2f}${s}" done unset IFS resume="${newresume}" -- cgit v1.2.3 From 41562f3293b34b3d543d6a90f6d4e12264a67022 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 3 Apr 2009 14:58:41 +0200 Subject: update-initramfs: Text exit code of command -v too. same simplification. Signed-off-by: maximilian attems --- update-initramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index be0616a..7e5337f 100755 --- a/update-initramfs +++ b/update-initramfs @@ -235,8 +235,8 @@ mbr_check() run_bootloader() { # if both lilo and grub around, figure out if lilo needs to be run - if ( [ -x "$(command -v update-grub)" ] || [ -e /boot/grub/menu.lst ] \ - || [ -e /boot/grub/grub.cfg ] ) \ + if ( command -v update-grub >/dev/null 2>&1 \ + || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \ && ( [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ] ); then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") -- cgit v1.2.3 From 652423c6f5b636f95899254aba213d417caff158 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 13 Apr 2009 23:10:28 +0200 Subject: hook-functions: Add i915 module for kms. people still need to enable kernel mode setting, but the module should be on the initramfs by default. currently no other drm module supports kms yet. Reported-by: Yves-Alexis Perez Signed-off-by: maximilian attems --- hook-functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hook-functions b/hook-functions index b869ce6..96c61bf 100644 --- a/hook-functions +++ b/hook-functions @@ -389,6 +389,9 @@ auto_add_modules() done ;; fb) + for x in i915; do + manual_add_modules "${x}" + done copy_modules_dir kernel/drivers/video copy_modules_dir kernel/drivers/char/agp ;; -- cgit v1.2.3 From 409aa55645953add7c38721432a374cbd7c4b3be Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 18 Apr 2009 17:56:52 +0200 Subject: update-initramfs: Pass version to flash-kernel allows handling of different subarches. (closes: #523711) Reported-by: Martin Michlmayr Signed-off-by: maximilian attems --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index 7e5337f..90a7eda 100755 --- a/update-initramfs +++ b/update-initramfs @@ -265,7 +265,7 @@ run_bootloader() zipl fi if flash-kernel --supported >/dev/null 2>&1; then - flash-kernel + flash-kernel ${version} fi } -- cgit v1.2.3 From ceb549235df16f54d4ec6ef2a6c7c50ade751884 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Apr 2009 14:50:27 +0200 Subject: update-initramfs: Don't hardcode path for lilo or elilo. elilo seems to be installed in /usr/sbin/ and thus wasn't run. (closes: #524928) Reported-by: dann frazier Signed-off-by: maximilian attems --- update-initramfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 90a7eda..29941f3 100755 --- a/update-initramfs +++ b/update-initramfs @@ -237,7 +237,7 @@ run_bootloader() # if both lilo and grub around, figure out if lilo needs to be run if ( command -v update-grub >/dev/null 2>&1 \ || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \ - && ( [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ] ); then + && ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ @@ -253,11 +253,11 @@ run_bootloader() mbr_check return 0 fi - if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then + if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then run_lilo return 0 fi - if [ -x /sbin/elilo ]; then + if command -v elilo >/dev/null 2>&1; then elilo return 0 fi -- cgit v1.2.3 From 4cf1ab73b5a1abdfb2fe37862b345976c8507dd1 Mon Sep 17 00:00:00 2001 From: Loic Minier Date: Tue, 14 Apr 2009 11:11:52 +0200 Subject: copy_exec: also avoid picking sse2, neon, and vfp hwcaps libs. merge 0.92bubuntu29 Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index 96c61bf..295bce8 100644 --- a/hook-functions +++ b/hook-functions @@ -152,8 +152,9 @@ copy_exec() { s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do # Try to use non-optimised libraries where possible. - # We assume that all HWCAP libraries will be in tls. - nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\).*/\(lib.*\)#/lib/\2#') + # We assume that all HWCAP libraries will be in tls, + # sse2, vfp or neon. + nonoptlib=$(echo "${x}" | sed -e 's#/lib/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\2#') if [ -e "${nonoptlib}" ]; then x="${nonoptlib}" -- cgit v1.2.3 From 2d23dd1950e24ec6b64ae2405464a89b82e4cca5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Apr 2009 22:47:30 +0200 Subject: hook-functions: MODULES=dep error out if sysfs not mounted on /sys. currently we fail sylently later, make it explicit. (closes: #524179) Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hook-functions b/hook-functions index 295bce8..780812a 100644 --- a/hook-functions +++ b/hook-functions @@ -229,6 +229,12 @@ dep_add_modules() { local block minor root FSTYPE root_dev_path x + # require mounted sysfs + if [ ! -d /sys/kernel/ ]; then + echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" + exit 1 + fi + # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ "${root}" = "/dev/root" ] ; then -- cgit v1.2.3 From 88462fef31e21ec066c9e71f09310b6320b135c0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 23 Apr 2009 11:25:34 +0200 Subject: debian/control: No longer mention EVMS in long description. evms seems dead, so no longer list it explicitly. Signed-off-by: maximilian attems --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 5551acb..72af0d2 100644 --- a/debian/control +++ b/debian/control @@ -18,6 +18,6 @@ Description: tools for generating an initramfs Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the kernel unpacks that archive into RAM, mounts and uses it as initial root file system. The mounting of the real root file system occurs in early user space. - klibc provides utilities to setup root. Having the root on EVMS, MD, LVM2, - LUKS or NFS is also supported. + klibc provides utilities to setup root. Having the root on MD, LVM2, LUKS or + NFS is also supported. Any boot loader with initrd support is able to load an initramfs archive. -- cgit v1.2.3 From 2fd44e5b137544829e6d1f7586519e8a92459ba7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 11 May 2009 08:54:35 +0200 Subject: hook-functions: MODULES=most fix old typo s/smc911x/smc91x/ commit 8761821795732a9755d673e92fb45ac9202270df had the error. (closes: #528094) --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 780812a..38b24e9 100644 --- a/hook-functions +++ b/hook-functions @@ -388,7 +388,7 @@ auto_add_modules() hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ pcnet32 qla3xxx \ - r8169 s2io sfc sis900 skge sky2 slhc smc911x starfire \ + r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ tulip typhoon via-rhine via-velocity winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do -- cgit v1.2.3 From 5fb8d7c356206b72c99c967ab7dde56c69393678 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 18 May 2009 14:00:01 +0200 Subject: mkinitramfs: Invoke dpkg --print-architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: > Running update-initramfs. > update-initramfs: Generating /boot/initrd.img-2.6.29-2-amd64 > dpkg : avertissement : obsolete option > '--print-installation-architecture', please use '--print-architecture' > instead. > dpkg : avertissement : obsolete option > '--print-installation-architecture', please use '--print-architecture' > instead. While we are it nuke duplicate invocation, since DPKG_ARCH is an exported variable anyway. (closes: #529222) Reported-by: Raphaël Hertzog Signed-off-by: maximilian attems --- hook-functions | 1 - mkinitramfs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index 38b24e9..6b2e3e4 100644 --- a/hook-functions +++ b/hook-functions @@ -483,7 +483,6 @@ check_minkver() curversion="${1}" initdir="${2}" if [ -z "${initdir}" ]; then - DPKG_ARCH=$(dpkg --print-installation-architecture) case ${DPKG_ARCH} in ia64|hppa) minversion="2.6.15" diff --git a/mkinitramfs b/mkinitramfs index 8f8e428..19972fb 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -141,7 +141,7 @@ fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 -DPKG_ARCH=`dpkg --print-installation-architecture` +DPKG_ARCH=`dpkg --print-architecture` # Export environment for hook scripts. # -- cgit v1.2.3 From ff0a5931a35066a1b31591a0457d0847536d6cea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 3 Jun 2009 17:10:58 +0200 Subject: nuke useless old file leftover from old bzr import. Reported-by: Michael Prokop Signed-off-by: maximilian attems --- .bzrignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .bzrignore diff --git a/.bzrignore b/.bzrignore deleted file mode 100644 index 9e5fa19..0000000 --- a/.bzrignore +++ /dev/null @@ -1,2 +0,0 @@ -debian/files -debian/initramfs-tools -- cgit v1.2.3 From ce5f54d97daa77a150a8539dc971e1830e21feb5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 10 Jun 2009 16:04:25 +0200 Subject: release 0.93.3 too many small fixes piled up to hold back even more.. --- debian/changelog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 46de96f..eb9da0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +initramfs-tools (0.93.3) unstable; urgency=low + + [ maximilian attems ] + * cleanup LABEL handling code. + * update-initramfs: Use exit code of command -v too. + * hook-functions: Add i915 module for kms. + * update-initramfs: Pass version to flash-kernel. (closes: #523711) + * update-initramfs: Don't hardcode path for lilo or elilo. (closes: #524928) + * hook-functions: MODULES=dep error out if sysfs not mounted on /sys. + (closes: #524179) + * debian/control: No longer mention EVMS in long description. + * hook-functions: MODULES=most fix old typo s/smc911x/smc91x/. + (closes: #528094) + * mkinitramfs: Invoke dpkg --print-architecture. (closes: #529222) + + [ Loic Minier ] + * copy_exec: also avoid picking sse2, neon, and vfp hwcaps libs. + + -- maximilian attems Tue, 21 Apr 2009 15:05:40 +0200 + initramfs-tools (0.93.2) unstable; urgency=low [ François Delawarde ] -- cgit v1.2.3 From 4a4dda7aff43b9fdb52633c1af877fa69884fc33 Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Mon, 15 Jun 2009 19:14:00 -0400 Subject: scripts/init-top/framebuffer: i915 needs intel-agp too The i915 DRM module doubles as a framebuffer of sorts, at least in kernel mode-setting setups; like its cousins intelfb and i810fb, it effectively requires intel-agp despite not actually using any of its symbols. As such, could you please arrange for scripts/init-top/framebuffer to give it the same treatment, per the following patch?: (closes: #533258) Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index e0028f7..678ffdf 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -78,7 +78,7 @@ matroxfb) # Map command line name to module name FB=matroxfb_base ;; -intelfb|i810fb) +intelfb|i810fb|i915) # Needs AGP driver loaded modprobe intel-agp ;; -- cgit v1.2.3 From 3eb5ad8d680f54dadb64994ec2c2e481c06211d2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 00:39:52 +0200 Subject: preinst: Don't hardcode vol_id cmd use command instead of hardcoded path, fixes lintian error: command-with-path-in-maintainer-script Signed-off-by: maximilian attems --- debian/initramfs-tools.preinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 8095b88..bb58684 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -20,8 +20,8 @@ case "$1" in # First time install. Can we autodetect the RESUME partition? if [ -r /proc/swaps ]; then RESUME=$(tail -n $(($(wc -l /proc/swaps | awk ' { print $1 } ') - 1)) /proc/swaps | sort -rk3 | head -n 1 | awk ' { print $1 } ') - if [ -x /sbin/vol_id ]; then - UUID=$(/sbin/vol_id -u "$RESUME" || true) + if command -v vol_id >/dev/null 2>&1; then + UUID=$(vol_id -u "$RESUME" || true) elif [ -x /lib/udev/vol_id ]; then UUID=$(/lib/udev/vol_id -u "$RESUME" || true) fi -- cgit v1.2.3 From bd65d247774c095479fe61f196e6273f0f30b6ce Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 00:43:01 +0200 Subject: initramfs-tools.8: Convert hyphen to minus sign fixes lintian error: hyphen-used-as-minus-sign --- initramfs-tools.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 15210d5..f5bbc2d 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2009/02/23" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2009/06/23" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -234,7 +234,7 @@ mkinitramfs sets several variables for the hook scripts environment. corresponds to the linux-2.6 modules dir. .TP \fB\fI version -is the $(uname -r) linux-2.6 version against mkinitramfs is run. +is the $(uname \-r) linux-2.6 version against mkinitramfs is run. .TP \fB\fI CONFDIR is the path of the used initramfs-tools configurations. -- cgit v1.2.3 From dbb23dbcf3eba81af78ecb546c86c9f94a18622e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 00:45:00 +0200 Subject: control: bump versioned dep on debhelper fixes lintian warning: package-lacks-versioned-build-depends-on-debhelper * 5 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 72af0d2..1cec19c 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: utils Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team -Build-Depends: debhelper (>= 4.1.0), cdbs +Build-Depends: debhelper (>= 5.0), cdbs Standards-Version: 3.8.1 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From 71ef55e707383818e7a4fe09f02ead7e63dd0d88 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 11:53:32 +0200 Subject: control: bump standards version without changes. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 1cec19c..17827ba 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 5.0), cdbs -Standards-Version: 3.8.1 +Standards-Version: 3.8.2 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From dd16e2d08faed5bc36616c62f9275f5c03527fd1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Jun 2009 14:09:40 +0200 Subject: hook-functions: Fix loading of entries without newline in /etc/i-t/modules don't use the overcomplicated sed to add a newline to really strip it, just use the simple /etc/init.d/module-init-tools parsing that should be well enough tested. ;) (closes: #532745) Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index 6b2e3e4..f0b310f 100644 --- a/hook-functions +++ b/hook-functions @@ -33,8 +33,9 @@ add_modules_from_file() return fi - sed -e '/^#/d' ${1} | while read module rest; do - force_load "${module}" "${rest}" + grep '^[^#]' ${1} | while read module args; do + [ -n "$module" ] || continue + force_load "${module}" "${args}" done } -- cgit v1.2.3 From f3802469d03140190f824d6ef93513612f300a97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Jun 2009 20:28:55 +0200 Subject: MODULES=most: Add virtio_net to initramfs. allows boot via PXE in a KVM virtualiziation environment. (closes: #533894) Reported-by: Michael Prokop Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index f0b310f..6925e4a 100644 --- a/hook-functions +++ b/hook-functions @@ -391,7 +391,7 @@ auto_add_modules() pcnet32 qla3xxx \ r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ - tulip typhoon via-rhine via-velocity winbond-840 \ + tulip typhoon via-rhine via-velocity virtio_net winbond-840 \ xircom_cb xircom_tulip_cb yellowfin; do manual_add_modules "${x}" done -- cgit v1.2.3 From ddf09adbf2f2710e62b4a1eedfad213ce6e908e7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 14:58:09 +0200 Subject: release 0.93.4 last of this line, we need to work on bootspeed. --- debian/changelog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index eb9da0c..b0575f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +initramfs-tools (0.93.4) unstable; urgency=medium + + [ Aaron M. Ucko ] + * scripts/init-top/framebuffer: i915 needs intel-agp too. (closes: #533258) + + [ maximilian attems ] + * preinst: Don't hardcode vol_id cmd. + * initramfs-tools.8: Convert hyphen to minus sign. + * control: bump versioned dep on debhelper. + * control: bump standards version without changes. + * hook-functions: Fix loading of entries without newline in + /etc/initramfs-tools/modules. (closes: #532745) + * MODULES=most: Add virtio_net to initramfs. (closes: #533894) + + -- maximilian attems Wed, 29 Jul 2009 14:55:04 +0200 + initramfs-tools (0.93.3) unstable; urgency=low [ maximilian attems ] -- 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 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 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 0d74255b03b80bf8102d007feb86a941ecc35ed0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:27:19 +0200 Subject: Redefinde MODULES=most to not carry any fb driver per default. this allows for a much smaller initramfs and thus faster boot. Signed-off-by: maximilian attems --- conf/initramfs.conf | 2 +- hook-functions | 8 -------- initramfs.conf.5 | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index a2bd8db..23dd249 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -8,7 +8,7 @@ # # MODULES: [ most | netboot | dep | list ] # -# most - Add all framebuffer, acpi, filesystem, and harddrive drivers. +# most - Add most filesystem and all harddrive drivers. # # dep - Try and guess which modules to load. # diff --git a/hook-functions b/hook-functions index 6925e4a..03e9723 100644 --- a/hook-functions +++ b/hook-functions @@ -396,13 +396,6 @@ auto_add_modules() manual_add_modules "${x}" done ;; - fb) - for x in i915; do - manual_add_modules "${x}" - done - copy_modules_dir kernel/drivers/video - copy_modules_dir kernel/drivers/char/agp - ;; ide) copy_modules_dir kernel/drivers/ide ;; @@ -444,7 +437,6 @@ auto_add_modules() *) auto_add_modules base auto_add_modules net - auto_add_modules fb auto_add_modules ide auto_add_modules scsi auto_add_modules block diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 6f6ee06..5fa6f87 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -24,7 +24,7 @@ directly. Specifies the modules for the initramfs image. The default setting is \fImost\fP. -\fImost\fP adds all the framebuffer, acpi, file system, ide, sata, scsi and usb drivers. +\fImost\fP adds most file system, all ide, sata, scsi and usb drivers. \fIdep\fP tries to guess which modules are necessary for the running box. -- cgit v1.2.3 From 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 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 db24ed6ec7887631c05ce0d51c53c8c2cb9c507a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:46:48 +0200 Subject: nuke framebuffer boot script fb should be loaded after initramfs by init to have a beautiful userland. allows faster boot not to try parsing crazy things with only posix sh at our hands. this will need a README.DEBIAN section as noone is now currently loading fbcon. Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 108 ------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100755 scripts/init-top/framebuffer diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer deleted file mode 100755 index 678ffdf..0000000 --- a/scripts/init-top/framebuffer +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -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 " - # In the ":" form - elif [ "${opt}" != "${opt#*:}" ]; then - echo -n "${opt%:*}=${opt#*:} " - # Presumably a modevalue without the "mode=" prefix - elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then - echo -n "mode=$opt " - # Presumably a boolean - else - echo -n "${opt}=1 " - fi - done -} - -FB="" -OPTS="" - -for x in $(cat /proc/cmdline); do - case ${x} in - vga=*) - FB="vesafb"; - OPTS=""; - ;; - video=*) - FB=${x#*=} - FB="${FB%%:*}" - OPTS="$(parse_video_opts "${x}")" - esac -done - -# Module-specific workarounds -case ${FB} in -matroxfb) - # Map command line name to module name - FB=matroxfb_base - ;; -intelfb|i810fb|i915) - # Needs AGP driver loaded - modprobe intel-agp - ;; -uvesafb) - # v86d requires /dev/zero and dev/mem, but udev haven't been started yet - [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 - [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 - ;; -*) - ;; -esac - -if [ -n "${FB}" ]; then - unset MODPROBE_OPTIONS - modprobe -q fbcon - modprobe -q ${FB} ${OPTS} -fi - -if [ -e /proc/fb ]; then - while read fbno desc; do - if [ $(($fbno < 32)) ]; then - mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} - fi - done < /proc/fb -else - mknod -m 0640 /dev/fb0 c 29 0 -fi -- cgit v1.2.3 From 757294f86013711d94d14a674f8c13aa0e17dee6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:10:11 +0200 Subject: Revert "hook-functions: Add hid_* modules." don't support any possible usb keyboard under earth, the usbhid is default the rest should be added by the appropriate sysadmin. revert this ubuntu sync for smaller initramfs and thus faster boot. This reverts commit 7d28901223a8f5fa47ddb0b0d39b34b04d43b8e9. Signed-off-by: maximilian attems --- hook-functions | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hook-functions b/hook-functions index 03e9723..bad79e1 100644 --- a/hook-functions +++ b/hook-functions @@ -371,11 +371,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \ - hid_apple hid_belkin hid_bright hid_cherry hid_chicony \ - hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \ - hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \ - hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 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 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 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 e0881b38724dffac0dcce1aad447c23ef571a374 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:59:13 +0200 Subject: mkinitramfs fix comment --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index f4f122c..13573b2 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -232,7 +232,7 @@ if [ -n "${ROOT}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi -# Modutils +# module-init-tools copy_exec /sbin/modprobe /sbin copy_exec /sbin/depmod /sbin copy_exec /sbin/rmmod /sbin -- cgit v1.2.3 From 39252ef3dcec3041db9e4b60b7f13ba75115e764 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 8 Aug 2009 13:52:23 +0200 Subject: hook-functions: Fix mounted /sys check for openvz container. ls -l /sys total 0 drwxr-xr-x 5 root root 0 2009-08-08 11:53 class drwxr-xr-x 2 root root 0 2009-08-08 11:53 devices --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index bad79e1..387fe60 100644 --- a/hook-functions +++ b/hook-functions @@ -231,7 +231,7 @@ dep_add_modules() local block minor root FSTYPE root_dev_path x # require mounted sysfs - if [ ! -d /sys/kernel/ ]; then + if [ ! -d /sys/devices/ ]; then echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" exit 1 fi -- cgit v1.2.3 From 2815ac37b586de638ed5db82dc38a292587664cc Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 21 Sep 2009 18:24:11 +0200 Subject: initramfs-tools.8: fix boot example script to execute scripts/functions example boot script needs it for log_begin_msg and log_end_msg functions. (closes: #545728) Reported-by: Rodolphe Pelloux-Prayer Signed-off-by: maximilian attems --- initramfs-tools.8 | 1 + 1 file changed, 1 insertion(+) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index f5bbc2d..144b89a 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -465,6 +465,7 @@ prereqs) ;; esac +\fR. /usr/share/initramfs-tools/hook-functions # Begin real processing below this line if [ ! \-x "/sbin/frobnicate" ]; then panic "Frobnication executable not found" -- cgit v1.2.3 From 5bbb92c9bfa7f109a8ed10f1a815e974cb0db01a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Sep 2009 01:54:15 +0200 Subject: fix out-of-date-standards-version --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 17827ba..69b51b0 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 5.0), cdbs -Standards-Version: 3.8.2 +Standards-Version: 3.8.3 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From 919c099e12308729a9a6bc141eab1f05532c93f8 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 16 Aug 2009 21:08:40 +0200 Subject: blacklist boot hook write to /etc/modprobe.d/initramfs.conf Newer modprobe will only look at .conf files. (closes: #541864) Signed-off-by: maximilian attems --- scripts/init-premount/blacklist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist index 1dd9dbc..2164906 100755 --- a/scripts/init-premount/blacklist +++ b/scripts/init-premount/blacklist @@ -21,5 +21,5 @@ esac # write blacklist to modprobe.d IFS=',' for b in ${blacklist}; do - echo "blacklist $b" >> /etc/modprobe.d/initramfs + echo "blacklist $b" >> /etc/modprobe.d/initramfs.conf done -- cgit v1.2.3 From 072ad3179c526b90b57719e127de851182b04c4c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Sep 2009 02:34:14 +0200 Subject: /etc/kernel hook script support newer kernel-package k-p no longer generates initramfs by itself, so do it for it. (closes: #523735) --- kernel/postinst.d/initramfs-tools | 25 +++++++++++++++++++++---- kernel/postrm.d/initramfs-tools | 25 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools index 1cb72a8..b389921 100755 --- a/kernel/postinst.d/initramfs-tools +++ b/kernel/postinst.d/initramfs-tools @@ -1,10 +1,27 @@ #!/bin/sh +version="$1" +bootopt="" + # passing the kernel version is required -[ -z "$1" ] && exit 0 +[ -z "${version}" ] && exit 0 + +# kernel-package passes an extra arg +if [ -n "$2" ]; then + if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then + ${bootdir}= $(dirname "$2") + bootopt="-b ${bootdir}" + else + exit 0 + fi +fi -# kernel-package passes an extra arg; hack to not run under kernel-package -[ -z "$2" ] || exit 0 +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "configure" ]; then + exit 0 + fi +fi # we're good - create initramfs. update runs do_bootloader -update-initramfs -c -t -k "$1" +update-initramfs -c -t -k "${version}" ${bootopt} diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools index 278a6fc..88c6d07 100755 --- a/kernel/postrm.d/initramfs-tools +++ b/kernel/postrm.d/initramfs-tools @@ -1,10 +1,27 @@ #!/bin/sh +version="$1" +bootopt="" + # passing the kernel version is required -[ -z "$1" ] && exit 0 +[ -z "${version}" ] && exit 0 + +# kernel-package passes an extra arg +if [ -n "$2" ]; then + if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then + ${bootdir}= $(dirname "$2") + bootopt="-b ${bootdir}" + else + exit 0 + fi +fi -# kernel-package passes an extra arg; hack to not run under kernel-package -[ -z "$2" ] || exit 0 +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "remove" ]; then + exit 0 + fi +fi # delete initramfs -update-initramfs -d -k "$1" +update-initramfs -d -k "${version}" ${bootopt} -- cgit v1.2.3 From c1fa297a9342bcf4750c4b6f1000e5cd364049f8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Sep 2009 19:46:29 +0200 Subject: update-initramfs: allow -t takeover on delete needed to have idempotent delete --- update-initramfs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/update-initramfs b/update-initramfs index 29941f3..255265f 100755 --- a/update-initramfs +++ b/update-initramfs @@ -429,12 +429,14 @@ delete() set_initramfs - if [ ! -e "${initramfs}" ]; then - panic "Cannot delete ${initramfs}, doesn't exist." - fi + if [ "${takeover}" = 0 ]; then + 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." + if ! version_exists "${version}"; then + panic "Cannot delete version ${version}: Not created by this utility." + fi fi altered_check -- cgit v1.2.3 From 02cb277c7eb1e40d926b95aef3419ee5c929f0f6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 25 Sep 2009 19:48:48 +0200 Subject: /etc/kernel/postrm.d/i-t: use now takeover on delete makes the script idempotent (closes: #547365) Reported-by: Jonathan Nieder Signed-off-by: maximilian attems --- kernel/postrm.d/initramfs-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools index 88c6d07..359a226 100755 --- a/kernel/postrm.d/initramfs-tools +++ b/kernel/postrm.d/initramfs-tools @@ -24,4 +24,4 @@ if [ -n "$DEB_MAINT_PARAMS" ]; then fi # delete initramfs -update-initramfs -d -k "${version}" ${bootopt} +update-initramfs -d -t -k "${version}" ${bootopt} -- cgit v1.2.3 From 8d3cbe0252a6caec0b5a6bd97c5aa2de65ccc139 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 27 Sep 2009 16:26:19 +0200 Subject: Nuke useless unused dir. shipp used conf-hooks.d Reported-by: Jonas Meurer Signed-off-by: maximilian attems --- debian/initramfs-tools.dirs | 2 +- debian/lintian/initramfs-tools | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/initramfs-tools.dirs b/debian/initramfs-tools.dirs index a11bf32..0f63f2f 100644 --- a/debian/initramfs-tools.dirs +++ b/debian/initramfs-tools.dirs @@ -10,6 +10,6 @@ etc/initramfs-tools/scripts/nfs-top etc/initramfs-tools/hooks etc/initramfs-tools/conf.d usr/share/initramfs-tools/conf.d -usr/share/initramfs-tools/hooksconf.d +usr/share/initramfs-tools/conf-hooks.d usr/share/initramfs-tools/modules.d /var/lib/initramfs-tools diff --git a/debian/lintian/initramfs-tools b/debian/lintian/initramfs-tools index 6d1b9c8..5191f49 100644 --- a/debian/lintian/initramfs-tools +++ b/debian/lintian/initramfs-tools @@ -1,3 +1,3 @@ initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/conf.d/ -initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/hooksconf.d/ +initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/conf-hooks.d/ initramfs-tools: package-contains-empty-directory usr/share/initramfs-tools/modules.d/ -- cgit v1.2.3 From 339235ef8fc662c5ac29a4906680cf839f0fb711 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 1 Oct 2009 00:01:18 +0200 Subject: kernel hook scripts: Fix typo /etc/kernel/postrm.d/initramfs-tools: line 12: =: command not found It says: ${bootdir}= $(dirname "$2") which should be: bootdir=$(dirname "$2") Tested-by: Matthijs Kooijman Signed-off-by: maximilian attems --- kernel/postinst.d/initramfs-tools | 2 +- kernel/postrm.d/initramfs-tools | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools index b389921..b4b286d 100755 --- a/kernel/postinst.d/initramfs-tools +++ b/kernel/postinst.d/initramfs-tools @@ -9,7 +9,7 @@ bootopt="" # kernel-package passes an extra arg if [ -n "$2" ]; then if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then - ${bootdir}= $(dirname "$2") + bootdir=$(dirname "$2") bootopt="-b ${bootdir}" else exit 0 diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools index 359a226..269650a 100755 --- a/kernel/postrm.d/initramfs-tools +++ b/kernel/postrm.d/initramfs-tools @@ -9,7 +9,7 @@ bootopt="" # kernel-package passes an extra arg if [ -n "$2" ]; then if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then - ${bootdir}= $(dirname "$2") + bootdir=$(dirname "$2") bootopt="-b ${bootdir}" else exit 0 -- cgit v1.2.3 From 3158f6513227b63efd672505592ab537e043212c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 1 Oct 2009 00:06:08 +0200 Subject: kernel hook scripts: add comments try to make the intention of the code more clear Reported-by: Matthijs Kooijman Signed-off-by: maximilian attems --- kernel/postinst.d/initramfs-tools | 2 ++ kernel/postrm.d/initramfs-tools | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools index b4b286d..68124f7 100755 --- a/kernel/postinst.d/initramfs-tools +++ b/kernel/postinst.d/initramfs-tools @@ -12,10 +12,12 @@ if [ -n "$2" ]; then bootdir=$(dirname "$2") bootopt="-b ${bootdir}" else + # official Debian linux-images take care themself exit 0 fi fi +# avoid running multiple times if [ -n "$DEB_MAINT_PARAMS" ]; then eval set -- "$DEB_MAINT_PARAMS" if [ -z "$1" ] || [ "$1" != "configure" ]; then diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools index 269650a..7811589 100755 --- a/kernel/postrm.d/initramfs-tools +++ b/kernel/postrm.d/initramfs-tools @@ -12,10 +12,12 @@ if [ -n "$2" ]; then bootdir=$(dirname "$2") bootopt="-b ${bootdir}" else + # official linux-images take care themself exit 0 fi fi +# avoid running multiple times if [ -n "$DEB_MAINT_PARAMS" ]; then eval set -- "$DEB_MAINT_PARAMS" if [ -z "$1" ] || [ "$1" != "remove" ]; then -- cgit v1.2.3 From a2127d339d78d2ea2779b24d0f42f6203777df72 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 28 Oct 2009 23:20:02 +0100 Subject: hook-funcitions: Only warn about missing firmware if /proc/modules exists makes no sense to look up if there are no modules. seen on a piuparts installation of linux-2.6 Signed-off-by: maximilian attems --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 387fe60..9e3eef2 100644 --- a/hook-functions +++ b/hook-functions @@ -71,7 +71,8 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ] \ - && [ ! -e "/lib/firmware/${version}/${firmware}" ]; then + && [ ! -e "/lib/firmware/${version}/${firmware}" ] \ + && [ -e /proc/modules ]; then if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ -- cgit v1.2.3 From c0d14c1245e96be8757ad4a42bf4cbfa9521dc81 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 8 Nov 2009 22:06:28 +0100 Subject: mkinitramfs: Be opportunistic when calling modprobe thus showing errors don't suppress the modprobe error output!!! this can happen when your depmod was generated by newer m-i-t then Lenny's. make deb-pkg generated images don't call yet depmod -a in postinst thus it can happend there and it was already triggered. (closes: #554873) Reported-by: Michael Prokop Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 9e3eef2..bd9e06a 100644 --- a/hook-functions +++ b/hook-functions @@ -45,7 +45,7 @@ manual_add_modules() local mam_x firmwares firmware for mam_x in $(modprobe --set-version="${version}" --ignore-install \ - --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do + --quiet --show-depends "${1}" | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue -- cgit v1.2.3 From 3d1da4511ab62173d457b78a243fdc001b648911 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Nov 2009 13:53:12 +0100 Subject: copy_exec: Check if ldd is around got report of a box with missing ldd. as the errors get seded away the user is left with no idea of the failure. Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index bd9e06a..9d59dc1 100644 --- a/hook-functions +++ b/hook-functions @@ -147,6 +147,10 @@ copy_exec() { fi # Copy the dependant libraries + if ! command -v ldd >/dev/null 2>&1 ; then + echo "WARNING: no ldd around - install libc-bin" + exit 1 + fi for x in $(ldd ${source} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; -- cgit v1.2.3 From 0e653d64758e03fd77b8ab436c8ca36cff9ee4c9 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 29 Dec 2009 15:44:48 +0100 Subject: Fix path to nfsroot.txt in documentation. Signed-off-by: maximilian attems --- initramfs-tools.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 144b89a..2ba022a 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -65,8 +65,8 @@ Use root=/dev/nfs for NFS to kick to in. NFSOPTS can be looked up in .TP \fB\fI ip tells how to configure the ip address. Allows to specify an different -NFS server than the DHCP server. See Documentation/nfsroot.txt in -any recent Linux source for details. Optional paramater for NFS root. +NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt +in any recent Linux source for details. Optional paramater for NFS root. .TP \fB\fI cryptopts -- cgit v1.2.3 From 90c19d7bac748efdaab0355d4aa3a25b579bc0f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 26 Jan 2010 21:05:35 -0500 Subject: scripts/local: avoid mount -t unknown Since fstype does not support btrfs (#548047), and since udev 150, vol_id no longer exists, get_fstype sets FSTYPE to "unknown", and then the root filesystem is mounted using "mount -t unknown /dev/hda2 /root". Of course, that fails, and with a really unhelpful error message ("mount: device doesnot exist") Why not just skip the -t parameter if FSTYPE=unknown? Mounting the root fs was going to fail, so letting mount autodetect the fs type can't be worse. Attached patch does that and got my root on btrfs working. Workaround: boot with rootfstype=btrfs Signed-off-by: maximilian attems --- scripts/local | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/local b/scripts/local index b6bd192..7bc740f 100644 --- a/scripts/local +++ b/scripts/local @@ -127,7 +127,11 @@ mountroot() # FIXME This has no error checking # Mount root - mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt} + if [ "${FSTYPE}" != "unknown" ]; then + mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt} + else + mount ${roflag} ${ROOTFLAGS} ${ROOT} ${rootmnt} + fi [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom" run_scripts /scripts/local-bottom -- cgit v1.2.3 From 49337bdc94ed5bc176338cfa793a868fcd33784c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 30 Jan 2010 19:54:13 +0100 Subject: scripts/local: Use blkid as backup fstype detection if blkid is on initramfs use it. Thanks to Joey Hess for calling syntax. Signed-off-by: maximilian attems --- scripts/local | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/local b/scripts/local index 7bc740f..feead1c 100644 --- a/scripts/local +++ b/scripts/local @@ -11,7 +11,9 @@ get_fstype () # vol_id has a more complete list of file systems, # but fstype is more robust eval $(fstype "${FS}" 2> /dev/null) - if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then + if [ "$FSTYPE" = "unknown" ] && [ command -v blkid >/dev/null 2>&1 ]; then + FSTYPE=$(blkid -o value -s TYPE "${FS}") + elif [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) fi RET=$? -- cgit v1.2.3 From 836e5cf6ddb30757365c2b879b96958c250dcd7b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 19 Feb 2010 20:45:00 +0100 Subject: mkinitramfs: only copy modprobe conf files do not add packaging garbage (closes: #506533) Signed-off-by: maximilian attems --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 13573b2..30a19d1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -237,7 +237,7 @@ 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/*.conf "${DESTDIR}/etc/modprobe.d/" # workaround: libgcc always needed on old-abi arm if [ "$DPKG_ARCH" = arm ] || [ "$DPKG_ARCH" = armeb ]; then -- cgit v1.2.3 From 51de1be0a82967582b024dd554c02e457fe8e917 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 20 Feb 2010 17:01:45 +0100 Subject: hook-functions: Avoid firmware copy error. Fix a2127d33 for systems without /proc/modules because the check has the wrong logic order. (closes: #570678) Signed-off-by: maximilian attems --- hook-functions | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index 9d59dc1..8376be3 100644 --- a/hook-functions +++ b/hook-functions @@ -71,8 +71,13 @@ manual_add_modules() # Only print warning for missing fw of loaded module # or forced loaded module if [ ! -e "/lib/firmware/${firmware}" ] \ - && [ ! -e "/lib/firmware/${version}/${firmware}" ] \ - && [ -e /proc/modules ]; then + && [ ! -e "/lib/firmware/${version}/${firmware}" ] ; then + # Only warn about missing firmware if + # /proc/modules exists + if [ ! -e /proc/modules ] ; then + continue + fi + if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ /proc/modules \ || grep -q "^$(basename "${mam_x}" .ko)" \ -- cgit v1.2.3 From 99b32f0831fe89f78144ca5a1da5c1e6a51dc667 Mon Sep 17 00:00:00 2001 From: Avi Rozen Date: Tue, 25 Aug 2009 23:19:27 +0300 Subject: mkinitramfs: add all usb storage devices USB storage device is not recognized at boot after kernel upgrade to 2.6.30. It seems that the usb-storage module has been split into several mini modules, which are not copied to the initramfs image. In my case usb-storage.ko is copied but ums-cypress.ko is not copied. I've attached a patch against hook-functions that fixes this, by using copy_modules_dir to copy all the modules in kernel/drivers/usb/storage, instead of just usb-storage. I've set the severity to important because my USB storage device also happens to be the boot device... Cheers, Avi (closes: #543568) Signed-off-by: maximilian attems --- hook-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 8376be3..90092bd 100644 --- a/hook-functions +++ b/hook-functions @@ -381,7 +381,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" @@ -440,6 +440,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + usb_storage) + copy_modules_dir kernel/drivers/usb/storage + ;; *) auto_add_modules base auto_add_modules net @@ -452,6 +455,7 @@ auto_add_modules() auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc + auto_add_modules usb_storage ;; esac } -- cgit v1.2.3 From 323005e4b8468ab9f7151d883d3df7b75f130911 Mon Sep 17 00:00:00 2001 From: Ferenc Wagner Date: Tue, 9 Feb 2010 17:16:04 +0100 Subject: initramfs-tools: make the panic argument available in the rescue shell Sometimes one misses the error message printed by the panic helper function, for example when attaching a serial console after the fact, or if kernel messages resulting from udev activity obscure or scroll it away. Please consider adding some facility like the attached patch. Thanks, Feri. (closes: #569033) Signed-off-by: maximilian attems --- initramfs-tools.8 | 4 ++++ scripts/functions | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 2ba022a..55d413a 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -504,6 +504,10 @@ set according relevant boot option. \fB\fI break Useful for manual intervention during setup and coding an boot script. .TP +\fB\fI REASON +Argument passed to the \fIpanic\fP helper function. Use to find out why +you landed in the initramfs shell. +.TP \fB\fI init passes the path to init(8) usually /sbin/init. .TP diff --git a/scripts/functions b/scripts/functions index 77de8f3..c34dd4a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -50,7 +50,7 @@ panic() modprobe i8042 modprobe atkbd echo $@ - PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 + REASON="$@" PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } maybe_break() -- 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(-) 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 1bf31aaa5bc8bf53bf123d8d75a927c1a358171c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 22 Feb 2010 23:36:53 +0100 Subject: blacklist earlier at init-top stage as udev will start earlier, care to blacklist before it loads. Signed-off-by: maximilian attems --- scripts/init-premount/blacklist | 25 ------------------------- scripts/init-top/blacklist | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100755 scripts/init-premount/blacklist create mode 100755 scripts/init-top/blacklist diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist deleted file mode 100755 index 2164906..0000000 --- a/scripts/init-premount/blacklist +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# sanity check -[ -z "${blacklist}" ] && exit 0 - -# write blacklist to modprobe.d -IFS=',' -for b in ${blacklist}; do - echo "blacklist $b" >> /etc/modprobe.d/initramfs.conf -done diff --git a/scripts/init-top/blacklist b/scripts/init-top/blacklist new file mode 100755 index 0000000..2164906 --- /dev/null +++ b/scripts/init-top/blacklist @@ -0,0 +1,25 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# sanity check +[ -z "${blacklist}" ] && exit 0 + +# write blacklist to modprobe.d +IFS=',' +for b in ${blacklist}; do + echo "blacklist $b" >> /etc/modprobe.d/initramfs.conf +done -- cgit v1.2.3 From 673abb77821433a67add61ac79d739c6cee9eee0 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 3 Feb 2010 22:48:07 -0800 Subject: configure_networking: support BOOTIF variable set by pxelinux updated patch against current master, using only shell, and with a cleaner method to convert BOOTF to a typical mac address. (closes: #567540) Signed-off-by: maximilian attems --- scripts/functions | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/scripts/functions b/scripts/functions index c34dd4a..60cfc11 100644 --- a/scripts/functions +++ b/scripts/functions @@ -258,6 +258,42 @@ parse_numeric() { configure_networking() { + if [ -n "${BOOTIF}" ]; then + # pxelinux sets BOOTIF to a value based on the mac address of the + # network card used to PXE boot, so use this value for DEVICE rather + # than a hard-coded device name from initramfs.conf. this facilitates + # network booting when machines may have multiple network cards. + # pxelinux sets BOOTIF to 01-$mac_address + + # strip off the leading "01-", which isn't part of the mac + # address + temp_mac=${BOOTIF#*-} + + # convert to typical mac address format by replacing "-" with ":" + bootif_mac="" + IFS='-' + for x in $temp_mac ; do + if [ -z "$bootif_mac" ]; then + bootif_mac="$x" + else + bootif_mac="$x:$bootif_mac" + fi + done + unset IFS + + # look for devices with matching mac address, and set DEVICE to + # appropriate value if match is found. + for device in /sys/class/net/* ; do + if [ -f "$device/address" ]; then + current_mac=$(cat "$device/address") + if [ "$bootif_mac" = "$current_mac" ]; then + DEVICE=${device##*/} + break + fi + fi + done + fi + # networking already configured thus bail out [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0 -- cgit v1.2.3 From 64882f7235362129e9bae0e7c7788981328d8077 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Nov 2009 14:20:39 +0000 Subject: copy_modules_dir: Take a list of exclusions after the base directory Signed-off-by: Ben Hutchings Signed-off-by: maximilian attems --- hook-functions | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index 90092bd..c40b3a4 100644 --- a/hook-functions +++ b/hook-functions @@ -188,14 +188,24 @@ copy_exec() { copy_modules_dir() { local x_mod + local exclude + local dir="$1" + shift - if ! [ -d "${MODULESDIR}/${1}" ]; then + if ! [ -d "${MODULESDIR}/${dir}" ]; then return; fi if [ "${verbose}" = "y" ]; then - echo "Copying module directory ${1}" + echo "Copying module directory ${dir}" + if [ $# -ge 1 ]; then + echo "(excluding $*)" + fi fi - for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do + while [ $# -ge 1 ]; do + exclude="$exclude -name $1 -prune -o " + shift + done + for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } -- cgit v1.2.3 From cd63438f4bfc5c400aeed74ea29010dbc0c0ef4e Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Nov 2009 14:21:49 +0000 Subject: auto_add_modules: Copy all modules from net, excluding some subdirectories This removes the need to maintain an explicit list, which always has some drivers missing. fixes #553024 partly. Signed-off-by: Ben Hutchings Signed-off-by: maximilian attems --- hook-functions | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/hook-functions b/hook-functions index c40b3a4..98597db 100644 --- a/hook-functions +++ b/hook-functions @@ -398,19 +398,9 @@ auto_add_modules() done ;; net) - for x in 3c59x 8139cp 8139too 8390 atl1 atl1e b44 bmac \ - bnx2 cxgb cxgb3 de2104x de4x5 defxx dl2k dmfe \ - e100 e1000 e1000e ehea epic100 \ - ep93xx_eth eql fealnx famachi forcedeth gelic_net \ - hp100 igb ipg ixgb ixgbe mace mlx4_core mv643xx_eth myri10ge \ - natsemi ne2k-pci netconsole netxen_nic niu ns83820 \ - pcnet32 qla3xxx \ - r8169 s2io sfc sis900 skge sky2 slhc smc91x starfire \ - sundance sungem sungem_phy sunhme sunvnet tehuti tg3 tlan \ - tulip typhoon via-rhine via-velocity virtio_net winbond-840 \ - xircom_cb xircom_tulip_cb yellowfin; do - manual_add_modules "${x}" - done + copy_modules_dir kernel/drivers/net \ + appletalk arcnet bonding can hamradio irda pcmcia \ + tokenring usb wan wimax wireless ;; ide) copy_modules_dir kernel/drivers/ide -- cgit v1.2.3 From df43f67500c9f3f1d9ad1e310173cf6babd85a61 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Feb 2010 00:56:29 +0100 Subject: scripts/local: fix blkid invocation 49337bd looks bogus. It adds the test "[ command ... ]" but I think that should be just "command ..." Reporte-by: Ben Hutchings Signed-off-by: maximilian attems --- scripts/local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local b/scripts/local index feead1c..1474073 100644 --- a/scripts/local +++ b/scripts/local @@ -11,7 +11,7 @@ get_fstype () # vol_id has a more complete list of file systems, # but fstype is more robust eval $(fstype "${FS}" 2> /dev/null) - if [ "$FSTYPE" = "unknown" ] && [ command -v blkid >/dev/null 2>&1 ]; then + if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then FSTYPE=$(blkid -o value -s TYPE "${FS}") elif [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) -- cgit v1.2.3 From d3de22eda550c41d0e262a0140a33a5979c772fd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 28 Feb 2010 13:59:41 +0100 Subject: init: export and unset BOOTIF enhances 673abb77821433a67add61ac79d739c6cee9eee0, to allow scripts to make use of the variable. Reported-by: Vagrant Cascadian Signed-off-by: maximilian attems --- init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init b/init index e8c97a5..234c3e5 100755 --- a/init +++ b/init @@ -36,6 +36,7 @@ export ROOTDELAY= export ROOTFLAGS= export ROOTFSTYPE= export IP= +export BOOTIF= export break= export init=/sbin/init export quiet=n @@ -240,6 +241,7 @@ unset ROOTFSTYPE unset ROOTDELAY unset ROOT unset IP +unset BOOTIF unset blacklist unset break unset noresume -- cgit v1.2.3 From 1277b2e7590a3a1354440472da497b68e8ba5385 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 8 Mar 2010 22:06:39 +0100 Subject: init: rexport resume to reallow it's hardcoded usage as bonus also simplify the noresume case, just unset it in that case. this should fix #572858 and friends, looks broken to me in Lenny too. Signed-off-by: maximilian attems --- init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init b/init index 234c3e5..e1d4151 100755 --- a/init +++ b/init @@ -45,6 +45,7 @@ export rootmnt=/root export debug= export panic= export blacklist= +export resume= export resume_offset= # Bring in the main config @@ -121,7 +122,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - RESUME="${x#resume=}" + resume="${x#resume=}" ;; resume_offset=*) resume_offset="${x#resume_offset=}" @@ -169,10 +170,9 @@ for x in $(cat /proc/cmdline); do esac done -if [ -z "${noresume}" ]; then - export resume=${RESUME} -else +if [ -n "${noresume}" ]; then export noresume + unset resume fi depmod -a -- cgit v1.2.3 From d50ca3a902ad834e2bacc2fe81e053a513b7748e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 23 Mar 2010 23:53:03 +0100 Subject: update-initramfs: -d delete .bak file as bonus rename confusing function. (closes: #559535) Signed-off-by: maximilian attems --- update-initramfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 255265f..b7f9003 100755 --- a/update-initramfs +++ b/update-initramfs @@ -141,7 +141,7 @@ backup_booted_initramfs() } # nuke generated copy -remove_initramfs() +remove_initramfs_bak() { [ -z "${initramfs_bak}" ] && return 0 rm -f "${initramfs_bak}" @@ -161,7 +161,7 @@ generate_initramfs() set_sha1 else mkinitramfs_return="$?" - remove_initramfs + remove_initramfs_bak rm -f "${initramfs}.new" if [ "$mkinitramfs_return" = "2" ]; then # minversion wasn't met, exit 0 @@ -445,7 +445,7 @@ delete() delete_sha1 - rm -f "${initramfs}" + rm -f "${initramfs}" "${initramfs}.bak" } # Check for update mode on existing and modified initramfs -- cgit v1.2.3 From 61375f9d9a76a0771b00a32412b7afd296551454 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Mon, 21 Dec 2009 23:06:53 +0000 Subject: init: Mount devtmpfs on /dev falling back to a tmpfs if not supported by the kernel. [ merge of 0.92bubuntu61 ] Signed-off-by: maximilian attems --- init | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/init b/init index e1d4151..68ceac7 100755 --- a/init +++ b/init @@ -17,9 +17,11 @@ tmpfs_size="10M" if [ -e /etc/udev/udev.conf ]; then . /etc/udev/udev.conf fi -mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev -[ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1 -[ -e /dev/null ] || mknod /dev/null c 1 3 +if ! mount -t devtmpfs -o mode=0755 none /dev; then + mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev + [ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1 + [ -e /dev/null ] || mknod /dev/null c 1 3 +fi > /dev/.initramfs-tools mkdir /dev/.initramfs -- cgit v1.2.3 From 1d3037b49b68ed615fb60d8f2a3c0e7e78c857d0 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Wed, 16 Dec 2009 17:47:49 +0000 Subject: mkinitramfs: Call depmod before packing the initramfs. init: thus drop depmod call. Don't quote modules.*map, so we actually expand it. (closes: #465760, #562561) [ merge from 0.92bubuntu57 and 0.92bubuntu58 ] Signed-off-by: maximilian attems --- init | 1 - mkinitramfs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/init b/init index 68ceac7..05853b4 100755 --- a/init +++ b/init @@ -177,7 +177,6 @@ if [ -n "${noresume}" ]; then unset resume fi -depmod -a maybe_break top # Don't do log messages here to avoid confusing usplash diff --git a/mkinitramfs b/mkinitramfs index 30a19d1..58082cf 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -247,6 +247,10 @@ fi run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks +# generate module deps +depmod -a -b "${DESTDIR}" ${version} +rm "${DESTDIR}/lib/modules/${version}"/modules.*map + # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / -- cgit v1.2.3 From 722cb312d3dc0e27b794aaa5eac7db331a9ebf8c Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Sun, 3 Aug 2008 17:34:22 -0400 Subject: update-initramfs: Default to not keep .bak backups we don't need to any more. TODO: lilo might still want .bak's. [ merge 0.92bubuntu9 + fix manpage note: indeed the precaution seems no longer needed these days, but is potentially harmful when /boot space is small. ] Signed-off-by: maximilian attems --- conf/update-initramfs.conf | 4 ++-- update-initramfs.conf.5 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index c08c6ed..3c27473 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -14,7 +14,7 @@ update_initramfs=yes # # backup_initramfs [ yes | no ] # -# Default is yes +# Default is no # If set to no leaves no .bak backup files. -backup_initramfs=yes +backup_initramfs=no diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 30e1a97..ce8f69f 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "2008/12/19" "Linux" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "2010/03/24" "Linux" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -18,7 +18,7 @@ conservative manners needs to be applied. This disables the \fBupdate_initramfs \-u\fP call. .TP \fB backup_initramfs -By default \fBupdate_initramfs\fP keeps an .bak file of the previous initramfs. If set to \fIno\fP the backup initramfs will not be kept. +If set \fBupdate_initramfs\fP keeps an .bak file of the previous initramfs. If unset the backup initramfs will not be kept. .SH AUTHOR The initramfs-tools are written by Maximilian Attems , -- cgit v1.2.3 From 3de636e6c8c578c1b74c6eca0b8660ec8b0a9d36 Mon Sep 17 00:00:00 2001 From: Piotr Lewandowski Date: Fri, 16 Oct 2009 23:25:53 +0200 Subject: update-initramfs breaks if /etc/mtab is a symlink to /proc/mounts The attached patch fixes the problem for me (udev no longer ships vol_id since 146-1). (closes: #525606) [ Fix not hardcoding blkid path ] Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 98597db..2184db5 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,7 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ "${root}" = "/dev/root" ] ; then - root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null + root="/dev/disk/by-uuid/"$(blkid -o value -s UUID ${root}) 2>/dev/null fi root="$(readlink -f ${root})" -- cgit v1.2.3 From 0108194018382b91867f966b1d0188959be1f66f Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 28 Sep 2009 11:05:32 +0100 Subject: MODULES=dep fix boot with MMC It doesn't boot with MODULES=dep because mmc_block is missing. (closes: #548711) Signed-off-by: maximilian attems --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index 2184db5..c5c3f05 100644 --- a/hook-functions +++ b/hook-functions @@ -367,6 +367,10 @@ dep_add_modules() manual_add_modules sd_mod fi + if [ -e /sys/bus/mmc/devices/ ]; then + manual_add_modules mmc_block + fi + if [ -e /sys/bus/i2o/devices/ ]; then force_load i2o_block force_load i2o_config -- cgit v1.2.3 From fe0a965e82ee16b7d64188fe1afb527ac648d686 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 24 Mar 2010 04:38:27 +0100 Subject: control: bump standards version without changes. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 69b51b0..5e76fa5 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: Jeff Bailey , maximilian attems , David Härdeman Maintainer: Debian kernel team Build-Depends: debhelper (>= 5.0), cdbs -Standards-Version: 3.8.3 +Standards-Version: 3.8.4 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From a069caef21d2456a17d2df77f1ab2e84b31074dd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 24 Mar 2010 04:39:34 +0100 Subject: control: Clean up Uploaders field none of the other listed persons are active currently. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5e76fa5..57f990e 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilian attems , David Härdeman +Uploaders: maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 5.0), cdbs Standards-Version: 3.8.4 -- cgit v1.2.3 From 2a49aa8a48994806b96003b7ef702d8b5d3f4825 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Wed, 24 Mar 2010 04:51:49 +0100 Subject: hook-functions: let dep_add_modules() recurse into lvm slave devices When searching for the root block device, there may be multiple device mapper indirections. Fixes MODULES=dep if crypto-root fs has snapshot. (closes: 573761) Signed-off-by: Nikolaus Schulz Signed-off-by: maximilian attems --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index c5c3f05..189ad78 100644 --- a/hook-functions +++ b/hook-functions @@ -284,10 +284,10 @@ dep_add_modules() || [ "${root#/dev/dm-}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) - # lvm on luks or luks on lvm - if [ "${block#dm-}" != "${block}" ]; then + # lvm on luks or luks on lvm, possibly lvm snapshots + while [ "${block#dm-}" != "${block}" ]; do block=$(ls -1 /sys/block/${block}/slaves | head -n 1) - fi + done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ -- cgit v1.2.3 From b5c928d159623f617f872323b7064ebfbf19a269 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 21 Apr 2009 00:55:05 +0200 Subject: switch from cdbs to debhelper 7 newest debhelper makefile is short and quick. inspiration from /usr/share/doc/debhelper/examples/rules.tiny. also drop useless pre-build rule, which seems to stem from old bzr. it was an vcs that didn't keep the permissions. Signed-off-by: maximilian attems --- debian/compat | 2 +- debian/control | 2 +- debian/rules | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/debian/compat b/debian/compat index 7ed6ff8..7f8f011 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index 57f990e..6580c78 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: utils Priority: optional Uploaders: maximilian attems Maintainer: Debian kernel team -Build-Depends: debhelper (>= 5.0), cdbs +Build-Depends: debhelper (>= 7.0) Standards-Version: 3.8.4 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git diff --git a/debian/rules b/debian/rules index 1376aa9..2d33f6a 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,4 @@ #!/usr/bin/make -f -include /usr/share/cdbs/1/rules/debhelper.mk - -pre-build:: - chmod +x init mkinitramfs - chmod +x hooks/* - for x in `find scripts/ kernel/ -maxdepth 1 -type d | tail -n+2`; do \ - chmod -R +x $$x; \ - done +%: + dh $@ -- cgit v1.2.3 From cc33aa5bfb7f687935ef682aa2cce0842af15ea4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 01:22:07 +0100 Subject: update-initramfs: Stop second guessing lilo usage. If people have both lilo and grub installed they need to figured out on their own, what they want. The mbr detection is error prone and a nice hack, but has survived it's time now that grub.cfg would need to be parsed in a different way. warn people that they should act. (closes: #574553) Signed-off-by: maximilian attems --- update-initramfs | 52 ++++------------------------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/update-initramfs b/update-initramfs index b7f9003..5085b0d 100755 --- a/update-initramfs +++ b/update-initramfs @@ -184,53 +184,6 @@ run_lilo() lilo } -# check if lilo is on mbr -mbr_check() -{ - # try to discover grub|grub2 and be happy - [ -r /boot/grub/grub.cfg ] \ - && groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \ - /boot/grub/grub.cfg) - [ -r /boot/grub/menu.lst ] \ - && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ - /boot/grub/menu.lst) - [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ - && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) - [ -n "${dev}" ] && [ -r ${dev} ] \ - && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ - | grep -q GRUB && return 0 - - # check out lilo.conf for validity - boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) - [ -z "${boot}" ] && return 0 - case ${boot} in - /dev/md/*) - if [ -r /proc/mdstat ]; then - MD=${boot#/dev/md/} - boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \ - /proc/mdstat)" - fi - ;; - /dev/md*) - if [ -r /proc/mdstat ]; then - MD=${boot#/dev/} - boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \ - /proc/mdstat)" - fi - ;; - esac - [ ! -r "${boot}" ] && return 0 - dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ - && run_lilo && return 0 - - # no idea which bootloader is used - echo - echo "WARNING: grub and lilo installed." - echo "If you use grub as bootloader everything is fine." - echo "If you use lilo as bootloader you must run lilo!" - echo -} - # Invoke bootloader run_bootloader() { @@ -250,7 +203,10 @@ run_bootloader() fi # do_bootloader unconfigured - mbr_check + echo + echo "WARNING: grub and lilo installed." + echo "Please deinstall unused bootloader." + echo return 0 fi if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then -- cgit v1.2.3 From 06a104875366502651939c8449382fb2ac95a9c5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 01:35:33 +0100 Subject: mkinitramfs: allow to build initramfs for unmodular linux images this is untested. (closes: #415474, #433708) Signed-off-by: maximilian attems --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 58082cf..e2f5ebe 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -131,8 +131,8 @@ fi MODULESDIR="/lib/modules/${version}" if [ ! -e "${MODULESDIR}" ]; then - echo "Cannot find ${MODULESDIR}" - exit 1 + echo "WARNING: missing ${MODULESDIR}" + echo "Device driver support needs thus be built-in linux image!" fi if [ ! -e "${MODULESDIR}/modules.dep" ]; then depmod ${version} -- cgit v1.2.3 From 40b99bb35a81066aadbd13e663ffdf9d1a3ba2ad Mon Sep 17 00:00:00 2001 From: Anna Jonna Armannsdottir Date: Mon, 22 Mar 2010 14:51:55 +0000 Subject: configure_networking: Try repeatedly ipconfig with increasing timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here is a bug description and a patch. Please consider it. The patch solves a an LTSP client problem that arises when the clients are connected to Cisco switches that have spanning-tree calculations enabled. Also related to: http://git.debian.org/?p=kernel/initramfs-tools.git;a=commitdiff;h=9c3ec61b1a5e2feaa8d9c6de737eaa00eb446a9c And http://git.debian.org/?p=kernel/initramfs-tools.git;a=commitdiff;h=115134f07a0dd042355a2a6fb5a5ca987b000f5d Here in an extensive explaination: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/181258 Also in the following: I can report the same problem. A number of diskless clients go flawlessly through a PXE boot, then the net interface is brought down when the Linux kernel boots and suddenly, dhcp does not work anymore. Background research on the network: The clients are connected to Cisco switches. The configuration of the switches makes them run spanning-tree calculations. This usually takes some seconds but for large networks it can take up to 30 40 seconds. The network port on the switch is turned on, when this calculation has been finished. This is primarily a security measure. See also: http://networkers-online.com/blog/2008/08/what-is-bpdu-filter/ If this security measure is turned off, the client boots without problems. :) To debug the problem, the following boot line was used: kernel amd64/vmlinuz append ro initrd=amd64/initrd.img nbdport=2000 debug=100 break=1 ip=dhcp In my case, this causes a timeout as can be seen on the attached screenshots. The kernel loads the NIC module e1000e and reports the type of NIC et.c. The kernel time reported is 5.927 . The debug shows the following: configure_networking [ -n eth0 ] [-e /tmp/net-eth0.conf ] ipconfig -t 60 eth0 At about 6.4 in kernel time, the NIC module reports further about it's IRQ configuration. Two seconds (2 sec) later at about 8.56 the NIC module reports that the Link is up at 100 Mbps full duplex. Some milliseconds later it signals ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready . At this point in time, ipconfig is just waiting for an answer to the DHCP-discover that really was choked by the switch. Now this is an obvious flaw in the script. It would be much more reasonable to try repeatedly with increasing timouts. This would also be much more efficent. may I suggest the following timeouts: 4 8 16 30 60 The sum of this timeout is about 120 seconds. I did some testing with exponential timeout with 1 2 4 8 16 30 ... and it solved the problem, but it seems that ipconfig runs once additionally after it has actually done the job. I am running tests now with an exponent of n/1.5 instead of n. That would give a sequence of (ca) 2 3 4 6 9 16 25 36 64 100 Attached are a jpeg screenshot of the boot sequence and of course the patch. The patch is relative to the present git snapshot. -- Kindest Regards, Anna Jonna Ármannsdóttir, %& A: Because people read from top to bottom. Unix System Aministration, Computing Services, %& Q: Why is top posting bad? University of Iceland. Signed-off-by: maximilian attems --- scripts/functions | 64 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/scripts/functions b/scripts/functions index 60cfc11..f99cba4 100644 --- a/scripts/functions +++ b/scripts/functions @@ -299,33 +299,45 @@ configure_networking() # support ip options see linux sources # Documentation/filesystems/nfsroot.txt - case ${IP} in - none|off) - # Do nothing - ;; - ""|on|any) - # Bring up device - ipconfig -t 180 ${DEVICE} - ;; - dhcp|bootp|rarp|both) - ipconfig -t 180 -c ${IP} -d ${DEVICE} - ;; - *) - ipconfig -t 180 -d $IP - - # grab device entry from ip option - NEW_DEVICE=${IP#*:*:*:*:*:*} - if [ "${NEW_DEVICE}" != "${IP}" ]; then - NEW_DEVICE=${NEW_DEVICE%:*} - else - # wrong parse, possibly only a partial string - NEW_DEVICE= - fi - if [ -n "${NEW_DEVICE}" ]; then - DEVICE="${NEW_DEVICE}" + # Documentation/frv/booting.txt + + for ROUNDTTT in 2 3 4 6 9 16 25 36 64 100; do + + # The NIC is to be configured if this file does not exist. + # Ip-Config tries to create this file and when it succeds + # creating the file, ipconfig is not run again. + if [ -e /tmp/net-"${DEVICE}".conf ]; then + break; fi - ;; - esac + + case ${IP} in + none|off) + # Do nothing + ;; + ""|on|any) + # Bring up device + ipconfig -t ${ROUNDTTT} ${DEVICE} + ;; + dhcp|bootp|rarp|both) + ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} + ;; + *) + ipconfig -t ${ROUNDTTT} -d $IP + + # grab device entry from ip option + NEW_DEVICE=${IP#*:*:*:*:*:*} + if [ "${NEW_DEVICE}" != "${IP}" ]; then + NEW_DEVICE=${NEW_DEVICE%:*} + else + # wrong parse, possibly only a partial string + NEW_DEVICE= + fi + if [ -n "${NEW_DEVICE}" ]; then + DEVICE="${NEW_DEVICE}" + fi + ;; + esac + done # source ipconfig output if [ -n "${DEVICE}" ]; then -- cgit v1.2.3 From 09fbb6c5727d3700cc672240fc69b026ef7a6e68 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 03:07:00 +0100 Subject: initramfs.conf.5: document UMASK variable for sensitive initramfs UMASK variable was supported for some time, but nobody knew about it. (closes: #536195) Signed-off-by: maximilian attems --- initramfs.conf.5 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 5fa6f87..984d1a2 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "2008/12/19" "Linux" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "2010/03/25" "Linux" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -48,6 +48,11 @@ The keymap will anyway be loaded by the initscripts later, and the packages that might need input will normally set this variable automatically, so there should normally be no need to set this. +.TP +\fB UMASK +Set the umask value of the generated initramfs file. +Useful to not disclose eventual keys. + .SH NFS VARIABLES .TP \fB BOOT -- cgit v1.2.3 From 83e83675cccb1856e2d90c8829c7a17852f62d46 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 17:00:26 +0100 Subject: update-initramfs: only run elilo if configured check for /etc/elilo.conf (closes: #534201) Signed-off-by: maximilian attems --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index 5085b0d..af7a99a 100755 --- a/update-initramfs +++ b/update-initramfs @@ -213,7 +213,7 @@ run_bootloader() run_lilo return 0 fi - if command -v elilo >/dev/null 2>&1; then + if [-r /etc/elilo.conf] && command -v elilo >/dev/null 2>&1; then elilo return 0 fi -- cgit v1.2.3 From 110a03b4fa048c3018bc5a09c8969af48b654099 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 25 Mar 2010 17:27:51 +0100 Subject: update-initramfs: fix previous elilo commit sloppy coding without coffee --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index af7a99a..8213e48 100755 --- a/update-initramfs +++ b/update-initramfs @@ -213,7 +213,7 @@ run_bootloader() run_lilo return 0 fi - if [-r /etc/elilo.conf] && command -v elilo >/dev/null 2>&1; then + if [ -r /etc/elilo.conf ] && command -v elilo >/dev/null 2>&1; then elilo return 0 fi -- cgit v1.2.3 From ae45b87f5f8503434a10baa0d95a4d2e5c0e9652 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 26 Mar 2010 05:46:03 +0100 Subject: MODULES=DEP Use driver/module syfs attribute I thought I'd experiment a bit with MODULES=DEP, but it seems this will not work. The atiixp module is properly installed into the initrd (I'm not sure how), but it doesn't end up in /conf/modules. Instead, the /conf/modules ends up as: radeonfb fbcon vesafb pci:v00001002d00004376sv00001462sd00000131bc01sc01i8a ide-gd ATIIXP_IDE pci:v00001002d00004376sv00001462sd00000131bc01sc01i8a unix Of these, the ide-gd and ATIIXP_IDE modules come from walking /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/. However, the module is called atiixp, not ATIIXP_IDE. The ATIIXP_IDE comes directly from sysfs, though: readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/driver /sys/bus/pci/drivers/ATIIXP_IDE Using driver/module instead of just driver is more robust: $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/driver/module /sys/module/atiixp This would also fix the ide-gd module, which really seems to be called ide-gd_mod: $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/driver /sys/bus/ide/drivers/ide-gd $ readlink -f /sys/devices/pci0000\:00/0000\:00\:14.1/ide0/0.0/driver/module /sys/module/ide_gd_mod $ sudo modprobe ide-gd FATAL: Module ide_gd not found. $ sudo modprobe ide-gd_mod (closes: #567189) Reported-by: Matthijs Kooijman [ checked that this already works in Lenny ] Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 189ad78..60bc2e9 100644 --- a/hook-functions +++ b/hook-functions @@ -218,7 +218,7 @@ sys_walk_mod_add() while [ "${device_path}" != "/sys" ]; do sys_walk_modalias ${device_path} - driver_path="$(readlink -f ${device_path}/driver)" + driver_path="$(readlink -f ${device_path}/driver/module)" if [ -e "$driver_path" ]; then module="$(basename $(readlink -f $driver_path))" if [ -n "${module}" ]; then -- cgit v1.2.3 From c713fd9872c4b917d89df89ddbc6c471d52c67d8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 26 Mar 2010 20:35:13 +0100 Subject: panic: quote variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Loïc Grenié Signed-off-by: maximilian attems --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index f99cba4..0ecb1d6 100644 --- a/scripts/functions +++ b/scripts/functions @@ -49,7 +49,7 @@ panic() fi modprobe i8042 modprobe atkbd - echo $@ + echo "$@" REASON="$@" PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } -- cgit v1.2.3 From 72f9d99901161b02513153eb3e587553fb21165e Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Fri, 26 Mar 2010 14:33:44 +0000 Subject: init: load the netconsole module with netconsole bootarg [ merge from 0.92bubuntu71 ] Signed-off-by: maximilian attems --- init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init b/init index 05853b4..f5b0646 100755 --- a/init +++ b/init @@ -169,6 +169,9 @@ for x in $(cat /proc/cmdline); do blacklist=*) blacklist=${x#blacklist=} ;; + netconsole=*) + netconsole=${x#netconsole=} + ;; esac done @@ -177,6 +180,8 @@ if [ -n "${noresume}" ]; then unset resume fi +[ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}" + maybe_break top # Don't do log messages here to avoid confusing usplash -- cgit v1.2.3 From 261811b5d0524c7fe579bf4ca22915c2dc4b636f Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Fri, 26 Mar 2010 14:33:13 +0000 Subject: init: mount /dev/pts as well as /dev Allows to redirect the console early. [ merge from 0.92bubuntu71 ] Signed-off-by: maximilian attems --- init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init b/init index f5b0646..0c9719d 100755 --- a/init +++ b/init @@ -22,6 +22,8 @@ if ! mount -t devtmpfs -o mode=0755 none /dev; then [ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1 [ -e /dev/null ] || mknod /dev/null c 1 3 fi +mkdir /dev/pts +mount -t devpts -o noexec,nosuid,gid=5,mode=0620 none /dev/pts || true > /dev/.initramfs-tools mkdir /dev/.initramfs -- cgit v1.2.3 From 9588c32006983fda80f393458e36fe3d7e590598 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 26 Mar 2010 13:00:28 +0100 Subject: mkinitramfs: Filter out looping or broken symlinks from the initramfs they cause cpio to explode (LP: #540686). [ merge from 0.92bubuntu70 ] (closes: #575157) Signed-off-by: maximilian attems --- mkinitramfs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkinitramfs b/mkinitramfs index e2f5ebe..877dfb4 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -256,6 +256,10 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / fi +# Remove any looping or broken symbolic links, since they break cpio. +find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ + | xargs -rL1 rm -f + [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( # work around lack of "set -o pipefail" for the following pipe: -- cgit v1.2.3 From 87d45befb832480954c8c025aee823f1627b9526 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 28 Mar 2010 15:57:33 +0200 Subject: MODULES=DEP: Check superblock on initramfs block do not trust mount as this is not the thing we look at on boot. (closes: #519800) as bonus run blkid if fstype has no idea. Reported-by: Martin Michlmayr Signed-off-by: maximilian attems --- hook-functions | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hook-functions b/hook-functions index 60bc2e9..cf8ea54 100644 --- a/hook-functions +++ b/hook-functions @@ -263,17 +263,18 @@ dep_add_modules() fi root="$(readlink -f ${root})" - # find out real rootfs on auto type - if [ "${FSTYPE}" = "auto" ]; then - eval "$(/usr/lib/klibc/bin/fstype ${root})" - fi + # do not trust mount, check superblock + eval "$(/usr/lib/klibc/bin/fstype ${root})" # check that fstype rootfs recognition if [ "${FSTYPE}" = "unknown" ]; then - echo "mkinitramfs: unknown fstype on root ${root}" - echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report bug on initramfs-tools" + FSTYPE=$(blkid -o value -s TYPE "${root}") + if [ -z "${FSTYPE}" ]; then + echo "mkinitramfs: unknown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "Error please report bug on initramfs-tools" exit 1 + fi fi # Add rootfs -- cgit v1.2.3 From 7ea605d62c6fca441a40820a573a2e0ef704f183 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 4 Apr 2010 02:15:17 +0200 Subject: Use ata_generic driver on all_generic_ide bootarg [ merge from 0.92bubuntu1 ] Reported-by: Ben Hutchings Signed-off-by: maximilian attems --- scripts/init-top/all_generic_ide | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide index 3274ee8..e9539d8 100755 --- a/scripts/init-top/all_generic_ide +++ b/scripts/init-top/all_generic_ide @@ -16,11 +16,11 @@ esac for x in $(cat /proc/cmdline); do case ${x} in all_generic_ide) - modprobe ide-generic + modprobe ata_generic all_generic_ide=1 ;; all_generic_ide=*) if [ ${x#all_generic_ide=} ]; then - modprobe ide-generic + modprobe ata_generic all_generic_ide=1 fi ;; esac -- cgit v1.2.3 From 9d6567169ea95ffad8a3c9a95218851821d147b8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 4 Apr 2010 05:30:31 +0200 Subject: scripts/functions: add get_fstype() from scripts/local allows wider usage. (closes: #487409) Reported-by: Christoph Anton Mitterer Signed-off-by: maximilian attems --- scripts/functions | 26 ++++++++++++++++++++++++++ scripts/local | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/scripts/functions b/scripts/functions index 0ecb1d6..9b864ae 100644 --- a/scripts/functions +++ b/scripts/functions @@ -256,6 +256,32 @@ parse_numeric() { ROOT=/dev/root } +# Parameter: device node to check +# Echos fstype to stdout +# Return value: indicates if an fs could be recognized +get_fstype () +{ + local FS FSTYPE FSSIZE RET + FS="${1}" + + # vol_id has a more complete list of file systems, + # but fstype is more robust + eval $(fstype "${FS}" 2> /dev/null) + if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then + FSTYPE=$(blkid -o value -s TYPE "${FS}") + elif [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then + FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) + fi + RET=$? + + if [ -z "${FSTYPE}" ]; then + FSTYPE="unknown" + fi + + echo "${FSTYPE}" + return ${RET} +} + configure_networking() { if [ -n "${BOOTIF}" ]; then diff --git a/scripts/local b/scripts/local index 1474073..cca5e8d 100644 --- a/scripts/local +++ b/scripts/local @@ -1,31 +1,5 @@ # Local filesystem mounting -*- shell-script -*- -# Parameter: device node to check -# Echos fstype to stdout -# Return value: indicates if an fs could be recognized -get_fstype () -{ - local FS FSTYPE FSSIZE RET - FS="${1}" - - # vol_id has a more complete list of file systems, - # but fstype is more robust - eval $(fstype "${FS}" 2> /dev/null) - if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then - FSTYPE=$(blkid -o value -s TYPE "${FS}") - elif [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then - FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null) - fi - RET=$? - - if [ -z "${FSTYPE}" ]; then - FSTYPE="unknown" - fi - - echo "${FSTYPE}" - return ${RET} -} - pre_mountroot() { [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top" -- cgit v1.2.3 From 38c90c536d96982ada4017d00da3878f87e7300e Mon Sep 17 00:00:00 2001 From: bert schulze Date: Sun, 28 Feb 2010 20:15:47 +0100 Subject: initramfs-tools: support different compression tools in mkinitramfs this version uses /etc/initramfs-tools/initramfs.conf to determine the compression method, checks kernel and userspace support with fallback to gzip. Since LZO didnt work for me at all with 2.6.33 I left that out for now. (closes: #533903) [ minor changes in mkinitramfs code ] Signed-off-by: maximilian attems --- conf/initramfs.conf | 6 ++++++ initramfs.conf.5 | 9 ++++++++- mkinitramfs | 16 +++++++++++++++- mkinitramfs.8 | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 23dd249..18c6c7e 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -35,6 +35,12 @@ BUSYBOX=y KEYMAP=n +# +# COMPRESS: [ gzip | bzip2 | lzma ] +# + +COMPRESS=gzip + # # NFS Section of the config. # diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 984d1a2..4d8ef89 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "2010/03/25" "Linux" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "2010/04/04" "Linux" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -48,6 +48,13 @@ The keymap will anyway be loaded by the initscripts later, and the packages that might need input will normally set this variable automatically, so there should normally be no need to set this. +.TP +\fB COMPRESS +Specifies the compression method used for the initramfs image. +.B mkinitramfs +will default to gzip if the kernel lacks support (CONFIG_RD) or the +corresponding userspace utility is not present. + .TP \fB UMASK Set the umask value of the generated initramfs file. diff --git a/mkinitramfs b/mkinitramfs index 877dfb4..33ef99b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -123,6 +123,20 @@ case "${version}" in ;; esac +# Check userspace and kernel support for compressed initramfs images +compress=${COMPRESS} +if command -v ${compress} >/dev/null 2>&1; then + compress=gzip + [ "${verbose}" = y ] && \ + echo "No ${COMPRESS} in ${PATH}, using gzip" +fi + +if ! `grep -q -i config_rd_${COMPRESS}=y /boot/config-${version}` ; then + compress=gzip + [ "${verbose}" = y ] && \ + echo "linux-2.6 misses ${COMPRESS} support, using gzip" +fi + if [ -d "${outfile}" ]; then echo "${outfile} is a directory" exit 1 @@ -273,7 +287,7 @@ eval ` find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | gzip >"${outfile}" + } | ${compress} >"${outfile}" echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 5d3c42b..c19697a 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -27,7 +27,7 @@ mkinitramfs \- low-level tool for generating an initramfs image The .B mkinitramfs script generates an initramfs image. -The initramfs is a gzipped cpio archive. The archive can be used on a +The initramfs is a compressed 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 -- cgit v1.2.3 From 0164c63083cf31e83660e866614c0cd83bd34bfd Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 4 Apr 2010 17:25:12 +0200 Subject: mkinitramfs.8: update date forgot to add here on compress commit. --- mkinitramfs.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs.8 b/mkinitramfs.8 index c19697a..d999957 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "2008/12/19" "Linux" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2010/04/04" "Linux" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image -- cgit v1.2.3 From fe7e630857d2fd1c9b7af48f33d46e626ac6509e Mon Sep 17 00:00:00 2001 From: Bert Schulze Date: Sun, 4 Apr 2010 17:43:48 +0200 Subject: mkinitramfs: -c compression support / commandline override fixed the commandline argument to select the compressor. also your test with "command" needed to be negated otherwise the fallback to gzip would take place everytime. -- frohe ostern Bert Schulze [ nuked trailing whitespace, and add comment for usage() ] Signed-off-by: maximilian attems --- hook-functions | 10 ++++++---- mkinitramfs | 15 ++++++++++++--- mkinitramfs.8 | 9 +++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/hook-functions b/hook-functions index cf8ea54..ab2f486 100644 --- a/hook-functions +++ b/hook-functions @@ -465,6 +465,7 @@ auto_add_modules() esac } +# mkinitramfs help message usage() { cat >&2 << EOF @@ -472,10 +473,11 @@ usage() Usage: ${0} [OPTION]... -o outfile [version] Options: - -d confdir Specify an alternative configuration directory. - -k Keep temporary directory used to make the image. - -o outfile Write to outfile. - -r root Override ROOT setting in initramfs.conf. + -c compress Override COMPRESS setting in initramfs.conf. + -d confdir Specify an alternative configuration directory. + -k Keep temporary directory used to make the image. + -o outfile Write to outfile. + -r root Override ROOT setting in initramfs.conf. See mkinitramfs(8) for further details. EOF diff --git a/mkinitramfs b/mkinitramfs index 33ef99b..110aca8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -11,7 +11,7 @@ errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" export BUSYBOXDIR="/bin" -OPTIONS=`getopt -o d:ko:r:v -n "$0" -- "$@"` +OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"` # Check for non-GNU getopt if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -20,6 +20,10 @@ eval set -- "$OPTIONS" while true; do case "$1" in + -c) + compress="$2" + shift 2 + ;; -d) CONFDIR="$2" shift 2 @@ -124,8 +128,13 @@ case "${version}" in esac # Check userspace and kernel support for compressed initramfs images -compress=${COMPRESS} -if command -v ${compress} >/dev/null 2>&1; then +if [ -z "${compress}" ]; then + compress=${COMPRESS} +else + COMPRESS=${compress} +fi + +if ! command -v ${compress} >/dev/null 2>&1; then compress=gzip [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" diff --git a/mkinitramfs.8 b/mkinitramfs.8 index d999957..7fdeefb 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -5,6 +5,8 @@ mkinitramfs \- low-level tool for generating an initramfs image .SH SYNOPSIS .B mkinitramfs +.RB [ \-c +.IR compress ] .RB [ \-d .IR confdir ] .RB [ \-k ] @@ -44,6 +46,13 @@ uses it as initial root file system. All finding of the root device happens in this early userspace. .SH OPTIONS +.TP +\fB \-c \fI compress +Override the +.B COMPRESS +setting in +.IR initramfs.conf . + .TP \fB \-d \fI confdir Set an alternate configuration directory. -- cgit v1.2.3 From 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 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 135b1620f5d591c6ffe6059124802d534d5473fb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 03:54:43 +0200 Subject: mkinitramfs: no longer copy depmod it is no longer used on boot, saves initramfs space and thus speed. Signed-off-by: maximilian attems --- mkinitramfs | 1 - 1 file changed, 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 110aca8..f7e484d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -257,7 +257,6 @@ fi # module-init-tools 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/*.conf "${DESTDIR}/etc/modprobe.d/" -- cgit v1.2.3 From 553aa3742ca43b4ba4e87b2dea2c5d31cc43a124 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Wed, 16 Dec 2009 17:47:49 +0000 Subject: mkinitramfs: generate pre-cached boot order file if tsort is available, use it instead of custom sorting code if a pre-cached order file is available, use that instead [ move cache_run_scripts from scripts/functions to hook-scripts as only used on mkinitramfs build and not on boot ] Signed-off-by: maximilian attems --- hook-functions | 16 ++++++++++++++++ mkinitramfs | 5 +++++ scripts/functions | 27 ++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index ab2f486..cf41e42 100644 --- a/hook-functions +++ b/hook-functions @@ -485,6 +485,22 @@ EOF } +# cache boot scripts order +cache_run_scripts() +{ + DESTDIR=${1} + scriptdir=${2} + initdir=${DESTDIR}${scriptdir} + [ ! -d ${initdir} ] && return + + runlist=$(get_prereq_pairs | tsort) + for crs_x in ${runlist}; do + [ -f ${initdir}/${crs_x} ] || continue + echo "${scriptdir}/${crs_x}" >> ${initdir}/ORDER + echo "[ -e /conf/param.conf ] && . /conf/param.conf" >> ${initdir}/ORDER + done +} + # minimal supported kernel version check_minkver() { diff --git a/mkinitramfs b/mkinitramfs index f7e484d..6eed876 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -269,6 +269,11 @@ fi run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks +# cache boot run order +for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do + cache_run_scripts "${DESTDIR}" "/scripts/${b#./}" +done + # generate module deps depmod -a -b "${DESTDIR}" ${version} rm "${DESTDIR}/lib/modules/${version}"/modules.*map diff --git a/scripts/functions b/scripts/functions index 9b864ae..7b68255 100644 --- a/scripts/functions +++ b/scripts/functions @@ -186,9 +186,22 @@ reduce_prereqs() done } +get_prereq_pairs() +{ + set_initlist + for gp_x in ${initlist}; do + echo ${gp_x} ${gp_x} + prereqs=$(${initdir}/${gp_x} prereqs) + for prereq in ${prereqs}; do + echo ${prereq} ${gp_x} + done + done +} + call_scripts() { for cs_x in ${runlist}; do + [ -f ${initdir}/${cs_x} ] || continue # mkinitramfs verbose output if [ "${verbose}" = "y" ]; then echo "Calling hook ${cs_x}" @@ -205,9 +218,17 @@ run_scripts() { initdir=${1} [ ! -d ${initdir} ] && return - get_prereqs - reduce_prereqs - call_scripts + + if [ -f ${initdir}/ORDER ]; then + . ${initdir}/ORDER + elif command -v tsort >/dev/null 2>&1; then + runlist=$(get_prereq_pairs | tsort) + call_scripts $2 + else + get_prereqs + reduce_prereqs + call_scripts + fi } # Load custom modules first -- cgit v1.2.3 From 755f0033cd5775e1d17c58965143b1b6001d3478 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 04:23:20 +0200 Subject: init: Silence "Loading essential drivers..." on quiet boot. no point in spamming that for quiet boot. Signed-off-by: maximilian attems --- init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init b/init index 0c9719d..c3cfc0b 100755 --- a/init +++ b/init @@ -190,9 +190,9 @@ maybe_break top run_scripts /scripts/init-top maybe_break modules -log_begin_msg "Loading essential drivers" +[ "$quiet" != "y" ] && log_begin_msg "Loading essential drivers" load_modules -log_end_msg +[ "$quiet" != "y" ] && log_end_msg maybe_break premount [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount" -- cgit v1.2.3 From 17c98474779d1887909bd60acaba1690e7e439e0 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 4 Jun 2009 02:58:57 +0100 Subject: mkinitramfs: set initramfs root to 755 fixes unionfs-fuse to service requests made by non-root users. [ merge from 0.92bubuntu31, this does not interfer with UMASK setting of created initramfs, but only concerns / of initramfs -maks ] Signed-off-by: maximilian attems --- mkinitramfs | 1 + 1 file changed, 1 insertion(+) diff --git a/mkinitramfs b/mkinitramfs index 6eed876..a9e98b2 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -162,6 +162,7 @@ if [ ! -e "${MODULESDIR}/modules.dep" ]; then fi DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 +chmod 755 "${DESTDIR}" __TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 DPKG_ARCH=`dpkg --print-architecture` -- cgit v1.2.3 From 18afe4934f72eeec551b7a42fa8dc200f80ded42 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 04:43:48 +0200 Subject: hook-functions: Add btrfs to base modules seems lots of people fancy it so lets add it. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index cf41e42..b7c816c 100644 --- a/hook-functions +++ b/hook-functions @@ -396,7 +396,7 @@ auto_add_modules() { case "$1" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid ext2 \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 56c017ce7d7103857f4043b29320156edee66bb0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 04:51:05 +0200 Subject: init: export BOOT for casper and friends merge from 0.92bubuntu9 Signed-off-by: maximilian attems --- init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init b/init index c3cfc0b..8083128 100755 --- a/init +++ b/init @@ -40,6 +40,7 @@ export ROOTDELAY= export ROOTFLAGS= export ROOTFSTYPE= export IP= +export BOOT= export BOOTIF= export break= export init=/sbin/init @@ -249,6 +250,7 @@ unset ROOTFSTYPE unset ROOTDELAY unset ROOT unset IP +unset BOOT unset BOOTIF unset blacklist unset break -- 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(-) 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 034308f306b2cb3bffeb5811aca2636405d29dd4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 05:14:34 +0200 Subject: modernize docs to todays standards seems nobody had a look since longer, nuke useless cpiogz for now, we may want resurrect that later. Signed-off-by: maximilian attems --- debian/initramfs-tools.examples | 1 - docs/example_hook | 56 +++------------------------ docs/example_hook_cpiogz | 84 ----------------------------------------- docs/example_script | 63 ++----------------------------- 4 files changed, 9 insertions(+), 195 deletions(-) delete mode 100644 docs/example_hook_cpiogz diff --git a/debian/initramfs-tools.examples b/debian/initramfs-tools.examples index 9f67297..9466301 100644 --- a/debian/initramfs-tools.examples +++ b/debian/initramfs-tools.examples @@ -1,4 +1,3 @@ conf/modules docs/example_script docs/example_hook -docs/example_hook_cpiogz diff --git a/docs/example_hook b/docs/example_hook index a0d015a..683ddad 100644 --- a/docs/example_hook +++ b/docs/example_hook @@ -1,5 +1,5 @@ #!/bin/sh - +# # # This is an example hook script. It will be run by 'mkinitramfs' # when it creates the image. It's job is to decide which files to @@ -8,39 +8,12 @@ # package is installed, or when the administrator runs 'mkinitramfs' # by hand to update an initramfs image. # -# TODO: What about the case where you install something that should be -# 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 -# predicated on a user response to a debconf question? That -# issue needs to be explored and a solution specified. -# -# * Do not assume that any needed subdirectories have been created -# yet, but don't bail out if they are already there. -# -# * All of the standard system tools are available, of course, since -# this hook is running in the real system, not the initramfs. -# -# * TODO: ... ? Anything else to tell them in this bullet-list? -# - -# -# The environment contains at least: -# -# CONFDIR -- usually /etc/mkinitramfs, can be set on mkinitramfs +# CONFDIR -- usually /etc/initramfs-tools, can be set on mkinitramfs # command line. # # DESTDIR -- The staging directory where we are building the image. -# -# 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? - +# +# see initramfs-tools(8) # # List the soft prerequisites here. This is a space separated list of @@ -80,7 +53,7 @@ esac # course may be other reasons to have custom logic deciding what to # install. The version variable may be useful for this. # -if [ -x /usr/bin/myprog ]; then +if command -v myprog >/dev/null 2>&1; then copy_exec /usr/bin/myprog usr/bin fi @@ -92,23 +65,4 @@ fi # ... and it should do what is necessary to have 'myprog' get run # inside the early runtime environment. -# Handle an error: -# -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 - # - # TODO: Decide if different error codes are meaningful, what they - # mean, and what the semantics of them are wrt 'mkinitramfs' - # pass or fail. Consider naming the error values with - # mnemonic symbols rather than magic numbers. They may or - # may not be the same set of errors as the set for - # in-initramfs scripts. - # -fi - exit 0 diff --git a/docs/example_hook_cpiogz b/docs/example_hook_cpiogz deleted file mode 100644 index f3e44d9..0000000 --- a/docs/example_hook_cpiogz +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -# -# The environment contains at least: -# -# CONFDIR -- usually /etc/mkinitramfs, can be set on mkinitramfs -# command line. -# -# DESTDIR -- The staging directory where we are building the image. -# -# TODO: Decide what environment variables are meaningful and defined -# in this context, then document them as part of the interface. -# -# TODO: Write a common header for these examples or move this -# documentation to a man page and reference it here. :-) -# - -# -# List the soft prerequisites here. This is a space separated list of -# names, of scripts that are in the same directory as this one, that -# must be run before this one can be. -# -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# -# Source the 'hook-functions' scriptlet (for 'catenate_cpiogz'): -# -. /usr/share/initramfs-tools/hook-functions - -# -# Lets pretend it has a conffile (think debconf), and we source it -# here. Don't make debconf lookup calls here. The postinst for the -# package owning this hook script should have done that and configured -# the "/etc/default/conffile" already. -# -# TODO: How does the package ensure that it's installed BEFORE the -# 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 - -# -# Also pretend that we only include our initramfs overlay if an opion -# is not "no", and the 'linux-image' package we are generating this -# initramfs for matches the version this script's package is designed -# for. Just for example; pretend this example mkinitramfs hook script -# is part of a 'linux-image' or 'xxx-modules' package. -# -if [ "$MYOPTION" != "no" -a "$version" = "2.6.12+ss2.1.9.1" ]; then - catenate_cpiogz /usr/lib/mypackage/initramfs.cpio.gz -fi - -# -# In this case, there does not have to be an (eg.): -# -# "/etc/mkinitramfs/init-top/mypackage" -# -# ... since that script is probably inside of the initramfs overlay -# already. If it's a conffile though, it does not belong in there, -# and should be placed in the appropriate location inside of -# "/etc/mkinitramfs". Remember that if it needs access to the -# settings in our "/etc/default/mypackage-initramfs", then that file -# must also get copied into a location inside of ${DESTDIR} by this -# hook script in order to make it available inside of the initramfs -# environment. -# - -exit 0 diff --git a/docs/example_script b/docs/example_script index d7f407f..5e9153b 100644 --- a/docs/example_script +++ b/docs/example_script @@ -2,45 +2,11 @@ # # This script is run inside of the initramfs environment during the -# system boot process. It is installed there by 'mkinitramfs'. The -# package that owns it may opt to install it in either an appropriate -# location under "/usr/share/initramfs-tools/scripts/", or a similar -# location under "/etc/mkinitramfs/scripts/", depending upon whether -# it should be considered to be a user modifiable conffile or not. -# -# TODO: How do we deal with the case where the package that installed -# this has been removed but not purged, if we always arbitrarily -# copy all of these scripts into the initramfs? -# -# * The available toolset is limited inside this environment... -# -# TODO: document that toolset in the man page. -# -# * /dev, /proc, and /sys are already mounted. / is a ?? ro/rw -# filesystem... etc. more documentation. -# -# * It is expected that /proc and /sys will be umounted before -# changing over to the real root file system, so you must not keep -# any files open on them beyond these scripts. -# -# * You may like to strip these documentation comments from this -# example if you take it for a template, to save a little space in -# the initramfs, since nobody will ever read it from inside of -# there anyhow. -# - -# -# The environment contains at least the following variables: -# -# TODO: Decide what environment variables are meaningful and defined -# in this context, then document them as part of the interface. -# -# Because this script will be run as a full separate process, rather -# than sourced inside the context of the driver script, if it needs to -# pass information to another script that may run after it, it must do -# so by writing data to a file location known to both scripts. Simply -# setting an environment variable will not work. +# system boot process. It is installed there by 'update-initramfs'. +# The # package that owns it may opt to install it in an appropriate +# location under "/usr/share/initramfs-tools/scripts/". # +# see initramfs-tools(8) for more details. # # List the soft prerequisites here. This is a space separated list of @@ -66,25 +32,4 @@ esac echo "Got here!" -# Handle an error: - -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 - # - # TODO: Decide if different error codes are meaningful, what they - # mean, and what the semantics of them are wrt 'init' pass - # or panic. Consider naming the error values with mnemonic - # symbols rather than magic numbers. - # -fi - exit 0 - -- cgit v1.2.3 From c1ab7621fbb6fd30d0d35eebc0853e04db6b41fa Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 05:18:37 +0200 Subject: examples: shipp old framebuffer boot script people might want to use that. Signed-off-by: maximilian attems --- debian/initramfs-tools.examples | 1 + docs/framebuffer | 108 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 docs/framebuffer diff --git a/debian/initramfs-tools.examples b/debian/initramfs-tools.examples index 9466301..bb28943 100644 --- a/debian/initramfs-tools.examples +++ b/debian/initramfs-tools.examples @@ -1,3 +1,4 @@ conf/modules docs/example_script docs/example_hook +docs/framebuffer diff --git a/docs/framebuffer b/docs/framebuffer new file mode 100644 index 0000000..678ffdf --- /dev/null +++ b/docs/framebuffer @@ -0,0 +1,108 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +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 " + # In the ":" form + elif [ "${opt}" != "${opt#*:}" ]; then + echo -n "${opt%:*}=${opt#*:} " + # Presumably a modevalue without the "mode=" prefix + elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then + echo -n "mode=$opt " + # Presumably a boolean + else + echo -n "${opt}=1 " + fi + done +} + +FB="" +OPTS="" + +for x in $(cat /proc/cmdline); do + case ${x} in + vga=*) + FB="vesafb"; + OPTS=""; + ;; + video=*) + FB=${x#*=} + FB="${FB%%:*}" + OPTS="$(parse_video_opts "${x}")" + esac +done + +# Module-specific workarounds +case ${FB} in +matroxfb) + # Map command line name to module name + FB=matroxfb_base + ;; +intelfb|i810fb|i915) + # Needs AGP driver loaded + modprobe intel-agp + ;; +uvesafb) + # v86d requires /dev/zero and dev/mem, but udev haven't been started yet + [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 + [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 + ;; +*) + ;; +esac + +if [ -n "${FB}" ]; then + unset MODPROBE_OPTIONS + modprobe -q fbcon + modprobe -q ${FB} ${OPTS} +fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + if [ $(($fbno < 32)) ]; then + mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} + fi + done < /proc/fb +else + mknod -m 0640 /dev/fb0 c 29 0 +fi -- cgit v1.2.3 From dff78f55c495d72adbbcaca6bff023224cc09b37 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 06:59:56 +0200 Subject: initramfs.conf.5, update-initramfs.conf.5: Add FILES section. allows to pointing to themselves. (closes: #565386) Signed-off-by: maximilian attems --- initramfs.conf.5 | 5 ++++- update-initramfs.conf.5 | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 4d8ef89..bb01f58 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "2010/04/04" "Linux" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "2010/04/05" "Linux" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -81,6 +81,9 @@ A root bootarg overrides that special setting. Defaults to \fIauto\fP in order to pick up value from DHCP server. Otherwise you need to specify \fIHOST:MOUNT\fP. +.SH FILES +.TP +.I /etc/initramfs-tools/initramfs.conf .SH AUTHOR The initramfs-tools are written by Maximilian Attems , diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index ce8f69f..525cd64 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "2010/03/24" "Linux" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "2010/04/05" "Linux" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -20,6 +20,10 @@ the \fBupdate_initramfs \-u\fP call. \fB backup_initramfs If set \fBupdate_initramfs\fP keeps an .bak file of the previous initramfs. If unset the backup initramfs will not be kept. +.SH FILES +.TP +.I /etc/initramfs-tools/update-initramfs.conf + .SH AUTHOR The initramfs-tools are written by Maximilian Attems , Jeff Bailey and numerous others. -- cgit v1.2.3 From 98ff14e976919ade0ab211a7cd882c7e4c48b2b2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 07:10:34 +0200 Subject: mkinitramfs: be silent if no map was generated in first place no need to spam people with: rm: cannot remove `/tmp/mkinitramfs_jWCE0R/lib/modules/2.6.33-2-amd64/modules.*map': No such file or directory Signed-off-by: maximilian attems --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index a9e98b2..2f9ac59 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -277,7 +277,7 @@ done # generate module deps depmod -a -b "${DESTDIR}" ${version} -rm "${DESTDIR}/lib/modules/${version}"/modules.*map +rm -f "${DESTDIR}/lib/modules/${version}"/modules.*map # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then -- cgit v1.2.3 From b07403cfe4d525574aab719bd83c231fe5f7687e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 07:42:45 +0200 Subject: debian/control: Add a breaks cryptsetup. see 576488, for report. Signed-off-by: maximilian attems --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 6580c78..42b68e0 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} +Breaks: cryptsetup (<< 2:1.1.0-2) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 43fbd1f6fec7e2de8c30dd4e961f47c5d22b4549 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 08:43:00 +0200 Subject: initramfs-tools.8: Document netconsole bootparam got missed when adding the support. Signed-off-by: maximilian attems --- initramfs-tools.8 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 55d413a..3bd5f12 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2009/06/23" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2010/04/05" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -123,6 +123,10 @@ The default is premount without any arg. Beware that if both "panic" and "break" are present, initramfs will not spawn any shells but reboot instead. +.TP +\fB\fI netconsole +loads netconsole linux modules with the chosen args. + .TP \fB\fI all_generic_ide loads generic IDE/ATA chipset support on boot. -- cgit v1.2.3 From d3c6ee2bdfb07593c009bba604901936eda525f1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 09:03:29 +0200 Subject: prepare release 0.94 add changelog and NEWS Signed-off-by: maximilian attems --- debian/NEWS | 11 +++++ debian/changelog | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/debian/NEWS b/debian/NEWS index 9ac39f5..ca2d765 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,14 @@ +initramfs-tools (0.94) unstable; urgency=low + + * For better boot speed and due to unusual complications framebuffer, AGP + and KMS drivers are dropped out of the generic MODULES=most case. + The dropped framebuffer boot script is shipped in the examples for + packagers of userspace boot graphics. They may also need to ship + a hook file adding the mentioned graphics drivers, but in a more + complete way. For the majority of boxes this is not necessary. + + -- maximilian attems Mon, 05 Apr 2010 08:10:34 +0200 + initramfs-tools (0.76) unstable; urgency=low * This release features nfs auto detection in the initramfs. diff --git a/debian/changelog b/debian/changelog index b0575f0..ea53cee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,136 @@ +initramfs-tools (0.94) UNRELEASED; urgency=low + + * The "Litte Bang" release + + [ maximilian attems ] + * Nuke kernelextras hooks. + * Create a klibc hook script. + * Redefinde MODULES=most to not carry any fb driver per default. + * Nuke framebuffer boot script. + * Revert "hook-functions: Add hid_* modules." + * Move busybox addition to a hook script. + * mkinitramfs fix comment. + * hook-functions: Fix mounted /sys check for openvz container. + * initramfs-tools.8: fix boot example script to execute. + scripts/functions. (closes: #545728) + * Fix out-of-date-standards-version. + * /etc/kernel hook script support for make deb-pkg generated linux-images + and kernel-package. (closes: #523735, #561289) + * update-initramfs: allow -t takeover on delete. + * /etc/kernel/postrm.d/i-t: use now takeover on delete. + (closes: #524534, #547365, #559619) + * Nuke useless unused dir. + * kernel hook scripts: Fix typo, add comments. + * hook-funcitions: Only warn about missing firmware if /proc/modules + exists. (closes: #560266, #575154) + * mkinitramfs: Be opportunistic when calling modprobe thus showing + errors. (closes: #554873) + * copy_exec: Check if ldd is around. + * scripts/local: Use blkid as backup fstype detection. (closes: #568527) + * mkinitramfs: only copy modprobe conf files. (closes: #506533) + * blacklist earlier at init-top stage. + * scripts/local: fix blkid invocation. + * init: export and unset BOOTIF. + * init: rexport resume to reallow it's hardcoded usage. (closes: #572858) + * update-initramfs: -d delete .bak file. (closes: #559535) + * control: bump standards version without changes. + * control: Clean up Uploaders field. + * switch from cdbs to debhelper 7. + * update-initramfs: Stop second guessing lilo usage. (closes: #574553) + * mkinitramfs: allow to build initramfs for unmodular linux images. + (closes: #415474, #433708) + * initramfs.conf.5: document UMASK variable for sensitive initramfs. + (closes: #536195) + * update-initramfs: only run elilo if configured. (closes: #534201) + * update-initramfs: fix previous elilo commit. + * MODULES=DEP Use driver/module syfs attribute. (closes: #567189) + * panic: quote variable. + * MODULES=DEP: Check rootfs on mkinitramfs. (closes: #519800) + * Use ata_generic driver on all_generic_ide bootarg + * scripts/functions: add get_fstype() from scripts/local. (closes: #487409) + * mkinitramfs.8: update date. + * Keep acpi modules in initramfs so that udev can load them early. + * mkinitramfs: no longer copy depmod. + * init: Silence "Loading essential drivers..." on quiet boot. + * hook-functions: Add btrfs to base modules. + * init: export BOOT for casper and friends. + * hooks/klibc: Keep gzip in initramfs. + * modernize docs to todays standards. + * examples: shipp old framebuffer boot script. + * initramfs.conf.5, update-initramfs.conf.5: Add FILES section. + (closes: #565386) + * mkinitramfs: be silent if no modules.map was generated in first place. + * debian/control: Add a breaks cryptsetup. + + [ Tormod Volden ] + * blacklist boot hook write to /etc/modprobe.d/initramfs.conf. + (closes: #541864) + + [ Michael Prokop ] + * Fix path to nfsroot.txt in documentation. + * hook-functions: Avoid firmware copy error. (closes: #570678) + + [ Joey Hess ] + * scripts/local: avoid mount -t unknown. (closes: #567065) + + [ Avi Rozen ] + * mkinitramfs: add all usb storage devices. (closes: #543568) + + [ Ferenc Wagner ] + * initramfs-tools: make the panic argument available in the rescue + shell. (closes: #569033) + + [ Maximilian Gass ] + * mkinitramfs: KEYMAP option fails to work due to missing keymap. + (closes: #565416) + + [ Vagrant Cascadian ] + * configure_networking: support BOOTIF variable set by pxelinux. + (closes: #535008) + + [ Ben Hutchings ] + * copy_modules_dir: Take a list of exclusions after the base directory. + * auto_add_modules: Copy all modules from net, excluding some + subdirectories. + + [ Scott James Remnant ] + * init: Mount devtmpfs on /dev. + * mkinitramfs: Call depmod before packing the initramfs. + (closes: #465760, #562561) + * init: load the netconsole module with netconsole bootarg + * init: mount /dev/pts as well as /dev. + + [ Ben Collins ] + * update-initramfs: Default to not keep .bak backups. + + [ Piotr Lewandowski ] + * update-initramfs breaks if /etc/mtab is a symlink to /proc/mounts. + (closes: #525606) + + [ Martin Michlmayr ] + * MODULES=dep fix boot with MMC. (closes: #548711) + + [ Nikolaus Schulz ] + * hook-functions: let dep_add_modules() recurse into lvm slave devices. + (closes: 573761) + + [ Anna Jonna Armannsdottir ] + * configure_networking: Try repeatedly ipconfig with increasing + timeout. + + [ Colin Watson ] + * mkinitramfs: Filter out looping or broken symlinks from the + initramfs. (closes: #575157) + * mkinitramfs: set initramfs root to 755. + + [ Bert Schulze ] + * initramfs-tools: support different compression tools in mkinitramfs. + (closes: #533903) + * mkinitramfs: -c compression support / commandline override. + (closes: #576429) + + -- maximilian attems Mon, 05 Apr 2010 05:25:48 +0200 + initramfs-tools (0.93.4) unstable; urgency=medium [ Aaron M. Ucko ] -- cgit v1.2.3 From dff462b8a86c3753f8b0107fbf4bb445ac9adb00 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 17:53:38 +0200 Subject: NEWS: shorten and rephrase concerning framebuffer boot script: "I don't think regular users need to see this; the maintainers of those packages can read the changelog." Reviewed-by: Ben Hutchings --- debian/NEWS | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index ca2d765..a2a16af 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,11 +1,7 @@ initramfs-tools (0.94) unstable; urgency=low - * For better boot speed and due to unusual complications framebuffer, AGP - and KMS drivers are dropped out of the generic MODULES=most case. - The dropped framebuffer boot script is shipped in the examples for - packagers of userspace boot graphics. They may also need to ship - a hook file adding the mentioned graphics drivers, but in a more - complete way. For the majority of boxes this is not necessary. + * To improve boot speed and avoid some complications, video drivers are + no longer included in the initramfs by default (MODULES=most). -- maximilian attems Mon, 05 Apr 2010 08:10:34 +0200 -- cgit v1.2.3 From 9b9648e26e87d9b7cd1ba0398f38441d4150c7eb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Apr 2010 22:37:02 +0200 Subject: release "Little Bang 0.94" initramfs-tools --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ea53cee..5a30a2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -initramfs-tools (0.94) UNRELEASED; urgency=low +initramfs-tools (0.94) unstable; urgency=low * The "Litte Bang" release -- cgit v1.2.3 From 46cec44601a2e65e3368c71b7728614c9b7d8a95 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 03:39:50 +0200 Subject: update TODO list to bring forward current known issues. --- debian/TODO | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/TODO b/debian/TODO index f62656f..7423d06 100644 --- a/debian/TODO +++ b/debian/TODO @@ -3,8 +3,16 @@ TODO o Grep for TODO and FIXME and do those. =) - o Eliminate ?udev?, ?klibc?, busybox (-> glibc). + o Exclude list of hooks for admin. + + o Easier generation for remote boxes, see #570522. + + o "Fix" sed magic for lib dependence, + copy_exec, maybe use dracut copy logic. - o Default to dep for PPC - Possibly to detect newworld? + o root loop support. + + o MODULES=dep md replace awk magic with proper parsing. + + o Eliminate ?udev?, ?klibc?, busybox (-> glibc). - o udevsettle timeouts handling -- cgit v1.2.3 From 5de4f2d88e47343f080884213919ddadb0efc7a7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 08:46:05 +0200 Subject: hook-functions: refactor copy_exec try to have an easier logic flow, also: * fail if wanted source does not exist * do not overwrite, no point in warning this add FIXME's to point missing /lib64 symlink parts. Signed-off-by: maximilian attems --- hook-functions | 61 ++++++++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/hook-functions b/hook-functions index b7c816c..dddf3b1 100644 --- a/hook-functions +++ b/hook-functions @@ -104,59 +104,37 @@ manual_add_modules() done } -# $1 is the source path (e.g. /usr/bin/time) -# $2 is the relative destination (e.g. /usr or /usr/time) -# -# The destination is interpreted in the same way "cp" would, meaning -# (assuming /bin is a directory): -# -# "copy_exec /usr/bin/time /bin" -> /bin/time -# "copy_exec /usr/bin/time /bin/mytime" -> /bin/mytime -# -# If $2 is left out, the same destination path as for the source arg will -# be used and directories will be created as needed, so: -# -# "copy_exec /usr/bin/time" -> /usr/bin/time -# +# $1 = file to copy to ramdisk +# $2 (optional) Name for the file on the ramdisk +# Location of the image dir is assumed to be $DESTDIR +# We never overwrite the target if it exists. copy_exec() { - local source target destination final_destination x nonoptlib + local src target x nonoptlib local libname dirname - source="${1}" - if [ -n "${2}" ]; then - target="${2}" - else - if [ ! -e "${DESTDIR}/$(dirname "${1}")" ]; then - mkdir -p "${DESTDIR}/$(dirname "${1}")" - fi - target="${1}" - fi + src="${1}" + target="${2:-$1}" + + [ -f "${src}" ] || return 1 if [ -d "${DESTDIR}/${target}" ]; then - destination="${target}/$(basename "${source}")" + # check if already copied + [ -e "${DESTDIR}/$target/${src##*/}" ] && return 0 else - destination="${target}" + [ -e "${DESTDIR}/$target" ] && return 0 + #FIXME: inst_dir + mkdir -p "${DESTDIR}/${target%/*}" fi - final_destination="${DESTDIR}/${destination}" - if [ -L "$final_destination" ]; then - if [ $(readlink "${final_destination}") != "${source}" ]; then - echo "W:copy_exec: Not copying ${source} to \$DESTDIR${destination}, which is already a copy of $(readlink ${final_destination})" >&2 - return - fi - else - ln -s ${source} ${DESTDIR}/${destination} - if [ "${verbose}" = "y" ]; then - echo "Adding binary ${source}" - fi - fi + [ "${verbose}" = "y" ] && echo "Adding binary ${src}" + ln -s "${src}" "${DESTDIR}/${target}" # Copy the dependant libraries if ! command -v ldd >/dev/null 2>&1 ; then echo "WARNING: no ldd around - install libc-bin" exit 1 fi - for x in $(ldd ${source} 2>/dev/null | sed -e ' + for x in $(ldd ${src} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; @@ -174,12 +152,11 @@ copy_exec() { libname=$(basename "${x}") dirname=$(dirname "${x}") + # FIXME inst_lib mkdir -p "${DESTDIR}/${dirname}" if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then ln -s "${x}" "${DESTDIR}/${dirname}" - if [ "${verbose}" = "y" ]; then - echo "Adding library ${x}" - fi + [ "${verbose}" = "y" ] && echo "Adding library ${x}" fi done } -- cgit v1.2.3 From a2a786f8bad3e1e3ed089c3c68addd9619c4c1ca Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 08:55:15 +0200 Subject: mkinitramfs: check only once for existing ldd no point to recheck on every copy_exec. now copy_exec starts to get redable.. Signed-off-by: maximilian attems --- hook-functions | 4 ---- mkinitramfs | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hook-functions b/hook-functions index dddf3b1..5f00f17 100644 --- a/hook-functions +++ b/hook-functions @@ -130,10 +130,6 @@ copy_exec() { ln -s "${src}" "${DESTDIR}/${target}" # Copy the dependant libraries - if ! command -v ldd >/dev/null 2>&1 ; then - echo "WARNING: no ldd around - install libc-bin" - exit 1 - fi for x in $(ldd ${src} 2>/dev/null | sed -e ' /\//!d; /linux-gate/d; diff --git a/mkinitramfs b/mkinitramfs index 2f9ac59..d71ada3 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -256,6 +256,11 @@ if [ -n "${ROOT}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi +if ! command -v ldd >/dev/null 2>&1 ; then + echo "WARNING: no ldd around - install libc-bin" + exit 1 +fi + # module-init-tools copy_exec /sbin/modprobe /sbin copy_exec /sbin/rmmod /sbin -- cgit v1.2.3 From 61d52590d7c75300dfb82ddfcc9ec542a8de45e9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 09:16:39 +0200 Subject: debian/control: Add a breaks mdadm hadn't checked that boot script before upload, see #576641. Signed-off-by: maximilian attems --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 42b68e0..4fee5e5 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<< 2:1.1.0-2) +Breaks: cryptsetup (<< 2:1.1.0-2), mdadm (<< 3.1.1-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 7f65166f8e30c26961bd0b85c2491d594b4b9d94 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 15:49:33 +0200 Subject: debian/control: Fix Breaks version comparison needs to include current sid versions. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4fee5e5..81a329c 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<< 2:1.1.0-2), mdadm (<< 3.1.1-1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (<= 3.1.1-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 27a9b05eb7d067023c48524dfa86de86a508e639 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 09:16:39 +0200 Subject: debian/control: Add a breaks mdadm hadn't checked that boot script before upload, see #576641. Signed-off-by: maximilian attems --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 42b68e0..4fee5e5 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<< 2:1.1.0-2) +Breaks: cryptsetup (<< 2:1.1.0-2), mdadm (<< 3.1.1-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 60d58df3065c796c8e60602568ca5130c489fb78 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 15:49:33 +0200 Subject: debian/control: Fix Breaks version comparison needs to include current sid versions. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4fee5e5..81a329c 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<< 2:1.1.0-2), mdadm (<< 3.1.1-1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (<= 3.1.1-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 9ac74c77a1f23fbfab17cf75077ce07cfc08eade Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 16:33:14 +0200 Subject: release 0.94.1 just the relevant fixes --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5a30a2a..5db44fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.94.1) unstable; urgency=low + + * debian/control: Add a breaks mdadm. + * debian/control: Fix Breaks version comparison. + + -- maximilian attems Tue, 06 Apr 2010 16:18:25 +0200 + initramfs-tools (0.94) unstable; urgency=low * The "Litte Bang" release -- cgit v1.2.3 From e1ad7fbe5fd73cff76a51867382e727ffed40ca7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 16:34:23 +0200 Subject: mkinitramfs: Use TMPDIR definition mktemp has marked the "-t" option as depcrecated, support TMPDIR. Signed-off-by: maximilian attems --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index d71ada3..c8079ab 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -161,9 +161,9 @@ if [ ! -e "${MODULESDIR}/modules.dep" ]; then depmod ${version} fi -DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1 +DESTDIR="$(mktemp -d ${TMPDIR:-/tmp}/mkinitramfs_XXXXXX)" || exit 1 chmod 755 "${DESTDIR}" -__TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1 +__TMPCPIOGZ="$(mktemp ${TMPDIR:-/tmp}/mkinitramfs-OL_XXXXXX)" || exit 1 DPKG_ARCH=`dpkg --print-architecture` -- cgit v1.2.3 From 82c15be74a55d1042341b4c43e4604a66d124ad1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 23:37:33 +0200 Subject: amend Breaks for mdadm recommend way by dpkg maintainer, need to test. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 81a329c..ad7552c 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (<= 3.1.1-1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (3.1.1-1+incremental+2), mdadm (3.1.1-1+incremental+1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From d6b533044ffcd014799a52b234d5a0769e183de8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 23:37:33 +0200 Subject: amend Breaks for mdadm recommend way by dpkg maintainer, need to test. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 81a329c..ad7552c 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (<= 3.1.1-1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (3.1.1-1+incremental+2), mdadm (3.1.1-1+incremental+1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 38756f9759f3985b75c66532cf0b9ca0b591260c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 23:48:45 +0200 Subject: debian/control: really fix that break list. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ad7552c..909b7da 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (3.1.1-1+incremental+2), mdadm (3.1.1-1+incremental+1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 1685c20d93e110970e2ac35734657ccb57de82c9 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 23:48:45 +0200 Subject: debian/control: really fix that break list. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ad7552c..909b7da 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (3.1.1-1+incremental+2), mdadm (3.1.1-1+incremental+1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 294f3024953b530186cfcdc01c5dd9a1b21f24a6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Apr 2010 23:50:30 +0200 Subject: release 0.94.2 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5db44fb..cdf341c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.94.2) unstable; urgency=low + + * debian/control: amend Breaks for exp mdadm. + + -- maximilian attems Tue, 06 Apr 2010 23:50:06 +0200 + initramfs-tools (0.94.1) unstable; urgency=low * debian/control: Add a breaks mdadm. -- cgit v1.2.3 From ea5eae180603a4dcf32215a3d66709cb565987e7 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 6 Apr 2010 20:01:46 +0200 Subject: mkinitramfs.8: Add information about $TMPDIR environment variable This documents problem with noexec mount options and fixes: BTW: The information about mkinitramfs looking at $TMPDIR is missing in the mkinitramfs(8) man page. Looked there (mostly for commandline options) before reporting that bug. But even searching for "TMP" in there now didn't find any hint on that. [ s/must/should/, date ] Signed-off-by: maximilian attems --- mkinitramfs.8 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 7fdeefb..49db6c8 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "2010/04/04" "Linux" "mkinitramfs manual" +.TH MKINITRAMFS 8 "2010/04/07" "Linux" "mkinitramfs manual" .SH NAME mkinitramfs \- low-level tool for generating an initramfs image @@ -92,6 +92,19 @@ This option queries if mkinitramfs can create ramdisks on a running kernel of ve This option queries if mkinitramfs can create ramdisks for kernel version .IR tversion . +.SH ENVIRONMENT +.B mkinitramfs +honours the +.B TMPDIR +environment variable. If set, it uses subdirectories in the given +directory to create its temporary working directories. Else it uses +.I /tmp +as default value for that purpose. The given directory should be on a +filesystem which allows the execution of files stored there, i.e. +should not be mounted with the +.B noexec +mount option. + .SH FILES .TP .I /etc/initramfs-tools/initramfs.conf -- cgit v1.2.3 From 45bcb8eb48e15dd75faa3eccd8c1cfacc14f8206 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 03:27:25 +0200 Subject: mkinitramfs: guard against empty EXTRA_CONF nothing there to see allmost.. Signed-off-by: maximilian attems --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index c8079ab..be983cf 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -66,7 +66,7 @@ done . "${CONFDIR}/initramfs.conf" EXTRA_CONF='' for i in /usr/share/initramfs-tools/conf.d/* ${CONFDIR}/conf.d/*; do - EXTRA_CONF="${EXTRA_CONF} $(basename $i \ + [ -e $i ] && EXTRA_CONF="${EXTRA_CONF} $(basename $i \ | grep '^[[:alnum:]][[:alnum:]\._-]*$' | grep -v '\.dpkg-.*$')"; done # FIXME: deprecated those settings on mkinitramfs run -- cgit v1.2.3 From 17b4d500164f285273c353c55e86850dd8a5998c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 07:00:41 +0200 Subject: update-initramfs: Use nounset better catch errors early.. Signed-off-by: maximilian attems --- update-initramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-initramfs b/update-initramfs index 8213e48..94b8971 100755 --- a/update-initramfs +++ b/update-initramfs @@ -8,12 +8,12 @@ USETRIGGERS=true mode="" version="" -set -e +set -eu [ -r ${CONF} ] && . ${CONF} if $USETRIGGERS \ - && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \ + && [ x"${DPKG_MAINTSCRIPT_PACKAGE:-}" != x ] \ && [ $# = 1 ] \ && [ x"$1" = x-u ] \ && dpkg-trigger --check-supported 2>/dev/null -- cgit v1.2.3 From f9db3f7bcbad79bdb1817aa53eb27a46b5951381 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 07:24:19 +0200 Subject: mkinitramfs: Fix several unbound variables might not be all, but a first go in stricter mkinitramfs. as bonus remove old amusing unused varialbe from day 2.. Signed-off-by: maximilian attems --- hook-functions | 14 +++++++------- mkinitramfs | 7 +++---- scripts/functions | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/hook-functions b/hook-functions index 5f00f17..76cbba9 100644 --- a/hook-functions +++ b/hook-functions @@ -175,10 +175,10 @@ copy_modules_dir() fi fi while [ $# -ge 1 ]; do - exclude="$exclude -name $1 -prune -o " + exclude="${exclude:-} -name $1 -prune -o " shift done - for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -print); do + for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } @@ -367,7 +367,7 @@ dep_add_modules() # The modules "most" classes added per default to the initramfs auto_add_modules() { - case "$1" in + case "${1:-}" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ @@ -479,10 +479,10 @@ check_minkver() { local curversion initdir DPKG_ARCH minversion cm_x tmp - curversion="${1}" - initdir="${2}" + curversion="${1:-}" + initdir="${2:-}" if [ -z "${initdir}" ]; then - case ${DPKG_ARCH} in + case ${DPKG_ARCH:-} in ia64|hppa) minversion="2.6.15" ;; @@ -498,7 +498,7 @@ check_minkver() return 0 fi set_initlist - for cm_x in ${initlist}; do + for cm_x in ${initlist:-}; do # sed: keep last line starting with MINKVER=, # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") diff --git a/mkinitramfs b/mkinitramfs index be983cf..045e73d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -7,7 +7,6 @@ export PATH='/usr/bin:/sbin:/bin' keep="n" CONFDIR="/etc/initramfs-tools" verbose="n" -errors_to="2>/dev/null" # BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" export BUSYBOXDIR="/bin" @@ -86,7 +85,7 @@ for i in /usr/share/initramfs-tools/conf-hooks.d/*; do fi done -if [ -n "${UMASK}" ]; then +if [ -n "${UMASK:-}" ]; then umask "${UMASK}" fi @@ -128,7 +127,7 @@ case "${version}" in esac # Check userspace and kernel support for compressed initramfs images -if [ -z "${compress}" ]; then +if [ -z "${compress:-}" ]; then compress=${COMPRESS} else COMPRESS=${compress} @@ -252,7 +251,7 @@ for i in ${EXTRA_CONF}; do done # ROOT hardcoding -if [ -n "${ROOT}" ]; then +if [ -n "${ROOT:-}" ]; then echo "ROOT=${ROOT}" > ${DESTDIR}/conf/conf.d/root fi diff --git a/scripts/functions b/scripts/functions index 7b68255..ec8a44b 100644 --- a/scripts/functions +++ b/scripts/functions @@ -189,7 +189,7 @@ reduce_prereqs() get_prereq_pairs() { set_initlist - for gp_x in ${initlist}; do + for gp_x in ${initlist:-}; do echo ${gp_x} ${gp_x} prereqs=$(${initdir}/${gp_x} prereqs) for prereq in ${prereqs}; do @@ -223,7 +223,7 @@ run_scripts() . ${initdir}/ORDER elif command -v tsort >/dev/null 2>&1; then runlist=$(get_prereq_pairs | tsort) - call_scripts $2 + call_scripts ${2:-} else get_prereqs reduce_prereqs -- cgit v1.2.3 From 5ab529df7757d33178083055a7ff00fca431efea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 07:49:35 +0200 Subject: mkinitramfs: On verbose indication what we rm not a fix for #576677, but at least some indication. Signed-off-by: maximilian attems --- mkinitramfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 045e73d..ad03580 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -289,8 +289,9 @@ if [ -e "${CONFDIR}/DSDT.aml" ]; then fi # Remove any looping or broken symbolic links, since they break cpio. +[ "${verbose}" = y ] && xargs_verbose="-t" find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ - | xargs -rL1 rm -f + | xargs ${xargs_verbose:-} -rL1 rm -f [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( -- cgit v1.2.3 From 497c367625f218368c577e0aaac79bc97e396a30 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Apr 2010 20:09:20 +0200 Subject: bug script: include sizes of generated initramfs usually gives a good indications when things go wrong. --- debian/script | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/script b/debian/script index 706a84d..daf3924 100755 --- a/debian/script +++ b/debian/script @@ -2,6 +2,9 @@ exec >&3 +echo "-- initramfs sizes" +ls -lh /boot/initrd.img-2.6.* + echo "-- /proc/cmdline" cat /proc/cmdline echo -- cgit v1.2.3 From 845edd0e39a635fdd171140fc35b616840fa34d5 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 03:07:16 +0200 Subject: debian/script: add generated resume param to bug /etc/initramfs-tools/conf.d/resume is often to be seen. Signed-off-by: maximilian attems --- debian/script | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/script b/debian/script index daf3924..43ae7d1 100755 --- a/debian/script +++ b/debian/script @@ -9,6 +9,11 @@ echo "-- /proc/cmdline" cat /proc/cmdline echo +if [ -r /etc/initramfs-tools/conf.d/resume ]; then + echo "-- resume" + cat /etc/initramfs-tools/conf.d/resume +fi + echo "-- /proc/filesystems" grep -v nodev /proc/filesystems echo -- cgit v1.2.3 From 6e22545f2f2355a3defb6bdb6a7a72329d54d373 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 03:46:37 +0200 Subject: debian/control: Add Breaks against experimental findutils (closes: #576677) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 909b7da..79ffcf6 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1), findutils (= 4.5.7-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 7a519612ec7b1ac077c395404d8b890738c790b3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 03:46:37 +0200 Subject: debian/control: Add Breaks against experimental findutils (closes: #576677) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 909b7da..79ffcf6 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1), findutils (= 4.5.7-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 062dfde05b2d67a2e2e8766f30847e56dd4c87d2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 03:56:11 +0200 Subject: release 0.94.3 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index cdf341c..b1fd2a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.94.3) unstable; urgency=low + + * debian/control: Add Breaks against experimental findutils. + (closes: #576677) + + -- maximilian attems Thu, 08 Apr 2010 03:50:28 +0200 + initramfs-tools (0.94.2) unstable; urgency=low * debian/control: amend Breaks for exp mdadm. -- cgit v1.2.3 From a46c26e0a01a83f41d7e491f1f1a747d5f000c85 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 05:59:04 +0200 Subject: init: fix hardcoded resume handling got confused in course of #572858, uppercase is for hardcoded device strings as here, pick up RESUME and not resume from config file. Closes: #576700 Signed-off-by: maximilian attems --- init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init b/init index 8083128..7d0db07 100755 --- a/init +++ b/init @@ -127,7 +127,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - resume="${x#resume=}" + RESUME="${x#resume=}" ;; resume_offset=*) resume_offset="${x#resume_offset=}" @@ -181,6 +181,8 @@ done if [ -n "${noresume}" ]; then export noresume unset resume +else + resume=${RESUME:-} fi [ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}" -- cgit v1.2.3 From c797a7af11908e7fdf2bac6380897e45f9f74e2b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 05:59:04 +0200 Subject: init: fix hardcoded resume handling got confused in course of #572858, uppercase is for hardcoded device strings as here, pick up RESUME and not resume from config file. Closes: #576700 Signed-off-by: maximilian attems --- init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init b/init index 8083128..7d0db07 100755 --- a/init +++ b/init @@ -127,7 +127,7 @@ for x in $(cat /proc/cmdline); do BOOT=${x#boot=} ;; resume=*) - resume="${x#resume=}" + RESUME="${x#resume=}" ;; resume_offset=*) resume_offset="${x#resume_offset=}" @@ -181,6 +181,8 @@ done if [ -n "${noresume}" ]; then export noresume unset resume +else + resume=${RESUME:-} fi [ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}" -- cgit v1.2.3 From 8c7b84b78088b12bef20ef3c138da3f508232373 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 06:04:03 +0200 Subject: release 0.94.4 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b1fd2a7..3fbdc8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +initramfs-tools (0.94.4) unstable; urgency=low + + * init: fix hardcoded resume handling. (Closes: #576700) + + -- maximilian attems Thu, 08 Apr 2010 06:02:28 +0200 + initramfs-tools (0.94.3) unstable; urgency=low * debian/control: Add Breaks against experimental findutils. -- cgit v1.2.3 From 7a26a4d17fe230055966ab8e1e5476e35fe9791a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 08:47:52 +0200 Subject: hook-functions: manual_add_modules simplify use meaningful variable s/mam_x/kmod/ loop directly on the modinfo output. Signed-off-by: maximilian attems --- hook-functions | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/hook-functions b/hook-functions index 76cbba9..3ba08c5 100644 --- a/hook-functions +++ b/hook-functions @@ -42,27 +42,23 @@ add_modules_from_file() # Add dependent modules + eventual firmware manual_add_modules() { - local mam_x firmwares firmware + local kmod firmware - for mam_x in $(modprobe --set-version="${version}" --ignore-install \ + for kmod in $(modprobe --set-version="${version}" --ignore-install \ --quiet --show-depends "${1}" | awk '/^insmod/ { print $2 }'); do # Prune duplicates - if [ -e "${DESTDIR}/${mam_x}" ]; then + if [ -e "${DESTDIR}/${kmod}" ]; then continue fi - mkdir -p "${DESTDIR}/$(dirname "${mam_x}")" - ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")" + mkdir -p "${DESTDIR}/$(dirname "${kmod}")" + ln -s "${kmod}" "${DESTDIR}/$(dirname "${kmod}")" if [ "${verbose}" = "y" ]; then - echo "Adding module ${mam_x}" + echo "Adding module ${kmod}" fi - # Add firmware files if necessary - firmwares=$(modinfo -F firmware "${mam_x}") - if [ -z "${firmwares}" ]; then - continue - fi - for firmware in $firmwares; do + # Add required firmware + for firmware in $(modinfo -F firmware "${kmod}"); do if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \ || [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then continue @@ -78,11 +74,11 @@ manual_add_modules() continue fi - if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \ + if grep -q "^$(basename "${kmod}" .ko)[[:space:]]" \ /proc/modules \ - || grep -q "^$(basename "${mam_x}" .ko)" \ + || grep -q "^$(basename "${kmod}" .ko)" \ "${CONFDIR}/modules"; then - echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2 + echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${kmod} .ko)" >&2 fi continue fi -- cgit v1.2.3 From ad301da1f90013d372772f9de0a3f518b9b24717 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 08:53:50 +0200 Subject: hook-functions: copy_modules_dir() small simplifications use meaningful variable name. Signed-off-by: maximilian attems --- hook-functions | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index 3ba08c5..86d4afa 100644 --- a/hook-functions +++ b/hook-functions @@ -156,8 +156,7 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { - local x_mod - local exclude + local kmod exclude local dir="$1" shift @@ -174,7 +173,7 @@ copy_modules_dir() exclude="${exclude:-} -name $1 -prune -o " shift done - for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do + for kmod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do manual_add_modules $(basename ${x_mod} .ko) done } -- cgit v1.2.3 From 5e5ec45e252b1b49b364fe38dcfca90bc90109c3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 17:54:47 +0200 Subject: mkinitramfs.8: Fix wrong sourcing in boot script Closes: 545728 Reported-by: Christoph Anton Mitterer Signed-off-by: maximilian attems --- initramfs-tools.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 3bd5f12..b0d0ebe 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2010/04/05" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2010/04/08" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -469,7 +469,7 @@ prereqs) ;; esac -\fR. /usr/share/initramfs-tools/hook-functions +\fR. /scripts/functions # Begin real processing below this line if [ ! \-x "/sbin/frobnicate" ]; then panic "Frobnication executable not found" -- cgit v1.2.3 From 6112a1927281c14b040ea8dbe3207cfddb4d9d4b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Apr 2010 20:24:24 +0200 Subject: debian/control: remove findutils Breaks newer findutils got uploaded to experimental ( and it was in principle findutils, who broke initramfs ;) Signed-off-by: maximilian attems --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 79ffcf6..909b7da 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1), findutils (= 4.5.7-1) +Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From 29166fa1d5311ee2c582ecb7e997ea855148dda0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 9 Apr 2010 01:00:17 +0200 Subject: initramfs-tools.8: Mention /scritps/functions Add direct reference to the file before dicussing the functions. Reported-by: Christoph Anton Mitterer --- initramfs-tools.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index b0d0ebe..6d0ae68 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -295,7 +295,9 @@ esac Where PREREQ is modified to list other scripts in the same subdirectory if necessary. .SS Help functions -A number of functions (mostly dealing with output) are provided to boot scripts: +A number of functions (mostly dealing with output) are provided to boot scripts in +.I /scripts/functions +: .TP \fB\fI -- cgit v1.2.3 From 6e9a3ba17b49c08cd2d42d320c5258fa142e5e93 Mon Sep 17 00:00:00 2001 From: bert schulze Date: Fri, 9 Apr 2010 12:50:31 +0200 Subject: mkinitramfs: add LZO support Albin Tonnerre sent a patch fixing the initramfs LZO decompression, so heres my fix for initramfs-tools to have compete compression support. Tell me if you want me to open a new bugreport. On a side note: this will only work with a patched kernel (might be upstream with 2.6.34), its a good idea to include a warning for those running 2.6.33 from experimental [ adding it on TODO of Lenny linux-2.6 2.6.32 ] Signed-off-by: maximilian attems --- conf/initramfs.conf | 2 +- mkinitramfs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 18c6c7e..2aa380f 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -36,7 +36,7 @@ BUSYBOX=y KEYMAP=n # -# COMPRESS: [ gzip | bzip2 | lzma ] +# COMPRESS: [ gzip | bzip2 | lzma | lzop ] # COMPRESS=gzip diff --git a/mkinitramfs b/mkinitramfs index ad03580..837bbd1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -139,7 +139,7 @@ if ! command -v ${compress} >/dev/null 2>&1; then echo "No ${COMPRESS} in ${PATH}, using gzip" fi -if ! `grep -q -i config_rd_${COMPRESS}=y /boot/config-${version}` ; then +if ! `grep -q -i ^config_rd_${COMPRESS%p} /boot/config-${version}` ; then compress=gzip [ "${verbose}" = y ] && \ echo "linux-2.6 misses ${COMPRESS} support, using gzip" -- cgit v1.2.3 From 3041c946e22f5e461ce25ea546b0b583e55ad578 Mon Sep 17 00:00:00 2001 From: bert schulze Date: Fri, 9 Apr 2010 19:13:38 +0200 Subject: mkinitramfs: use -9 for lzop "You do want to use -9 as far as LZO is concerned. The compression ratio is way better, and the extraction time is actually *not* related to the compression level" Albin Tonnerre already pointed that out to Maximilian, forgot to put you on CC. Let's keep the gzip "speed enthusiasts" happy and enable -9 for lzop only. Signed-off-by: maximilian attems --- mkinitramfs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkinitramfs b/mkinitramfs index 837bbd1..e249d32 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -145,6 +145,8 @@ if ! `grep -q -i ^config_rd_${COMPRESS%p} /boot/config-${version}` ; then echo "linux-2.6 misses ${COMPRESS} support, using gzip" fi +[ "${compress}" = lzop ] && compress="lzop -9" + if [ -d "${outfile}" ]; then echo "${outfile} is a directory" exit 1 -- cgit v1.2.3 From 5db5becc85059e56075de5a331ed7c5a4cc2de0c Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 9 Apr 2010 20:32:23 -0700 Subject: configure_networking: pxelinux BOOTIF fixes looks like i missed a few things on implementing BOOTIF support properly. somehow i managed to get the order of the mac address backwards. i know i tested it many times.. Signed-off-by: maximilian attems --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index ec8a44b..88f1bbd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -323,7 +323,7 @@ configure_networking() if [ -z "$bootif_mac" ]; then bootif_mac="$x" else - bootif_mac="$x:$bootif_mac" + bootif_mac="$bootif_mac:$x" fi done unset IFS -- cgit v1.2.3 From 4b7ef011bf8d2e532a1944f0ff423163588a6878 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 9 Apr 2010 20:32:23 -0700 Subject: init: add BOOTIF bootarg as mentioned by Christoph Bussenius in #535008, it does appear that setting BOOTIF from the value in /proc/cmdline is needed. at the time i wrote the patch, i'm not sure it was, but it definitely is now. with these patchese applied, it seems to work. at least for the moment. Signed-off-by: maximilian attems --- init | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init b/init index 7d0db07..142eb14 100755 --- a/init +++ b/init @@ -175,6 +175,9 @@ for x in $(cat /proc/cmdline); do netconsole=*) netconsole=${x#netconsole=} ;; + BOOTIF=*) + BOOTIF=${x#BOOTIF=} + ;; esac done -- cgit v1.2.3 From 30906972191d78dde73363441b4b8670b116f528 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 10 Apr 2010 06:40:46 +0200 Subject: initramfs-tools.8: cryptopts param gone since a while already, rm ref. Signed-off-by: maximilian attems --- initramfs-tools.8 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 6d0ae68..fb289a7 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -68,10 +68,6 @@ tells how to configure the ip address. Allows to specify an different NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt in any recent Linux source for details. Optional paramater for NFS root. -.TP -\fB\fI cryptopts -passes the args for cryptoroot. Set by the cryptsetup boot hooks. - .TP \fB\fI boot either local or NFS (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). -- cgit v1.2.3 From 891b651f29f356e67d77a9a3bb04508dc816756b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 10 Apr 2010 06:45:36 +0200 Subject: initramfs-tools.8: document BOOTIF variable Signed-off-by: maximilian attems --- initramfs-tools.8 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index fb289a7..0a15574 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2010/04/08" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2010/04/10" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -68,6 +68,12 @@ tells how to configure the ip address. Allows to specify an different NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt in any recent Linux source for details. Optional paramater for NFS root. +.TP +\fB\fI BOOTIF +is a mac adress in pxelinux format with leading "01-" and "-" as separations. +pxelinux passes mac adress of network card used to PXE boot on with this +bootarg. + .TP \fB\fI boot either local or NFS (affects which initramfs scripts are run, see the "Subdirectories" section under boot scripts). -- cgit v1.2.3 From 24875289070511b1039b690e72cf241b5d554688 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 10 Apr 2010 07:04:05 +0200 Subject: configure_networking(): work with empty DEVICE string initramfs-tools currently requires a device to be hard-coded, but this is not much use if the network device is not known ahead of time. If the device specified in either /etc/initramfs-tools/initramfs.conf or on the ip=xxx kernel command line. usefull for multiple net devices. Based on patch by Tim Small Closes: #566295, #575766 Reviewed-by: Vagrant Cascadian Signed-off-by: maximilian attems --- conf/initramfs.conf | 5 +++-- scripts/functions | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 2aa380f..0a108a8 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -58,10 +58,11 @@ BOOT=local # # DEVICE: ... # -# Specify the network interface, like eth0 +# Specify a specific network interface, like eth0 +# Overriden by optional ip= bootarg # -DEVICE=eth0 +DEVICE= # # NFSROOT: [ auto | HOST:MOUNT ] diff --git a/scripts/functions b/scripts/functions index 88f1bbd..1cc9be6 100644 --- a/scripts/functions +++ b/scripts/functions @@ -363,10 +363,10 @@ configure_networking() ;; ""|on|any) # Bring up device - ipconfig -t ${ROUNDTTT} ${DEVICE} + ipconfig -t ${ROUNDTTT} "${DEVICE}" ;; dhcp|bootp|rarp|both) - ipconfig -t ${ROUNDTTT} -c ${IP} -d ${DEVICE} + ipconfig -t ${ROUNDTTT} -c ${IP} -d "${DEVICE}" ;; *) ipconfig -t ${ROUNDTTT} -d $IP @@ -391,7 +391,8 @@ configure_networking() # source specific bootdevice . /tmp/net-${DEVICE}.conf else - # source any interface as not exaclty specified + # source any interface... + # ipconfig should have quit after first response . /tmp/net-*.conf fi } -- cgit v1.2.3 From b4305bf8d52ee8498262d256993a7c5e9941ba50 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 11 Apr 2010 06:56:53 +0200 Subject: hook-functions: add hid-apple got axed while reverting the include any hid commit. Closes: #577253 Signed-off-by: maximilian attems --- hook-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hook-functions b/hook-functions index 86d4afa..2f6580b 100644 --- a/hook-functions +++ b/hook-functions @@ -364,9 +364,9 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid btrfs ext2 \ - ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \ - atkbd i8042 virtio_pci; do + for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid-apple btrfs \ + ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ + af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" done ;; -- cgit v1.2.3 From 60e66ab6f7e799ac99e051fd8877f5b54758f454 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 18 May 2010 05:00:09 +0200 Subject: Revert "mkinitramfs: only copy modprobe conf files" This reverts commit 836e5cf6ddb30757365c2b879b96958c250dcd7b. due to partial upgrades this can only done after squueeze release. Reopen: #506533 Closes: #577981 Signed-off-by: maximilian attems --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index e249d32..e54c77f 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -266,7 +266,7 @@ fi copy_exec /sbin/modprobe /sbin copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" -cp -a /etc/modprobe.d/*.conf "${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 -- cgit v1.2.3 From 6ac7ec30d81bee53674c3bf6a19750126bac4554 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 19 May 2010 16:59:24 +0200 Subject: Support booting from USB 3 xHCI-based controllers using kernel driver xhci. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 2f6580b..b486439 100644 --- a/hook-functions +++ b/hook-functions @@ -364,7 +364,7 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid-apple btrfs \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple btrfs \ ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 70b8f446dfe1ac302fdf5d564896214a6ccf5a1e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 19 May 2010 20:01:17 +0200 Subject: initramfs-tools: change license to GPL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The public domain "license" is very liberal and thus allows this to be relicensed under mostly any compatible license. Although not strictly needed many passed contributors agreed on the license change. Many especially asked for the "or any later version", thus it is now licensed under GPL v2 or later. This should ease collaboration with dracut. Acked-by: Jeff Bailey Acked-by: Kees Cook Acked-by: Matt Kraai Acked-by: Michal Pokrywka Acked-by: martin f krafft Acked-by: Ian Campbell Acked-by: Andres Salomon Acked-by: Loïc Minier Acked-by: Chris Lamb Acked-by: Michael Prokop Acked-by: Ferenc Wagner Acked-by: Avi Rozen Acked-by: Piotr Lewandowski Acked-by: Daniel Reichelt Acked-by: Colin Watson Acked-by: Fabio M. Di Nitto Acked-by: Axel Beckert Acked-by: debian@x.ray.net Acked-by: Maik Zumstrull Acked-by: David Härdeman Acked-by: Martin Michlmayr Acked-by: Ben Collins Acked-by: Glennie Vignarajah Acked-by: Ben Hutchings Acked-by: Aaron M. Ucko Acked-by: kel@otaku42.de Acked-by: Maximilian Gass Acked-by: Joey Hess Acked-by: Gerfried Fuchs Acked-by: Tormod Volden --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index ddbb70f..c21c66d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -26,4 +26,4 @@ Copyright: 2005 - 2006 Adam Conrad License: -PUBLIC DOMAIN +GPL v2 or any later version -- cgit v1.2.3 From 9e7cebc5bc94634987b35bf08e150c179bd927c4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 16:34:07 -0700 Subject: hook-functions: re-add hid-microsoft people use it and thus complain.. Closes: 577253 Signed-off-by: maximilian attems --- hook-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index b486439..c7308b8 100644 --- a/hook-functions +++ b/hook-functions @@ -364,8 +364,9 @@ auto_add_modules() { case "${1:-}" in base) - for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple btrfs \ - ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ + for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ + hid-microsoft \ + btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" done -- cgit v1.2.3 From 81606da78671a6f2b4d54bb2b2e8dbd586ef9c61 Mon Sep 17 00:00:00 2001 From: Claus Herwig Date: Fri, 30 Apr 2010 02:27:55 +0200 Subject: mkinitramfs: fix MODULES=dep on mylex raid devices (DAC960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mkinitramfs fails to generate a initrd file for root filesystems on an old mylex raid controller (kernel module DAC960). In my case this breaks installation for lenny (5.0.3) on a FJS Primergy server - as this bug is not only in the mentioned version but also in 0.92 which ships on the lenny install cd: The installer can boot, as the old kernel module is still present. But the base install step fails when it tries to generate the initrd. The error in detail, when invoking mkinitramfs manually with -x ----------- (...) + manual_add_modules ext2 + local mam_x firmwares firmware ++ modprobe --set-version=2.6.29.6-vs2.3.0.36.14-beng --ignore-install --quiet --show-depends ext2 ++ awk '/^insmod/ { print $2 }' + for mam_x in '$(modprobe --set-version="${version}" --ignore-install --quiet --show-depends "${1}" | awk '\''/^insmod/ { print $2 }'\'')' + '[' -e /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko ']' ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + mkdir -p /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + ln -s /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs + '[' n = y ']' ++ modinfo -F firmware /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/mbcache.ko + firmwares= + '[' -z '' ']' + continue + for mam_x in '$(modprobe --set-version="${version}" --ignore-install --quiet --show-depends "${1}" | awk '\''/^insmod/ { print $2 }'\'')' + '[' -e /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko ']' ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + mkdir -p /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2 ++ dirname /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + ln -s /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko /tmp/mkinitramfs_lNjzuV//lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2 + '[' n = y ']' ++ modinfo -F firmware /lib/modules/2.6.29.6-vs2.3.0.36.14-beng/kernel/fs/ext2/ext2.ko + firmwares= + '[' -z '' ']' + continue + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + '[' /dev/rd/c0d0p1 '!=' /dev/rd/c0d0p1 ']' + block=rd/c0d0p1 + block=rd/c + '[' -z rd/c ']' + '[' '!' -e /sys/block/rd/c ']' + echo 'mkinitramfs: for root /dev/rd/c0d0p1 missing rd/c /sys/block/ entry' mkinitramfs: for root /dev/rd/c0d0p1 missing rd/c /sys/block/ entry + echo 'mkinitramfs: workaround is MODULES=most' mkinitramfs: workaround is MODULES=most + echo 'mkinitramfs: Error please report the bug' mkinitramfs: Error please report the bug + exit 1 ------------- So the reason is that mkinitramfs fails to derive the correct block device notation from the root device as the DAC960 driver uses a strange format for it. Once figured out, this is easily corrected. Please find a short patch for /usr/share/initramfs-tools/hook-functions attached. Thank you, Claus Herwig -- CHECON EDV-Consulting und Redaktion Claus Herwig * Barer Straße 70 * 80799 München +49 89 27826981 * Fax 27826982 * c.herwig@checon.de Closes: #579702 [ whitespace cleanups -maks ] Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hook-functions b/hook-functions index c7308b8..744fc91 100644 --- a/hook-functions +++ b/hook-functions @@ -305,6 +305,12 @@ dep_add_modules() elif [ "${root#/dev/mmcblk}" != "${root}" ]; then block=${root#/dev/} block=${block%%p[0-9]*} + + # DAC960 - good old mylex raid - root dev format /dev/rd/cXdXpX + elif [ "${root#/dev/rd/c}" != "${root}" ]; then + block="rd!c${root#/dev/rd/c}" + block=${block%%p[0-9]*} + # classical root device else block=${root#/dev/} -- cgit v1.2.3 From 6e9b04af970b7ebe6d5099bc1721e6fdf4bf1742 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 16:52:16 -0700 Subject: initramfs-tools: drop outdated breaks all of this software got fixed and was mostly seen in exp, with cryptestup fixed long time ago. Signed-off-by: maximilian attems --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index 79ffcf6..6580c78 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,6 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} -Breaks: cryptsetup (<= 2:1.1.0-2), mdadm (= 3.1.1-1+incremental+4), mdadm (= 3.1.1-1+incremental+3), mdadm (= 3.1.1-1+incremental+2), mdadm (= 3.1.1-1+incremental+1), findutils (= 4.5.7-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 -- cgit v1.2.3 From e20bb92433deadc137626f3bcd1e86b93d14b579 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 16:59:14 -0700 Subject: debian/copyright: add boilerplate to keep lintian happy. shuts up copyright-should-refer-to-common-license-file-for-gpl. Signed-off-by: maximilian attems --- debian/copyright | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/copyright b/debian/copyright index c21c66d..f84910d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -27,3 +27,6 @@ Copyright: 2005 - 2006 Adam Conrad License: GPL v2 or any later version + +On Debian systems, the complete text of the GNU General Public License version +2 can be found in `/usr/share/common-licenses/GPL-2'. -- cgit v1.2.3 From 81da804d1cd8deba5d2eb4d7180c060a01969368 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 17:15:59 -0700 Subject: hook-functions: Fix copy_modules_dir() overseen variable renaming. Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 744fc91..213a48a 100644 --- a/hook-functions +++ b/hook-functions @@ -174,7 +174,7 @@ copy_modules_dir() shift done for kmod in $(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -print); do - manual_add_modules $(basename ${x_mod} .ko) + manual_add_modules $(basename ${kmod} .ko) done } -- cgit v1.2.3 From 06468756ee6d5477b306a61473789f4aa9c088a1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 28 May 2010 17:24:05 -0700 Subject: release 0.95 Signed-off-by: maximilian attems --- debian/changelog | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3fbdc8c..35ef312 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,52 @@ +initramfs-tools (0.95) unstable; urgency=low + + [ maximilian attems ] + * update TODO list. + * hook-functions: refactor copy_exec. + * mkinitramfs: check only once for existing ldd. + * mkinitramfs: Use eventual TMPDIR definition. + * mkinitramfs: guard against empty EXTRA_CONF. + * update-initramfs: Use nounset. + * mkinitramfs: Fix several unbound variables. + * mkinitramfs: On verbose indicate what we rm. + * bug script: include sizes of generated initramfs. + * debian/script: add generated resume param to bug. + * hook-functions: manual_add_modules simplify. + * hook-functions: copy_modules_dir() small simplifications. + * mkinitramfs.8: Fix wrong sourcing in boot script. (Closes: #545728) + * initramfs-tools.8: Mention /scritps/functions. + * initramfs-tools.8: cryptopts param gone. + * initramfs-tools.8: document BOOTIF variable. + * configure_networking(): work with empty DEVICE string. + (Closes: #566295, #575766) + * hook-functions: add hid-apple. (Closes: #577253) + * Revert "mkinitramfs: only copy modprobe conf files". (Closes: #577981) + * initramfs-tools: change license to GPL. + * hook-functions: re-add hid-microsoft. (Closes: #577253) + * initramfs-tools: drop outdated breaks. + * debian/copyright: add boilerplate to keep lintian happy. + * hook-functions: Fix copy_modules_dir(). + + [ Axel Beckert ] + * mkinitramfs.8: Add information about $TMPDIR environment variable. + + [ bert schulze ] + * mkinitramfs: add LZO support. + * mkinitramfs: use -9 for lzop. + + [ Vagrant Cascadian ] + * configure_networking: pxelinux BOOTIF fixes. + * init: add BOOTIF bootarg. + + [ Michael Prokop ] + * Support booting from USB 3 xHCI-based controllers. + + [ Claus Herwig ] + * mkinitramfs: fix MODULES=dep on mylex raid devices (DAC960). + (Closes: #579702) + + -- maximilian attems Fri, 28 May 2010 17:22:56 -0700 + initramfs-tools (0.94.4) unstable; urgency=low * init: fix hardcoded resume handling. (Closes: #576700) -- cgit v1.2.3 From 8db2ddbaaf1f554c131f2483032aa31b6b70b36b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 30 May 2010 21:25:02 +0200 Subject: update-initramfs: fix unbound variables. [Closes: #583695] Signed-off-by: Michael Prokop --- update-initramfs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 94b8971..89bbdbe 100755 --- a/update-initramfs +++ b/update-initramfs @@ -7,6 +7,8 @@ KPKGCONF=/etc/kernel-img.conf USETRIGGERS=true mode="" version="" +update_initramfs=yes +backup_initramfs=no set -eu @@ -26,7 +28,7 @@ fi usage() { - if [ -n "${1}" ]; then + if [ -n "${1:-}" ]; then printf "${@}\n\n" >&2 fi cat >&2 << EOF @@ -61,7 +63,7 @@ chrooted() mild_panic() { - if [ -n "${1}" ]; then + if [ -n "${1:-}" ]; then printf "${@}\n" >&2 fi exit 0 @@ -69,7 +71,7 @@ mild_panic() panic() { - if [ -n "${1}" ]; then + if [ -n "${1:-}" ]; then printf "${@}\n" >&2 fi exit 1 @@ -127,6 +129,7 @@ backup_booted_initramfs() fi # keep booted initramfs + boot_initramfs= uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) if [ -n "$uptime_days" ]; then boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days}) @@ -295,6 +298,7 @@ set_current_version() set_linked_version() { + linktarget= if [ -e /initrd.img ] && [ -L /initrd.img ]; then linktarget="$(basename "$(readlink /initrd.img)")" fi @@ -313,6 +317,10 @@ set_linked_version() set_highest_version() { get_sorted_versions + if [ -z "${version_list}" ]; then + version= + return + fi set -- ${version_list} version=${1} } -- cgit v1.2.3 From 06d05e4d9d0471e1448d233bbd37e38b7f8c3bc7 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 30 May 2010 02:16:52 -0500 Subject: update-initramfs: use $* instead of $@ Use "$*" where it makes the quoting behavior easier to understand. Signed-off-by: Jonathan Nieder Reviewed-by: Michael Prokop --- update-initramfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-initramfs b/update-initramfs index 89bbdbe..e49115b 100755 --- a/update-initramfs +++ b/update-initramfs @@ -29,7 +29,7 @@ fi usage() { if [ -n "${1:-}" ]; then - printf "${@}\n\n" >&2 + printf "${*}\n\n" >&2 fi cat >&2 << EOF Usage: ${0} [OPTION]... @@ -64,7 +64,7 @@ chrooted() mild_panic() { if [ -n "${1:-}" ]; then - printf "${@}\n" >&2 + printf "${*}\n" >&2 fi exit 0 } @@ -72,7 +72,7 @@ mild_panic() panic() { if [ -n "${1:-}" ]; then - printf "${@}\n" >&2 + printf "${*}\n" >&2 fi exit 1 } @@ -80,7 +80,7 @@ panic() verbose() { if [ "${verbose}" = 1 ]; then - printf "${@}\n" + printf "${*}\n" fi } -- cgit v1.2.3 From 75ab44586744b4c2b7ff1a1a13e9c7c8425ac829 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 30 May 2010 22:10:44 +0200 Subject: release 0.95.1. Signed-off-by: Michael Prokop --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 35ef312..4d3f8c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +initramfs-tools (0.95.1) unstable; urgency=low + + [ Michael Prokop ] + * NMU as requested by maintainer. + * update-initramfs: fix unbound variables. [Closes: #583695] + Based on patch by Jonathan Nieder. + + [ Jonathan Nieder ] + * update-initramfs: use $* instead of $@. + + -- Michael Prokop Sun, 30 May 2010 22:09:15 +0200 + initramfs-tools (0.95) unstable; urgency=low [ maximilian attems ] -- cgit v1.2.3 From bacdb4b82667bfba079617a0d26eaffffc7df038 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 00:34:06 +0200 Subject: Make sure copy_exec hook function does not exit with a non-zero return value in non-verbose mode. [Closes: #584520] Reported-by: Gerrit Keller Signed-off-by: Michael Prokop --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 213a48a..86dc905 100644 --- a/hook-functions +++ b/hook-functions @@ -148,7 +148,7 @@ copy_exec() { mkdir -p "${DESTDIR}/${dirname}" if [ ! -e "${DESTDIR}/${dirname}/${libname}" ]; then ln -s "${x}" "${DESTDIR}/${dirname}" - [ "${verbose}" = "y" ] && echo "Adding library ${x}" + [ "${verbose}" = "y" ] && echo "Adding library ${x}" || true fi done } -- cgit v1.2.3 From 86223e387feb41c8dd15231fc87ce23c2b71c310 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 00:52:46 +0200 Subject: Document mode vs. mode_option option in framebuffer example script. [Closes: #439846] Signed-off-by: Michael Prokop --- docs/framebuffer | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/framebuffer b/docs/framebuffer index 678ffdf..47d8302 100644 --- a/docs/framebuffer +++ b/docs/framebuffer @@ -21,14 +21,16 @@ esac # 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=" +# 3) the "mode" or "mode_option" option (name depends on the framebuffer driver) +# has the form x[M][R][-][@][i][m] +# and may or may not start with "mode=" or "mode_option=" +# -> please adjust as necessary in the parse_video_opts() function # # When the options are used with modules, they need to be space-separated # and the following conversions are needed: # : -> = # -> =1 -# -> mode= +# -> mode= or mode_option= parse_video_opts() { local OPTS="$1" @@ -48,7 +50,10 @@ parse_video_opts() echo -n "${opt%:*}=${opt#*:} " # Presumably a modevalue without the "mode=" prefix elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then + # Adjust: mode= option? echo -n "mode=$opt " + # ... or mode_option= option? + # echo -n "mode_option=$opt " # Presumably a boolean else echo -n "${opt}=1 " -- cgit v1.2.3 From b1c242ffc5762fea6c15fe880e352008a5c34c43 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 03:02:08 +0200 Subject: hook-functions: make device name handling for /proc/mdstat more flexible for MODULES=dep We can't assume it's always [hs]dX# in /proc/mdstat. It can be e.g. also [hs]dX (raw device) or dm-## as well. So don't statically calculate the string based on string length but instead try to be as smart as possible. Also add support for handling additional arguments in the /proc/mdstat output like "(auto-read-only)". This affects MODULES=dep only. [Closes: #584520] + [Closes: #514756] Reported-by: Simon Richter Reported-by: Martin Michlmayr Signed-off-by: Michael Prokop --- hook-functions | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/hook-functions b/hook-functions index 86dc905..8bebdea 100644 --- a/hook-functions +++ b/hook-functions @@ -259,8 +259,9 @@ dep_add_modules() done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then - block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ - /proc/mdstat) + block=$(grep "^${block}" /proc/mdstat | \ + awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" fi # luks or lvm on cciss or ida if [ "${block#cciss}" != "${block}" ] \ @@ -272,13 +273,28 @@ dep_add_modules() # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} - block=$(awk "/^md${root}/{print substr(\$5, 1, 3); exit}" \ - /proc/mdstat) + block=$(grep "^md${root}" /proc/mdstat | \ + awk "{gsub(/^md${root} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" + # drop the partition number only for sdX and hdX devices + # and keep it for other devices like loop#, dm-# devices + case "$block" in + sd*) block=${block%%[0-9]*};; + hd*) block=${block%%[0-9]*};; + esac # md root /dev/mdX elif [ "${root#/dev/md}" != "${root}" ]; then - root=${root#/dev/} - block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \ - /proc/mdstat) + root=${root#/dev/md} + block=$(grep "^md${root}" /proc/mdstat | \ + awk "{gsub(/^md${root} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") + block="${block%%\[*}" + # drop the partition number only for sdX and hdX devices + # and keep it for other devices like loop#, dm-# devices + case "$block" in + sd*) block=${block%%[0-9]*};; + hd*) block=${block%%[0-9]*};; + esac + # cciss device elif [ "${root#/dev/cciss/}" != "${root}" ]; then block=${root#/dev/cciss/*} -- cgit v1.2.3 From 90d76d566f7597d9826606b8b5cec62b50c44096 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 11:10:01 +0200 Subject: Support dashes inside scripts names. [Closes: #566056] Signed-off-by: Michael Prokop --- initramfs-tools.8 | 4 ++-- mkinitramfs | 4 ++-- scripts/functions | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 0a15574..fd00429 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -9,8 +9,8 @@ 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. -Valid boot and hook scripts names consist solely of alphabetics, numerics -and underscores. Other scripts are discarded. +Valid boot and hook scripts names consist solely of alphabetics, numerics, +dashes and underscores. Other scripts are discarded. .SS Hook scripts These are used when an initramfs image is created and not included in the diff --git a/mkinitramfs b/mkinitramfs index e54c77f..04eae42 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -229,14 +229,14 @@ cp -p /usr/share/initramfs-tools/init ${DESTDIR}/init # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ - -regextype posix-extended -regex '.*/[[:alnum:]_.]+$' -type f); do + -regextype posix-extended -regex '.*/[[:alnum:]\._-]+$' -type f); do [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" cp -p "/usr/share/initramfs-tools/scripts/${b}" \ "${DESTDIR}/scripts/$(dirname "${b}")/" done for b in $(cd "${CONFDIR}/scripts" && find . \ - -regextype posix-extended -regex '.*/[[:alnum:]_.]+$' -type f); do + -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}")/" diff --git a/scripts/functions b/scripts/functions index 1cc9be6..8730d52 100644 --- a/scripts/functions +++ b/scripts/functions @@ -74,7 +74,7 @@ set_initlist() # only allow variable name chars case ${si_x#${initdir}/} in - *[![:alnum:]_.]*) + *[![:alnum:]\._-]*) [ "${verbose}" = "y" ] \ && echo "$si_x ignored: not alphanumeric or '_' file" continue @@ -106,7 +106,7 @@ reduce_satisfied() for rs_y in ${deplist}; do # only allow variable name chars case ${rs_y} in - *[![:alnum:]_.]*) + *[![:alnum:]\._-]*) continue ;; esac -- cgit v1.2.3 From 66522c9547575495d2d36ee0f3d030ef502aeba6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 11:18:12 +0200 Subject: dep_add_modules(): handle ubifs and return since ubifs root is a char device Add additional check to handle ubifs and return since ubifs root is a char device but most of the following commands in dep_add_modules() only work with block devices. Patch by Martin Michlmayr [Closes: #582858] Signed-off-by: Michael Prokop --- hook-functions | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hook-functions b/hook-functions index 8bebdea..6a6e233 100644 --- a/hook-functions +++ b/hook-functions @@ -226,6 +226,14 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + + # handle ubifs and return since ubifs root is a char device but + # most of the commands below only work with block devices. + if [ "${FSTYPE}" = "ubifs" ]; then + manual_add_modules "${FSTYPE}" + return + fi + if [ "${root}" = "/dev/root" ] ; then root="/dev/disk/by-uuid/"$(blkid -o value -s UUID ${root}) 2>/dev/null fi -- cgit v1.2.3 From 87c674055316c2938d37e92789a6041824844c0d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 12:38:33 +0200 Subject: mkinitramfs: warn if TMPDIR is mounted noexec + fall back to not cache run scripts then If the TMPDIR (/tmp by default) is mounted with noexec the user will notify several lines like: /usr/sbin/mkinitramfs: 276: /tmp/mkinitramfs_Ck5cpl/scripts/init-top/all_generic_ide: Permission denied To get rid of that the user can either point $TMPDIR to a filesystem that's mounted with exec permission or otherwise the cache_run_scripts() feature won't be used. Notify user accordingly with a warning message. [Closes: #576678] Signed-off-by: Michael Prokop --- mkinitramfs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 04eae42..baf69dd 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -164,6 +164,14 @@ fi DESTDIR="$(mktemp -d ${TMPDIR:-/tmp}/mkinitramfs_XXXXXX)" || exit 1 chmod 755 "${DESTDIR}" + +# do not execute cache_run_scripts() if mounted with noexec +NOEXEC="" +fs=$(df $DESTDIR | tail -1 | awk '{print $6}') +if [ -n "$fs" ] && mount | grep -q "on $fs .*noexec" ; then + NOEXEC=1 +fi + __TMPCPIOGZ="$(mktemp ${TMPDIR:-/tmp}/mkinitramfs-OL_XXXXXX)" || exit 1 DPKG_ARCH=`dpkg --print-architecture` @@ -277,9 +285,13 @@ run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks # cache boot run order -for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do - cache_run_scripts "${DESTDIR}" "/scripts/${b#./}" -done +if [ -n "$NOEXEC" ]; then + echo "Warning: 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#./}" + done +fi # generate module deps depmod -a -b "${DESTDIR}" ${version} -- cgit v1.2.3 From e2b7015f7d0e47065c2a299c2e7bde59dbac0b14 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 13:57:56 +0200 Subject: Add symlinks issue to TODO file. --- debian/TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/TODO b/debian/TODO index 7423d06..505da9c 100644 --- a/debian/TODO +++ b/debian/TODO @@ -13,6 +13,8 @@ TODO o root loop support. o MODULES=dep md replace awk magic with proper parsing. + -> WIP, check o Eliminate ?udev?, ?klibc?, busybox (-> glibc). + o Support expanding symlinks, see #506540 + #338405 -- cgit v1.2.3 From 127fc8277f7868021a40851c399682eec259c2ed Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 15:56:30 +0200 Subject: Add myself to uploaders. ACK-ed by maks on IRC. Signed-off-by: Michael Prokop --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 6580c78..f98fdd7 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: maximilian attems +Uploaders: maximilian attems , Michael Prokop Maintainer: Debian kernel team Build-Depends: debhelper (>= 7.0) Standards-Version: 3.8.4 -- cgit v1.2.3 From 5aac044bc1c91dc3a7920d560eeb5df04bc1c9d2 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 16:06:50 +0200 Subject: release 0.96.1. Signed-off-by: Michael Prokop --- debian/changelog | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4d3f8c0..a63ec34 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +initramfs-tools (0.96.1) unstable; urgency=low + + * hook-functions: Make sure copy_exec hook function does not + exit with a non-zero return value in non-verbose mode. + [Closes: #584520] + * docs/framebuffer: Document mode vs. mode_option option in + framebuffer example script. [Closes: #439846] + * hook-functions: make device name handling for /proc/mdstat + more flexible for MODULES=dep. [Closes: #584520, #514756] + * mkinitramfs / scripts/functions + initramfs-tools.8: + Support dashes inside scripts names. [Closes: #566056] + * hook-functions: handle ubifs in dep_add_modules() and return + since ubifs root is a char device, (see issue #582858). + * mkinitramfs: warn if TMPDIR is mounted noexec + fall back + to not cache run scripts then. [Closes: #576678] + * Add myself to uploaders. + + -- Michael Prokop Tue, 08 Jun 2010 15:59:08 +0200 + initramfs-tools (0.95.1) unstable; urgency=low [ Michael Prokop ] -- cgit v1.2.3 From d2914e36a645da74bf7294f8d4a9ddf7ea0af170 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 8 Jun 2010 17:07:51 +0200 Subject: Fix bug number in changelog (#584520 -> #549680) for upload of 0.96.1. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a63ec34..b3ae973 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,7 @@ initramfs-tools (0.96.1) unstable; urgency=low * docs/framebuffer: Document mode vs. mode_option option in framebuffer example script. [Closes: #439846] * hook-functions: make device name handling for /proc/mdstat - more flexible for MODULES=dep. [Closes: #584520, #514756] + more flexible for MODULES=dep. [Closes: #549680, #514756] * mkinitramfs / scripts/functions + initramfs-tools.8: Support dashes inside scripts names. [Closes: #566056] * hook-functions: handle ubifs in dep_add_modules() and return -- cgit v1.2.3 From a8a5ce4030983af37715f2581099d453473fd0ea Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 13 Jun 2010 20:43:04 +0200 Subject: script: Add update-initramfs.conf to bug report we see lately unbound variables from there, so it's nice to have it. Signed-off-by: maximilian attems --- debian/script | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/script b/debian/script index 43ae7d1..da030d1 100755 --- a/debian/script +++ b/debian/script @@ -34,6 +34,12 @@ if [ -r /etc/initramfs-tools/initramfs.conf ]; then echo fi +if [ -r /etc/initramfs-tools/update-initramfs.conf ]; then + echo "-- /etc/initramfs-tools/update-initramfs.conf" + sed 's/#.*$//;/^[[:space:]]*$/d' /etc/initramfs-tools/update-initramfs.conf + echo +fi + if [ -r /etc/crypttab ]; then echo "-- /etc/crypttab" cat /etc/crypttab -- cgit v1.2.3 From cc6077aa62a510e6ce3d72c8a195bb33d141f904 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 13 Jun 2010 20:46:37 +0200 Subject: update-initramfs: Fix another unbound variable still uncovering things.. Closes: #583695 Signed-off-by: maximilian attems --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index e49115b..f8408e6 100755 --- a/update-initramfs +++ b/update-initramfs @@ -146,7 +146,7 @@ backup_booted_initramfs() # nuke generated copy remove_initramfs_bak() { - [ -z "${initramfs_bak}" ] && return 0 + [ -z "${initramfs_bak:-}" ] && return 0 rm -f "${initramfs_bak}" verbose "Removing ${initramfs_bak}" } -- cgit v1.2.3 From e65ee485d9d6f257e70231669a13e05cc45acbb3 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 8 Jun 2010 21:43:08 +0200 Subject: Produce an error when root cannot be determined with MODULES=dep A lot of code in dep_add_modules() uses $root. Therefore, produce an error message if we cannot determine the root device. [ error out on this condtion too. -maks ] Signed-off-by: Martin Michlmayr Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hook-functions b/hook-functions index 6a6e233..0a6c9b7 100644 --- a/hook-functions +++ b/hook-functions @@ -226,6 +226,12 @@ dep_add_modules() # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" + if [ -z "$root" ]; then + echo "mkinitramfs: failed to determine root device" + echo "mkinitramfs: workaround is MODULES=most" + echo "Error please report bug on initramfs-tools and include the output of 'mount'" + exit 1 + fi # handle ubifs and return since ubifs root is a char device but # most of the commands below only work with block devices. -- cgit v1.2.3 From 2a8c9907b1095015e1d669d3cd895657936f6247 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 11:11:42 +0200 Subject: hook-functions/mkinitramfs/update-initramfs: consequently output error messages to stderr Signed-off-by: Michael Prokop --- hook-functions | 22 +++++++++++----------- mkinitramfs | 4 ++-- update-initramfs | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hook-functions b/hook-functions index 0a6c9b7..f5da1c4 100644 --- a/hook-functions +++ b/hook-functions @@ -220,16 +220,16 @@ dep_add_modules() # require mounted sysfs if [ ! -d /sys/devices/ ]; then - echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" + echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" >&2 exit 1 fi # findout root block device + fstype eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')" if [ -z "$root" ]; then - echo "mkinitramfs: failed to determine root device" - echo "mkinitramfs: workaround is MODULES=most" - echo "Error please report bug on initramfs-tools and include the output of 'mount'" + echo "mkinitramfs: failed to determine root device" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "Error please report bug on initramfs-tools and include the output of 'mount'" >&2 exit 1 fi @@ -252,10 +252,10 @@ dep_add_modules() if [ "${FSTYPE}" = "unknown" ]; then FSTYPE=$(blkid -o value -s TYPE "${root}") if [ -z "${FSTYPE}" ]; then - echo "mkinitramfs: unknown fstype on root ${root}" - echo "mkinitramfs: workaround is MODULES=most" - echo "Error please report bug on initramfs-tools" - exit 1 + echo "mkinitramfs: unknown fstype on root ${root}" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "Error please report bug on initramfs-tools" >&2 + exit 1 fi fi @@ -349,9 +349,9 @@ dep_add_modules() # Error out if /sys lack block dev if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then - echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" - echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report the bug" + echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" >&2 + echo "mkinitramfs: workaround is MODULES=most" >&2 + echo "mkinitramfs: Error please report the bug" >&2 exit 1 fi diff --git a/mkinitramfs b/mkinitramfs index baf69dd..58e4c11 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -148,7 +148,7 @@ fi [ "${compress}" = lzop ] && compress="lzop -9" if [ -d "${outfile}" ]; then - echo "${outfile} is a directory" + echo "${outfile} is a directory" >&2 exit 1 fi @@ -266,7 +266,7 @@ if [ -n "${ROOT:-}" ]; then fi if ! command -v ldd >/dev/null 2>&1 ; then - echo "WARNING: no ldd around - install libc-bin" + echo "WARNING: no ldd around - install libc-bin" >&2 exit 1 fi diff --git a/update-initramfs b/update-initramfs index f8408e6..53ebed2 100755 --- a/update-initramfs +++ b/update-initramfs @@ -170,7 +170,7 @@ generate_initramfs() # minversion wasn't met, exit 0 exit 0 fi - echo "update-initramfs: failed for ${initramfs}" + echo "update-initramfs: failed for ${initramfs}" >&2 exit $mkinitramfs_return fi } @@ -180,7 +180,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "ERROR lilo fails for new ${initramfs}:" + echo "ERROR lilo fails for new ${initramfs}:" >&2 echo lilo -t fi @@ -460,7 +460,7 @@ while getopts "k:cudyvtb:h?" flag; do b) BOOTDIR="${OPTARG}" if [ ! -d "${BOOTDIR}" ]; then - echo "Error: ${BOOTDIR} is not a directory." + echo "Error: ${BOOTDIR} is not a directory." >&2 exit 1 fi ;; @@ -473,7 +473,7 @@ done shift $((${OPTIND} - 1)) if [ $# -ne 0 ]; then - echo "Invalid argument for option -k." + echo "Invalid argument for option -k." >&2 usage fi -- cgit v1.2.3 From 04b86198ef7d32d3f4ae700fcf34a2539876f0a7 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:06:13 +0200 Subject: init: display warning message if devtmpfs could not be mounted. Older kernel versions (like the one shipped with Lenny) don't support devtmpfs. Therefore display a warning message when falling back to tmpfs. See #501359. Thanks: Ferenc Wagner Signed-off-by: Michael Prokop --- init | 1 + 1 file changed, 1 insertion(+) diff --git a/init b/init index 142eb14..c838049 100755 --- a/init +++ b/init @@ -18,6 +18,7 @@ if [ -e /etc/udev/udev.conf ]; then . /etc/udev/udev.conf fi if ! mount -t devtmpfs -o mode=0755 none /dev; then + echo "W: devtmpfs not available, falling back to tmpfs for /dev" mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev [ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1 [ -e /dev/null ] || mknod /dev/null c 1 3 -- cgit v1.2.3 From 60afd2a944cf36a5bce6ca3b4c07a422e98efeba Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:10:28 +0200 Subject: code cleanup: drop trailing whitespaces. Signed-off-by: Michael Prokop --- conf/update-initramfs.conf | 2 +- debian/changelog | 6 +++--- debian/copyright | 2 +- docs/example_hook | 2 +- hook-functions | 2 +- init | 6 +++--- initramfs.conf.5 | 12 ++++++------ mkinitramfs | 2 +- scripts/functions | 2 +- scripts/local | 2 +- scripts/nfs | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 3c27473..31823e2 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -1,4 +1,4 @@ -# +# # Configuration file for update-initramfs(8) # diff --git a/debian/changelog b/debian/changelog index b3ae973..901222a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -247,7 +247,7 @@ initramfs-tools (0.93.4) unstable; urgency=medium * initramfs-tools.8: Convert hyphen to minus sign. * control: bump versioned dep on debhelper. * control: bump standards version without changes. - * hook-functions: Fix loading of entries without newline in + * hook-functions: Fix loading of entries without newline in /etc/initramfs-tools/modules. (closes: #532745) * MODULES=most: Add virtio_net to initramfs. (closes: #533894) @@ -537,7 +537,7 @@ initramfs-tools (0.92d) unstable; urgency=low each message. - initramfs-tools.preinst: Try to use UUID for resume device. - add boot script loading ide-generic on all_generic_ide cmdline. - Thanks Frans Pop for report. (closes: #485786) + Thanks Frans Pop for report. (closes: #485786) * init: add possible mountroot break (closes: #488963) * initramfs-tools.8: document UUID usage for root and all_generic_ide. (closes: #489186) @@ -744,7 +744,7 @@ initramfs-tools (0.90) unstable; urgency=low -- maximilian attems Thu, 09 Aug 2007 21:30:29 +0200 initramfs-tools (0.89) unstable; urgency=low - + Release "L'\xE9lecteur c'est notoire N'a pas tout' sa raison" [ Joey Hess ] diff --git a/debian/copyright b/debian/copyright index f84910d..9fe89c8 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,7 +13,7 @@ http://git.debian.org/?p=kernel/initramfs-tools.git;a=shortlog Authors: Adam Conrad , Ben Collins , David Härdeman , - Jeff Bailey , + Jeff Bailey , maximilian attems , Scott James Remnant diff --git a/docs/example_hook b/docs/example_hook index 683ddad..1f35352 100644 --- a/docs/example_hook +++ b/docs/example_hook @@ -12,7 +12,7 @@ # command line. # # DESTDIR -- The staging directory where we are building the image. -# +# # see initramfs-tools(8) # diff --git a/hook-functions b/hook-functions index f5da1c4..8b6a89c 100644 --- a/hook-functions +++ b/hook-functions @@ -183,7 +183,7 @@ sys_walk_mod_add() { local driver_path module device_path="$1" - + while [ "${device_path}" != "/sys" ]; do sys_walk_modalias ${device_path} driver_path="$(readlink -f ${device_path}/driver/module)" diff --git a/init b/init index 142eb14..a614d89 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs -o nodev,noexec,nosuid none /sys -mount -t proc -o nodev,noexec,nosuid none /proc +mount -t sysfs -o nodev,noexec,nosuid none /sys +mount -t proc -o nodev,noexec,nosuid none /proc # Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out @@ -184,7 +184,7 @@ done if [ -n "${noresume}" ]; then export noresume unset resume -else +else resume=${RESUME:-} fi diff --git a/initramfs.conf.5 b/initramfs.conf.5 index bb01f58..92c3a6d 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -48,12 +48,12 @@ The keymap will anyway be loaded by the initscripts later, and the packages that might need input will normally set this variable automatically, so there should normally be no need to set this. -.TP -\fB COMPRESS -Specifies the compression method used for the initramfs image. -.B mkinitramfs -will default to gzip if the kernel lacks support (CONFIG_RD) or the -corresponding userspace utility is not present. +.TP +\fB COMPRESS +Specifies the compression method used for the initramfs image. +.B mkinitramfs +will default to gzip if the kernel lacks support (CONFIG_RD) or the +corresponding userspace utility is not present. .TP \fB UMASK diff --git a/mkinitramfs b/mkinitramfs index 58e4c11..70e5c13 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -315,7 +315,7 @@ exec 3>&1 eval ` # http://cfaj.freeshell.org/shell/cus-faq-2.html exec 4>&1 >&3 3>&- - cd "${DESTDIR}" + cd "${DESTDIR}" { find . 4>&-; echo "ec1=$?;" >&4 } | { diff --git a/scripts/functions b/scripts/functions index 8730d52..685642e 100644 --- a/scripts/functions +++ b/scripts/functions @@ -218,7 +218,7 @@ run_scripts() { initdir=${1} [ ! -d ${initdir} ] && return - + if [ -f ${initdir}/ORDER ]; then . ${initdir}/ORDER elif command -v tsort >/dev/null 2>&1; then diff --git a/scripts/local b/scripts/local index cca5e8d..98464f9 100644 --- a/scripts/local +++ b/scripts/local @@ -50,7 +50,7 @@ pre_mountroot() # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do # give hint about renamed root - case "${ROOT}" in + case "${ROOT}" in /dev/hd*) suffix="${ROOT#/dev/hd}" major="${suffix%[[:digit:]]}" diff --git a/scripts/nfs b/scripts/nfs index 435d2d0..5c41573 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -4,7 +4,7 @@ retry_nr=0 -# parse nfs bootargs and mount nfs +# parse nfs bootargs and mount nfs do_nfsmount() { -- cgit v1.2.3 From ab28c77261267a14cc7308e8c4d7a0b48a8ac2ab Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 12:15:07 +0200 Subject: code cleanup: consequently replace spaces in indentions with tabs to unify coding stile Signed-off-by: Michael Prokop --- hook-functions | 18 +++++++++--------- hooks/busybox | 8 ++++---- hooks/klibc | 8 ++++---- mkinitramfs | 22 +++++++++++----------- update-initramfs | 16 ++++++++-------- 5 files changed, 36 insertions(+), 36 deletions(-) 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(-) diff --git a/hook-functions b/hook-functions index c456c5d..ffb6a67 100644 --- a/hook-functions +++ b/hook-functions @@ -3,7 +3,7 @@ catenate_cpiogz() { # Sanity check if [ ! -e "${1}" ]; then - echo "W:catenate_cpiogz: arg1='${1}' does not exist." >&2 + echo "W: catenate_cpiogz: arg1='${1}' does not exist." >&2 return fi @@ -29,7 +29,7 @@ add_modules_from_file() { # Sanity check if [ ! -e "${1}" ]; then - echo "W:add_modules_from_file: arg1='${1}' does not exist." >&2 + echo "W: add_modules_from_file: arg1='${1}' does not exist." >&2 return fi diff --git a/hooks/busybox b/hooks/busybox index a2e57ae..1a275b7 100755 --- a/hooks/busybox +++ b/hooks/busybox @@ -20,7 +20,7 @@ if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then # those root need busybox eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')" if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then - echo "Warning: Busybox is required for successful boot!" + echo "W: Busybox is required for successful boot!" fi else . /usr/share/initramfs-tools/hook-functions diff --git a/mkinitramfs b/mkinitramfs index a854f02..1c6ad28 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -224,8 +224,8 @@ list) # nothing to add ;; *) - echo "mkinitramfs: Warning unsupported MODULES setting: ${MODULES}." - echo "mkinitramfs: Falling back to MODULES=most." + echo "W: mkinitramfs: unsupported MODULES setting: ${MODULES}." + echo "W: mkinitramfs: Falling back to MODULES=most." auto_add_modules ;; esac @@ -286,7 +286,7 @@ run_scripts "${CONFDIR}"/hooks # cache boot run order if [ -n "$NOEXEC" ]; then - echo "Warning: TMPDIR is mounted noexec, will not cache run scripts." + echo "W: TMPDIR is mounted noexec, will not cache run scripts." else for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do cache_run_scripts "${DESTDIR}" "/scripts/${b#./}" -- cgit v1.2.3 From b1fff5e9e4b0ed38f018132cef28330eac7a963c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 16:04:08 +0200 Subject: add bash-completion for update-initramfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #537139 Thanks: David Paleino Thanks: Stéphane Jourdois Signed-off-by: Michael Prokop --- bash_completion.d/initramfs-tools | 26 ++++++++++++++++++++++++++ debian/control | 1 + debian/initramfs-tools.install | 1 + 3 files changed, 28 insertions(+) create mode 100644 bash_completion.d/initramfs-tools diff --git a/bash_completion.d/initramfs-tools b/bash_completion.d/initramfs-tools new file mode 100644 index 0000000..a52074f --- /dev/null +++ b/bash_completion.d/initramfs-tools @@ -0,0 +1,26 @@ +# update-initramfs(8) completion + +_update_initramfs() +{ + local cur prev valid_options + + # TODO: this can be "_get_comp_words_by_ref cur prev" once + # bash-completion >= 1.2 is available, see #537139 + cur=$(_get_cword) + prev=${COMP_WORDS[COMP_CWORD-1]} + + # The only option that takes an argument is -k + if [[ "$prev" == '-k' ]]; then + # Complete with kernel versions + _kernel_versions + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} all' -- "$cur" ) ) + return; + fi + + # Complete with available options (obtained from -h) + valid_options=$( update-initramfs -h 2>&1 | \ + sed -e '/^ -/!d;s/^ \(-\w\+\).*/\1/' ) + COMPREPLY=( $( compgen -W "$valid_options" -- $cur ) ) +} + +complete -F _update_initramfs update-initramfs diff --git a/debian/control b/debian/control index f98fdd7..30d873b 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Package: initramfs-tools Architecture: all Recommends: busybox (>= 1:1.01-3) | busybox-initramfs Depends: klibc-utils (>= 1.5.9-1), cpio, module-init-tools, udev (>= 0.086-1), findutils (>= 4.2.24), ${misc:Depends} +Suggests: bash-completion Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 71670ef..ebe6a14 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -11,3 +11,4 @@ update-initramfs usr/sbin debian/script usr/share/bug/initramfs-tools debian/lintian/initramfs-tools usr/share/lintian/overrides kernel etc +bash_completion.d etc -- cgit v1.2.3 From 5697c3b7e4ece610e71117f1dddb2cc8637f8420 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 15 Jun 2010 18:16:37 +0200 Subject: hook-functions: replace awk calls with sed in dep_add_modules() If mawk is installed as default awk version it won't handle [:digit:], instead let's replace the grep/awk/shell version with one single sed invocation. Closes: #585991 Thanks: Thorsten Glaser Signed-off-by: Michael Prokop --- hook-functions | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/hook-functions b/hook-functions index ffb6a67..1a0e097 100644 --- a/hook-functions +++ b/hook-functions @@ -273,9 +273,7 @@ dep_add_modules() done # lvm on md or luks on md if [ "${block#md}" != "${block}" ]; then - block=$(grep "^${block}" /proc/mdstat | \ - awk "{gsub(/^${block} : .* (multipath|linear|raid[[:digit:]]+)\ /,\"\")};1") - block="${block%%\[*}" + block=$(sed -ne 's/multipath/[/' -e 's/linear/[/' -e 's/raid[0-9][0-9]*/[/' -e 's/\([hs]d[a-z][a-z]*\)[0-9][0-9]*/\1/g' -e '/^'${block}' :/s/^[^[]*\[ \([^\[]*\)\[.*$/\1/p' Date: Tue, 15 Jun 2010 18:22:15 +0200 Subject: debian/script: append /proc/mdstat (iff present) to bugreports Signed-off-by: Michael Prokop --- debian/script | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/script b/debian/script index da030d1..fa706cd 100755 --- a/debian/script +++ b/debian/script @@ -46,6 +46,12 @@ if [ -r /etc/crypttab ]; then echo fi +if [ -r /proc/mdstat ]; then + echo "-- /proc/mdstat" + cat /proc/mdstat + echo +fi + if grep -q "MODULES=dep" /etc/initramfs-tools/initramfs.conf ; then echo "-- /sys/block" ls /sys/block -- cgit v1.2.3 From 5b565beaeaf605ba72b43c15e59ec85ca524728b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 15 Jun 2010 18:56:00 +0200 Subject: scripts/functions: allow hooks to abort build Execute call_scripts() under "set -e" so hook scripts can exit initrd build iff necessary. Closes: #396388 Signed-off-by: Michael Prokop --- scripts/functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/functions b/scripts/functions index 685642e..641e678 100644 --- a/scripts/functions +++ b/scripts/functions @@ -200,6 +200,8 @@ get_prereq_pairs() call_scripts() { + # allow hooks to abort build: + set -e for cs_x in ${runlist}; do [ -f ${initdir}/${cs_x} ] || continue # mkinitramfs verbose output @@ -212,6 +214,7 @@ call_scripts() . /conf/param.conf fi done + set +e } run_scripts() -- cgit v1.2.3 From 3054e3ed58dee5a70bcd462c71573d380f03bd7a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 15 Jun 2010 16:56:12 +0100 Subject: initramfs-tools: work around 'find -printf %Y' bug The change to filter out looping or broken symlinks from the initramfs, written by me for Ubuntu and applied to Debian for #575157, tickles a bug in find (which I think also had an associated Debian bug, but I've been unable to find it): https://savannah.gnu.org/bugs/index.php?29460 This was fixed in 4.5.8, which is currently only in experimental. In any case findutils is very deep in the dependency chain for upgrades and I believe it would be a good idea to avoid requiring a new version of it (I've had problems quite recently with strict dependencies on findutils causing unresolvable dependency loops). The following patch works around this bug in a reasonably straightforward way. [ debian findutils bug was #576772 ] Signed-off-by: maximilian attems --- mkinitramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 1c6ad28..e3b392e 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -304,8 +304,8 @@ fi # Remove any looping or broken symbolic links, since they break cpio. [ "${verbose}" = y ] && xargs_verbose="-t" -find "${DESTDIR}" -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ - | xargs ${xargs_verbose:-} -rL1 rm -f +(cd "${DESTDIR}" && find . -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ + | xargs ${xargs_verbose:-} -rL1 rm -f) [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( -- cgit v1.2.3 From bb66fc2a8b40d6c8ecd093cf1b358d4476ab1e1c Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Sun, 13 Jun 2010 17:23:14 +0100 Subject: hook-functions/init/scripts/local: add support for ubifs. MODULES=dep fails when / is ubifs. This patch adds support for something like root=ubi0:rootfs when ubi is modular. Quoting Martin: It essentially does three things: - adds the correct modules to the ramdisk (for MODULES=dep and MODULES=most) - reads ubi.mtd= from the command line - loads ubi with the ubi.mtd info and ignores the "Waiting for root" check I've successfully tested this with a kernel with modular ubi and with the following boot variants: console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs console=ttyS0,115200 ubi.mtd=2 root=ubi0_0 rootfstype=ubifs With console=ttyS0,115200 ubi.mtd=2 root=/dev/ubi0_0 rootfstype=ubifs I get an error that it cannot mount root but I suspect this is an ubifs error and has nothing to do with i-t (since at this point I can manually mount it with -t ubifs ubi0_0 whereas the /dev/ variant doesn't work). Tested with MODULES=dep and MODULES=most as well as with a kernel that has ubifs built in. Closes: #582858 Thanks: Martin Michlmayr Signed-off-by: Martin Michlmayr Reviewed-by: Michael Prokop --- hook-functions | 10 ++++++++++ init | 5 +++++ scripts/local | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/hook-functions b/hook-functions index 1a0e097..3ce081d 100644 --- a/hook-functions +++ b/hook-functions @@ -237,6 +237,10 @@ dep_add_modules() # most of the commands below only work with block devices. if [ "${FSTYPE}" = "ubifs" ]; then manual_add_modules "${FSTYPE}" + # add some modules required by ubifs on which it doesn's depend + manual_add_modules deflate + manual_add_modules zlib + manual_add_modules lzo return fi @@ -415,6 +419,11 @@ auto_add_modules() block) copy_modules_dir kernel/drivers/block ;; + ubi) + for x in deflate zlib lzo ubi ubifs; do + manual_add_modules "${x}" + done + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -447,6 +456,7 @@ auto_add_modules() auto_add_modules ata auto_add_modules i2o auto_add_modules dasd + auto_add_modules ubi auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc diff --git a/init b/init index 397a8c2..467a562 100755 --- a/init +++ b/init @@ -43,6 +43,7 @@ export ROOTFSTYPE= export IP= export BOOT= export BOOTIF= +export UBIMTD= export break= export init=/sbin/init export quiet=n @@ -127,6 +128,9 @@ for x in $(cat /proc/cmdline); do boot=*) BOOT=${x#boot=} ;; + ubi.mtd=*) + UBIMTD=${x#ubi.mtd=} + ;; resume=*) RESUME="${x#resume=}" ;; @@ -258,6 +262,7 @@ unset ROOT unset IP unset BOOT unset BOOTIF +unset UBIMTD unset blacklist unset break unset noresume diff --git a/scripts/local b/scripts/local index 98464f9..9b51174 100644 --- a/scripts/local +++ b/scripts/local @@ -8,6 +8,13 @@ pre_mountroot() wait_for_udev 10 + # Load ubi with the correct MTD partition and return since fstype + # doesn't work with a char device like ubi. + if [ -n "$UBIMTD" ]; then + modprobe ubi mtd=$UBIMTD + return + fi + # Don't wait for a root device that doesn't have a corresponding # device in /dev (ie, mtd0) if [ "${ROOT#/dev}" = "${ROOT}" ]; then -- cgit v1.2.3 From 528ba7842a4079526118ba6edda25ed926d550ea Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Jun 2010 10:36:29 +0200 Subject: hook-functions: do not install ubi module by default via auto_add_modules() d-i does not support UBI/UBIFS yet and adding ubi.ko it by default to initrd when MODULES=most is set doesn't provide any benefits yet. Therefore don't waste ~125kb disk space by default, instead leave the installation of ubi to d-i through a hook. Signed-off-by: Michael Prokop --- hook-functions | 1 - 1 file changed, 1 deletion(-) diff --git a/hook-functions b/hook-functions index 3ce081d..ded7887 100644 --- a/hook-functions +++ b/hook-functions @@ -456,7 +456,6 @@ auto_add_modules() auto_add_modules ata auto_add_modules i2o auto_add_modules dasd - auto_add_modules ubi auto_add_modules ieee1394 auto_add_modules firewire auto_add_modules mmc -- cgit v1.2.3 From b1f74e697820d878a15e430e4ce1b74cd7fad2d3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 16 Jun 2010 17:29:11 +0200 Subject: get_fstype: reference blkid in comment the removal of vol_id compat code as requested in #585419 is to early as we need it for Lenny upgrades. Nevertheless have the comment point to the newer tool. :) Thanks: Christoph Anton Mitterer Signed-off-by: maximilian attems --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 641e678..de8c1b2 100644 --- a/scripts/functions +++ b/scripts/functions @@ -288,7 +288,7 @@ get_fstype () local FS FSTYPE FSSIZE RET FS="${1}" - # vol_id has a more complete list of file systems, + # blkid has a more complete list of file systems, # but fstype is more robust eval $(fstype "${FS}" 2> /dev/null) if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then -- cgit v1.2.3 From 7fc1ee52f3388dd28207f35240a24e15fd0e6c47 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Jun 2010 16:47:47 +0200 Subject: initial version of maintainer-notes.html --- maintainer-notes.html | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 maintainer-notes.html diff --git a/maintainer-notes.html b/maintainer-notes.html new file mode 100644 index 0000000..f3223a8 --- /dev/null +++ b/maintainer-notes.html @@ -0,0 +1,306 @@ + + + + +Maintainer documentation for initramfs-tools + + + + + +
+
+ +

Maintainer documentation for initramfs-tools

+ +
+ +

Table of Contents

+ + + +
+ +

1. Definitions

+ +

+ Note: This cheatpage assumes that you are using git-core 1.5.6 or newer. +

+ + + + + +
version:version string
username:name of the alioth account
mailaddress:mailaddress of the user
+ + +
+ +

2. Preparations

+ +
    + +
  1. Install required software (notice: git is named git-core on Debian/stable): +
    +# apt-get install git git-buildpackage dpkg-dev
    +
    +
  2. + +
  3. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and git-dch: +
    +% export GIT_AUTHOR_EMAIL=<mailaddress>
    +% export DEBEMAIL=<mailaddress>
    +% export GIT_COMMITTER_EMAIL=<mailaddress>
    +
    +
  4. + +
  5. Checkout repository (anonymous): +
    +% git clone git://git.debian.org/git/kernel/initramfs-tools.git
    +% cd initramfs-tools
    +
    +
  6. + +
  7. Checkout repository (with developer access): +
    +% git clone ssh://username@git.debian.org/git/kernel/initramfs-tools.git
    +% cd initramfs-tools
    +
    +
  8. + +
+ + +
+ +

3. Workflow for daily work

+ +

3.1 Implement new features

+ +
    + +
  1. Checkout new branch and switch to it: +
    +% git checkout -b username/short-descr-of-new-feature
    +
    +
  2. + +
  3. Hack and commit work: +
    +% $EDITOR $somefile
    +% git add $somefile
    +% git commit -s
    +
    +
  4. + +

    NOTE: Use 'Closes: #BUGID' for closing a bugreport, 'Thanks: Name +<mailaddress>' for giving credits in your commit message. git-dch will use +this information for generating the changelog using the --meta option later +on.

    + +
  5. Finally push your branch to alioth: +
    +% git push origin username/short-descr-of-new-feature
    +
    +
  6. + +
+ +

3.2 Merge branches

+ +
    + +
  1. Switch to the branch you want to merge: +
    +% git checkout username/new-feature
    +
    +
  2. + +
  3. Rebase to master: +
    +% git rebase master
    +
    +
  4. + +
  5. Switch to master branch and merge: +
    +% git checkout master
    +% git merge username/new-feature
    +
    +
  6. + +
  7. Push: +
    +% git push
    +
    +
  8. + +
  9. After branch is merged delete branch on server and locally: +
    +% git push origin :username/short-descr-of-new-feature
    +% git branch -d username/short-descr-of-new-feature
    +
    +
  10. + +
+ +

3.3 Test specific branch

+ +
    + +
  1. Checkout a specific branch iff branch is not already present locally: +
    +% git checkout -b somename/short-descr-of-new-feature origin/somename/short-descr-of-new-feature
    +
    +
  2. + +
  3. Checkout a specific branch iff branch is already present locally: +
    +% git checkout -b somename/short-descr-of-new-feature
    +
    +
  4. + +
  5. Adjust debian/changelog accordingly: +
    +git-dch --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
    +
    +
  6. + +
  7. Build package: +
    +% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
    +
    +
+ + + +

4. Contribute

+ +

TODO / WIP:

+ +
    +
  1. Create patch: +
    +% git format-patch HEAD
    +
    +
+ + + +

5 Releasing new version

+ +
    + +
  1. Creating changelog: + +
    +% git-dch --debian-branch debian --release --since HASH
    +
    + +or more dynamically: + +
    +% git-dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" [--id-length=7] [--full]
    +
    + +
  2. + +
  3. Releasing: +
    +% git commit -a -s -m "Releasing debian version version."
    +
    +
  4. + +
  5. Tagging: +
    +% git tag -s v"version" -m "release version"
    +
    +
  6. + +
  7. Pushing: +
    +% git push
    +% git push --tags
    +
    +
  8. + +
  9. Build in chroot and upload to ftp-master.
  10. + +
  11. Send mail announcing the new initramfs-tools version with subject +"initramfs-tools $VERSION release" to initramfs@vger.kernel.org, +debian-kernel@lists.debian.org + kernel-team@lists.ubuntu.com - including a +shortlog (generated through "git shortlog $TAG..").
  12. + +
+ + +
+ +

Ressources

+ + + + + +
+ +

Credits

+ +
    +
  • Thanks to Daniel Baumann for his "Maintainer Cheatpage" which inspired this document
  • +
+ + +
+ +

+-- Michael Prokop <mika@debian.org> +

+ +
+ +
+ + + + -- cgit v1.2.3 From afafea43128839a5e5787afe25ddd961e45c8b7c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Jun 2010 17:48:02 +0200 Subject: maintainer-notes.html: fix git-dch commandline. Signed-off-by: Michael Prokop --- maintainer-notes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintainer-notes.html b/maintainer-notes.html index f3223a8..11149b8 100644 --- a/maintainer-notes.html +++ b/maintainer-notes.html @@ -193,7 +193,7 @@ on.

  • Adjust debian/changelog accordingly:
    -git-dch --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
    +git-dch --debian-branch="$(git branch | awk -F\* '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
     
  • -- cgit v1.2.3 From e506ee7e5b4bd9d87299e0e55d5fa43b738c0933 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 16 Jun 2010 17:52:13 +0200 Subject: move maintainer-notes.html to docs/ and install as /usr/share/doc/initramfs-tools/maintainer-notes.html Signed-off-by: Michael Prokop --- debian/initramfs-tools.docs | 1 + docs/maintainer-notes.html | 306 ++++++++++++++++++++++++++++++++++++++++++++ maintainer-notes.html | 306 -------------------------------------------- 3 files changed, 307 insertions(+), 306 deletions(-) create mode 100644 docs/maintainer-notes.html delete mode 100644 maintainer-notes.html diff --git a/debian/initramfs-tools.docs b/debian/initramfs-tools.docs index 5c374b1..a592331 100644 --- a/debian/initramfs-tools.docs +++ b/debian/initramfs-tools.docs @@ -1 +1,2 @@ HACKING +docs/maintainer-notes.html diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html new file mode 100644 index 0000000..11149b8 --- /dev/null +++ b/docs/maintainer-notes.html @@ -0,0 +1,306 @@ + + + + +Maintainer documentation for initramfs-tools + + + + + +
    +
    + +

    Maintainer documentation for initramfs-tools

    + +
    + +

    Table of Contents

    + + + +
    + +

    1. Definitions

    + +

    + Note: This cheatpage assumes that you are using git-core 1.5.6 or newer. +

    + + + + + +
    version:version string
    username:name of the alioth account
    mailaddress:mailaddress of the user
    + + +
    + +

    2. Preparations

    + +
      + +
    1. Install required software (notice: git is named git-core on Debian/stable): +
      +# apt-get install git git-buildpackage dpkg-dev
      +
      +
    2. + +
    3. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and git-dch: +
      +% export GIT_AUTHOR_EMAIL=<mailaddress>
      +% export DEBEMAIL=<mailaddress>
      +% export GIT_COMMITTER_EMAIL=<mailaddress>
      +
      +
    4. + +
    5. Checkout repository (anonymous): +
      +% git clone git://git.debian.org/git/kernel/initramfs-tools.git
      +% cd initramfs-tools
      +
      +
    6. + +
    7. Checkout repository (with developer access): +
      +% git clone ssh://username@git.debian.org/git/kernel/initramfs-tools.git
      +% cd initramfs-tools
      +
      +
    8. + +
    + + +
    + +

    3. Workflow for daily work

    + +

    3.1 Implement new features

    + +
      + +
    1. Checkout new branch and switch to it: +
      +% git checkout -b username/short-descr-of-new-feature
      +
      +
    2. + +
    3. Hack and commit work: +
      +% $EDITOR $somefile
      +% git add $somefile
      +% git commit -s
      +
      +
    4. + +

      NOTE: Use 'Closes: #BUGID' for closing a bugreport, 'Thanks: Name +<mailaddress>' for giving credits in your commit message. git-dch will use +this information for generating the changelog using the --meta option later +on.

      + +
    5. Finally push your branch to alioth: +
      +% git push origin username/short-descr-of-new-feature
      +
      +
    6. + +
    + +

    3.2 Merge branches

    + +
      + +
    1. Switch to the branch you want to merge: +
      +% git checkout username/new-feature
      +
      +
    2. + +
    3. Rebase to master: +
      +% git rebase master
      +
      +
    4. + +
    5. Switch to master branch and merge: +
      +% git checkout master
      +% git merge username/new-feature
      +
      +
    6. + +
    7. Push: +
      +% git push
      +
      +
    8. + +
    9. After branch is merged delete branch on server and locally: +
      +% git push origin :username/short-descr-of-new-feature
      +% git branch -d username/short-descr-of-new-feature
      +
      +
    10. + +
    + +

    3.3 Test specific branch

    + +
      + +
    1. Checkout a specific branch iff branch is not already present locally: +
      +% git checkout -b somename/short-descr-of-new-feature origin/somename/short-descr-of-new-feature
      +
      +
    2. + +
    3. Checkout a specific branch iff branch is already present locally: +
      +% git checkout -b somename/short-descr-of-new-feature
      +
      +
    4. + +
    5. Adjust debian/changelog accordingly: +
      +git-dch --debian-branch="$(git branch | awk -F\* '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
      +
      +
    6. + +
    7. Build package: +
      +% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
      +
      +
    + + + +

    4. Contribute

    + +

    TODO / WIP:

    + +
      +
    1. Create patch: +
      +% git format-patch HEAD
      +
      +
    + + + +

    5 Releasing new version

    + +
      + +
    1. Creating changelog: + +
      +% git-dch --debian-branch debian --release --since HASH
      +
      + +or more dynamically: + +
      +% git-dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" [--id-length=7] [--full]
      +
      + +
    2. + +
    3. Releasing: +
      +% git commit -a -s -m "Releasing debian version version."
      +
      +
    4. + +
    5. Tagging: +
      +% git tag -s v"version" -m "release version"
      +
      +
    6. + +
    7. Pushing: +
      +% git push
      +% git push --tags
      +
      +
    8. + +
    9. Build in chroot and upload to ftp-master.
    10. + +
    11. Send mail announcing the new initramfs-tools version with subject +"initramfs-tools $VERSION release" to initramfs@vger.kernel.org, +debian-kernel@lists.debian.org + kernel-team@lists.ubuntu.com - including a +shortlog (generated through "git shortlog $TAG..").
    12. + +
    + + +
    + +

    Ressources

    + + + + + +
    + +

    Credits

    + +
      +
    • Thanks to Daniel Baumann for his "Maintainer Cheatpage" which inspired this document
    • +
    + + +
    + +

    +-- Michael Prokop <mika@debian.org> +

    + +
    + +
    + + + + diff --git a/maintainer-notes.html b/maintainer-notes.html deleted file mode 100644 index 11149b8..0000000 --- a/maintainer-notes.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - -Maintainer documentation for initramfs-tools - - - - - -
    -
    - -

    Maintainer documentation for initramfs-tools

    - -
    - -

    Table of Contents

    - - - -
    - -

    1. Definitions

    - -

    - Note: This cheatpage assumes that you are using git-core 1.5.6 or newer. -

    - - - - - -
    version:version string
    username:name of the alioth account
    mailaddress:mailaddress of the user
    - - -
    - -

    2. Preparations

    - -
      - -
    1. Install required software (notice: git is named git-core on Debian/stable): -
      -# apt-get install git git-buildpackage dpkg-dev
      -
      -
    2. - -
    3. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and git-dch: -
      -% export GIT_AUTHOR_EMAIL=<mailaddress>
      -% export DEBEMAIL=<mailaddress>
      -% export GIT_COMMITTER_EMAIL=<mailaddress>
      -
      -
    4. - -
    5. Checkout repository (anonymous): -
      -% git clone git://git.debian.org/git/kernel/initramfs-tools.git
      -% cd initramfs-tools
      -
      -
    6. - -
    7. Checkout repository (with developer access): -
      -% git clone ssh://username@git.debian.org/git/kernel/initramfs-tools.git
      -% cd initramfs-tools
      -
      -
    8. - -
    - - -
    - -

    3. Workflow for daily work

    - -

    3.1 Implement new features

    - -
      - -
    1. Checkout new branch and switch to it: -
      -% git checkout -b username/short-descr-of-new-feature
      -
      -
    2. - -
    3. Hack and commit work: -
      -% $EDITOR $somefile
      -% git add $somefile
      -% git commit -s
      -
      -
    4. - -

      NOTE: Use 'Closes: #BUGID' for closing a bugreport, 'Thanks: Name -<mailaddress>' for giving credits in your commit message. git-dch will use -this information for generating the changelog using the --meta option later -on.

      - -
    5. Finally push your branch to alioth: -
      -% git push origin username/short-descr-of-new-feature
      -
      -
    6. - -
    - -

    3.2 Merge branches

    - -
      - -
    1. Switch to the branch you want to merge: -
      -% git checkout username/new-feature
      -
      -
    2. - -
    3. Rebase to master: -
      -% git rebase master
      -
      -
    4. - -
    5. Switch to master branch and merge: -
      -% git checkout master
      -% git merge username/new-feature
      -
      -
    6. - -
    7. Push: -
      -% git push
      -
      -
    8. - -
    9. After branch is merged delete branch on server and locally: -
      -% git push origin :username/short-descr-of-new-feature
      -% git branch -d username/short-descr-of-new-feature
      -
      -
    10. - -
    - -

    3.3 Test specific branch

    - -
      - -
    1. Checkout a specific branch iff branch is not already present locally: -
      -% git checkout -b somename/short-descr-of-new-feature origin/somename/short-descr-of-new-feature
      -
      -
    2. - -
    3. Checkout a specific branch iff branch is already present locally: -
      -% git checkout -b somename/short-descr-of-new-feature
      -
      -
    4. - -
    5. Adjust debian/changelog accordingly: -
      -git-dch --debian-branch="$(git branch | awk -F\* '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
      -
      -
    6. - -
    7. Build package: -
      -% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
      -
      -
    - - - -

    4. Contribute

    - -

    TODO / WIP:

    - -
      -
    1. Create patch: -
      -% git format-patch HEAD
      -
      -
    - - - -

    5 Releasing new version

    - -
      - -
    1. Creating changelog: - -
      -% git-dch --debian-branch debian --release --since HASH
      -
      - -or more dynamically: - -
      -% git-dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" [--id-length=7] [--full]
      -
      - -
    2. - -
    3. Releasing: -
      -% git commit -a -s -m "Releasing debian version version."
      -
      -
    4. - -
    5. Tagging: -
      -% git tag -s v"version" -m "release version"
      -
      -
    6. - -
    7. Pushing: -
      -% git push
      -% git push --tags
      -
      -
    8. - -
    9. Build in chroot and upload to ftp-master.
    10. - -
    11. Send mail announcing the new initramfs-tools version with subject -"initramfs-tools $VERSION release" to initramfs@vger.kernel.org, -debian-kernel@lists.debian.org + kernel-team@lists.ubuntu.com - including a -shortlog (generated through "git shortlog $TAG..").
    12. - -
    - - -
    - -

    Ressources

    - - - - - -
    - -

    Credits

    - -
      -
    • Thanks to Daniel Baumann for his "Maintainer Cheatpage" which inspired this document
    • -
    - - -
    - -

    --- Michael Prokop <mika@debian.org> -

    - -
    - -
    - - - - -- cgit v1.2.3 From d53a83994bfe7a9e1b9278afc4a12f7dca610f3f Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 02:18:28 +0200 Subject: maintainer-notes.html: extend contribution section, rewrap + fix git-dch/git-buildpackage commandline Signed-off-by: Michael Prokop --- docs/maintainer-notes.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index 11149b8..3bda045 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -193,13 +193,14 @@ on.

  • Adjust debian/changelog accordingly:
    -git-dch --debian-branch="$(git branch | awk -F\* '/^* / { print $2}' )" --since=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') -S --id-length=7 --meta
    +% git-dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
    +  --since="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta
     
  • Build package:
    -% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
    +% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
     
    @@ -207,12 +208,15 @@ on.

    4. Contribute

    -

    TODO / WIP:

    -
    1. Create patch:
      -% git format-patch HEAD
      +% git format-patch -s -p origin/master
      +
      + +
    2. Send patch file(s) to maintainers via mail (requires Debian package git-email): +
      +% git send-email --to=initramfs-tools@packages.qa.debian.org $PATCHFILE[S]
       
    -- cgit v1.2.3 From eb93a7e7d11da7789fa357c763ce2bc76245c8a8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 11:22:01 +0200 Subject: pre_mountroot(): reduce timeout to 30 seconds giant disk arrays, clusters will need to provide their own rootdelay= boot arg, they should have capable admins. 3 minutes wait is just too long for regular users. sync from ubuntu 0.96.1ubuntu1. Acked-by: Michael Prokop Signed-off-by: maximilian attems --- scripts/local | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/local b/scripts/local index 9b51174..8cb279a 100644 --- a/scripts/local +++ b/scripts/local @@ -26,12 +26,9 @@ pre_mountroot() if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then log_begin_msg "Waiting for root file system" - # Default delay is 180s - if [ -z "${ROOTDELAY}" ]; then - slumber=180 - else - slumber=${ROOTDELAY} - fi + # Default delay is 30s + slumber=${ROOTDELAY:-30} + if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "TIMEOUT ${slumber}" || true fi -- cgit v1.2.3 From 38563fedd5e9058c9ec164031df300dd2c2d31ad Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 16 Jun 2010 18:19:08 +0200 Subject: scripts/functions: On panic change to tty1 if chvt around To make sure the user can read any error messages displayed. (LP: #243226) usplash and other may cause the user to land somewhere, where nothing is displayed. merge from Ubuntu with adding conditional chvt invocation, as it may not be around. Thanks: Luke Yelavich Thanks: Colin Watson Signed-off-by: maximilian attems --- scripts/functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/functions b/scripts/functions index de8c1b2..ac77972 100644 --- a/scripts/functions +++ b/scripts/functions @@ -42,6 +42,11 @@ panic() if [ -x /sbin/usplash_write ]; then /sbin/usplash_write "QUIT" fi + + if command -v chvt >/dev/null 2>&1; then + chvt 1 + fi + # Disallow console access if [ -n "${panic}" ]; then sleep ${panic} -- cgit v1.2.3 From 20313797a36d115827f1060cffe48255852a387f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 16 Jun 2010 22:33:33 +0200 Subject: mkinitramfs: No point in hardcoding busybox path should make merge for Ubuntu easier. Thanks to David Greaves in LP: #573282 for the idea. Signed-off-by: maximilian attems --- mkinitramfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index e3b392e..9af5bfd 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -7,8 +7,9 @@ export PATH='/usr/bin:/sbin:/bin' keep="n" CONFDIR="/etc/initramfs-tools" verbose="n" -# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/" -export BUSYBOXDIR="/bin" +test -e /bin/busybox && BUSYBOXDIR=/bin +test -e /usr/lib/initramfs-tools/bin/busybox && BUSYBOXDIR=/usr/lib/initramfs-tools/bin +export BUSYBOXDIR OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"` -- cgit v1.2.3 From a39db63500c4482aad7d2fc17ad83edd3a56bb8f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 16 Jun 2010 17:12:53 +0200 Subject: Add lsinitramfs to initramfs-tools useful script to quickly look into initramfs for debugger or bug reporter, inspired by similar dracut tool. Signed-off-by: maximilian attems --- debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + lsinitramfs | 14 ++++++++++++++ lsinitramfs.8 | 31 +++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100755 lsinitramfs create mode 100644 lsinitramfs.8 diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index ebe6a14..184837f 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -1,3 +1,4 @@ +lsinitramfs usr/bin mkinitramfs usr/sbin mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index 0c88045..6d78d4c 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -1,3 +1,4 @@ +lsinitramfs.8 mkinitramfs.8 mkinitramfs-kpkg.8 initramfs.conf.5 diff --git a/lsinitramfs b/lsinitramfs new file mode 100755 index 0000000..aea7747 --- /dev/null +++ b/lsinitramfs @@ -0,0 +1,14 @@ +#!/bin/sh + +usage() +{ + echo "Usage: $(basename $0) " + exit 1 +} + +[ $# -eq 0 ] && usage + +for i in $*; do + echo $i + zcat $i | cpio --extract --verbose --quiet --list +done diff --git a/lsinitramfs.8 b/lsinitramfs.8 new file mode 100644 index 0000000..bb809ae --- /dev/null +++ b/lsinitramfs.8 @@ -0,0 +1,31 @@ +.TH LSINITRAMFS 8 "2010/06/16" "Linux" "lsinitramfs manual" + +.SH NAME +lsinitramfs \- list content of an initramfs image + +.SH SYNOPSIS +.B lsinitramfs +.IR initramfsfile + +.SH DESCRIPTION +The +.B lsinitramfs +lists the content of given initramfs images. It allows to quickly +check the content of this specific initramfs. + +.SH EXAMPLES + +List initramfs of current running kernel: + +.PP +.B lsinitramfs /boot/initrd.img-$(uname -r) + +.SH AUTHOR +The initramfs-tools are written by Maximilian Attems +and numerous others. + +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). -- cgit v1.2.3 From ecb8416d5ede3e5eae463802721c2a12216b61a4 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 01:49:09 +0200 Subject: lsinitramfs: be more defensive against cmdline options * make sure the specified file(s) can be read * redirect error message to stderr * support -h/--help option * variable quoting Signed-off-by: Michael Prokop --- lsinitramfs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lsinitramfs b/lsinitramfs index aea7747..809445f 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -3,12 +3,24 @@ usage() { echo "Usage: $(basename $0) " - exit 1 } -[ $# -eq 0 ] && usage +if [ "$#" -eq 0 ] ; then + usage >&2 + exit 1 +fi + +if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then + usage + exit 0 +fi -for i in $*; do - echo $i - zcat $i | cpio --extract --verbose --quiet --list +for i in "$*" ; do + if ! [ -r "$i" ] ; then + echo "Specified file could not be read." >&2 + exit 1 + else + echo "$i" + zcat "$i" | cpio --extract --verbose --quiet --list + fi done -- cgit v1.2.3 From 969f8fdc8561869dfc600ed6bc5cd892df3c130e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 11:45:30 +0200 Subject: lsinitramfs: set errexit and nounset better protect it from the start as have the pain later.. Signed-off-by: maximilian attems --- lsinitramfs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsinitramfs b/lsinitramfs index 809445f..3f67381 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + usage() { echo "Usage: $(basename $0) " -- cgit v1.2.3 From fafede51c3adca9f70bdb1bbe629db9aba35be85 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 11:52:20 +0200 Subject: lsinitramfs: allow to pass several filenames due to the quoting use $@ to expand to several arguments. Signed-off-by: maximilian attems --- lsinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsinitramfs b/lsinitramfs index 3f67381..e395de8 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -17,7 +17,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then exit 0 fi -for i in "$*" ; do +for i in "$@" ; do if ! [ -r "$i" ] ; then echo "Specified file could not be read." >&2 exit 1 -- cgit v1.2.3 From 68c87cd042ce2819625b2f067cf67e690d8b2ce8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 14:29:23 +0200 Subject: mkinitramfs: check syntax of boot and hook scripts only run them when sytax is good. Idea from LP: #570243. important now that we have errexit on for them. Signed-off-by: maximilian attems --- scripts/functions | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/functions b/scripts/functions index ac77972..8177216 100644 --- a/scripts/functions +++ b/scripts/functions @@ -100,6 +100,13 @@ set_initlist() continue fi + # skip bad syntax + if [ ! sh -n ${si_x} ]; then + [ "${verbose}" = "y" ] \ + && echo "$si_x ignored: bad syntax" + continue + fi + initlist="${initlist} ${si_x#${initdir}/}" done } @@ -123,6 +130,10 @@ reduce_satisfied() if [ -d ${initdir}/${rs_y} ]; then continue fi + # skip bad syntax + if [ ! sh -n ${initdir}/${rs_y} ]; then + continue + fi tmpdeplist="${tmpdeplist} ${rs_y}" done deplist=${tmpdeplist} -- cgit v1.2.3 From ae02e4b51c1b138994d0c6f199862f0cb82d78f8 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 17 Jun 2010 14:34:23 +0200 Subject: scripts/functions: beautify a bit reduce_satisfied() shorten code, no code change. function easier to read. Signed-off-by: maximilian attems --- scripts/functions | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/functions b/scripts/functions index 8177216..883df0d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -123,17 +123,12 @@ reduce_satisfied() ;; esac # skip non executable scripts - if [ ! -x ${initdir}/${rs_y} ]; then - continue - fi + [ ! -x ${initdir}/${rs_y} ] && continue # skip directories - if [ -d ${initdir}/${rs_y} ]; then - continue - fi + [ -d ${initdir}/${rs_y} ] && continue # skip bad syntax - if [ ! sh -n ${initdir}/${rs_y} ]; then - continue - fi + [ ! sh -n ${initdir}/${rs_y} ] && continue + tmpdeplist="${tmpdeplist} ${rs_y}" done deplist=${tmpdeplist} -- cgit v1.2.3 From 2ff4ba20c4629961373e78eb8d07f1221236802b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 15:00:50 +0200 Subject: scripts/functions: fix usage of test for script execution Signed-off-by: Michael Prokop --- scripts/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 883df0d..42fafa8 100644 --- a/scripts/functions +++ b/scripts/functions @@ -94,14 +94,14 @@ set_initlist() fi # skip directories - if [ -d ${si_x} ]; then + if [ -d ${si_x} ; then [ "${verbose}" = "y" ] \ && echo "$si_x ignored: a directory" continue fi # skip bad syntax - if [ ! sh -n ${si_x} ]; then + if ! sh -n ${si_x} ; then [ "${verbose}" = "y" ] \ && echo "$si_x ignored: bad syntax" continue -- cgit v1.2.3 From 74f71c9697d7dd7b25a7014320a7366027149fee Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 15:05:31 +0200 Subject: scripts/functions: fix another sh -n usage and fix typo Signed-off-by: Michael Prokop --- scripts/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 42fafa8..56ae1e1 100644 --- a/scripts/functions +++ b/scripts/functions @@ -94,7 +94,7 @@ set_initlist() fi # skip directories - if [ -d ${si_x} ; then + if [ -d ${si_x} ]; then [ "${verbose}" = "y" ] \ && echo "$si_x ignored: a directory" continue @@ -127,7 +127,7 @@ reduce_satisfied() # skip directories [ -d ${initdir}/${rs_y} ] && continue # skip bad syntax - [ ! sh -n ${initdir}/${rs_y} ] && continue + sh -n ${initdir}/${rs_y} || continue tmpdeplist="${tmpdeplist} ${rs_y}" done -- cgit v1.2.3 From 91f5947c08560feecb5f05d85efa6a2669486de3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 17 Jun 2010 01:58:31 +0200 Subject: hook-functions: install virtio_pci module if /sys/bus/virtio is present and using modules=dep Thanks: Vincent Danjean Closes: #585992 Signed-off-by: Michael Prokop --- hook-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hook-functions b/hook-functions index ded7887..d860bc7 100644 --- a/hook-functions +++ b/hook-functions @@ -365,6 +365,10 @@ dep_add_modules() manual_add_modules mmc_block fi + if [ -e /sys/bus/virtio ] ; then + manual_add_modules virtio_pci + fi + if [ -e /sys/bus/i2o/devices/ ]; then force_load i2o_block force_load i2o_config -- cgit v1.2.3 From 6af23c2bb403323fef33e830770c832616a7911b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 11:06:02 +0200 Subject: docs/maintainer-notes: valid XHTML 1.0 Strict document, add section "Build snapshot version", add license note, minor formating cleanups + improvements Signed-off-by: Michael Prokop --- docs/maintainer-notes.html | 122 +++++++++++++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 38 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index 3bda045..e8d36ea 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -12,8 +12,6 @@ acronym { cursor: help; } body { font-family: "DejaVu Sans", "Bitstream Vera Sans", sans-serif; } pre { background-color: #EEEEEE; border: 1px dashed black; padding: 1em; } div.right { text-align: right; } -red { color: red; } -gray { color: gray; } /*]]>*/ @@ -39,29 +37,34 @@ gray { color: gray; }
  • 3.1 Implement new features
  • 3.2 Merge branches
  • 3.3 Test specific branch
  • +
  • 3.4 Build snapshot version
  • 4. Contribute
  • -
  • 5 Releasing new version
  • -
  • 6 Ressources
  • -
  • 7 Credits
  • - +
  • 5. Release new version
  • +
  • 6. Ressources
  • +
  • 7. Credits
  • +
  • 8. License

  • -

    1. Definitions

    +

    NOTE: The most recent version of this document is available at +docs/maintainer-notes.html in the the git repository +or online at git.debian.org.

    -

    - Note: This cheatpage assumes that you are using git-core 1.5.6 or newer. -

    +
    + +

    1. Definitions

    - - - + + + +
    version:version string
    username:name of the alioth account
    mailaddress:mailaddress of the user
    $mailaddress:mailaddress of the user
    $username:name of the alioth account
    $version:version string
    $yourname:your fullname
    @@ -79,13 +82,16 @@ gray { color: gray; }
  • Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and git-dch:
    -% export GIT_AUTHOR_EMAIL=<mailaddress>
    -% export DEBEMAIL=<mailaddress>
    -% export GIT_COMMITTER_EMAIL=<mailaddress>
    +export DEBEMAIL=$mailaddress
    +export DEBFULLNAME=$yourname
    +export GIT_AUTHOR_EMAIL=$mailaddress
    +export GIT_AUTHOR_NAME=$yourname
    +export GIT_COMMITTER_EMAIL=$mailaddress
    +export GIT_COMMITTER_NAME=$yourname
     
  • -
  • Checkout repository (anonymous): +
  • Checkout repository (anonymous):
     % git clone git://git.debian.org/git/kernel/initramfs-tools.git
     % cd initramfs-tools
    @@ -94,7 +100,7 @@ gray { color: gray; }
     
     
  • Checkout repository (with developer access):
    -% git clone ssh://username@git.debian.org/git/kernel/initramfs-tools.git
    +% git clone ssh://$username@git.debian.org/git/kernel/initramfs-tools.git
     % cd initramfs-tools
     
  • @@ -112,7 +118,7 @@ gray { color: gray; }
  • Checkout new branch and switch to it:
    -% git checkout -b username/short-descr-of-new-feature
    +% git checkout -b $username/short-descr-of-new-feature
     
  • @@ -122,16 +128,17 @@ gray { color: gray; } % git add $somefile % git commit -s
    -
  • -

    NOTE: Use 'Closes: #BUGID' for closing a bugreport, 'Thanks: Name -<mailaddress>' for giving credits in your commit message. git-dch will use +NOTE: Use 'Closes: #BUGID' for closing a bugreport and 'Thanks: Fullname +<mailaddress>' for giving credits in your commit message. git-dch will use this information for generating the changelog using the --meta option later -on.

    +on. + +
  • Finally push your branch to alioth:
    -% git push origin username/short-descr-of-new-feature
    +% git push origin $username/short-descr-of-new-feature
     
  • @@ -143,7 +150,7 @@ on.

  • Switch to the branch you want to merge:
    -% git checkout username/new-feature
    +% git checkout $username/new-feature
     
  • @@ -156,7 +163,7 @@ on.

  • Switch to master branch and merge:
     % git checkout master
    -% git merge username/new-feature
    +% git merge $username/new-feature
     
  • @@ -168,8 +175,8 @@ on.

  • After branch is merged delete branch on server and locally:
    -% git push origin :username/short-descr-of-new-feature
    -% git branch -d username/short-descr-of-new-feature
    +% git push origin :$username/short-descr-of-new-feature
    +% git branch -d $username/short-descr-of-new-feature
     
  • @@ -202,9 +209,34 @@ on.

     % git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
     
    + + + + + +
    + +

    3.4 Build snapshot version

    + +
      + +
    1. Adjust debian/changelog accordingly: +
      +% git-dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
      +  --since="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta
      +
      +
    2. + +
    3. Build package: +
      +% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc [-us -uc]
      +
      +
    4. +
    +

    4. Contribute

    @@ -213,23 +245,27 @@ on.

     % git format-patch -s -p origin/master
     
    +
  • Send patch file(s) to maintainers via mail (requires Debian package git-email):
     % git send-email --to=initramfs-tools@packages.qa.debian.org $PATCHFILE[S]
     
    +
  • + +
    -

    5 Releasing new version

    +

    5. Release new version

    1. Creating changelog:
      -% git-dch --debian-branch debian --release --since HASH
      +% git-dch --debian-branch debian --release --since HASH
       
      or more dynamically: @@ -238,17 +274,21 @@ or more dynamically: % git-dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" [--id-length=7] [--full] +NOTE: we do not use history based sorting for the changelog entries but +sort them by author (doing that manually when reviewing the changelog, see #586165). +
    2. Releasing:
      -% git commit -a -s -m "Releasing debian version version."
      +% git commit -a -s -m "Releasing version $version."
       
    3. Tagging:
      -% git tag -s v"version" -m "release version"
      +% git tag -s v"$version" -m "release $version"
       
    4. @@ -271,7 +311,7 @@ shortlog (generated through "git shortlog $TAG..").
      -

      Ressources

      +

      6. Ressources

      + +
      + +

      7. Credits

      + +
      -

      Credits

      +

      8. License

        -
      • Thanks to Daniel Baumann for his "Maintainer Cheatpage" which inspired this document
      • +
      • This document is licensed under GPL v2 or any later version.

      --- Michael Prokop <mika@debian.org> +-- Michael Prokop <mika@debian.org>


      - - -- cgit v1.2.3 From 22d996c1b3bf29e2b665db695414441ec21c7270 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Jun 2010 11:25:03 +0200 Subject: maintainer doc: use git commands without the dash plus minor changes: - initramfs-tools uses master branches. - DEBEMAIL and friends affects devscripts. Signed-off-by: maximilian attems --- docs/maintainer-notes.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index e8d36ea..9858201 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -80,7 +80,7 @@ or online at -
    5. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and git-dch: +
    6. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and devscripts (git dch):
       export DEBEMAIL=$mailaddress
       export DEBFULLNAME=$yourname
      @@ -130,7 +130,7 @@ export GIT_COMMITTER_NAME=$yourname
       
      NOTE: Use 'Closes: #BUGID' for closing a bugreport and 'Thanks: Fullname -<mailaddress>' for giving credits in your commit message. git-dch will use +<mailaddress>' for giving credits in your commit message. git dch will use this information for generating the changelog using the --meta option later on. @@ -200,14 +200,14 @@ on.
    7. Adjust debian/changelog accordingly:
      -% git-dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
      +% git dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
         --since="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta
       
    8. Build package:
      -% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
      +% git buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc
       
    9. @@ -222,14 +222,14 @@ on.
    10. Adjust debian/changelog accordingly:
      -% git-dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
      +% git dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
         --since="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta
       
    11. Build package:
      -% git-buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc [-us -uc]
      +% git buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc [-us -uc]
       
    12. @@ -265,13 +265,13 @@ on.
    13. Creating changelog:
      -% git-dch --debian-branch debian --release --since HASH
      +% git dch --debian-branch master --release --since HASH
       
      or more dynamically:
      -% git-dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" [--id-length=7] [--full]
      +% git dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" [--id-length=7] [--full]
       
      NOTE: we do not use history based sorting for the changelog entries but -- cgit v1.2.3 From 1d66ae1f03358b221d67aaf65fbda0ff3c6071fc Mon Sep 17 00:00:00 2001 From: Ferenc Wagner Date: Thu, 17 Jun 2010 18:49:54 +0200 Subject: scripts/nfs: cleanup retry logic The condition of log_end_msg was always true. Calling do_nfsmount before the loop lets us drop two other checks. Signed-off-by: Ferenc Wagner Signed-off-by: maximilian attems --- scripts/nfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/nfs b/scripts/nfs index 5c41573..02b3830 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -69,14 +69,14 @@ mountroot() delay=${ROOTDELAY} fi - # loop until nfsmount succeds + # loop until nfsmount succeeds + do_nfsmount while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do - [ ${retry_nr} -gt 0 ] && \ [ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount" + /bin/sleep 1 do_nfsmount retry_nr=$(( ${retry_nr} + 1 )) - [ ! -e ${rootmnt}${init} ] && /bin/sleep 1 - [ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg + [ "$quiet" != "y" ] && log_end_msg done [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom" -- cgit v1.2.3 From 6147641d9129db51421ef0706972e21ceb36c801 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Jun 2010 11:14:14 +0200 Subject: nfsmount: more small cleanups code up the nfs rootdelay in a more efficient way. here people need the time it takes, so stay on 180s. Signed-off-by: maximilian attems --- scripts/nfs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/nfs b/scripts/nfs index 02b3830..6fa0c43 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -62,12 +62,7 @@ mountroot() wait_for_udev 10 # Default delay is around 180s - # FIXME: add usplash_write info - if [ -z "${ROOTDELAY}" ]; then - delay=180 - else - delay=${ROOTDELAY} - fi + delay=${ROOTDELAY:-180} # loop until nfsmount succeeds do_nfsmount -- cgit v1.2.3 From 2f3eb88faf2ac21036d4b33e5f44c9be076a635a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Jun 2010 11:36:26 +0200 Subject: lsinitramfs: use getopt for -l option only pass verbose to cpio if invoked with -l or --long. add minimal hints to manpage. Signed-off-by: maximilian attems --- lsinitramfs | 39 +++++++++++++++++++++++++++++++-------- lsinitramfs.8 | 2 ++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/lsinitramfs b/lsinitramfs index e395de8..3fcc50c 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -12,17 +12,40 @@ if [ "$#" -eq 0 ] ; then exit 1 fi -if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then - usage - exit 0 -fi +cpio_args="--extract --quiet --list" + +OPTIONS=`getopt -o hl --long help,long -n "$0" -- "$@"` +# Check for non-GNU getopt +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$OPTIONS" + +while true; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -l|--long) + cpio_args="${cpio_args:+${cpio_args} --verbose}" + shift + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + esac +done -for i in "$@" ; do - if ! [ -r "$i" ] ; then +for initramfs in "$@" ; do + if ! [ -r "${initramfs}" ] ; then echo "Specified file could not be read." >&2 exit 1 else - echo "$i" - zcat "$i" | cpio --extract --verbose --quiet --list + echo "${initramfs}" + zcat "${initramfs}" | cpio ${cpio_args} fi done diff --git a/lsinitramfs.8 b/lsinitramfs.8 index bb809ae..c1aa897 100644 --- a/lsinitramfs.8 +++ b/lsinitramfs.8 @@ -5,7 +5,9 @@ lsinitramfs \- list content of an initramfs image .SH SYNOPSIS .B lsinitramfs +.RB [ \-l ] .IR initramfsfile +.RB [ \-h ] .SH DESCRIPTION The -- cgit v1.2.3 From d25f6105991a6865eeaa7116c9b518af3160f0b1 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 11:57:54 +0200 Subject: slightly improve manpage lsinitramfs.8 Signed-off-by: Michael Prokop --- lsinitramfs.8 | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/lsinitramfs.8 b/lsinitramfs.8 index c1aa897..d802c76 100644 --- a/lsinitramfs.8 +++ b/lsinitramfs.8 @@ -5,23 +5,37 @@ lsinitramfs \- list content of an initramfs image .SH SYNOPSIS .B lsinitramfs -.RB [ \-l ] -.IR initramfsfile -.RB [ \-h ] +.RI [ options ] " " [ ] +.br .SH DESCRIPTION The .B lsinitramfs -lists the content of given initramfs images. It allows to quickly -check the content of this specific initramfs. +command lists the content of given initramfs images. It allows to quickly check +the content of one (or multiple) specified initramfs files. -.SH EXAMPLES +.SH OPTIONS -List initramfs of current running kernel: +.TP +.B -h +Display usage information and exit. + +.TP +.B -l +Display long and more verbose listing of initramfs content. + +.SH USAGE EXAMPLES + +List initramfs content of current running kernel: .PP .B lsinitramfs /boot/initrd.img-$(uname -r) +List content of two initramfs files in verbose mode: + +.PP +.B lsinitramfs -l /boot/vmlinuz-2.6.31-grml64 /boot/vmlinuz-2.6.33-grml64 + .SH AUTHOR The initramfs-tools are written by Maximilian Attems and numerous others. -- cgit v1.2.3 From e967b03f31e784e8a8a6189c5de5d7b0e6b9bb56 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 18 Jun 2010 12:23:37 +0200 Subject: mkinitramfs, lsinitramfs: Better error message for non-GNU getopt Reported-by: Michael Prokop Signed-off-by: maximilian attems --- lsinitramfs | 2 +- mkinitramfs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lsinitramfs b/lsinitramfs index 3fcc50c..91c65e1 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -16,7 +16,7 @@ cpio_args="--extract --quiet --list" OPTIONS=`getopt -o hl --long help,long -n "$0" -- "$@"` # Check for non-GNU getopt -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi eval set -- "$OPTIONS" diff --git a/mkinitramfs b/mkinitramfs index 9af5bfd..e49e01c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -14,7 +14,7 @@ export BUSYBOXDIR OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"` # Check for non-GNU getopt -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi eval set -- "$OPTIONS" -- cgit v1.2.3 From cf097346fd4e32a4918ca02c304fe1cf95ec5c23 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 12:37:34 +0200 Subject: Releasing version 0.97. Signed-off-by: Michael Prokop --- debian/changelog | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/debian/changelog b/debian/changelog index 901222a..a3e8189 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,68 @@ +initramfs-tools (0.97) unstable; urgency=low + + [ Martin Michlmayr ] + * [e65ee48] Produce an error when root cannot be determined with + MODULES=dep + * [bb66fc2] hook-functions/init/scripts/local: add support for ubifs. + (Closes: #582858) - thanks to Martin Michlmayr + + [ Ferenc Wagner ] + * [1d66ae1] scripts/nfs: cleanup retry logic + + [ Colin Watson ] + * [3054e3e] initramfs-tools: work around 'find -printf %Y' bug + + [ maximilian attems ] + * [a8a5ce4] script: Add update-initramfs.conf to bug report + * [cc6077a] update-initramfs: Fix another unbound variable (Closes: + #583695) + * [b1f74e6] get_fstype: reference blkid in comment - thanks to + Christoph Anton Mitterer + * [eb93a7e] pre_mountroot(): reduce timeout to 30 seconds + * [38563fe] scripts/functions: On panic change to tty1 if chvt around + - thanks to Colin Watson + * [2031379] mkinitramfs: No point in hardcoding busybox path + * [68c87cd] mkinitramfs: check syntax of boot and hook scripts + * [ae02e4b] scripts/functions: beautify a bit reduce_satisfied() + * [22d996c] maintainer doc: use git commands without the dash + * [6147641] nfsmount: more small cleanups + * [e967b03] mkinitramfs, lsinitramfs: Better error message for + non-GNU getopt + * Add lsinitramfs (to list content of an initramfs image) ([a39db63] + [969f8fd] [fafede5] [2f3eb88]) + + [ Michael Prokop ] + * [2a8c990] hook-functions/mkinitramfs/update-initramfs: consequently + output error messages to stderr + * [04b8619] init: display warning message if devtmpfs could not be + mounted. - thanks to Ferenc Wagner + * [60afd2a] code cleanup: drop trailing whitespaces. + * [ab28c77] code cleanup: consequently replace spaces in indentions + with tabs to unify coding stile + * [3a02c6f] code cleanup: consequently use "W:" for warnings. + * [b1fff5e] add bash-completion for update-initramfs (Closes: #537139) + - thanks to Stéphane Jourdois + * [5697c3b] hook-functions: replace awk calls with sed in + dep_add_modules() (Closes: #585991) - thanks to Thorsten Glaser + + * [7afab22] debian/script: append /proc/mdstat (iff present) to + bugreports + * [5b565be] scripts/functions: allow hooks to abort build (Closes: + #396388) + * [528ba78] hook-functions: do not install ubi module by default via + auto_add_modules() + * [ecb8416] lsinitramfs: be more defensive against cmdline options + * [2ff4ba2] scripts/functions: fix usage of test for script execution + * [74f71c9] scripts/functions: fix another sh -n usage and fix typo + * [91f5947] hook-functions: install virtio_pci module if + /sys/bus/virtio is present and using modules=dep (Closes: #585992) - + thanks to Vincent Danjean + * [d25f610] slightly improve manpage lsinitramfs.8 + * Provide maintainer-notes.html, being "Maintainer documentation for + initramfs-tools" ([7fc1ee5] [afafea4] [e506ee7] [d53a839] [6af23c2]) + + -- Michael Prokop Fri, 18 Jun 2010 12:28:04 +0200 + initramfs-tools (0.96.1) unstable; urgency=low * hook-functions: Make sure copy_exec hook function does not -- cgit v1.2.3 From 7faeb32bd8c61244d1fd47522133c04cd24445f8 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 15:45:51 +0200 Subject: fix typos in manpage, scripts/functions and conf/initramfs.conf - thanks lintian * paramater -> parameter * adress -> address * adress -> address * overriden -> overridden * correponds -> corresponds * correponds -> corresponds * Overriden -> Overridden * usualy -> usually Signed-off-by: Michael Prokop --- conf/initramfs.conf | 4 ++-- initramfs-tools.8 | 16 ++++++++-------- scripts/functions | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/conf/initramfs.conf b/conf/initramfs.conf index 0a108a8..bc9060b 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -2,7 +2,7 @@ # initramfs.conf # Configuration file for mkinitramfs(8). See initramfs.conf(5). # -# Note that configuration options from this file can be overriden +# Note that configuration options from this file can be overridden # by config files in the /etc/initramfs-tools/conf.d directory. # @@ -59,7 +59,7 @@ BOOT=local # DEVICE: ... # # Specify a specific network interface, like eth0 -# Overriden by optional ip= bootarg +# Overridden by optional ip= bootarg # DEVICE= diff --git a/initramfs-tools.8 b/initramfs-tools.8 index fd00429..d0d904c 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -66,12 +66,12 @@ Use root=/dev/nfs for NFS to kick to in. NFSOPTS can be looked up in \fB\fI ip tells how to configure the ip address. Allows to specify an different NFS server than the DHCP server. See Documentation/filesystems/nfsroot.txt -in any recent Linux source for details. Optional paramater for NFS root. +in any recent Linux source for details. Optional parameter for NFS root. .TP \fB\fI BOOTIF -is a mac adress in pxelinux format with leading "01-" and "-" as separations. -pxelinux passes mac adress of network card used to PXE boot on with this +is a mac address in pxelinux format with leading "01-" and "-" as separations. +pxelinux passes mac address of network card used to PXE boot on with this bootarg. .TP @@ -259,7 +259,7 @@ sets if a keymap needs to be added to initramfs. .TP \fB\fI MODULES specifies which kind of modules should land on initramfs. -This setting shouldn't be overriden by hook script, but can guide them +This setting shouldn't be overridden by hook script, but can guide them on how much they need to include on initramfs. @@ -496,12 +496,12 @@ init sets several variables for the boot scripts environment. .TP \fB\fI ROOT -correponds to the root boot option. +corresponds to the root boot option. Advanced boot scripts like cryptsetup or live-initramfs need to play tricks. Otherwise keep it alone. .TP \fB\fI ROOTDELAY, ROOTFLAGS, ROOTFSTYPE, IP -correponds to the rootdelay, rootflags, rootfstype or ip boot option. +corresponds to the rootdelay, rootflags, rootfstype or ip boot option. .TP \fB\fI DPKG_ARCH allows arch specific boot actions. @@ -521,10 +521,10 @@ passes the path to init(8) usually /sbin/init. .TP \fB\fI readonly is the default for mounting the root corresponds to the ro bootarg. -Overriden by rw bootarg. +Overridden by rw bootarg. .TP \fB\fI rootmnt -is the path where root gets mounted usualy /root. +is the path where root gets mounted usually /root. .TP \fB\fI debug indicates that a debug log is captured for further investigation. diff --git a/scripts/functions b/scripts/functions index 56ae1e1..068e901 100644 --- a/scripts/functions +++ b/scripts/functions @@ -220,7 +220,7 @@ call_scripts() echo "Calling hook ${cs_x}" fi ${initdir}/${cs_x} - # allow boot scripts to modify exported boot paramaters + # allow boot scripts to modify exported boot parameters if [ -e /conf/param.conf ]; then . /conf/param.conf fi -- cgit v1.2.3 From f1360c981fb00126d9a43e2afc6ad5b6639bddd6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 15:53:51 +0200 Subject: debian/NEWS: drop asterisk chars to make lintian happy Signed-off-by: Michael Prokop --- debian/NEWS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index a2a16af..350189b 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,13 +1,13 @@ initramfs-tools (0.94) unstable; urgency=low - * To improve boot speed and avoid some complications, video drivers are + To improve boot speed and avoid some complications, video drivers are no longer included in the initramfs by default (MODULES=most). -- maximilian attems Mon, 05 Apr 2010 08:10:34 +0200 initramfs-tools (0.76) unstable; urgency=low - * This release features nfs auto detection in the initramfs. + This release features nfs auto detection in the initramfs. The boot paramaters are parsed according to the linux source Documentation/kernel-parameters.txt and more specifically Documentation/nfsroot.txt. @@ -20,7 +20,7 @@ initramfs-tools (0.76) unstable; urgency=low initramfs-tools (0.61) unstable; urgency=low - * This release moves the initramfs-tools confdir from /etc/mkinitramfs to + This release moves the initramfs-tools confdir from /etc/mkinitramfs to /etc/initramfs-tools. Packages are encouraged to ship files as scripts under /usr/share/initramfs-tools. @@ -31,7 +31,7 @@ initramfs-tools (0.61) unstable; urgency=low initramfs-tools (0.10) breezy; urgency=low - * This release includes hardware auto detection in the initramfs. + This release includes hardware auto detection in the initramfs. This means two things in particular that are important: 1) the resulting initramfs will be huge. Like 10 megs huge. -- cgit v1.2.3 From c4a198163ba0db791085205d277545c6949f4830 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 15:54:15 +0200 Subject: install doc-base file for doc-base-registration Fix possible-documentation-but-no-doc-base-registration to make lintian happy. Signed-off-by: Michael Prokop --- debian/initramfs-tools.doc-base | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 debian/initramfs-tools.doc-base diff --git a/debian/initramfs-tools.doc-base b/debian/initramfs-tools.doc-base new file mode 100644 index 0000000..41f2134 --- /dev/null +++ b/debian/initramfs-tools.doc-base @@ -0,0 +1,10 @@ +Document: initramfs-maintainer +Title: Maintainer documentation for initramfs-tools +Author: Michael Prokop +Abstract: This document describes the workflow of + the initramfs-tools maintainers. +Section: Debian + +Format: HTML +Index: /usr/share/doc/initramfs-tools/maintainer-notes.html +Files: /usr/share/doc/initramfs-tools/maintainer-notes.html -- cgit v1.2.3 From f813bd9b1c289a07a23b826d67be87d99fde9465 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 18 Jun 2010 15:56:59 +0200 Subject: add debian/source/format with "3.0 (native)" to make lintian happy Signed-off-by: Michael Prokop --- debian/source/format | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/source/format diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) -- cgit v1.2.3 From 38ee1a01a95be213733d90573edafd1a1363c413 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 22 Jun 2010 10:38:43 +0200 Subject: maintainer-notes: document "git remote prune origin" Thanks: maximilian attems Signed-off-by: Michael Prokop --- docs/maintainer-notes.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index 9858201..354dece 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -180,6 +180,13 @@ on.
    14. +
    15. If a branch is removed from the server it will stay locally. You can get of +any stale remote branches locally by executing: +
      +% git remote prune origin
      +
      +
    16. +

    3.3 Test specific branch

    -- cgit v1.2.3 From 2390db89c9bcf1f83405098ba9221ae7476187cb Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 22 Jun 2010 10:44:34 +0200 Subject: maintainer-notes: use git config instead of environment variables Thanks: Gerfried Fuchs Signed-off-by: Michael Prokop --- docs/maintainer-notes.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index 354dece..eeceafd 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -80,14 +80,17 @@ or online at -
  • Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for git and devscripts (git dch): +
  • Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for devscripts (git dch):
     export DEBEMAIL=$mailaddress
    -export DEBFULLNAME=$yourname
    -export GIT_AUTHOR_EMAIL=$mailaddress
    -export GIT_AUTHOR_NAME=$yourname
    -export GIT_COMMITTER_EMAIL=$mailaddress
    -export GIT_COMMITTER_NAME=$yourname
    +export DEBFULLNAME=$yourname
    +
    +
  • + +
  • Set user name and email address for git (drop the --global option to use configuration per-repo basis): +
    +% git config --global user.name  "$yourname"
    +% git config --global user.email "$mailaddress"
     
  • -- cgit v1.2.3 From 837f2614f79e8ea66385e6dcb2a6072ddb5ec186 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 19 Jun 2010 18:08:15 +0200 Subject: mkinitramfs: set nounset and errexit Better catch both early than stupid mistakes cropping in. Signed-off-by: maximilian attems --- hook-functions | 2 +- mkinitramfs | 2 ++ scripts/functions | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hook-functions b/hook-functions index d860bc7..9d63d58 100644 --- a/hook-functions +++ b/hook-functions @@ -532,7 +532,7 @@ check_minkver() # sed: keep last line starting with MINKVER=, # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") - if [ -z "${tmp}" ]; then + if [ -z "${tmp:-}" ]; then continue elif dpkg --compare-versions "${curversion}" lt "${minver}"; then echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2 diff --git a/mkinitramfs b/mkinitramfs index e49e01c..bccdbed 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + umask 0022 export PATH='/usr/bin:/sbin:/bin' diff --git a/scripts/functions b/scripts/functions index 068e901..364cc27 100644 --- a/scripts/functions +++ b/scripts/functions @@ -107,7 +107,7 @@ set_initlist() continue fi - initlist="${initlist} ${si_x#${initdir}/}" + initlist="${initlist:-} ${si_x#${initdir}/}" done } -- cgit v1.2.3 From be710159d21269670b74b2dbe13898285c1911e4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 22 Jun 2010 00:07:32 +0200 Subject: reportbug: list the mkinitramfs hook scripts of reporting box It is interesting to see which are installed, may help to pindown some bugs earlier. Signed-off-by: maximilian attems --- debian/script | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/script b/debian/script index fa706cd..46b6650 100755 --- a/debian/script +++ b/debian/script @@ -57,3 +57,7 @@ if grep -q "MODULES=dep" /etc/initramfs-tools/initramfs.conf ; then ls /sys/block echo fi + +echo "-- mkinitramfs hooks" +ls /usr/share/initramfs-tools/hooks /etc/initramfs-tools/hooks/ +echo -- cgit v1.2.3 From 295bca71a41b7df7b61a426fdd5bf8bf0a21281f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 21 Jun 2010 10:19:48 +0200 Subject: initramfs-tools.8: Enhance documentation of boot option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhance manpage to target casual reader, who wants to know more about his kernel commandline. The boot/mkinitramfs hook hacker may easily read on, so move their desc a bit down. Add errexit hint of hook scripts. Also enhance a better written § from dracut, the current one was just jibberish. Reviewed-by: Michael Prokop Signed-off-by: maximilian attems --- initramfs-tools.8 | 60 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index d0d904c..fc2c085 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "2010/04/10" "Linux" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "2010/06/22" "Linux" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -9,38 +9,28 @@ 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. -Valid boot and hook scripts names consist solely of alphabetics, numerics, -dashes and underscores. Other scripts are discarded. - -.SS Hook scripts -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 -kernel boot in the early user-space before the root partition has been -mounted. - -.SH INIT SCRIPT -The script which is executed first and is in charge of running all other -scripts can be found in /usr/share/initramfs-tools/init. It takes a number of -arguments which influence the boot procedure: +.SH Kernel Command Line +The root filesystem used by the kernel is specified by the boot loader as +always. The traditional \fBroot=/dev/sda1\fR style device specification is +allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR the initrd will +search all available devices for a filesystem with the appropriate label, and +mount that device as the root filesystem. \fBroot=UUID=uuidnumber\fR will +mount the partition with that UUID as the root filesystem. -.SS Boot options - -The init and root are usually passed by the boot loader for local boot. -The other parameters are optional. +.SS Standard .TP -\fB\fI init +\fB\fI init= "" the binary to hand over execution to on the root fs after the initramfs scripts are done. .TP -\fB\fI root +\fB\fI root= "" the device node to mount as the root file system. The recommended usage is to specify the UUID as followed "root=UUID=xxx". -As normal device names are not stable and may change depending on the -boot order. + +.TP +\fB\fI rootfstype +set the root file system type. .TP \fB\fI rootdelay @@ -51,10 +41,6 @@ The default is 180 seconds. \fB\fI rootflags set the file system mount option string. -.TP -\fB\fI rootfstype -set the root file system type. - .TP \fB\fI nfsroot can be either "auto" to try to get the relevant information from DHCP or a @@ -106,6 +92,7 @@ mounts the rootfs read-write. disables load of specific modules. Use blacklist=module1,module2,module3 bootparameter. +.SS Debug .TP \fB\fI panic sets an timeout on panic. @@ -136,6 +123,21 @@ loads generic IDE/ATA chipset support on boot. .SH HOOK SCRIPTS +Valid boot and hook scripts names consist solely of alphabetics, numerics, +dashes and underscores. Other scripts are discarded. + +.SS Hook scripts +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. +Hook scripts are executed under errexit. Thus a hook script can abort the +mkinitramfs build on possible errors (exitcode != 0). + +.SS Boot scripts +These are included in the initramfs image and normally executed during +kernel boot in the early user-space before the root partition has been +mounted. + + 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 -- cgit v1.2.3 From c327689d1a2f1620e63f0f5fb8264e106444c644 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 22 Jun 2010 12:10:53 +0200 Subject: update-initramfs: run_bootloader() return after zipl and flash-kernel Spotted by mika, that those returns where missing. Signed-off-by: maximilian attems --- update-initramfs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update-initramfs b/update-initramfs index f4323b7..909e359 100755 --- a/update-initramfs +++ b/update-initramfs @@ -222,9 +222,11 @@ run_bootloader() fi if [ -r /etc/zipl.conf ]; then zipl + return 0 fi if flash-kernel --supported >/dev/null 2>&1; then flash-kernel ${version} + return 0 fi } -- cgit v1.2.3 From 3bdc6b1d6419359309f261d045bf9c78269b9292 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Jul 2010 17:57:15 +0200 Subject: mkinitramfs: Fix missing compress quotings the fallback for unset ${compress} never got used, due to the missing quotes. Do also set the GZIP CONFIG option when setting fallback of gzip. Closes: 587608 Thanks: Valentin QUEQUET Signed-off-by: maximilian attems --- mkinitramfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index bccdbed..1d74e76 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -136,8 +136,9 @@ else COMPRESS=${compress} fi -if ! command -v ${compress} >/dev/null 2>&1; then +if ! command -v "${compress}" >/dev/null 2>&1; then compress=gzip + COMPRESS=GZIP [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" fi @@ -323,7 +324,7 @@ eval ` find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | ${compress} >"${outfile}" + } | "${compress}" >"${outfile}" echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi -- cgit v1.2.3 From 90d99e475616b9819226afcf09b866fa2fcd9985 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Jul 2010 17:57:15 +0200 Subject: mkinitramfs: Fix missing compress quotings the fallback for unset ${compress} never got used, due to the missing quotes. Do also set the GZIP CONFIG option when setting fallback of gzip. Closes: 587608 Thanks: Valentin QUEQUET Signed-off-by: maximilian attems --- mkinitramfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index e49e01c..3a2feae 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -134,8 +134,9 @@ else COMPRESS=${compress} fi -if ! command -v ${compress} >/dev/null 2>&1; then +if ! command -v "${compress}" >/dev/null 2>&1; then compress=gzip + COMPRESS=GZIP [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" fi @@ -321,7 +322,7 @@ eval ` find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | ${compress} >"${outfile}" + } | "${compress}" >"${outfile}" echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi -- cgit v1.2.3 From 89a79c1c9f15220a377fd11d49687e17b2958062 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 5 Jul 2010 21:53:52 +0200 Subject: release 0.97.1 urgency high as it fixes initramfs-tools compress handling. Signed-off-by: maximilian attems --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index a3e8189..bccde47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.97.1) unstable; urgency=high + + * [90d99e4] mkinitramfs: Fix initramfs generation without COMPRESS set. + (Closes: 587608) - thanks Valentin QUEQUET + + -- maximilian attems Mon, 05 Jul 2010 21:50:47 +0200 + initramfs-tools (0.97) unstable; urgency=low [ Martin Michlmayr ] -- cgit v1.2.3 From 0b5ce7cd3e4655af03133718f0a92883425b9c6c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Jul 2010 12:48:56 +0200 Subject: initramfs-tools: output name of script that errexits. this should make bug reports concerning bogus hook scripts easier to handle, like the *loooong* iscan story. Closes: 586554 Signed-off-by: maximilian attems --- scripts/functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 364cc27..d42a3cf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -211,7 +211,6 @@ get_prereq_pairs() call_scripts() { - # allow hooks to abort build: set -e for cs_x in ${runlist}; do [ -f ${initdir}/${cs_x} ] || continue @@ -219,7 +218,12 @@ call_scripts() if [ "${verbose}" = "y" ]; then echo "Calling hook ${cs_x}" fi - ${initdir}/${cs_x} + ${initdir}/${cs_x} && ec=$? || ec=$? + # allow hooks to abort build: + if [ "$ec" -ne 0 ]; then + echo "E: ${initdir}/${cs_x} failed with return $ec." + exit $ec + fi # allow boot scripts to modify exported boot parameters if [ -e /conf/param.conf ]; then . /conf/param.conf -- cgit v1.2.3 From ce732c34bed22a712591f8459d8a0bb59ac91856 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Jul 2010 12:51:12 +0200 Subject: initramfs-tools: output name of script that errexits. this should make bug reports concerning bogus hook scripts easier to handle, like the *loooong* iscan story. Closes: 586554 Signed-off-by: maximilian attems --- scripts/functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/functions b/scripts/functions index 56ae1e1..1292fd6 100644 --- a/scripts/functions +++ b/scripts/functions @@ -211,7 +211,6 @@ get_prereq_pairs() call_scripts() { - # allow hooks to abort build: set -e for cs_x in ${runlist}; do [ -f ${initdir}/${cs_x} ] || continue @@ -219,7 +218,12 @@ call_scripts() if [ "${verbose}" = "y" ]; then echo "Calling hook ${cs_x}" fi - ${initdir}/${cs_x} + ${initdir}/${cs_x} && ec=$? || ec=$? + # allow hooks to abort build: + if [ "$ec" -ne 0 ]; then + echo "E: ${initdir}/${cs_x} failed with return $ec." + exit $ec + fi # allow boot scripts to modify exported boot paramaters if [ -e /conf/param.conf ]; then . /conf/param.conf -- cgit v1.2.3 From d78e243c8f73a16a307579c6df7683af6db8227a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 6 Jul 2010 12:59:13 +0200 Subject: release 0.97.2 --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index bccde47..9d667e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.97.2) unstable; urgency=high + + * [ce732c3] initramfs-tools: output name of script that errexits. + (Closes: 586554) + + -- maximilian attems Tue, 06 Jul 2010 12:58:37 +0200 + initramfs-tools (0.97.1) unstable; urgency=high * [90d99e4] mkinitramfs: Fix initramfs generation without COMPRESS set. -- cgit v1.2.3 From 089a903dab458bd48e0ba84a1da751f6e2312bae Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 7 Jul 2010 14:37:07 +0200 Subject: mkinitramfs: set COMPRESS=gzip to be more consistent. it is used that way in the configuration file example. Thanks: Colin Watson Signed-off-by: maximilian attems --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 1d74e76..f8e0759 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -138,7 +138,7 @@ fi if ! command -v "${compress}" >/dev/null 2>&1; then compress=gzip - COMPRESS=GZIP + COMPRESS=gzip [ "${verbose}" = y ] && \ echo "No ${COMPRESS} in ${PATH}, using gzip" fi -- cgit v1.2.3 From 210c83c797e16623bb727fa47960d514d8e8c510 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 10:56:28 +0200 Subject: control: conform to latest policy without changes Signed-off-by: maximilian attems --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 30d873b..99898ea 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: maximilian attems , Michael Prokop Maintainer: Debian kernel team Build-Depends: debhelper (>= 7.0) -Standards-Version: 3.8.4 +Standards-Version: 3.9.0 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From 961341244f4c4eb5c565b638755844778da49ff4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 11:27:06 +0200 Subject: mkinitramfs: Provide error code of failed mkinitramfs creation We better print them out before exiting, this should allow quicker diagnose of what is going on. Be sure to print out all error codes as a failure of compress is highly likely to generate an SIGPIPE aka error code 141. Silent error exits are troublesome for debugging error cause. Signed-off-by: maximilian attems --- mkinitramfs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index f8e0759..752ee45 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -327,9 +327,18 @@ eval ` } | "${compress}" >"${outfile}" echo "ec3=$?;" >&4 ` -if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi -if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi -if [ "$ec3" -ne 0 ]; then exit "$ec3"; fi +if [ "$ec1" -ne 0 ]; then + echo "E: mkinitramfs failure find $ec1 cpio $ec2 $compress $ec3" + exit "$ec1" +fi +if [ "$ec2" -ne 0 ]; then + echo "E: mkinitramfs failure cpio $ec2 $compress $ec3" + exit "$ec2" +fi +if [ "$ec3" -ne 0 ]; then + echo "E: mkinitramfs failure $compress $ec3" + exit "$ec3" +fi ) || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then -- cgit v1.2.3 From 51a8d5ff74630ffda651d4dbcdab608af3eea9e3 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 14:59:06 +0200 Subject: revert mkinitramfs errexit and nounset currently already to many failure pathes, no point in rushing more into the next release for squeeze. plan is to reinstate postqueeze. Reviewed-by: Michael Prokop Signed-off-by: maximilian attems --- mkinitramfs | 2 -- 1 file changed, 2 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 752ee45..713f4e0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,7 +1,5 @@ #!/bin/sh -set -eu - umask 0022 export PATH='/usr/bin:/sbin:/bin' -- cgit v1.2.3 From 6bcb867c1cb3082f265dc1c1a60ec72c9dcd90ed Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 11:34:52 +0200 Subject: Maintainer notes document dev mailinglists we are listening there. :) Signed-off-by: maximilian attems --- docs/maintainer-notes.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index eeceafd..ede8550 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -263,6 +263,9 @@ any stale remote branches locally by executing: +
  • The development mailinglists are debian-kernel@lists.debian.org or initramfs@vger.kernel.org. Discussion of eventual features, bugs or patches are more then welcomed there. +
  • + -- cgit v1.2.3 From c85bb1f2d6fcf617775255fbf278358ad2379e95 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 8 Jul 2010 14:40:27 +0200 Subject: some minor rewording of sentences about development mailinglists Signed-off-by: Michael Prokop --- docs/maintainer-notes.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index ede8550..fd85e00 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -263,8 +263,11 @@ any stale remote branches locally by executing: -
  • The development mailinglists are debian-kernel@lists.debian.org or initramfs@vger.kernel.org. Discussion of eventual features, bugs or patches are more then welcomed there. -
  • +
  • The development mailinglists are debian-kernel@lists.debian.org +and initramfs@vger.kernel.org. +Discussion of features, bugs and patches are more than welcome on those +lists.
  • -- cgit v1.2.3 From 7c6221d459e765f6ae8f40361727b72b65c88509 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 8 Jul 2010 15:03:31 +0200 Subject: maintainer notes: underline that mail to one of the 2 lists is good small wording change. Signed-off-by: maximilian attems --- docs/maintainer-notes.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/maintainer-notes.html b/docs/maintainer-notes.html index fd85e00..e9cec2d 100644 --- a/docs/maintainer-notes.html +++ b/docs/maintainer-notes.html @@ -266,8 +266,8 @@ any stale remote branches locally by executing:
  • The development mailinglists are debian-kernel@lists.debian.org and initramfs@vger.kernel.org. -Discussion of features, bugs and patches are more than welcome on those -lists.
  • +Discussion of features, bugs and patches are more than welcome on one +of these lists. -- cgit v1.2.3 From 09d251adb669002cbfcd5fd330e1c6471f6fc644 Mon Sep 17 00:00:00 2001 From: Stephen Powell Date: Fri, 2 Jul 2010 08:03:16 +0200 Subject: postinst hook: respect INITRD variable Do not create an initial RAM file system image for a custom kernel created by make-kpkg if one was not requested by the --initrd flag of make-kpkg. Signed-off-by: maximilian attems --- kernel/postinst.d/initramfs-tools | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools index 68124f7..5005ca4 100755 --- a/kernel/postinst.d/initramfs-tools +++ b/kernel/postinst.d/initramfs-tools @@ -9,6 +9,8 @@ bootopt="" # kernel-package passes an extra arg if [ -n "$2" ]; then if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then + # exit if custom kernel does not need an initramfs + [ "$INITRD" = 'No' ] && exit 0 bootdir=$(dirname "$2") bootopt="-b ${bootdir}" else -- cgit v1.2.3 From ff6116f97b557fd337993a8cc87403021e581325 Mon Sep 17 00:00:00 2001 From: Stephen Powell Date: Fri, 2 Jul 2010 08:05:28 +0200 Subject: Redirect STDOUT to STDERR for post{inst,rm} hooks Avoids output being swallowed by debconf's redirection of STDOUT. Signed-off-by: maximilian attems --- kernel/postinst.d/initramfs-tools | 2 +- kernel/postrm.d/initramfs-tools | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools index 5005ca4..d4db23d 100755 --- a/kernel/postinst.d/initramfs-tools +++ b/kernel/postinst.d/initramfs-tools @@ -28,4 +28,4 @@ if [ -n "$DEB_MAINT_PARAMS" ]; then fi # we're good - create initramfs. update runs do_bootloader -update-initramfs -c -t -k "${version}" ${bootopt} +update-initramfs -c -t -k "${version}" ${bootopt} >&2 diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools index 7811589..4e8f73b 100755 --- a/kernel/postrm.d/initramfs-tools +++ b/kernel/postrm.d/initramfs-tools @@ -26,4 +26,4 @@ if [ -n "$DEB_MAINT_PARAMS" ]; then fi # delete initramfs -update-initramfs -d -t -k "${version}" ${bootopt} +update-initramfs -d -t -k "${version}" ${bootopt} >&2 -- cgit v1.2.3 From 7af6ef47abf2d617fb15ca90966c8020067d4990 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 9 Jul 2010 12:53:58 +0200 Subject: mkinitramfs: do not execute compress command under quotes If we quote the $compress command then any options are considered as part of the command, resulting in something like: lzop -9: not found while updating a initramfs Closes: #588517 Signed-off-by: Michael Prokop --- mkinitramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitramfs b/mkinitramfs index 713f4e0..0bb7806 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -322,7 +322,7 @@ eval ` find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | "${compress}" >"${outfile}" + } | ${compress} >"${outfile}" echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then -- cgit v1.2.3 From b65a48670ef4ec22dd7801ad377ce19741f2387a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 9 Jul 2010 14:50:06 +0200 Subject: update-initramfs: stop buildprocess if any script is failing Signed-off-by: Michael Prokop --- update-initramfs | 3 --- 1 file changed, 3 deletions(-) diff --git a/update-initramfs b/update-initramfs index 909e359..a685241 100755 --- a/update-initramfs +++ b/update-initramfs @@ -504,11 +504,8 @@ if [ "${version}" = "all" ] \ OPTS="${OPTS} -y" fi for u_version in ${version_list}; do - # Don't stop if one version doesn't work. - set +e verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}" "${0}" -${mode} -k "${u_version}" ${OPTS} - set -e done exit 0 fi -- cgit v1.2.3 From 762ae2a78f6b1e9648242a3b3bc4baebc7151e48 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 1 Aug 2010 09:48:51 +0200 Subject: update-initramfs: revert nounset Brought no gain in code readability and lots of bug reports. Closes: #588915 Suggested-by: Colin Watson Signed-off-by: maximilian attems --- update-initramfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-initramfs b/update-initramfs index a685241..747fc0b 100755 --- a/update-initramfs +++ b/update-initramfs @@ -10,7 +10,7 @@ version="" update_initramfs=yes backup_initramfs=no -set -eu +set -e [ -r ${CONF} ] && . ${CONF} -- cgit v1.2.3 From a4e1a9ea7321799da65a11bb96413d66b7cb07eb Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 6 Aug 2010 23:59:07 +0200 Subject: initramfs-tools: only allow hook scripts to errexit on mkinitramfs version is "the" essential exported variable by mkinitramfs. Use it's string length to determine that we are on mkinitramfs stage and not trying to boot a not precached initramfs image. hook scripts on boot can exit due to random failures and shouldn't interrupt boot there. Signed-off-by: maximilian attems --- scripts/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index d42a3cf..1e2aeee 100644 --- a/scripts/functions +++ b/scripts/functions @@ -222,7 +222,8 @@ call_scripts() # allow hooks to abort build: if [ "$ec" -ne 0 ]; then echo "E: ${initdir}/${cs_x} failed with return $ec." - exit $ec + # only errexit on mkinitramfs + [ -n "${version}" ] && exit $ec fi # allow boot scripts to modify exported boot parameters if [ -e /conf/param.conf ]; then -- cgit v1.2.3 From 6f0b64634e739a648ab9e9cd17e59bbb6d409123 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 7 Aug 2010 00:36:41 +0200 Subject: update-initramfs: run_bootloader() invoke Initramfs hooks Conform to policy http://kernel-handbook.alioth.debian.org/ch-update-hooks.html#s-initramfs-hooks We check that the dir exists to no longer invoke boot loader on our own for squeeze, but work on partial upgrades from lenny. The bootloader invocations can be removed postsqueeze. Signed-off-by: maximilian attems --- update-initramfs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/update-initramfs b/update-initramfs index 747fc0b..f2439c8 100755 --- a/update-initramfs +++ b/update-initramfs @@ -190,6 +190,14 @@ run_lilo() # Invoke bootloader run_bootloader() { + # invoke policy conformant bootloader hooks + if [ -d /etc/initramfs/post-update.d/ ]; then + run-parts --arg=${version} --arg=${initramfs} \ + /etc/initramfs/post-update.d/ + return 0 + fi + + # FIXME: to be removed postsqueeze release # if both lilo and grub around, figure out if lilo needs to be run if ( command -v update-grub >/dev/null 2>&1 \ || [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \ -- cgit v1.2.3 From e7daaf7fdf80ba63626515ca3e3e3054aaac0417 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 29 Jul 2010 23:28:54 -0400 Subject: init: provide validate_init() wrapper to support absolute symlinks. If /sbin/init is an absolute symlink (e.g. to /bin/systemd) the readlink check doesn't work as $rootmnt is involved. The validate_init() shell function takes care of this fact, as well as when guessing the init binary points to a directory. For example Ubuntu's upstart has its configuration inside /etc/init whereas this is considered a valid run_init_process() binary by the Linux kernel and `test -x' returns true when checking for executables. Therefore be more conservative with providing full backwards compability as well as new added support for absolute symlinks at the same time. Closes: #590744 --- init | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/init b/init index 467a562..dee5625 100755 --- a/init +++ b/init @@ -227,24 +227,48 @@ run_scripts /scripts/init-bottom mount -n -o move /sys ${rootmnt}/sys mount -n -o move /proc ${rootmnt}/proc +validate_init() { + checktarget="${1}" + + # Work around absolute symlinks + if [ -d "${rootmnt}" ] && [ -h "${rootmnt}${checktarget}" ]; then + case $(readlink "${rootmnt}${checktarget}") in /*) + checktarget="$(chroot ${rootmnt} readlink ${checktarget})" + ;; + esac + fi + + # Make sure the specified init can be executed + if [ ! -x "${rootmnt}${checktarget}" ]; then + return 1 + fi + + # Upstart uses /etc/init as configuration directory :-/ + if [ -d "${rootmnt}${checktarget}" ]; then + return 1 + fi +} + # Check init bootarg -if [ -n "${init}" ] && [ ! -x "${rootmnt}${init}" ]; then - echo "Target filesystem doesn't have ${init}." - init= +if [ -n "${init}" ]; then + if ! validate_init "$init"; then + echo "Target filesystem doesn't have requested ${init}." + init= + fi fi # Search for valid init if [ -z "${init}" ] ; then - for init in /sbin/init /etc/init /bin/init /bin/sh; do - if [ ! -x "${rootmnt}${init}" ]; then - continue + for inittest in /sbin/init /etc/init /bin/init /bin/sh; do + if validate_init "${inittest}"; then + init="$inittest" + break fi - break done fi # No init on rootmount -if [ ! -x "${rootmnt}${init}" ]; then +if ! validate_init "${init}" ; then panic "No init found. Try passing init= bootarg." fi -- cgit v1.2.3 From a0c314053b1818a370e6a6aca21dd2594e75ca31 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 31 Jul 2010 14:20:21 -0400 Subject: init: provide fastforward path for the common case when validating init binary. --- init | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/init b/init index dee5625..abe3c9b 100755 --- a/init +++ b/init @@ -257,19 +257,22 @@ if [ -n "${init}" ]; then fi fi -# Search for valid init -if [ -z "${init}" ] ; then - for inittest in /sbin/init /etc/init /bin/init /bin/sh; do - if validate_init "${inittest}"; then - init="$inittest" - break - fi - done -fi +# Common case: /sbin/init is present +if [ ! -x "${rootmnt}/sbin/init" ]; then + # ... if it's not available search for valid init + if [ -z "${init}" ] ; then + for inittest in /sbin/init /etc/init /bin/init /bin/sh; do + if validate_init "${inittest}"; then + init="$inittest" + break + fi + done + fi -# No init on rootmount -if ! validate_init "${init}" ; then - panic "No init found. Try passing init= bootarg." + # No init on rootmount + if ! validate_init "${init}" ; then + panic "No init found. Try passing init= bootarg." + fi fi maybe_break init -- cgit v1.2.3 From b343994b0e30594a0340c63249962421735cbcda Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 7 Aug 2010 10:04:53 -0400 Subject: Bump Standards-Version to 3.9.1. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 99898ea..a9d16c4 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Uploaders: maximilian attems , Michael Prokop Maintainer: Debian kernel team Build-Depends: debhelper (>= 7.0) -Standards-Version: 3.9.0 +Standards-Version: 3.9.1 Vcs-Browser: http://git.debian.org/?p=kernel/initramfs-tools.git Vcs-Git: git://git.debian.org/git/kernel/initramfs-tools.git -- cgit v1.2.3 From 71de264f4777f16e1329a59df70d59972a88f854 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 7 Aug 2010 10:25:35 -0400 Subject: release 0.98 Signed-off-by: Michael Prokop --- debian/changelog | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9d667e6..8697676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,55 @@ +initramfs-tools (0.98) unstable; urgency=low + + [ Michael Prokop ] + * [7faeb32] fix typos in manpage, scripts/functions and + conf/initramfs.conf - thanks lintian + * [f1360c9] debian/NEWS: drop asterisk chars to make lintian happy + * [c4a1981] install doc-base file for doc-base-registration + * [f813bd9] add debian/source/format with "3.0 (native)" to make + lintian happy + * [38ee1a0] maintainer-notes: document "git remote prune origin" - + thanks to maximilian attems + * [2390db8] maintainer-notes: use git config instead of environment + variables - thanks to Gerfried Fuchs + * [c85bb1f] some minor rewording of sentences about development + mailinglists + * [7af6ef4] mkinitramfs: do not execute compress command under quotes + (Closes: #588517) + * [b65a486] update-initramfs: stop buildprocess if any script is + failing + * [e7daaf7] init: provide validate_init() wrapper to support absolute + symlinks. (Closes: #590744) + * [a0c3140] init: provide fastforward path for the common case when + validating init binary. + * [b343994] Bump Standards-Version to 3.9.1. + + [ maximilian attems ] + * [837f261] mkinitramfs: set nounset and errexit + * [be71015] reportbug: list the mkinitramfs hook scripts of reporting + box + * [295bca7] initramfs-tools.8: Enhance documentation of boot option + * [c327689] update-initramfs: run_bootloader() return after zipl and + flash-kernel + * [089a903] mkinitramfs: set COMPRESS=gzip to be more consistent. - + thanks to Colin Watson + * [210c83c] control: conform to latest policy without changes + * [9613412] mkinitramfs: Provide error code of failed mkinitramfs + creation + * [51a8d5f] revert mkinitramfs errexit and nounset + * [6bcb867] Maintainer notes document dev mailinglists + * [7c6221d] maintainer notes: underline that mail to one of the 2 + lists is good + * [762ae2a] update-initramfs: revert nounset (Closes: #588915) + * [a4e1a9e] initramfs-tools: only allow hook scripts to errexit on + mkinitramfs + * [6f0b646] update-initramfs: run_bootloader() invoke Initramfs hooks + + [ Stephen Powell ] + * [09d251a] postinst hook: respect INITRD variable + * [ff6116f] Redirect STDOUT to STDERR for post{inst,rm} hooks + + -- Michael Prokop Sat, 07 Aug 2010 09:41:39 -0400 + initramfs-tools (0.97.2) unstable; urgency=high * [ce732c3] initramfs-tools: output name of script that errexits. -- cgit v1.2.3 From 85fbb23edd4eb450f3180e3bfb51245e4da4d56d Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 20 Aug 2010 12:35:43 -0700 Subject: configure_networking(): Look for presence of /tmp/net-*.conf files when $DEVICE is not set (which is now default), otherwise ipconfig may receive a valid DHCP response, but fails to break out of the loop and is called repeatedly. thanks to Petter Reinholdtsen, i think i've figured out the initramfs-tools portion of this problem (there may still be outstanding issues with ipconfig). tested the attached patch, which seems to address the issue for me at least. Closes: #584583 Signed-off-by: maximilian attems --- scripts/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/functions b/scripts/functions index 1e2aeee..419203a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -372,9 +372,9 @@ configure_networking() # The NIC is to be configured if this file does not exist. # Ip-Config tries to create this file and when it succeds # creating the file, ipconfig is not run again. - if [ -e /tmp/net-"${DEVICE}".conf ]; then - break; - fi + for x in /tmp/net-"${DEVICE}".conf /tmp/net-*.conf ; do + [ -e "$x" ] && break 2 + done case ${IP} in none|off) -- cgit v1.2.3 From 3d176938d95d6b54a0b44e0aa7fe47eb4c4659b4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 25 Aug 2010 22:14:32 +0200 Subject: Releasing version 0.98.1. Signed-off-by: maximilian attems --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8697676..0ede144 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.98.1) unstable; urgency=high + + [ Vagrant Cascadian ] + * [85fbb23] configure_networking(): Look for presence of + /tmp/net-*.conf files to not recall ipconfig. (Closes: #584583) + + -- maximilian attems Wed, 25 Aug 2010 22:13:18 +0200 + initramfs-tools (0.98) unstable; urgency=low [ Michael Prokop ] -- cgit v1.2.3 From 97f20c507233a2a2fb419b90a5839097a631cb44 Mon Sep 17 00:00:00 2001 From: Eckhart Wörner Date: Tue, 7 Sep 2010 01:01:04 +0200 Subject: initramfs-tools: Add hid-cherry and hid-logitech to initramfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both a Cherry and a Logitech keyboard I own cannot be used at early boot time unless one also adds the hid-cherry / the hid-logitech module to the initramfs. The attached patch adds those two modules to hook-functions. For the Cherry keyboard, kernels up to 2.6.32-3 are not affected, from 2.6.32-5 (squeeze default) onwards all tested kernels were affected. Didn't do detailed checks for the Logitech keyboard. The used devices that exhibit this problem are: ID 046d:c30a Logitech, Inc. iTouch Composite ID 046a:0023 Cherry GmbH CyMotion Master Linux Keyboard Severity level important, since this makes booting with encrypted root partition impossible using those keyboards. Closes: #595827 Reported-by: Eckhart Wörner Signed-off-by: maximilian attems --- hook-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook-functions b/hook-functions index 9d63d58..0684296 100644 --- a/hook-functions +++ b/hook-functions @@ -394,7 +394,7 @@ auto_add_modules() case "${1:-}" in base) for x in ehci-hcd ohci-hcd uhci-hcd usbhid xhci hid-apple \ - hid-microsoft \ + hid-cherry hid-logitech hid-microsoft \ btrfs ext2 ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs \ af_packet atkbd i8042 virtio_pci; do manual_add_modules "${x}" -- cgit v1.2.3 From 3963c563cf1ea4b1126a4c1949181029a0ff2305 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 7 Sep 2010 12:53:14 +0200 Subject: release version 0.98.2 Signed-off-by: maximilian attems --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0ede144..dfa3ab4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.98.2) unstable; urgency=high + + [ Eckhart Wörner ] + * [97f20c5] initramfs-tools: Add hid-cherry and hid-logitech to + initramfs (Closes: #595827) + + -- maximilian attems Tue, 07 Sep 2010 12:54:01 +0200 + initramfs-tools (0.98.1) unstable; urgency=high [ Vagrant Cascadian ] -- cgit v1.2.3 From 7a6f9e972def00f7f0435d9f2616bcb79dc619b7 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 9 Sep 2010 14:16:55 -0700 Subject: remove files that no longer exist --- docs/example_hook_cpiogz | 84 --------------------------------- hooks/kernelextras | 44 ----------------- hooks/legacylvm | 28 ----------- hooks/udevhelper | 36 -------------- scripts/init-premount/blacklist | 25 ---------- scripts/init-premount/thermal | 37 --------------- scripts/init-top/framebuffer | 102 ---------------------------------------- scripts/local-top/lvm | 74 ----------------------------- 8 files changed, 430 deletions(-) delete mode 100644 docs/example_hook_cpiogz delete mode 100755 hooks/kernelextras delete mode 100755 hooks/legacylvm delete mode 100755 hooks/udevhelper delete mode 100755 scripts/init-premount/blacklist delete mode 100755 scripts/init-premount/thermal delete mode 100755 scripts/init-top/framebuffer delete mode 100755 scripts/local-top/lvm diff --git a/docs/example_hook_cpiogz b/docs/example_hook_cpiogz deleted file mode 100644 index f3e44d9..0000000 --- a/docs/example_hook_cpiogz +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -# -# The environment contains at least: -# -# CONFDIR -- usually /etc/mkinitramfs, can be set on mkinitramfs -# command line. -# -# DESTDIR -- The staging directory where we are building the image. -# -# TODO: Decide what environment variables are meaningful and defined -# in this context, then document them as part of the interface. -# -# TODO: Write a common header for these examples or move this -# documentation to a man page and reference it here. :-) -# - -# -# List the soft prerequisites here. This is a space separated list of -# names, of scripts that are in the same directory as this one, that -# must be run before this one can be. -# -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# -# Source the 'hook-functions' scriptlet (for 'catenate_cpiogz'): -# -. /usr/share/initramfs-tools/hook-functions - -# -# Lets pretend it has a conffile (think debconf), and we source it -# here. Don't make debconf lookup calls here. The postinst for the -# package owning this hook script should have done that and configured -# the "/etc/default/conffile" already. -# -# TODO: How does the package ensure that it's installed BEFORE the -# 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 - -# -# Also pretend that we only include our initramfs overlay if an opion -# is not "no", and the 'linux-image' package we are generating this -# initramfs for matches the version this script's package is designed -# for. Just for example; pretend this example mkinitramfs hook script -# is part of a 'linux-image' or 'xxx-modules' package. -# -if [ "$MYOPTION" != "no" -a "$version" = "2.6.12+ss2.1.9.1" ]; then - catenate_cpiogz /usr/lib/mypackage/initramfs.cpio.gz -fi - -# -# In this case, there does not have to be an (eg.): -# -# "/etc/mkinitramfs/init-top/mypackage" -# -# ... since that script is probably inside of the initramfs overlay -# already. If it's a conffile though, it does not belong in there, -# and should be placed in the appropriate location inside of -# "/etc/mkinitramfs". Remember that if it needs access to the -# settings in our "/etc/default/mypackage-initramfs", then that file -# must also get copied into a location inside of ${DESTDIR} by this -# hook script in order to make it available inside of the initramfs -# environment. -# - -exit 0 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 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/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 diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist deleted file mode 100755 index 1dd9dbc..0000000 --- a/scripts/init-premount/blacklist +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# sanity check -[ -z "${blacklist}" ] && exit 0 - -# write blacklist to modprobe.d -IFS=',' -for b in ${blacklist}; do - echo "blacklist $b" >> /etc/modprobe.d/initramfs -done diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal deleted file mode 100755 index aa146ec..0000000 --- a/scripts/init-premount/thermal +++ /dev/null @@ -1,37 +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) - modprobe fan - modprobe thermal - ;; -esac diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer deleted file mode 100755 index 0ed798e..0000000 --- a/scripts/init-top/framebuffer +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -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 " - # In the ":" form - elif [ "${opt}" != "${opt#*:}" ]; then - echo -n "${opt%:*}=${opt#*:} " - # Presumably a modevalue without the "mode=" prefix - elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then - echo -n "mode=$opt " - # Presumably a boolean - else - echo -n "${opt}=1 " - fi - done -} - -FB="" -OPTS="" - -for x in $(cat /proc/cmdline); do - case ${x} in - vga=*) - FB="vesafb"; - OPTS=""; - ;; - video=*) - FB=${x#*=} - FB="${FB%%:*}" - OPTS="$(parse_video_opts "${x}")" - esac -done - -# Map command line name to module name and other tweaks -case ${FB} in -matroxfb) - FB=matroxfb_base - ;; -uvesafb) - # v86d requires /dev/zero and dev/mem, but udev haven't been started yet - [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 - [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 - ;; -*) - ;; -esac - -if [ -n "${FB}" ]; then - modprobe fbcon - modprobe ${FB} ${OPTS} -fi - -if [ -e /proc/fb ]; then - while read fbno desc; do - if [ $(($fbno < 32)) ]; then - mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} - fi - done < /proc/fb -else - mknod -m 0640 /dev/fb0 c 29 0 -fi 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