--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: update-initramfs triggerisation
- From: Ian Jackson <iwj@ubuntu.com>
- Date: Mon, 22 Oct 2007 16:23:18 +0100
- Message-id: <18204.49254.182970.535519@davenant.relativity.greenend.org.uk>
Source: initramfs-tools
Version: 0.91b
Severity: wishlist
Tags: patch
The attached patch triggerises the invocation of mkinitramfs by
package maintainer scripts via update-initramfs.
By `triggerises' I mean that the patch arranges for the formulaic
update-initramfs invocations by maintainer scripts (eg of udev, kernel
packages, etc.) to call dpkg-trigger instead of actually doing the
work of update-initramfs and mkinitramfs. update-initramfs and hence
mkinitramfs will be actually run out of initramfs-tools's postinst
script during trigger processing. The consequence is that all of the
initramfs updates during a dpkg run are deferred, and instead the
update is done once at the end.
This is achieved by new code in update-initramfs. This detects the
formulaic invocation by a maintscript, and exec's dpkg-trigger instead
(if the conditions are favourable). An alternative approach would be
to change all of the packages not to call update-initramfs but instead
to call a new script but this would involve a much more complicated
and lengthy transition for no significant benefit.
The patch is safe to use with a non-triggers-supporting dpkg and in
all transitional states: where the trigger system is not properly set
up yet, update-initramfs does its work as normal. Note that sid's
dpkg does not yet have the triggers patch merged but there has been
extensive discussion of the design and interfaces for triggers and the
API should IMO be considered stable.
These changes have been tested and released as part of Ubuntu 7.10 aka
`gutsy gibbon'. The patch below is the consilidation of the results
of our testing.
So we believe that this patch can and should be safely applied to
sid's initramfs-tools straight away.
Ian.
diff -ruN ../orig/initramfs-tools-0.85eubuntu16/debian/changelog initramfs-tools-0.85eubuntu18/debian/changelog
--- ../orig/initramfs-tools-0.85eubuntu16/debian/changelog 2007-07-31 06:31:15.000000000 +0100
+++ initramfs-tools-0.85eubuntu18/debian/changelog 2007-08-24 15:45:43.000000000 +0100
@@ -1,3 +1,19 @@
+initramfs-tools (0.85eubuntu18) gutsy; urgency=low
+
+ * Use dpkg-trigger even in our own postinst, unless we're doing
+ trigger processing or the running dpkg version doesn't support
+ reflexive triggers. This reduces update-initramfs runs from two per
+ upgrade batch to one per batch.
+
+ -- Ian Jackson <iwj@ubuntu.com> Fri, 24 Aug 2007 15:45:38 +0100
+
+initramfs-tools (0.85eubuntu17) gutsy; urgency=low
+
+ * Use dpkg-trigger (if available and operational) to save on
+ calls to update-initramfs.
+
+ -- Ian Jackson <iwj@ubuntu.com> Thu, 16 Aug 2007 16:03:52 +0100
+
initramfs-tools (0.85eubuntu16) gutsy; urgency=low
* Load thermal modules on lpia as well. This may need to change in
diff -ruN ../orig/initramfs-tools-0.85eubuntu16/debian/initramfs-tools.postinst initramfs-tools-0.85eubuntu18/debian/initramfs-tools.postinst
--- ../orig/initramfs-tools-0.85eubuntu16/debian/initramfs-tools.postinst 2006-12-21 23:32:07.000000000 +0000
+++ initramfs-tools-0.85eubuntu18/debian/initramfs-tools.postinst 2007-08-24 15:45:02.000000000 +0100
@@ -25,9 +25,16 @@
-# 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
update-initramfs -u
+ # ... this activates the trigger, if triggers are working
+else
+ DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs -u
+ # ... force it to actually happen
fi
#DEBHELPER#
diff -ruN ../orig/initramfs-tools-0.85eubuntu16/debian/initramfs-tools.triggers initramfs-tools-0.85eubuntu18/debian/initramfs-tools.triggers
--- ../orig/initramfs-tools-0.85eubuntu16/debian/initramfs-tools.triggers 1970-01-01 01:00:00.000000000 +0100
+++ initramfs-tools-0.85eubuntu18/debian/initramfs-tools.triggers 2007-08-16 16:03:05.000000000 +0100
@@ -0,0 +1 @@
+interest update-initramfs
diff -ruN ../orig/initramfs-tools-0.85eubuntu16/debian/rules initramfs-tools-0.85eubuntu18/debian/rules
--- ../orig/initramfs-tools-0.85eubuntu16/debian/rules 2006-12-21 23:32:07.000000000 +0000
+++ initramfs-tools-0.85eubuntu18/debian/rules 2007-08-16 16:10:49.000000000 +0100
@@ -8,3 +8,7 @@
for x in `find scripts/ -maxdepth 1 -type d | tail -n+2`; do \
chmod -R +x $$x; \
done
+
+binary-install/initramfs-tools::
+ install -m 644 -o 0 -g 0 debian/initramfs-tools.triggers \
+ debian/initramfs-tools/DEBIAN/triggers
diff -ruN ../orig/initramfs-tools-0.85eubuntu16/update-initramfs initramfs-tools-0.85eubuntu18/update-initramfs
--- ../orig/initramfs-tools-0.85eubuntu16/update-initramfs 2007-04-10 16:07:41.000000000 +0100
+++ initramfs-tools-0.85eubuntu18/update-initramfs 2007-08-16 16:56:23.000000000 +0100
@@ -4,11 +4,24 @@
BOOTDIR=/boot
CONF=/etc/initramfs-tools/update-initramfs.conf
KPKGCONF=/etc/kernel-img.conf
+USETRIGGERS=true
set -e
[ -r ${CONF} ] && . ${CONF}
+if $USETRIGGERS \
+ && test x"$DPKG_MAINTSCRIPT_PACKAGE" != x \
+ && test $# = 1 \
+ && test 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
--- End Message ---
--- Begin Message ---
Source: initramfs-tools
Source-Version: 0.92
We believe that the bug you reported is fixed in the latest version of
initramfs-tools, which is due to be installed in the Debian FTP archive:
initramfs-tools_0.92.dsc
to pool/main/i/initramfs-tools/initramfs-tools_0.92.dsc
initramfs-tools_0.92.tar.gz
to pool/main/i/initramfs-tools/initramfs-tools_0.92.tar.gz
initramfs-tools_0.92_all.deb
to pool/main/i/initramfs-tools/initramfs-tools_0.92_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 447611@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
maximilian attems <maks@debian.org> (supplier of updated initramfs-tools package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Wed, 09 Apr 2008 10:42:49 +0200
Source: initramfs-tools
Binary: initramfs-tools
Architecture: source all
Version: 0.92
Distribution: unstable
Urgency: low
Maintainer: Debian kernel team <debian-kernel@lists.debian.org>
Changed-By: maximilian attems <maks@debian.org>
Description:
initramfs-tools - tools for generating an initramfs
Closes: 447611 463607 465901 467078 467627 468112 468113 470869 474691
Changes:
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 <tfheen@err.no>.
* 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 <sojkam1@fel.cvut.cz>.
* ps3 nuke useless hardcoded initramfs script. (closes: #468113)
* resume: Add support for resume_offset swap file suspend to disk.
(closes: #474691) Thanks Alan Jenkins <alan-jenkins@tuffmail.co.uk>.
* 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.
Files:
331235c0dd9e0dfbc2ef8b4065a2c9a9 780 utils optional initramfs-tools_0.92.dsc
66617c9ca31288fcadeb88e69af2c23d 65089 utils optional initramfs-tools_0.92.tar.gz
e42742da43870f0544feacbbcd7bb832 71950 utils optional initramfs-tools_0.92_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH/IIJeW7Lc5tEHqgRAkScAKDA9LT52pky3AVKva6wmfSJaX4pNQCgiIEe
gsS10Xjq+XjPSHR+FXjbfy8=
=00G2
-----END PGP SIGNATURE-----
--- End Message ---