From: "MOESSBAUER, Felix" <felix.moessbauer@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
"Arjunan, Srinu" <srinuvasan.a@siemens.com>
Cc: "ubely@ilbers.de" <ubely@ilbers.de>,
"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
"Kiszka, Jan" <jan.kiszka@siemens.com>
Subject: Re: [PATCH] recipes-initramfs/compress-initrd: add recipe to compress initrd with xz
Date: Mon, 13 May 2024 06:47:47 +0000 [thread overview]
Message-ID: <0372409e74c5d0aab55e61d8c2f9f2e988b0297d.camel@siemens.com> (raw)
In-Reply-To: <20240513052637.27242-1-srinuvasan.a@siemens.com>
On Mon, 2024-05-13 at 10:56 +0530, srinuvasan.a via isar-users wrote:
> From: srinuvasan <srinuvasan.a@siemens.com>
>
> By default initrd compressed with zstd tool, with the present
Hi, the standard for bullseye is gz.
> bullseye base image
> of amd64 the initrd size is almost 27MB, this can be reduced with the
> help of xz tool,
> using this one the generated initrd size is almost 18MB, we saved
> almost 9MB.
>
> Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> ---
> meta-isar/conf/local.conf.sample | 2 +-
> .../compress-initrd/compress-initrd.bb | 18
> ++++++++++++++++++
> .../compress-initrd/files/postinst | 5 +++++
> 3 files changed, 24 insertions(+), 1 deletion(-)
> create mode 100644 meta-isar/recipes-initramfs/compress-
> initrd/compress-initrd.bb
> create mode 100644 meta-isar/recipes-initramfs/compress-
> initrd/files/postinst
>
> diff --git a/meta-isar/conf/local.conf.sample b/meta-
> isar/conf/local.conf.sample
> index 17455015..ac8b749e 100644
> --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -149,7 +149,7 @@ CONF_VERSION = "1"
>
> #
> # The default list of extra packages to be installed.
> -IMAGE_INSTALL = "hello-isar example-raw example-module-
> ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar-
> disable-apt-cache cowsay example-prebuilt"
> +IMAGE_INSTALL = "hello-isar example-raw example-module-
> ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar-
> disable-apt-cache cowsay example-prebuilt compress-initrd"
>
> #
> # Machines with secure boot should use signed modules.
> diff --git a/meta-isar/recipes-initramfs/compress-initrd/compress-
> initrd.bb b/meta-isar/recipes-initramfs/compress-initrd/compress-
> initrd.bb
> new file mode 100644
> index 00000000..21e28782
> --- /dev/null
> +++ b/meta-isar/recipes-initramfs/compress-initrd/compress-initrd.bb
> @@ -0,0 +1,18 @@
> +# Compress the initrd with better compression tool
> +#
> +# This software is a part of ISAR.
> +
> +DESCRIPTION = "Compress the initrd with better compression tool"
This description makes is too vague.
> +MAINTAINER = "Your name here <you@domain.com>"
No ;)
> +
> +inherit dpkg-raw
> +
> +DEBIAN_DEPENDS = "linux-image-${KERNEL_NAME}, xz-utils, initramfs-
> tools"
> +
> +SRC_URI = " \
> + file://postinst \
> +"
> +do_install() {
> + install -v -d "${D}/etc/initramfs-tools/conf.d/"
> + echo "COMPRESS=xz" >
Please don't hardcode values. Further, we need to have the compression
utility installed to be able to perform that compression. For xz,
that's xz-utils.
In general, I like the idea to make this customizable (even if I like
zstd more than xz because xz requires a lot of resources for
decompression). However, I'm wondering if we can implement this using
the imagetypes infrastructure (@Adriaan, in CC). That would make it
consistent across ISAR and also avoid the introduction of additional
variables.
Felix
> "${D}/etc/initramfs-tools/conf.d/${PN}.conf"
> +}
> diff --git a/meta-isar/recipes-initramfs/compress-
> initrd/files/postinst b/meta-isar/recipes-initramfs/compress-
> initrd/files/postinst
> new file mode 100644
> index 00000000..0db52142
> --- /dev/null
> +++ b/meta-isar/recipes-initramfs/compress-initrd/files/postinst
> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +set -e
> +
> +update-initramfs -c -k all
> --
> 2.39.2
>
--
Siemens AG, Technology
Linux Expert Center
next prev parent reply other threads:[~2024-05-13 6:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 5:26 srinuvasan.a
2024-05-13 5:27 ` Jan Kiszka
2024-05-13 5:47 ` Srinuvasan Arjunan
2024-05-13 6:29 ` Jan Kiszka
2024-05-13 6:47 ` MOESSBAUER, Felix [this message]
2024-05-13 9:41 ` [PATCH v1] " srinuvasan.a
2024-05-30 5:49 ` Uladzimir Bely
2024-05-30 5:52 ` Srinuvasan Arjunan
2024-05-31 7:35 ` Jan Kiszka
2024-04-17 13:43 ` [PATCH V3] " srinuvasan.a
2024-07-08 9:44 ` Srinuvasan Arjunan
2024-07-18 11:36 ` Srinuvasan Arjunan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0372409e74c5d0aab55e61d8c2f9f2e988b0297d.camel@siemens.com \
--to=felix.moessbauer@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=srinuvasan.a@siemens.com \
--cc=ubely@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox