Debian Bug report logs - #574336
pkgsel: Only run update-initramfs once during installation?

version graph

Package: pkgsel; Maintainer for pkgsel is Debian Install System Team <debian-boot@lists.debian.org>;

Reported by: Petter Reinholdtsen <pere@hungry.com>

Date: Wed, 17 Mar 2010 13:42:01 UTC

Severity: normal

Tags: patch

Found in version pkgsel/0.25

Done: Cyril Brulebois <kibi@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 13:42:04 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 13:42:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: submit@bugs.debian.org
Subject: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 14:35:58 +0100
Package: pkgsel
Version: 0.25
Tags:    patch

When checking the Ubuntu changes to pkgsel, I noticed this change:

 - Divert update-initramfs and call it just once at the end (with
   bind-mounted /dev, /proc, and /sys, and a preceding update-dev).

This seem like a good optimization for the installation time to bring
over to Debian, making sure update-initramfs is only executed twice
during the installation instead of several times more (once when the
kernel is installed by base-insatller, and once after pkgsel is done).
Is there any reason not to include it?

This patch relative to the current svn version would implement it.  It
is ripped directly from the Ubuntu patch.

Index: debian/postinst
===================================================================
--- debian/postinst	(revision 62670)
+++ debian/postinst	(working copy)
@@ -6,7 +6,7 @@
 export LANG=C
 
 REMOUNT_CD=""
-DIVERTS='/usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-rebuilddb /usr/bin/fc-cache'
+DIVERTS='/usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-rebuilddb /usr/bin/fc-cache /usr/sbin/update-initramfs'
 
 log() {
 	logger -t pkgsel "$@"
@@ -163,7 +163,22 @@
 	chroot /target fc-cache -f -v >/target/var/log/fontconfig.log 2>&1 \
 		|| true
 fi
+if [ -x /target/usr/sbin/update-initramfs ]; then
+	# get UUIDs for any devices formatted after partitioning
+	update-dev
 
+	# make UUIDs etc. available in the target system
+	mount -o bind /dev /target/dev
+	mount -o bind /sys /target/sys
+	mount -o bind /proc /target/proc
+	
+	chroot /target /usr/sbin/update-initramfs -u || true
+	
+	umount /target/proc
+	umount /target/sys
+	umount /target/dev
+fi
+
 db_progress STEP 30
 db_progress STOP
 
Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 14:33:18 GMT) (full text, mbox, link).


Acknowledgement sent to 574336@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 14:33:19 GMT) (full text, mbox, link).


Message #10 received at 574336@bugs.debian.org (full text, mbox, reply):

From: Frans Pop <elendil@planet.nl>
To: 574336@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 15:30:44 +0100
On Wednesday 17 March 2010, Petter Reinholdtsen wrote:
> This seem like a good optimization for the installation time to bring
> over to Debian, making sure update-initramfs is only executed twice
> during the installation instead of several times more

In exactly which scenario would it be executed more than twice?

I don't much like the patch either. Why doesn't it just use in-target to 
run update-initramfs?




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 15:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 15:27:03 GMT) (full text, mbox, link).


Message #15 received at 574336@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 574336@bugs.debian.org
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 16:23:50 +0100
[Frans Pop]
> In exactly which scenario would it be executed more than twice?

I expect it to run the triggers several times, once for each block of
packages passed from apt to dpkg, but have not verified that this is
the case.  I had a look in the installation log for Debian Edu based
on Squeeze, and here it is called four times:

