Browse Source

wic_fakeroot: Handle standalone pseudo invocations

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>
Vijai Kumar K 4 năm trước cách đây
mục cha
commit
2d1bde438a
2 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 1 0
      meta/classes/wic-img.bbclass
  2. 5 0
      scripts/wic_fakeroot

+ 1 - 0
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)

+ 5 - 0
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.'):