public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
To: <isar-users@googlegroups.com>, <Vijaikumar_Kanagarajan@mentor.com>
Subject: [PATCH v3 6/9] wic_fakeroot: Handle standalone pseudo invocations
Date: Mon, 7 Sep 2020 21:50:15 +0530	[thread overview]
Message-ID: <20200907162018.16636-3-Vijaikumar_Kanagarajan@mentor.com> (raw)
In-Reply-To: <20200907162018.16636-1-Vijaikumar_Kanagarajan@mentor.com>

When using --exclude-path option wic copies the rootfs to a new location
and invokes pseudo as a standalone command to rebuild the database in the
new rootfs.

This is not applicable when using wic_fakeroot. Return 0 for such
standalone invocations in wic_fakeroot.

It also looks for files.db inside the pseudo directory and throws an
exception if it is not found. Handle that too.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 meta/classes/wic-img.bbclass | 1 +
 scripts/wic_fakeroot         | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index a2c9627..b1a7259 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -144,6 +144,7 @@ EOSUDO
     export BUILDDIR=${BUILDDIR}
     export MTOOLS_SKIP_CHECK=1
     mkdir -p ${IMAGE_ROOTFS}/../pseudo
+    touch ${IMAGE_ROOTFS}/../pseudo/files.db
 
     # create the temp dir in the buildchroot to ensure uniqueness
     WICTMP=$(cd ${BUILDCHROOT_DIR}; mktemp -d -p tmp)
diff --git a/scripts/wic_fakeroot b/scripts/wic_fakeroot
index 88a03fa..304f9e8 100755
--- a/scripts/wic_fakeroot
+++ b/scripts/wic_fakeroot
@@ -25,6 +25,11 @@ cmd = args[0]
 #    rootfs/root ...
 assert os.geteuid() == 0, "wic_fakeroot must be run as root!"
 
+# Check if we are calling the pseudo command itself. Return 0
+# for standalone pseudo operations.
+if cmd.startswith('-'):
+    sys.exit(0)
+
 # e2fsck <= 1.43.5 returns 1 on non-errors (stretch and before affected)
 # treat 1 as safe ... the filesystem was successfully repaired and is OK
 if cmd.startswith('fsck.'):
-- 
2.17.1


  parent reply	other threads:[~2020-09-07 16:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07 16:17 [PATCH v3 0/9] WIC update Vijai Kumar K
2020-09-07 16:17 ` [PATCH v3 1/9] wic: Update to the latest wic from openembedded core Vijai Kumar K
2020-09-07 16:17 ` [PATCH v3 2/9] wic/plugins: Fix wic plugins to work with the latest wic Vijai Kumar K
2020-09-07 16:17 ` [PATCH v3 3/9] wic-img: Satisfy the quirks of " Vijai Kumar K
2020-09-07 16:20   ` [PATCH v3 4/9] oe.path: Add copyhardlink() helper function Vijai Kumar K
2020-09-07 16:20     ` [PATCH v3 5/9] lib/oe/path: try hardlinking instead of guessing when it might fail Vijai Kumar K
2020-09-07 16:20     ` Vijai Kumar K [this message]
2020-09-07 16:20     ` [PATCH v3 7/9] meta-isar/conf: Add provision to debug WIC Vijai Kumar K
2020-09-07 16:20     ` [PATCH v3 8/9] debian-common: Add tar as a dependency for wic Vijai Kumar K
2020-09-07 16:20     ` [PATCH v3 9/9] meta-isar/canned-wks: Remove unwanted /boot mountpoint Vijai Kumar K

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=20200907162018.16636-3-Vijaikumar_Kanagarajan@mentor.com \
    --to=vijaikumar_kanagarajan@mentor.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