Bug#447611: update-initramfs triggerisation
tags 447611 -patch
stop
On Mon, 22 Oct 2007, Ian Jackson wrote:
> The attached patch triggerises the invocation of mkinitramfs by
> package maintainer scripts via update-initramfs.
<snipp long desc>
thanks for the long description.
i'm following dpkg git, once this cool feature is merged,
i'm happy to apply a patch using it. i didn't see it merged in
the master tree yet. as i didn't follow the dpkg discsussions
i don't know current status.
> 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
need to get a deeper look in git-dch as debian changelog only generates
conflicts, better snipped for now also as ubuntu specific:
patching file debian/changelog
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file debian/changelog.rej
> 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 ] && \
if [ "$1" != "triggered" ] && \
seems more readable, don't know why the oldstyle x$string = string
remains in usage?
> + dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.5ubuntu10~~'
> +then
ubuntu specific, would with high probab trigger on the wrong versions,
also why is this needed?
has there been a buggy dpkg trigger support!?
> update-initramfs -u
> + # ... this activates the trigger, if triggers are working
please comment before command.
> +else
> + DPKG_MAINTSCRIPT_PACKAGE='' update-initramfs -u
> + # ... force it to actually happen
> fi
same
> #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
"interest" ???
please short comment above why this specific choice?
> 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
no i-t uses cdbs,
please add to debian/initramfs-tools.install
but maybe i misread and there is no cdbs support for that yet??
> 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
why not using built-ins?
if [ -n "$USETRIGGERS" ] && [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]
&& dpkg-trigger --check-supported 2>/dev/null; then
also this seems to be at the wrong place,
if you want it to only affect the update-initramfs -u code path
than make it a function and call it a line before update instead
of an opencoded getopt.
> +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
also doesn't apply:
patching file update-initramfs
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file update-initramfs.rej
you may want to checkout latest git
git clone git://git.debian.org/git/kernel/initramfs-tools.git
don't get me wrong, i highly like the idea of that work
and i'm happy to use it soon.
regards
--
maks
Reply to: