From b9f9dc1ca53878cd3b182e02a587872bfb2ecc28 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Wed, 11 Sep 2019 14:35:52 +0100 Subject: [PATCH] Execute chroot_hacks in live layer only. As discussed and explained to Jibel and Didier on 17th of June, based on canary image build logs, it showed clearly that lb controlled initrd was only built once at the very first layer by chroot_hacks. However, that is the wrong layer to build the final initrd at, as at this point casper is not present yet and is not part of the build. Thus insure that chroot_hacks only runs at the live layer. Ideally a subset of chroot_hacks should run on every layer, as each layer should be squeaky clean, and most of layers without initrds. However, jibel & didrocks are still implementing requested patches to unbreak layer images and make each layer smaller. Hence this minimal portion of the overall required work. Signed-off-by: Dimitri John Ledkov --- live-build/lb_chroot_layered | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/live-build/lb_chroot_layered b/live-build/lb_chroot_layered index 22d50bdb..264eacd2 100755 --- a/live-build/lb_chroot_layered +++ b/live-build/lb_chroot_layered @@ -239,7 +239,9 @@ create_chroot_pass () { # layered mode is to create an initrd on each layer with a significant # impact on image size (+30MB per layer). This is an issue even with # update-initramfs disabled. - lb chroot_hacks ${*} + if $(is_live_layer $pass); then + lb chroot_hacks ${*} + fi lb chroot_interactive ${*}