From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7368350909424730112 X-Received: by 2002:a05:6512:32ba:b0:521:43b2:3194 with SMTP id 2adb3069b0e04-5220fd7bf83mr8884242e87.41.1715593189933; Mon, 13 May 2024 02:39:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:15aa:b0:51f:2788:12da with SMTP id 2adb3069b0e04-521e462827bls2152763e87.2.-pod-prod-08-eu; Mon, 13 May 2024 02:39:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBm1fAKqqbkKqgTy63pAMWNUf+jVjkI8wBArLVKhV2apQhL02xuQhGzcgSZE7YQ1esK5zL X-Received: by 2002:a05:6512:239e:b0:51d:9808:6645 with SMTP id 2adb3069b0e04-5221016b3f1mr11239953e87.50.1715593187679; Mon, 13 May 2024 02:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715593187; cv=none; d=google.com; s=arc-20160816; b=gXnIgyVyj79ZytLybLmGGPHVay1UhDSt7732h4HZIshRfsFqD7f1ZQuezTUA5iWTgd IsJ8l+98qi+PKkYjpmjqIDDR4X7GBsys53HO4pwnGgXdRXr/xeA945iWckQRY1R/3aXE TOU+/1gHhYQfyj7Y/KENcrBQOedg3yJg6zpH8YW+kopLs7/+/KdQD/tKM9K7a9RGHipz F36tLZGXykRWhBAk1m+8E2sA9SeAXfJfsjxsfxrusoqb01BSCUGuW8MgwScO4Ycun/XR LJSQW95n4Dc4gnha+zooyr5cPo5hnwrBiii4MYSEytWCkLe/ZREahPBT8glxuApvBqp8 L9Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=pCJpkiRXJYj/OwdyYCv9tStYaXhL0uam1xCaild5wkY=; fh=8ep8SxF0CTqGEIIfLUURQAZdkz0lofbLWAhTTJJSPdk=; b=fvMYtWeF+dcb5mB3efB+FMQty1//dF2OUvGzBfx7WVVGi63jtkAJ/wk7KM7I7fRbM6 J/vu6IHVm0Hrj3B129b1VHAw5e47epv/lVrZRrSse2YelpOaJ8yu11h6DODdiruNYnru Bq6dpxI3NSGtgFA9ffDQk0uaGtZ2lQ+xYfrM4nYlOL7C+0ec4cPjUDXm2414JEcLAPuY ViDL+Ttn+aPHkqwK1TvSEZikSbNAUeJqypTwPx9O03kQEVJQY/zoCZ0K2NWnnaHDiS7n UtjUq+z28geaLtOMOPg72lA0pn1BvD9vXacHYjy7/9wbl8LE2UTl1tcF/hqPvyKoaVL1 4Bkg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fb5GXwsH; spf=pass (google.com: domain of fm-1324425-20240513093946fb6c80757829b40cff-qmkwr8@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-1324425-20240513093946fb6c80757829b40cff-qMkWR8@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net. [185.136.65.225]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-521f38d8fcasi276393e87.11.2024.05.13.02.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2024 02:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-20240513093946fb6c80757829b40cff-qmkwr8@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) client-ip=185.136.65.225; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fb5GXwsH; spf=pass (google.com: domain of fm-1324425-20240513093946fb6c80757829b40cff-qmkwr8@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-1324425-20240513093946fb6c80757829b40cff-qMkWR8@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20240513093946fb6c80757829b40cff for ; Mon, 13 May 2024 11:39:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=srinuvasan.a@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=pCJpkiRXJYj/OwdyYCv9tStYaXhL0uam1xCaild5wkY=; b=fb5GXwsHeyXXli34EvF0OcsRYMPnpYmcQQKBUDT34xj85VX0m+zFqUAzWpPS/68WMChvMH OHUAxy+1dMhZoz0NeZhAITQRxF50mgqnYhu7hgvPjv8fjTg8ZTBABGp0DQc6YYtS2p2IpwvX PPzi/jbb7bQd6gpQHGddyz+yYVNLw=; From: srinuvasan.a@siemens.com To: isar-users@googlegroups.com Cc: felix.moessbauer@siemens.com, jan.kiszka@siemens.com, adriaan.schmidt@siemens.com, srinuvasan Subject: [PATCH v1] recipes-initramfs/compress-initrd: add recipe to compress initrd with xz Date: Mon, 13 May 2024 15:11:43 +0530 Message-Id: <20240513094143.365942-1-srinuvasan.a@siemens.com> In-Reply-To: <0372409e74c5d0aab55e61d8c2f9f2e988b0297d.camel@siemens.com> References: <0372409e74c5d0aab55e61d8c2f9f2e988b0297d.camel@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1324425:519-21489:flowmailer X-TUID: 3iDDpcJBU+RL From: srinuvasan 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 with the help of xz tool, using this one the generated initrd size is almost 18MB, we saved almost 9MB. Signed-off-by: srinuvasan --- meta-isar/conf/local.conf.sample | 2 +- .../compress-initrd/compress-initrd.bb | 21 +++++++++++++++++++ .../compress-initrd/files/postinst | 5 +++++ 3 files changed, 27 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..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 = "Compress the initrd with configured compression tool" +MAINTAINER = "Your name here " + +inherit dpkg-raw + +COMPRESS_TOOL ?= "xz" + +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=${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 -- 2.34.1