root@tjener:~#  grep -C1 update-init /var/log/installer/syslog
Mar 14 06:03:00 in-target: Setter opp initramfs-tools (0.93.4) ...
Mar 14 06:03:00 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 06:03:00 in-target: Behandler utløsere for initramfs-tools ...
--
Mar 14 06:03:12 in-target: Running depmod.
Mar 14 06:03:12 in-target: Running update-initramfs.
Mar 14 06:03:12 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-686
Mar 14 06:03:22 in-target: Examining /etc/kernel/postinst.d.
--
Mar 14 07:11:44 in-target: update-alternatives: using /usr/lib/usplash/debian-edu-usplash.so to provide /usr/lib/usplash/usplash-artwork.so (usplash-artwork.so) in auto mode.
Mar 14 07:11:44 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:11:44 in-target: Setter opp debian-edu-doc-en (1.3~20100223~5.0.4+edu0) ...
--
Mar 14 07:13:51 in-target: Setter opp usplash (0.5.19-3) ...
Mar 14 07:13:52 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:13:52 in-target: Setter opp util-linux-locales (2.16.2-0) ...
--
Mar 14 07:15:18 in-target: Behandler utløsere for initramfs-tools ...
Mar 14 07:15:18 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-686
Mar 14 07:15:28 debian-edu-fsautoresize: overfull /usr, resizing to 6596198
--
Mar 14 07:46:15 in-target: KILLALL="false"
Mar 14 07:46:15 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:46:16 in-target: Setting up libklibc (1.5.15-1) ...
--
Mar 14 07:46:16 in-target: Setting up initramfs-tools (0.93.4) ...
Mar 14 07:46:16 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:46:16 in-target: Setting up syslinux-common (2:3.85+dfsg-1) ...
--
Mar 14 07:46:34 in-target: Setting up dmsetup (2:1.02.39-1) ...
Mar 14 07:46:34 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:46:34 in-target: Setting up cryptsetup (2:1.1.0~rc2-1) ...
Mar 14 07:46:34 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:46:34 in-target: Setting up libavahi-common-data (0.6.25-3) ...
--
Mar 14 07:47:36 debian-edu-fsautoresize: overfull /var, resizing to 3216998
Mar 14 07:47:37 in-target: Running update-initramfs.
Mar 14 07:47:37 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-486
Mar 14 07:47:46 in-target: cryptsetup: WARNING: could not determine root device from /etc/fstab
--
Mar 14 07:48:03 in-target: update-alternatives: using /usr/lib/usplash/debian-edu-usplash.so to provide /usr/lib/usplash/usplash-artwork.so (usplash-artwork.so) in auto mode.
Mar 14 07:48:03 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:48:03 in-target: Setting up firmware-linux-free (2.6.32-5) ...
--
Mar 14 07:48:08 in-target: Setting up usplash (0.5.19-3) ...
Mar 14 07:48:08 in-target: update-initramfs: deferring update (trigger activated)
Mar 14 07:48:09 in-target: Setting up tasksel-data (2.81) ...
--
Mar 14 07:48:09 in-target: Processing triggers for initramfs-tools ...
Mar 14 07:48:09 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-486
Mar 14 07:48:18 in-target: cryptsetup: WARNING: could not determine root device from /etc/fstab
root@tjener:~#  grep -C1 update-init /var/log/installer/syslog|grep Gener
Mar 14 06:03:12 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-686
Mar 14 07:15:18 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-686
Mar 14 07:47:37 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-486
Mar 14 07:48:09 in-target: update-initramfs: Generating /boot/initrd.img-2.6.32-trunk-486
root@tjener:~#

It is possible some of these are from setting up the LTSP chroot
environment.

> I don't much like the patch either. Why doesn't it just use
> in-target to run update-initramfs?

I did wonder about that too.  I expected in-target to handle /proc/
and friends, but do not know why Ubuntu choose to do this outside
in-target and did not test if they are needed or not.  Decided to pass
on the patch untouched for review. :)

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 16:12:06 GMT) (full text, mbox, link).


Acknowledgement sent to 574336@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 16:12:06 GMT) (full text, mbox, link).


Message #20 received at 574336@bugs.debian.org (full text, mbox, reply):

From: Frans Pop <elendil@planet.nl>
To: 574336@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 17:09:20 +0100
On Wednesday 17 March 2010, Petter Reinholdtsen wrote:
> It is possible some of these are from setting up the LTSP chroot
> environment.

Something looks very broken in this example.

Why is initramfs-tools getting set up twice for the same version?

Why is dmsetup getting installed if it is not being used during 
partitioning (in which case it should already have been installed _before_ 
initramfs-tools gets installed the first time)?

After that the only remaining cause for an extra run is usplash.
If debian-edu wants that installed by default, then the correct solution 
IMO is to include it on the first CD and ensure it gets installed during 
post-base-installer.d and not during pkgsel.

The problem here IMO is a badly structured installation, not a missing 
feature in pkgsel.

Cheers,
FJP




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 16:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 16:27:04 GMT) (full text, mbox, link).


Message #25 received at 574336@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 574336@bugs.debian.org
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 17:26:25 +0100
[Frans Pop]
> Something looks very broken in this example.
> 
> Why is initramfs-tools getting set up twice for the same version?

No idea.  This what made me suspect the cause might be the LTSP
chroot.

> Why is dmsetup getting installed if it is not being used during
> partitioning (in which case it should already have been installed
> _before_ initramfs-tools gets installed the first time)?

It is a dependency of lvm2.  I asked 'aptitude why dmsetup' on the
machine in question. :)

> After that the only remaining cause for an extra run is usplash.  If
> debian-edu wants that installed by default, then the correct
> solution IMO is to include it on the first CD and ensure it gets
> installed during post-base-installer.d and not during pkgsel.

There is not enouch room on the CD for that. :)

