From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7368350909424730112 X-Forwarded-Encrypted: i=2; AJvYcCW2YZQDiC7c/P/xlcMCH8XQcQWwF6NmeJJZzMzCJ/B7dDGscuJCq2S1QUkHdaSWR95DIlM5Ze2xCdtuJ5tlE1M2fjwe3BDAAEn1Abc= X-Received: by 2002:a17:902:9007:b0:1ec:681c:30fa with SMTP id d9443c01a7336-1ef43e23407mr76035665ad.36.1715579245691; Sun, 12 May 2024 22:47:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:903:110d:b0:1eb:d72d:55cb with SMTP id d9443c01a7336-1eefe7865d4ls22565645ad.1.-pod-prod-05-us; Sun, 12 May 2024 22:47:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU1vyRJvSmYXHCqGB4N0hei/Bv1rrMbSo+VSfyT8NItp61uQvkAVkQlNJmLGugUeh1xElyV4uuWv8i8Nuv4tjF6aLob1P962Ctrauw= X-Google-Smtp-Source: AGHT+IGdgfMlRP09srcK8zbSwJ5qFHeZVa2eFqmEzNJPVe90rlxdPeZMW9KUGIAuz0GwNStWBamy X-Received: by 2002:a17:902:c94f:b0:1ee:a09e:c7af with SMTP id d9443c01a7336-1ef43f4d784mr96365215ad.54.1715579244292; Sun, 12 May 2024 22:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715579244; cv=none; d=google.com; s=arc-20160816; b=cey/EE2QSG4gCGpJzhszp39XO0ksu7SHgfnYYRi/wHhEKZm75hdW/dzPL1hXjISp5I 8+MBIR/ZC3nf8ziYZwrmfNmdn1/M9wWBqZpmjexEyVst75CBClWzG9MQ3M1owC+JbhQ3 4yr1cXCk4NfmUxthrp108pEeW8euZJyx+UC8p/nh6YO1heppN++iGarpXqDVICVeC0YB SE9JhZjKiEArOKrSSZ3QhT18WP4iqLN6wQWxNVLGivDIsv4rD671XRYEukmV52SK09VT 9txW0Q+iuKfKhX9926y4BadGDM0VgWfnWua9Hda6uQV+aY5j6Cfx43a3v9Pm1aqOlN0l limg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=FqgsxjcALQoSffavF6HeDJSXGTfti9IxM7ZNTQ95ldc=; fh=MnXRrZm0X2q/vA2tARL8ur2go/Nf6C5/Bhfpdarg6/o=; b=aMVSJ2i6IVlO5xe2OzQBmtDYqnvXShOW71lFt6JJLr0djTne3WYaJNvgE01htE6X+H /5IN9m+e0LCXrY4tSikEHNDKRo0xjdUcCBJ2Iu8V0RtD3Z46C3CZdWn7uGCm+0wumCUE gVJsbXlXkgYpBlqfKz7bWTyN5bzpJoMO6IxDSCfW7mjgrL8RNK8k8FT9DUJ3EFy9+hOu kp99y4P9uYR1abC4JiGAXcBdNVKo/6fRDVbZJSMTlVRLswWADyT1O9TqL3234M7BxBqI CTYrl8DDLjPrTwcwktAnvO6+Bz0At4Ka7+QxcSP7GUjTYLP9CX3Ggp5FowAJZp+Hpjt9 J/6g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MNHAsXR1; spf=pass (google.com: domain of srinuvasanasv@gmail.com designates 2607:f8b0:4864:20::e2a as permitted sender) smtp.mailfrom=srinuvasanasv@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com. [2607:f8b0:4864:20::e2a]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-1ef0c034b04si4524355ad.11.2024.05.12.22.47.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 May 2024 22:47:24 -0700 (PDT) Received-SPF: pass (google.com: domain of srinuvasanasv@gmail.com designates 2607:f8b0:4864:20::e2a as permitted sender) client-ip=2607:f8b0:4864:20::e2a; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MNHAsXR1; spf=pass (google.com: domain of srinuvasanasv@gmail.com designates 2607:f8b0:4864:20::e2a as permitted sender) smtp.mailfrom=srinuvasanasv@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-47eeb28c44bso1013270137.1 for ; Sun, 12 May 2024 22:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715579243; x=1716184043; dara=google.com; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FqgsxjcALQoSffavF6HeDJSXGTfti9IxM7ZNTQ95ldc=; b=MNHAsXR132fXABx/tWKUPLsUkWYZgXfRVxhEYM3uL6OnH5tW/BPiX2qZMhbOWms6TN nsnaFv2Gx1UVAOyY1dX1+XYxCeewFM5qWECxCTR9CHrsyTOB3nRsx7HmqF/uN4mztmwm ySDKd+vJAifWp7R+ccx8UdKJiNu+DMeHlrqlB6sTwdQWM396J6t8rZH+zJJMdzALMoaw 4eNI8H5B2V7ZF8TNbm7XVzqUKdHi8Vue0nGdpE2vZY8rqzFVmgpWQgb0LEvRpaIdupxe 0ImRrlHexH8ZiFA8Ug4GE/DUKjy4KhmlWJkrlBH7sr2fFXuKReoW+S52kdwew4zKMf9V 1Kzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715579243; x=1716184043; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FqgsxjcALQoSffavF6HeDJSXGTfti9IxM7ZNTQ95ldc=; b=osdHRrkzgH6GmBePeyzUGbymYxL7WRs5Xg9zZuEpReqVTCEJMVjV1Hd51T9dfRZCPF rV0jmn9A/uvhkt6thm2SoTBsq7CVADxjX7mL+UyH+ZMhjLR1TOXaqLUg94EVtZ+M2+MI v3foIbvoYsefEQyONCCA7N9K0yMO2QmiEc4h4z6mqX4aYPaUiUb5RfuVLrjyqXGeTVY6 VWJ6Xp1vD414KPNiW9XP3gYr07ZfIn5RJ07SC17S6yUUYUCQn148Kui/mG5eU5XBP/tB V2v0S0H9Ftb+godlCBJe0et84Ph5msgEy9dLS5CKQNLBsSmEdP1WBSg7qIRULaiZyCpt tQqA== X-Forwarded-Encrypted: i=1; AJvYcCW4qLdt1vwYsJrQGKsB7vNjnxrXdY7biFP+e7k23QlItwqldKqmgOdPa+XaC+eb5jAD0sWvCKTeGQdmFQmfcItKueEhhzb+OLqHEQs= X-Gm-Message-State: AOJu0YyHAa0R8pfdjiJ5fZn2iykrfdPbODtNK83ltvn8W5qBcobXD9XO UjTypjUiJUghJIfyPgqdcggN+2n8kFsBn325Vx5fjMLgCDSem0zbKyiQ1xJkhlef2z8xi6Wygfz p+DRA0/cidp0+LEkrsKK7NAHG9IqhFA== X-Received: by 2002:a05:6102:4187:b0:47c:2a81:a98 with SMTP id ada2fe7eead31-48077e176fbmr8814661137.20.1715579243183; Sun, 12 May 2024 22:47:23 -0700 (PDT) MIME-Version: 1.0 References: <20240513052637.27242-1-srinuvasan.a@siemens.com> In-Reply-To: From: Srinuvasan Arjunan Date: Mon, 13 May 2024 11:17:12 +0530 Message-ID: Subject: Re: [PATCH] recipes-initramfs/compress-initrd: add recipe to compress initrd with xz To: Jan Kiszka Cc: srinuvasan.a@siemens.com, isar-users@googlegroups.com, ubely@ilbers.de Content-Type: multipart/alternative; boundary="0000000000005fc89f06184f6b6d" X-TUID: KU7w7/47Y6JZ --0000000000005fc89f06184f6b6d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2024 at 10:57=E2=80=AFAM 'Jan Kiszka' via isar-users < isar-users@googlegroups.com> wrote: > On 13.05.24 07:26, srinuvasan.a@siemens.com wrote: > > From: srinuvasan > > > > 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 almos= t > 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 > > --- > > 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 =3D "1" > > > > # > > # 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 cowsa= y > example-prebuilt" > > +IMAGE_INSTALL =3D "hello-isar example-raw example-module-${KERNEL_NAME= } > enable-fsck isar-exclude-docs samefile hello isar-disable-apt-cache cowsa= y > 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 =3D "Compress the initrd with better compression tool" > > +MAINTAINER =3D "Your name here " > > + > > +inherit dpkg-raw > > + > > +DEBIAN_DEPENDS =3D "linux-image-${KERNEL_NAME}, xz-utils, initramfs-to= ols" > > + > > +SRC_URI =3D " \ > > + file://postinst \ > > +" > > +do_install() { > > + install -v -d "${D}/etc/initramfs-tools/conf.d/" > > + echo "COMPRESS=3Dxz" > "${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-b9d6= 7edec32e%40siemens.com > . > --0000000000005fc89f06184f6b6d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, May 13, 2024 at 10:57=E2=80= =AFAM '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 almo= st 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

