From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7368350909424730112 Date: Wed, 29 May 2024 22:52:59 -0700 (PDT) From: Srinuvasan Arjunan To: isar-users Message-Id: <14fa126c-32b2-4801-8c1e-386816ca33a2n@googlegroups.com> In-Reply-To: <1f98ad04a922a3deab3bdf28936cb05c586f28a0.camel@ilbers.de> References: <0372409e74c5d0aab55e61d8c2f9f2e988b0297d.camel@siemens.com> <20240513094143.365942-1-srinuvasan.a@siemens.com> <1f98ad04a922a3deab3bdf28936cb05c586f28a0.camel@ilbers.de> Subject: Re: [PATCH v1] recipes-initramfs/compress-initrd: add recipe to compress initrd with xz MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_83787_51791913.1717048379800" X-TUID: BvCVnzACD/Uu ------=_Part_83787_51791913.1717048379800 Content-Type: multipart/alternative; boundary="----=_Part_83788_1831426587.1717048379800" ------=_Part_83788_1831426587.1717048379800 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thursday, May 30, 2024 at 11:19:32=E2=80=AFAM UTC+5:30 Uladzimir Bely wr= ote: On Mon, 2024-05-13 at 15:11 +0530, srinuvasan.a via isar-users wrote:=20 > From: srinuvasan =20 >=20 > By default initrd compressed with gzip tool, with the present=20 > bullseye base image=20 > of amd64 the initrd size is almost 27MB, this can be reduced with the=20 > help of xz tool,=20 > using this one the generated initrd size is almost 18MB, we saved=20 > almost 9MB.=20 >=20 > Signed-off-by: srinuvasan =20 > ---=20 > meta-isar/conf/local.conf.sample | 2 +-=20 > .../compress-initrd/compress-initrd.bb | 21=20 > +++++++++++++++++++=20 > .../compress-initrd/files/postinst | 5 +++++=20 > 3 files changed, 27 insertions(+), 1 deletion(-)=20 > create mode 100644 meta-isar/recipes-initramfs/compress-=20 > initrd/compress-initrd.bb=20 > create mode 100644 meta-isar/recipes-initramfs/compress-=20 > initrd/files/postinst=20 >=20 > diff --git a/meta-isar/conf/local.conf.sample b/meta-=20 > isar/conf/local.conf.sample=20 > index 17455015..ac8b749e 100644=20 > --- a/meta-isar/conf/local.conf.sample=20 > +++ b/meta-isar/conf/local.conf.sample=20 > @@ -149,7 +149,7 @@ CONF_VERSION =3D "1"=20 > =20 > #=20 > # The default list of extra packages to be installed.=20 > -IMAGE_INSTALL =3D "hello-isar example-raw example-module-=20 > ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar-=20 > disable-apt-cache cowsay example-prebuilt"=20 > +IMAGE_INSTALL =3D "hello-isar example-raw example-module-=20 > ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar-=20 > disable-apt-cache cowsay example-prebuilt compress-initrd"=20 > =20 > #=20 > # Machines with secure boot should use signed modules.=20 > diff --git a/meta-isar/recipes-initramfs/compress-initrd/compress-=20 > initrd.bb b/meta-isar/recipes-initramfs/compress-initrd/compress-=20 > initrd.bb=20 > new file mode 100644=20 > index 00000000..b1a5909b=20 > --- /dev/null=20 > +++ b/meta-isar/recipes-initramfs/compress-initrd/compress-initrd.bb=20 > @@ -0,0 +1,21 @@=20 > +# Sample recipe to configure the desired compression tool=20 > +# during initramfs generation=20 > +#=20 > +# This software is a part of ISAR.=20 > +=20 > +DESCRIPTION =3D "Compress the initrd with configured compression tool"= =20 > +MAINTAINER =3D "Your name here "=20 This line is still not fixed/removed.=20 > +=20 > +inherit dpkg-raw=20 > +=20 > +COMPRESS_TOOL ?=3D "xz"=20 > +=20 > +DEBIAN_DEPENDS =3D "linux-image-${KERNEL_NAME}, xz-utils, initramfs-=20 > tools"=20 > +=20 > +SRC_URI =3D " \=20 > + file://postinst \=20 > +"=20 > +do_install() {=20 > + install -v -d "${D}/etc/initramfs-tools/conf.d/"=20 > + echo "COMPRESS=3D${COMPRESS_TOOL}" > "${D}/etc/initramfs-=20 > tools/conf.d/${PN}.conf"=20 > +}=20 > diff --git a/meta-isar/recipes-initramfs/compress-=20 > initrd/files/postinst b/meta-isar/recipes-initramfs/compress-=20 > initrd/files/postinst=20 > new file mode 100644=20 > index 00000000..0db52142=20 > --- /dev/null=20 > +++ b/meta-isar/recipes-initramfs/compress-initrd/files/postinst=20 > @@ -0,0 +1,5 @@=20 > +#!/bin/sh=20 > +=20 > +set -e=20 > +=20 > +update-initramfs -c -k all=20 > --=20 > 2.34.1=20 >=20 Since this is a new Isar package, an appropriate Kconfig/yaml item is=20 worth adding into kas/package.=20 --=20 Best regards,=20 Uladzimir. Thanks for the review, will send another version of the patch soon. Many thanks, Srinu=20 ------=_Part_83788_1831426587.1717048379800 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Thursday, May 30, 2024 at 11:19:32=E2= =80=AFAM UTC+5:30 Uladzimir Bely wrote:
On Mon, 2024-05-13 at 15:11 +0530, srinuvasan.a via isar-users = wrote:
> From: srinuvasan <srinuv...@sie= mens.com>
>=20
> By default initrd compressed with gzip tool, with the present
> bullseye base image
> of amd64 the initrd size is almost 27MB, this can be reduced wit= h the
> help of xz tool,
> using this one the generated initrd size is almost 18MB, we save= d
> almost 9MB.
>=20
> Signed-off-by: srinuvasan <srin= uv...@siemens.com>
> ---
> =C2=A0meta-isar/conf/local.conf.sample=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +-
> =C2=A0.../compress-initrd/compress-initrd.bb=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | 21
> +++++++++++++++++++
> =C2=A0.../compress-initrd/files/postinst=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 5 +++++
> =C2=A03 files changed, 27 insertions(+), 1 deletion(-)
> =C2=A0create mode 100644 meta-isar/recipes-initramfs/compress-
> initrd/compress-initrd.bb
> =C2=A0create mode 100644 meta-isar/recipes-initramfs/compress-
> initrd/files/postinst
>=20
> 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 =3D "1"
> =C2=A0
> =C2=A0#
> =C2=A0# The default list of extra packages to be installed.
> -IMAGE_INSTALL =3D "hello-isar example-raw example-module-
> ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar= -
> disable-apt-cache cowsay example-prebuilt"
> +IMAGE_INSTALL =3D "hello-isar example-raw example-module-
> ${KERNEL_NAME} enable-fsck isar-exclude-docs samefile hello isar= -
> disable-apt-cache cowsay example-prebuilt compress-initrd"
> =C2=A0
> =C2=A0#
> =C2=A0# Machines with secure boot should use signed modules.
> diff --git a/meta-isar/recipes-initramfs/compress-initrd/compres= s-
> = initrd.bb b/meta-isar/recipes-initramfs/compress-initrd/compress-
> = initrd.bb
> new file mode 100644
> index 00000000..b1a5909b
> --- /dev/null
> +++ b/meta-isar/recipes-initramfs/compress-initrd/compress-initrd.= bb
> @@ -0,0 +1,21 @@
> +# Sample recipe to configure the desired compression tool
> +# during initramfs generation
> +#
> +# This software is a part of ISAR.
> +
> +DESCRIPTION =3D "Compress the initrd with configured compressio= n tool"
> +MAINTAINER =3D "Your name here <y...@domain.com>"

This line is still not fixed/removed.

> +
> +inherit dpkg-raw
> +
> +COMPRESS_TOOL ?=3D "xz"
> +
> +DEBIAN_DEPENDS =3D "linux-image-${KERNEL_NAME}, xz-utils, initr= amfs-
> tools"
> +
> +SRC_URI =3D " \
> +=C2=A0=C2=A0=C2=A0 file://postinst=C2=A0\
> +"
> +do_install() {
> +=C2=A0=C2=A0=C2=A0 install -v -d "${D}/etc/initramfs-tools/conf= .d/"
> +=C2=A0=C2=A0=C2=A0 echo "COMPRESS=3D${COMPRESS_TOOL}" > "${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
> --=20
> 2.34.1
>=20

Since this is a new Isar package, an appropriate Kconfig/yaml item is
worth adding into kas/package.

--=20
Best regards,
Uladzimir.

=C2=A0 Thanks for the re= view, will send another version of the patch soon.

=C2=A0 Many thanks,
Srinu=C2=A0
------=_Part_83788_1831426587.1717048379800-- ------=_Part_83787_51791913.1717048379800--