> The problem here IMO is a badly structured installation, not a
> missing feature in pkgsel.

Oh, well.  My goal for this request was a faster installation.  I
assume we share that goal, and do not see the point of arguing further
for making sure update-initramfs is called as few times as possible.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#574336; Package pkgsel. (Wed, 17 Mar 2010 17:18:08 GMT) (full text, mbox, link).


Acknowledgement sent to Frans Pop <elendil@planet.nl>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Wed, 17 Mar 2010 17:18:08 GMT) (full text, mbox, link).


Message #30 received at 574336@bugs.debian.org (full text, mbox, reply):

From: Frans Pop <elendil@planet.nl>
To: 574336@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Wed, 17 Mar 2010 18:16:24 +0100
On Wednesday 17 March 2010, Petter Reinholdtsen wrote:
> No idea.  This what made me suspect the cause might be the LTSP
> chroot.

Ah. I failed to really comprehend that earlier.
Yes, I guess that could be and that would of course make it separate from 
base system installation 

> > Why is dmsetup getting installed if it is not being used during
> > partitioning (in which case it should already have been installed
> > _before_ initramfs-tools gets installed the first time)?
>
> It is a dependency of lvm2.  I asked 'aptitude why dmsetup' on the
> machine in question. :)

The same goes for LVM2 though. That should really be installed as a result 
of partitioning, not as an extra package. Or is that installed in the LTSP 
chroot as well?
If it is the LTSP chroot that is the cause, then I think pkgsel really is 
the wrong place to address this.

> Oh, well.  My goal for this request was a faster installation.  I
> assume we share that goal, and do not see the point of arguing further
> for making sure update-initramfs is called as few times as possible.

Sure. But that does not mean we should blindly complicate D-I code without 
checking the validity of the use case.

P.S. I've been wondering if we shouldn't consider postponing kernel 
installation until after APT is configured. In some ways it is more 
logical to group it with bootloader installation than with base system 
installation. It could also make sense for firmware installation (see my 
comments in #574158). Not something to change lightly though. Added 
complication is consistent handling of Recommends.




Reply sent to Cyril Brulebois <kibi@debian.org>:
You have taken responsibility. (Sun, 02 Mar 2014 02:03:05 GMT) (full text, mbox, link).


Notification sent to Petter Reinholdtsen <pere@hungry.com>:
Bug acknowledged by developer. (Sun, 02 Mar 2014 02:03:05 GMT) (full text, mbox, link).


Message #35 received at 574336-done@bugs.debian.org (full text, mbox, reply):

From: Cyril Brulebois <kibi@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 574336-done@bugs.debian.org
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Sun, 2 Mar 2014 03:00:15 +0100
[Message part 1 (text/plain, inline)]
Petter Reinholdtsen <pere@hungry.com> (2010-03-17):
> Package: pkgsel
> Version: 0.25
> Tags:    patch
> 
> When checking the Ubuntu changes to pkgsel, I noticed this change:
> 
>  - Divert update-initramfs and call it just once at the end (with
>    bind-mounted /dev, /proc, and /sys, and a preceding update-dev).
> 
> This seem like a good optimization for the installation time to bring
> over to Debian, making sure update-initramfs is only executed twice
> during the installation instead of several times more (once when the
> kernel is installed by base-insatller, and once after pkgsel is done).
> Is there any reason not to include it?
> 
> This patch relative to the current svn version would implement it.  It
> is ripped directly from the Ubuntu patch.

With dpkg triggers, this shouldn't be needed any more, so closing.

See my comments in another bug report about a possible extra, explicit
call which we might want to get rid of:
  https://lists.debian.org/debian-boot/2014/02/msg00296.html

Mraw,
KiBi.
[signature.asc (application/pgp-signature, inline)]

Message #36 received at 574336-done@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: Cyril Brulebois <kibi@debian.org>, 574336-done@bugs.debian.org
Subject: Re: Bug#574336: pkgsel: Only run update-initramfs once during installation?
Date: Fri, 07 Mar 2014 00:26:14 +0100
Control: reopen -1

[Cyril Brulebois]
> With dpkg triggers, this shouldn't be needed any more, so closing.

Do you mean the use of triggers already make sure update-initramfs is
only called once during installation?  As far as I can tell, that is not
quite the case.  When installing many packages (like done by Debian
Edu), dpkg is called many times to process a bulk of packages, and
update-initramfs is also called several of times.  The use of triggers
help to reduce the number of calls, but do not cut the number of
update-initramfs calls to one.  And one call is all that is needed
during installation.  Any more just slow down the installation process.

-- 
Happy hacking
Petter Reinholdtsen



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 04 Apr 2014 07:29:45 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Aug 8 02:09:06 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.