Linutronix / elbe

Embedded Linux Build Environment
https://elbe-rfs.org
GNU General Public License v3.0
163 stars 59 forks source link

images differ in initrd from package #341

Closed mrelyb closed 1 year ago

mrelyb commented 2 years ago

When I build a package.tar.gz and an image and I calc a checksum e.g. with md5sum of both initrds they differ.

I digged around and found that for the image "update-initramfs" is triggered one more time in bootloader installation. To avoid the files being different I just deleted both lines in grub installation. See the patch below.

commit 651bc7af7fb60ec2b8b859db719931b8e3635eb0
Author: Matthias Bühler <matthias.buehler@trumpf.com>
Date:   Tue Nov 24 14:53:42 2020 +0100

    disabled rebuild of initramfs on target image so initramfs in image and rootfs.tar.gz are the same

    Signed-off-by: Matthias Bühler <matthias.buehler@trumpf.com>

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index 345779868..ebc4931d5 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -190,7 +190,6 @@ class grubinstaller202(grubinstaller_base):
             devmap.write("(hd0) %s\n" % poopdev)
             devmap.close()

-            chroot(imagemnt, "update-initramfs -u -k all")
             chroot(imagemnt, "update-grub2")

             if "efi" in self.fw_type:
@@ -267,8 +266,6 @@ class grubinstaller97(grubinstaller_base):
             devmap.write("(hd0) %s\n" % poopdev)
             devmap.close()

-            chroot(imagemnt, "update-initramfs -u -k all")
-
             # Replace groot and kopt because else they will be given
             # bad values
             #
bgermann commented 1 year ago

This removes all the explicit update-initramfs calls. I guess, your kernel debianization triggers update-initramfs in the postinst script. Will this work with e.g. the Linux debianization that you get with make deb-pkg which does not have the same postinst as the one in the Debian archive?