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/initramfs-tools.preinst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 debian/initramfs-tools.preinst (limited to 'debian/initramfs-tools.preinst') 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# -- 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 b8c8f676a5f0da208b27e4d9bac71ae3814a1b97 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 27 Sep 2006 16:03:30 +0200 Subject: - mkinitramfs: allow umask setting paranoid - revert an nfs changes small fixes over the place --- debian/changelog | 27 +++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 6 ++++-- hook-functions | 20 +++++++++++--------- mkinitramfs | 10 ++++++++-- scripts/nfs | 2 +- update-initramfs | 4 ++-- 6 files changed, 53 insertions(+), 16 deletions(-) (limited to 'debian/initramfs-tools.preinst') 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 849c7c5f29f3689a4879204c23a6e89e2e6c0d7e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Oct 2006 08:52:12 +0200 Subject: - add backup handling to initramfs-tools - allow conservative settings for skipping updated initramfs. - debug output to screen - parse mbr for lilo + small fixes --- conf/update-initramfs.conf | 11 ++++++ debian/changelog | 38 ++++++++++++++++++++ debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + debian/initramfs-tools.preinst | 2 +- hooks/kernelextras | 1 - init | 4 +++ initramfs-tools.8 | 9 +++-- initramfs.conf.5 | 6 ++-- mkinitramfs.8 | 6 ++-- scripts/init-top/framebuffer | 69 +++++++++++++++++++++++++++++++----- update-initramfs | 78 +++++++++++++++++++++++++++++++++++++---- update-initramfs.8 | 6 ++-- update-initramfs.conf.5 | 26 ++++++++++++++ 14 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 conf/update-initramfs.conf create mode 100644 update-initramfs.conf.5 (limited to 'debian/initramfs-tools.preinst') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf new file mode 100644 index 0000000..36c3dde --- /dev/null +++ b/conf/update-initramfs.conf @@ -0,0 +1,11 @@ +# +# Configuration file for update-initramfs(8) +# + +# +# update_initramfs [ yes | no ] +# +# Default is yes +# If set to no disables any update to initramfs beside kernel upgrade + +update_initramfs=yes diff --git a/debian/changelog b/debian/changelog index 2990625..1eaf2f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +initramfs-tools (0.83) unstable; urgency=high + + Release "Ois was du verzapfst is a koida Kaffee" + + * update-initramfs: Keep an initramfs backup while we are running. Do also + keep the booted initramfs as .bak in /boot. First helps on power cut. + Second is a good conservative approach and demanded feature. + Thanks Thiemo Nagel for report. (closes: 387780) + + * init: When debug is invoked with an additional arg, write output to + console. Thanks Christian Aichinger for the idea. + Should ease remote debugging. + + * initramfs-tools.8: Document new debug= feature. + + * initramfs-tools.preinstall: Check for right arg. (closes: 391619) + + * update-initramfs: Try to guess harder if lilo might need to be run + if grub is also around. On old installs we get _zero_ information from + /etc/kernel.img. Parse mbr for lilo signature. (closes: 385949) + Thanks to Michael Prokop for finetuning. + + * scripts/init-top/framebuffer: Parse video bootarg and refactor script. + This add support for custom framebuffer modules. (closes: 386441) + Thanks for the patch by David Härdeman . + + * update.conf: Allow to make "update-initramfs -u" an noop. Useful for + conservative settings of a remote server. (closes: 362064) urgency high. + Thanks Manoj Srivastava for the tough testing. + + * update-initramfs.conf.5: Document the new update_initramfs variable. + + * update-initramfs: Kope with stupid mv of grub to /usr/sbin. + + * manpages: Get a banana and mark myself as author. + + -- maximilian attems Fri, 13 Oct 2006 08:12:40 +0200 + initramfs-tools (0.82) unstable; urgency=high * Merge 0.69ubuntu15, plus 0.69ubuntu14 and 0.69ubuntu11 changelog entries diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 5514c2e..5b3d8a6 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -3,6 +3,7 @@ mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/initramfs-tools +conf/update-initramfs.conf etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools conf/modules usr/share/initramfs-tools diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index f127e99..0c88045 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -3,3 +3,4 @@ mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 +update-initramfs.conf.5 diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 7b02612..fc1fd06 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -3,7 +3,7 @@ set -e case "$1" in - configure) + install) if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d diff --git a/hooks/kernelextras b/hooks/kernelextras index 6bbd6b9..714e9a9 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -42,4 +42,3 @@ manual_add_modules vga16fb if [ ${fbcon} = "y" ]; then force_load fbcon fi - diff --git a/init b/init index 85f6291..fbe32be 100755 --- a/init +++ b/init @@ -110,6 +110,10 @@ for x in $(cat /proc/cmdline); do exec >/tmp/initramfs.debug 2>&1 set -x ;; + debug=*) + debug=y + set -x + ;; break=*) break=${x#break=} ;; diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 7af09e1..4ce53d3 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/08/19" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -96,7 +96,9 @@ sets an timeout on panic. Currently only zero value supported. .TP \fB \fI debug -generates lots of output to /tmp/initramfs.debug. +generates lots of output. It writes a log to /tmp/initramfs.debug. +Instead when invoked with an arbitrary argument output is written to console. +Use for example "debug=vc". .TP \fB \fI break @@ -443,7 +445,8 @@ cpio -i -d -H newc --no-absolute-filenames .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .PP This manual was written by David H\[:a]rdeman , updated by Maximilian Attems . diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 89e9f4b..ca47a02 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/09/02 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -58,8 +58,8 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. Loosely based on mkinitrd.conf by Herbert Xu. .SH SEE ALSO diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 9041ba6..23e719f 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/08/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -95,8 +95,8 @@ it to be loaded by ACPI. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 4f0ab62..bafbe19 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -13,27 +13,78 @@ prereqs) ;; esac + +# The options part of the kernel "video=" argument (i.e. everyting +# after "video=:") has very inconsistent rules. +# +# Generally the following applies: +# 1) options are comma-separated +# 2) options can be in either of these three forms: +# =, :, . +# 3) the "mode" option has the form x[M][R][-][@][i][m] +# and may or may not start with "mode=" +# +# When the options are used with modules, they need to be space-separated +# and the following conversions are needed: +# : -> = +# -> =1 +# -> mode= +parse_video_opts() +{ + local OPTS="$1" + local IFS="," + + # Must be a line like video=:,[opt2]... + if [ "$OPTS" = "${OPTS%%:*}" ]; then + return + fi + OPTS="${OPTS#*:}" + for opt in $OPTS; do + # Already in the "=" form + if [ "$opt" != "${opt#*=}" ]; then + echo -n "$opt " + # Presumably a modevalue without the "mode=" prefix + elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + echo -n "mode=$opt " + # Presumably a boolean + else + echo -n "$opt=1 " + fi + done +} + +FB="" +OPTS="" + SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do case $x in splash*) - SPLASH=true; + FB="vga16fb"; + OPTS=""; ;; vga=*) - VESA=true; + FB="vesafb"; + OPTS=""; ;; + video=*) + FB=${x#*=} + FB="${FB%%:*}" + OPTS="$(parse_video_opts "$TMP")" esac done -if [ $SPLASH = "true" -o $VESA = "true" ]; then - modprobe -q fbcon - if [ $VESA = "true" ]; then - modprobe -q vesafb - else - modprobe -q vga16fb - fi +if [ -n "$FB" ]; then + modprobe -q $FB $OPTS +fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + mknod /dev/fb$fbno 29 $fbno + done < /proc/fb + mknod /dev/fb0 c 29 0 for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty$i c 4 $i diff --git a/update-initramfs b/update-initramfs index 45d4631..4995553 100755 --- a/update-initramfs +++ b/update-initramfs @@ -2,10 +2,13 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot +CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf set -e +[ -r ${CONF} ] && . ${CONF} + usage() { if [ -n "${1}" ]; then @@ -62,6 +65,46 @@ set_initramfs() initramfs="${BOOTDIR}/initrd.img-${version}" } + +# backup initramfs while running +backup_initramfs() +{ + [ ! -r "${initramfs}" ] && return 0 + initramfs_bak="${initramfs}.dpkg-bak" + [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}" + mv -f "${initramfs}" "${initramfs_bak}" + verbose "Keeping ${initramfs_bak}" +} + +# keep booted initramfs +backup_booted_initramfs() +{ + # chroot + [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 + + # no backup yet + initramfs_bak="${initramfs}.dpkg-bak" + if [ ! -r "${initramfs}.bak" ]; then + mv -f ${initramfs_bak} "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + + + # keep booted initramfs + uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) + if [ -n "$uptime_days" ]; then + boot_initramfs=$(find "${initramfs_bak}" -mtime +${uptime_days}) + fi + if [ -n "${boot_initramfs}" ]; then + mv -f "${initramfs_bak}" "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + verbose "Removing current backup ${initramfs_bak}" + rm -f ${initramfs_bak} +} + generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" @@ -91,11 +134,27 @@ run_lilo() fi } +# check if lilo is on mbr +mbr_check() +{ + boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) + [ -z "${boot}" ] && return 0 + [ ! -r "${boot}" ] && return 0 + dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO + [ $? -eq 0 ] && run_lilo && return 0 + echo + echo "WARNING: grub and lilo installed." + echo "If you use grub as bootloader everything is fine." + echo "If you use lilo as bootloader you must run lilo!" + echo +} + # only run lilo if no grub is around # or if "do_bootloader = yes" is set run_bootloader() { - if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then + if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ + || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") @@ -103,13 +162,10 @@ run_bootloader() || [ "${do_b}" = "YES" ]; then run_lilo return 0 + else + mbr_check + return 0 fi - - echo - echo "WARNING: grub and lilo installed." - echo "If you use grub as bootloader everything is fine." - echo "If you use lilo as bootloader you must run lilo!" - echo fi return 0 fi @@ -228,6 +284,11 @@ create() update() { + if [ "${update_initramfs}" = "no" ]; then + echo "update-initramfs: Not updating initramfs." + exit 0 + fi + if [ -z "${version}" ]; then set_linked_version fi @@ -251,10 +312,13 @@ update() altered_check + backup_initramfs + generate_initramfs run_bootloader + backup_booted_initramfs } delete() diff --git a/update-initramfs.8 b/update-initramfs.8 index 871e9a5..a562349 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/06" $" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/10/12" $" "" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image @@ -85,8 +85,8 @@ Create the initramfs for a specific kernel: .B update\-initramfs -c -k 2.6.18-1-686 .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 new file mode 100644 index 0000000..551f6c9 --- /dev/null +++ b/update-initramfs.conf.5 @@ -0,0 +1,26 @@ +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" + +.SH NAME +update-initramfs.conf \- configuration file for update-initramfs + +.SH DESCRIPTION +The configuration file allows to disable the update action from +.B update-initramfs. + +.SH GENERAL VARIABLES +.TP +\fB update_initramfs +Default is \fIyes\fP for running the latest initramfs-tools hooks in the +newest Linux image. +It is possible to set it to \fIno\fP for remote servers or boxes where +conservative manners needs to be applied. This disables +the \fBupdate_initramfs -u\fP call. + +.SH AUTHOR +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). -- cgit v1.2.3 From dc67493c8b72ebb4a360194a13c74a13d06def52 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Oct 2006 13:16:03 +0200 Subject: - improve run_bootloader (elilo, zipl) - fix preinst sed command - bunch of minor fixes --- debian/changelog | 40 ++++++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 4 +--- hook-functions | 3 ++- hooks/thermal | 11 +++++++++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 2 +- scripts/init-top/framebuffer | 2 +- scripts/local | 4 ++++ update-initramfs | 15 ++++++++++++--- 9 files changed, 74 insertions(+), 11 deletions(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(+) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(+) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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 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(-) (limited to 'debian/initramfs-tools.preinst') 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