From: "Q. Gylstorff" <Quirin.Gylstorff@siemens.com>
To: jan.kiszka@siemens.com, isar-users@googlegroups.com
Cc: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Subject: [PATCH v14 2/2] meta/classes: add cpiogz-img
Date: Thu, 8 Jul 2021 10:42:38 +0200 [thread overview]
Message-ID: <20210708084238.2933-3-Quirin.Gylstorff@siemens.com> (raw)
In-Reply-To: <20210708084238.2933-1-Quirin.Gylstorff@siemens.com>
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
This allows to create a initramfs like filesystem.
Based on original patch by Michael Adler <michael.adler@siemens.com>.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
[Jan: reformatting, dropped bullseye target, added to local.conf]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
meta-isar/conf/local.conf.sample | 1 +
.../multiconfig/qemuamd64-buster-cpiogz.conf | 9 ++++++++
meta/classes/cpiogz-img.bbclass | 22 +++++++++++++++++++
scripts/ci_build.sh | 1 +
4 files changed, 33 insertions(+)
create mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
create mode 100644 meta/classes/cpiogz-img.bbclass
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 7b20a62..fcdc277 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -50,6 +50,7 @@ BBMULTICONFIG = " \
qemuamd64-stretch \
qemuamd64-buster \
qemuamd64-buster-tgz \
+ qemuamd64-buster-cpiogz \
qemuamd64-bullseye \
container-amd64-stretch \
container-amd64-buster \
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf b/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
new file mode 100644
index 0000000..cadcdac
--- /dev/null
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+MACHINE ?= "qemuamd64"
+DISTRO ?= "debian-buster"
+
+IMAGE_TYPE = "cpiogz-img"
diff --git a/meta/classes/cpiogz-img.bbclass b/meta/classes/cpiogz-img.bbclass
new file mode 100644
index 0000000..8e90acb
--- /dev/null
+++ b/meta/classes/cpiogz-img.bbclass
@@ -0,0 +1,22 @@
+# This software is a part of ISAR.
+# Copyright (C) 2020 Siemens AG
+#
+# SPDX-License-Identifier: MIT
+
+CPIOGZ_FNAME ?= "${IMAGE_FULLNAME}.cpio.gz"
+CPIOGZ_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${CPIOGZ_FNAME}"
+IMAGER_INSTALL += "cpio"
+CPIO_IMAGE_FORMAT ?= "newc"
+
+do_cpiogz_image() {
+ sudo rm -f ${CPIOGZ_IMAGE_FILE}
+ image_do_mounts
+ sudo chroot ${BUILDCHROOT_DIR} \
+ sh -c "cd ${PP_ROOTFS}; /usr/bin/find . | \
+ /usr/bin/cpio -H ${CPIO_IMAGE_FORMAT} -o | /usr/bin/gzip -9 > \
+ ${PP_DEPLOY}/${CPIOGZ_FNAME}"
+ sudo chown $(id -u):$(id -g) ${CPIOGZ_IMAGE_FILE}
+ image_undo_mounts
+}
+
+addtask cpiogz_image before do_image after do_image_tools
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index b1bbe51..a2895f6 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -37,6 +37,7 @@ TARGETS_SET="\
mc:qemuamd64-stretch:isar-image-base \
mc:qemuamd64-buster:isar-image-base \
mc:qemuamd64-buster-tgz:isar-image-base \
+ mc:qemuamd64-buster-cpiogz:isar-image-base \
mc:qemuamd64-buster:isar-initramfs \
mc:qemumipsel-stretch:isar-image-base \
mc:qemumipsel-buster:isar-image-base \
--
2.20.1
next prev parent reply other threads:[~2021-07-08 8:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 8:42 [PATCH v14 0/2] CPIO & OVA Images Q. Gylstorff
2021-07-08 8:42 ` [PATCH v14 1/2] meta/classes: Generate ova image for VMWare or Virtualbox Q. Gylstorff
2021-07-08 8:42 ` Q. Gylstorff [this message]
2021-08-20 9:07 ` [PATCH v14 0/2] CPIO & OVA Images Anton Mikanovich
2021-09-07 10:48 ` Gylstorff Quirin
2021-09-07 13:06 ` Jan Kiszka
2021-09-07 13:49 ` Anton Mikanovich
2021-09-13 9:39 ` Anton Mikanovich
2021-09-14 10:54 ` Henning Schild
2021-09-16 10:01 ` Henning Schild
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=20210708084238.2933-3-Quirin.Gylstorff@siemens.com \
--to=quirin.gylstorff@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/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