On Mon, May 13, 2024 at 10:57 AM 'Jan Kiszka' via isar-users <isar-users@googlegroups.com> wrote:
On 13.05.24 07:26, srinuvasan.a@siemens.com wrote:
> From: srinuvasan <srinuvasan.a@siemens.com>
>
> By default initrd compressed with zstd tool, with the present 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.
>

Isn't that just a matter of increasing the compression rate of zstd? It
seems xz is getting out of fashion generally, and it comes with higher
decompression load.

Jan

  Sorry, its not zstd tool, the default one is gzip (wrongly captured in commit message), Just i pushed this patch for very limited memory requirement embedded devices, in this case i considered the memory requirement not a decompression load.

Thanks,
Srinu

> 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"
> +MAINTAINER = "Your name here <you@domain.com>"
> +
> +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" > "${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

--
Siemens AG, Technology
Linux Expert Center

--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/bc4dcff7-778a-44ac-a7c4-b9d67edec32e%40siemens.com.