From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
To: isar-users@googlegroups.com
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Subject: [RFC PATCH 2/5] meta: refactor containerization
Date: Tue, 12 Oct 2021 15:04:10 +0200 [thread overview]
Message-ID: <20211012130413.1719424-3-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20211012130413.1719424-1-adriaan.schmidt@siemens.com>
Don't unmount, but instead use "stay on one filesystem" options
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
meta/classes/image-container-extension.bbclass | 3 ++-
meta/classes/image-sdk-extension.bbclass | 6 +-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/meta/classes/image-container-extension.bbclass b/meta/classes/image-container-extension.bbclass
index e26604a..762be4a 100644
--- a/meta/classes/image-container-extension.bbclass
+++ b/meta/classes/image-container-extension.bbclass
@@ -19,6 +19,7 @@ containerize_rootfs() {
# prepare OCI container image skeleton
bbdebug 1 "prepare OCI container image skeleton"
rm -rf "${oci_img_dir}"
+
sudo umoci init --layout "${oci_img_dir}"
sudo umoci new --image "${oci_img_dir}:${empty_tag}"
sudo umoci config --image "${oci_img_dir}:${empty_tag}" \
@@ -27,7 +28,7 @@ containerize_rootfs() {
"${oci_img_dir}_unpacked"
# add root filesystem as the flesh of the skeleton
- sudo cp -a "${rootfs}"/* "${oci_img_dir}_unpacked/rootfs/"
+ sudo sh -c "tar --one-file-system -C \"${rootfs}\" -cpf - . | tar -C \"${oci_img_dir}_unpacked/rootfs\" --strip-components=1 -xpf -"
# clean-up temporary files
sudo find "${oci_img_dir}_unpacked/rootfs/tmp" -mindepth 1 -delete
diff --git a/meta/classes/image-sdk-extension.bbclass b/meta/classes/image-sdk-extension.bbclass
index 426b925..2cc5933 100644
--- a/meta/classes/image-sdk-extension.bbclass
+++ b/meta/classes/image-sdk-extension.bbclass
@@ -33,15 +33,11 @@ do_populate_sdk() {
sudo rm -f ${SDKCHROOT_DIR}/etc/apt/sources.list.d/isar-apt.list
fi
- sudo umount -R ${SDKCHROOT_DIR}/dev || true
- sudo umount ${SDKCHROOT_DIR}/proc || true
- sudo umount -R ${SDKCHROOT_DIR}/sys || true
-
# Remove setup scripts
sudo rm -f ${SDKCHROOT_DIR}/chroot-setup.sh ${SDKCHROOT_DIR}/configscript.sh
# Make all links relative
- for link in $(find ${SDKCHROOT_DIR}/ -type l); do
+ for link in $(find ${SDKCHROOT_DIR}/ -type l -xdev); do
target=$(readlink $link)
if [ "${target#/}" != "${target}" ]; then
--
2.30.2
next prev parent reply other threads:[~2021-10-12 13:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 13:04 [RFC PATCH 0/5] Refactor mount logic Adriaan Schmidt
2021-10-12 13:04 ` [RFC PATCH 1/5] oe imports in central location Adriaan Schmidt
2021-10-12 13:04 ` Adriaan Schmidt [this message]
2021-10-13 10:17 ` [RFC PATCH 2/5] meta: refactor containerization Jan Kiszka
2021-10-12 13:04 ` [RFC PATCH 3/5] meta: add oe.utils Adriaan Schmidt
2021-10-13 10:17 ` Jan Kiszka
2021-10-20 6:49 ` Schmidt, Adriaan
2021-10-12 13:04 ` [RFC PATCH 4/5] meta: add mounts class Adriaan Schmidt
2021-10-13 10:31 ` Jan Kiszka
2021-10-20 7:02 ` Schmidt, Adriaan
2021-10-12 13:04 ` [RFC PATCH 5/5] meta: refactor to use the new mounting mechanism Adriaan Schmidt
2021-10-13 10:42 ` Jan Kiszka
2021-10-20 9:20 ` Schmidt, Adriaan
2021-11-22 14:45 ` [RFC PATCH 0/5] Refactor mount logic Anton Mikanovich
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=20211012130413.1719424-3-adriaan.schmidt@siemens.com \
--to=adriaan.schmidt@siemens.com \
--cc=isar-users@googlegroups.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