=C2=A0 Sorry, its not zstd tool, th= e default one is gzip (wrongly captured in commit message), Just i pushed t= his patch for very limited memory requirement embedded=C2=A0devices, in thi= s case i considered=C2=A0the memory requirement not a decompression load.

Thanks,
Srinu

> Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> ---
>=C2=A0 meta-isar/conf/local.conf.sample=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| 18 ++++++++++++++++++
>=C2=A0 .../compress-initrd/files/postinst=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0|=C2=A0 5 +++++
>=C2=A0 3 files changed, 24 insertions(+), 1 deletion(-)
>=C2=A0 create mode 100644 meta-isar/recipes-initramfs/compress-initrd/<= a href=3D"http://compress-initrd.bb" rel=3D"noreferrer" target=3D"_blank">c= ompress-initrd.bb
>=C2=A0 create mode 100644 meta-isar/recipes-initramfs/compress-initrd/f= iles/postinst
>
> diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.c= onf.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-${KERNE= L_NAME} enable-fsck isar-exclude-docs samefile hello isar-disable-apt-cache= cowsay example-prebuilt"
> +IMAGE_INSTALL =3D "hello-isar example-raw example-module-${KERNE= L_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/compress-init= rd.bb b/meta-isar/recipes-initramfs/compress-initrd/compress-initrd.bb<= /a>
> 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 =3D "Compress the initrd with better compression too= l"
> +MAINTAINER =3D "Your name here <
you@domain.com>"
> +
> +inherit dpkg-raw
> +
> +DEBIAN_DEPENDS =3D "linux-image-${KERNEL_NAME}, xz-utils, initra= mfs-tools"
> +
> +SRC_URI =3D " \
> +=C2=A0 =C2=A0 file://postinst \
> +"
> +do_install() {
> +=C2=A0 =C2=A0 install -v -d "${D}/etc/initramfs-tools/conf.d/&qu= ot;
> +=C2=A0 =C2=A0 echo "COMPRESS=3Dxz" > "${D}/etc/init= ramfs-tools/conf.d/${PN}.conf"
> +}
> diff --git a/meta-isar/recipes-initramfs/compress-initrd/files/postins= t 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 &= quot;isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail 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.
--0000000000005fc89f06184f6b6d--