Skip to contentSkip to conversation

wic: Fix permissions

PATCH Superseded Ricardo Ribalda 2 participants 7 messages Apr 9, 2020

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover wic: Fix permissions

Hi

Today wic behaves differently if we run it from bitbake of directly from the commandline.

When it is run from bitbake, the permissions/usersnames are handled by the pseudo database of the main image.

When it is run from the comandline , it is run outside the main image database.

This results on permissions/usernames not working ok on some usecases on both bitbake and wic.

This is an attempt to fix all the permission bugs that I am aware from wic. Using the following usecases

#exclude-path
part / --source rootfs --fstype=ext4 --exclude-path=home

#split_partition
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/
part /etc --source rootfs --rootfs-dir=tmp/work/qt5222-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/ --fstype=ext4

#multi_partition
part / --source rootfs --ondisk sda --fstype=ext4
part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4

With the current master:
-------------------------
#exclude-path
From Bitbake: OK
wic cmdline: FAIL

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on both partitions

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After:  wic: Fix permissions when using exclude or include path
--------------------------------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on second partition

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After: wic: Fix multi images .wks with bitbake
----------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

#split_partition
From Bitbake: FAIL, permissions invalid on second partition wic cmdline: FAIL, permissions invalid on second partition

#multi_partition
From Bitbake: OK
wic cmdline: OK

After: wic: Add --change-directory argument
--------------------------------------------

we can have a .wks like:
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/ part /etc --source rootfs --fstype=ext4 --change-directory=/etc

Wich works fine from bitbake and from cmdline, and has the same functionality as split_partition.

Ricardo Ribalda Delgado (4):
wic: Fix permissions when using exclude or include path
wic: Fix multi images .wks with bitbake
wic: Add --change-directory argument
wic: Continue if excluded_path does not exist

 meta/classes/image_types_wic.bbclass     |  8 +++-
 scripts/lib/wic/help.py                  |  6 +++
 scripts/lib/wic/ksparser.py              |  1 +
 scripts/lib/wic/partition.py             | 15 ++++---
 scripts/lib/wic/plugins/source/rootfs.py | 52 ++++++++++++++++++++++--
 5 files changed, 68 insertions(+), 14 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/4 wic: Fix permissions when using exclude or include path

When parameters include_path or exclude_path are passed to the rootfs plugin, it will copy the partition content into a folder and make all the modifications there.

This is done using copyhardlinktree(), which does not take into consideration the content of the pseudo folder, which contains the information about the right permissions and ownership of the folders.

This results in a rootfs owned by the user that is running the wic command (usually UID 1000), which makes some rootfs unbootable.

This bug can be easily triggerd with the following .wks

part / --source rootfs --fstype=ext4 --exclude-path=home

And this sequence:

$ wic create test-permissions -e core-image-minimal -o test/
$ sudo mount test/test-permissions-202004080823-sda.direct.p1 /mnt
$ ls -la /mnt/etc/shadow

To fix this we copy the content of the pseudo folders to the new folder and modify the pseudo database using the "pseudo -B" command.

If the rootfs is not a rootfs generated by bitbake a warning is shown making the user aware that the permissions on the target might not match what he expects.

WARNING: /tmp/test/../pseudo folder does not exist. Usernames and permissions will be invalid

---
 scripts/lib/wic/partition.py             |  7 +++--
 scripts/lib/wic/plugins/source/rootfs.py | 36 ++++++++++++++++++++++--
 2 files changed, 37 insertions(+), 6 deletions(-)
scripts/lib/wic/partition.py +4 -3
index 2d95f78439..b02711be37 100644
@@ -190,7 +190,7 @@ class Partition():
                            (self.mountpoint, self.size, self.fixed_size))
 
     def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
-                       native_sysroot, real_rootfs = True):
+                       native_sysroot, real_rootfs = True, pseudo_dir = None):
         """
         Prepare content for a rootfs partition i.e. create a partition
         and fill it from a /rootfs dir.
@@ -198,8 +198,9 @@ class Partition():
         Currently handles ext2/3/4, btrfs, vfat and squashfs.
         """
         p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot)
-        p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR",
-                                         "%s/../pseudo" %  rootfs_dir)
+        if (pseudo_dir == None):
+            pseudo_dir = "%s/../pseudo" %  rootfs_dir
+        p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR", pseudo_dir)
         p_passwd = os.environ.get("PSEUDO_PASSWD", rootfs_dir)
         p_nosymlinkexp = os.environ.get("PSEUDO_NOSYMLINKEXP", "1")
         pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix
scripts/lib/wic/plugins/source/rootfs.py +33 -3
index 705aeb5563..caad9efccc 100644
@@ -20,7 +20,7 @@ from oe.path import copyhardlinktree
 
 from wic import WicError
 from wic.pluginbase import SourcePlugin
-from wic.misc import get_bitbake_var
+from wic.misc import get_bitbake_var, exec_native_cmd
 
 logger = logging.getLogger('wic')
 
@@ -44,6 +44,15 @@ class RootfsPlugin(SourcePlugin):
 
         return os.path.realpath(image_rootfs_dir)
 
+    @staticmethod
+    def __get_pseudo(native_sysroot, rootfs, pseudo_dir):
+        pseudo = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot
+        pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % pseudo_dir
+        pseudo += "export PSEUDO_PASSWD=%s;" % rootfs
+        pseudo += "export PSEUDO_NOSYMLINKEXP=1;"
+        pseudo += "%s " % get_bitbake_var("FAKEROOTCMD")
+        return pseudo
+
     @classmethod
     def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
                              oe_builddir, bootimg_dir, kernel_dir,
@@ -68,8 +77,14 @@ class RootfsPlugin(SourcePlugin):
                                "it is not a valid path, exiting" % part.rootfs_dir)
 
         part.rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
+        pseudo_dir = os.path.join(part.rootfs_dir, "../pseudo")
+        if not os.path.lexists(pseudo_dir):
+            logger.warn("%s folder does not exist. "
+                        "Usernames and permissions will be invalid " % pseudo_dir)
+            pseudo_dir = None
 
         new_rootfs = None
+        new_pseudo = None
         # Handle excluded paths.
         if part.exclude_path or part.include_path:
             # We need a new rootfs directory we can delete files from. Copy to
@@ -78,9 +93,23 @@ class RootfsPlugin(SourcePlugin):
 
             if os.path.lexists(new_rootfs):
                 shutil.rmtree(os.path.join(new_rootfs))
-
             copyhardlinktree(part.rootfs_dir, new_rootfs)
 
+            # Convert the pseudo directory to its new location
+            if (pseudo_dir):
+                new_pseudo = os.path.join(new_rootfs, "../pseudo%d" % part.lineno)
+                if os.path.lexists(new_pseudo):
+                    shutil.rmtree(new_pseudo)
+                os.mkdir(new_pseudo)
+                shutil.copy(os.path.join(pseudo_dir, "files.db"),
+                            os.path.join(new_pseudo, "files.db"))
+
+                pseudo_cmd = "%s -B -m %s -M %s" % (cls.__get_pseudo(native_sysroot,
+                                                                     new_rootfs,
+                                                                     new_pseudo),
+                                                    part.rootfs_dir, new_rootfs)
+                exec_native_cmd(pseudo_cmd, native_sysroot)
+
             for path in part.include_path or []:
                 copyhardlinktree(path, new_rootfs)
 
@@ -112,4 +141,5 @@ class RootfsPlugin(SourcePlugin):
                     shutil.rmtree(full_path)
 
         part.prepare_rootfs(cr_workdir, oe_builddir,
-                            new_rootfs or part.rootfs_dir, native_sysroot)
+                            new_rootfs or part.rootfs_dir, native_sysroot,
+                            pseudo_dir = new_pseudo or pseudo_dir)
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/4 wic: Fix multi images .wks with bitbake

In reply to Ricardo Ribalda

In order to support .wks files with multiple images inside bitbake we need to explicitly set the pseudo database in use.

Eg: If we try this .mks:
part / --source rootfs --ondisk sda --fstype=ext4
part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4

The username for all the files under /export will be set to the runner of bitbake (usually UID 1000).

Before we run wic, we need to make sure that the pseudo database will be flushed, and contains all the data needed.

---
 meta/classes/image_types_wic.bbclass | 8 ++++++--
 scripts/lib/wic/partition.py         | 9 +++------
 2 files changed, 9 insertions(+), 8 deletions(-)
meta/classes/image_types_wic.bbclass +6 -2
index b83308b45c..96ed0473ee 100644
@@ -32,8 +32,7 @@ IMAGE_CMD_wic () {
 	if [ -z "$wks" ]; then
 		bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
 	fi
-
-	BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
+	BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
 	mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
 }
 IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
@@ -86,6 +85,10 @@ python do_write_wks_template () {
     bb.utils.copyfile(wks_file, "%s/%s" % (depdir, basename + '-' + os.path.basename(wks_file)))
 }
 
+do_flush_pseudodb() {
+	${FAKEROOTENV} ${FAKEROOTCMD} -S
+}
+
 python () {
     if d.getVar('USING_WIC'):
         wks_file_u = d.getVar('WKS_FULL_PATH', False)
@@ -139,6 +142,7 @@ python do_rootfs_wicenv () {
     depdir = d.getVar('IMGDEPLOYDIR')
     bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env')
 }
+addtask do_flush_pseudodb after do_image before do_image_wic
 addtask do_rootfs_wicenv after do_image before do_image_wic
 do_rootfs_wicenv[vardeps] += "${WICVARS}"
 do_rootfs_wicenv[prefuncs] = 'set_image_size'
scripts/lib/wic/partition.py +3 -6
index b02711be37..d850fbd1b1 100644
@@ -200,13 +200,10 @@ class Partition():
         p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot)
         if (pseudo_dir == None):
             pseudo_dir = "%s/../pseudo" %  rootfs_dir
-        p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR", pseudo_dir)
-        p_passwd = os.environ.get("PSEUDO_PASSWD", rootfs_dir)
-        p_nosymlinkexp = os.environ.get("PSEUDO_NOSYMLINKEXP", "1")
         pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix
-        pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % p_localstatedir
-        pseudo += "export PSEUDO_PASSWD=%s;" % p_passwd
-        pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp
+        pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % pseudo_dir
+        pseudo += "export PSEUDO_PASSWD=%s;" % rootfs_dir
+        pseudo += "export PSEUDO_NOSYMLINKEXP=1;"
         pseudo += "%s " % get_bitbake_var("FAKEROOTCMD")
 
         rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label,
Signature · 1 line
2.25.1
#3 lore raw

PATCH v4 3/4 wic: Add --change-directory argument

In reply to Ricardo Ribalda

This option allows to specify which part of a rootfs is going to be included, the same way the -C argument on tar.

Thanks to this option we can make sure the permissions and usernames on the target partition are respected, and also simplify the creation of splitted partitons, not neeting to invoke external vars or using .wks.in files. Eg:

part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/ part /etc --source rootfs --fstype=ext4 --change-directory=/etc

---
 scripts/lib/wic/help.py                  |  6 ++++++
 scripts/lib/wic/ksparser.py              |  1 +
 scripts/lib/wic/partition.py             |  1 +
 scripts/lib/wic/plugins/source/rootfs.py | 17 ++++++++++++++---
 4 files changed, 22 insertions(+), 3 deletions(-)
scripts/lib/wic/help.py +6 -0
index 1e3d06a87b..62a2a90e79 100644
@@ -980,6 +980,12 @@ DESCRIPTION
                          copies. This option only has an effect with the rootfs
                          source plugin.
 
+         --change-directory: This option is specific to wic. It changes to the
+                             given directory before copying the files. This
+                             option is useful when we want to split a rootfs in
+                             multiple partitions and we want to keep the right
+                             permissions and usernames in all the partitions.
+
          --extra-space: This option is specific to wic. It adds extra
                         space after the space filled by the content
                         of the partition. The final size can go
scripts/lib/wic/ksparser.py +1 -0
index 650b976223..c60869d397 100644
@@ -138,6 +138,7 @@ class KickStart():
         part.add_argument('--align', type=int)
         part.add_argument('--exclude-path', nargs='+')
         part.add_argument('--include-path', nargs='+')
+        part.add_argument('--change-directory')
         part.add_argument("--extra-space", type=sizetype)
         part.add_argument('--fsoptions', dest='fsopts')
         part.add_argument('--fstype', default='vfat',
scripts/lib/wic/partition.py +1 -0
index d850fbd1b1..3240be072a 100644
@@ -31,6 +31,7 @@ class Partition():
         self.extra_space = args.extra_space
         self.exclude_path = args.exclude_path
         self.include_path = args.include_path
+        self.change_directory = args.change_directory
         self.fsopts = args.fsopts
         self.fstype = args.fstype
         self.label = args.label
scripts/lib/wic/plugins/source/rootfs.py +14 -3
index caad9efccc..d3742802bb 100644
@@ -86,14 +86,25 @@ class RootfsPlugin(SourcePlugin):
         new_rootfs = None
         new_pseudo = None
         # Handle excluded paths.
-        if part.exclude_path or part.include_path:
+        if part.exclude_path or part.include_path or part.change_directory:
             # We need a new rootfs directory we can delete files from. Copy to
             # workdir.
             new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno))
 
             if os.path.lexists(new_rootfs):
                 shutil.rmtree(os.path.join(new_rootfs))
-            copyhardlinktree(part.rootfs_dir, new_rootfs)
+
+            if part.change_directory:
+                cd = part.change_directory
+                if cd[-1] == '/':
+                    cd = cd[:-1]
+                if os.path.isabs(cd):
+                    logger.error("Must be relative: --change-directory=%s" % cd)
+                    sys.exit(1)
+                orig_dir = os.path.join(part.rootfs_dir, cd)
+            else:
+                orig_dir = part.rootfs_dir
+            copyhardlinktree(orig_dir, new_rootfs)
 
             # Convert the pseudo directory to its new location
             if (pseudo_dir):
@@ -107,7 +118,7 @@ class RootfsPlugin(SourcePlugin):
                 pseudo_cmd = "%s -B -m %s -M %s" % (cls.__get_pseudo(native_sysroot,
                                                                      new_rootfs,
                                                                      new_pseudo),
-                                                    part.rootfs_dir, new_rootfs)
+                                                    orig_dir, new_rootfs)
                 exec_native_cmd(pseudo_cmd, native_sysroot)
 
             for path in part.include_path or []:
Signature · 1 line
2.25.1
#4 lore raw

PATCH v4 4/4 wic: Continue if excluded_path does not exist

In reply to Ricardo Ribalda

If an excuded path does not exist, continue without an error. This allows to seamleasly reuse .wks among different projects.

Eg:

part / --source rootfs --fstype=ext4 --exclude-path=/opt/private_keys

Where /opt/private_keys in only populated by some of the image.bb files.

---
 scripts/lib/wic/plugins/source/rootfs.py | 3 +++
 1 file changed, 3 insertions(+)
scripts/lib/wic/plugins/source/rootfs.py +3 -0
index d3742802bb..8874ac62c4 100644
@@ -131,6 +131,9 @@ class RootfsPlugin(SourcePlugin):
                     sys.exit(1)
 
                 full_path = os.path.realpath(os.path.join(new_rootfs, path))
+                
+                if not os.path.lexists(full_path):
+                    continue
 
                 # Disallow climbing outside of parent directory using '..',
                 # because doing so could be quite disastrous (we will delete the
Signature · 1 line
2.25.1
#5 lore raw
In reply to Ricardo Ribalda
Quoted 67 lines · On Thu, 9 Apr 2020 12:49:47 +0200 Ricardo Ribalda Delgado…

Hi

Today wic behaves differently if we run it from bitbake of directly from the commandline.

When it is run from bitbake, the permissions/usersnames are handled by the pseudo database of the main image.

When it is run from the comandline , it is run outside the main image database.

This results on permissions/usernames not working ok on some usecases on both bitbake and wic.

This is an attempt to fix all the permission bugs that I am aware from wic. Using the following usecases

#exclude-path
part / --source rootfs --fstype=ext4 --exclude-path=home

#split_partition
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/
part /etc --source rootfs --rootfs-dir=tmp/work/qt5222-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/ --fstype=ext4

#multi_partition
part / --source rootfs --ondisk sda --fstype=ext4
part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4

With the current master:
-------------------------
#exclude-path
From Bitbake: OK
wic cmdline: FAIL

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on both partitions

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After:  wic: Fix permissions when using exclude or include path
--------------------------------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on second partition

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After: wic: Fix multi images .wks with bitbake
----------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

Quoted 8 lines

#split_partition
From Bitbake: FAIL, permissions invalid on second partition wic cmdline: FAIL, permissions invalid on second partition

#multi_partition
From Bitbake: OK
wic cmdline: OK

This looks really good, are you able to automate any of these tests and put them in meta/lib/oeqa/selftest/cases/wic.py?

Quoted 20 lines

After: wic: Add --change-directory argument
--------------------------------------------

we can have a .wks like:
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/ part /etc --source rootfs --fstype=ext4 --change-directory=/etc

Wich works fine from bitbake and from cmdline, and has the same functionality as split_partition.

Ricardo Ribalda Delgado (4):
wic: Fix permissions when using exclude or include path
wic: Fix multi images .wks with bitbake
wic: Add --change-directory argument
wic: Continue if excluded_path does not exist

Quoted 7 lines
 meta/classes/image_types_wic.bbclass     |  8 +++-
 scripts/lib/wic/help.py                  |  6 +++
 scripts/lib/wic/ksparser.py              |  1 +
 scripts/lib/wic/partition.py             | 15 ++++---
 scripts/lib/wic/plugins/source/rootfs.py | 52 ++++++++++++++++++++++--
 5 files changed, 68 insertions(+), 14 deletions(-)

I'll give this a detailed review over the weekend. Looks good at first glance, though I may suggest renaming --change-directory to something else so it's more obvious what it's doing when you just read that in a wks file. Perhaps --part-subdir, I don't know. Let's not bikeshed it too much though.

Thanks,

Signature · 2 lines
Paul Barker
Konsulko Group
#6 lore raw

Hi Paul

Quoted 75 lines · Paul Barker
Quoted 71 lines · On Thu, 9 Apr 2020 12:49:47 +0200 Ricardo Ribalda Delgado…

Hi

Today wic behaves differently if we run it from bitbake of directly from the commandline.

When it is run from bitbake, the permissions/usersnames are handled by the pseudo database of the main image.

When it is run from the comandline , it is run outside the main image database.

This results on permissions/usernames not working ok on some usecases on both bitbake and wic.

This is an attempt to fix all the permission bugs that I am aware from wic. Using the following usecases

#exclude-path
part / --source rootfs --fstype=ext4 --exclude-path=home

#split_partition
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/
part /etc --source rootfs --rootfs-dir=tmp/work/qt5222-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/ --fstype=ext4

#multi_partition
part / --source rootfs --ondisk sda --fstype=ext4
part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4

With the current master:
-------------------------
#exclude-path
From Bitbake: OK
wic cmdline: FAIL

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on both partitions

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After: wic: Fix permissions when using exclude or include path
--------------------------------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

#split_partition
From Bitbake: OK
wic cmdline: FAIL, permissions invalid on second partition

#multi_partition
From Bitbake: FAIL second partition
wic cmdline: OK

After: wic: Fix multi images .wks with bitbake
----------------------------------------------
#exclude-path
From Bitbake: OK
wic cmdline: OK

#split_partition
From Bitbake: FAIL, permissions invalid on second partition wic cmdline: FAIL, permissions invalid on second partition

Quoted 7 lines
Quoted 4 lines

#multi_partition
From Bitbake: OK
wic cmdline: OK

This looks really good, are you able to automate any of these tests and put them in meta/lib/oeqa/selftest/cases/wic.py?

Havent done it before, but for sure I can give it a try.

Any good guide I can use? Last time I was playing with selftest whenever I changed something on a test I had to run the whole test from scratch, which is not very productive :).

Quoted 29 lines
Quoted 21 lines

After: wic: Add --change-directory argument
--------------------------------------------

we can have a .wks like:
part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/ part /etc --source rootfs --fstype=ext4 --change-directory=/etc

Wich works fine from bitbake and from cmdline, and has the same functionality as split_partition.

Ricardo Ribalda Delgado (4):
wic: Fix permissions when using exclude or include path
wic: Fix multi images .wks with bitbake
wic: Add --change-directory argument
wic: Continue if excluded_path does not exist

Quoted 7 lines
 meta/classes/image_types_wic.bbclass     |  8 +++-
 scripts/lib/wic/help.py                  |  6 +++
 scripts/lib/wic/ksparser.py              |  1 +
 scripts/lib/wic/partition.py             | 15 ++++---
 scripts/lib/wic/plugins/source/rootfs.py | 52 ++++++++++++++++++++++--
 5 files changed, 68 insertions(+), 14 deletions(-)
Quoted 5 lines

I'll give this a detailed review over the weekend. Looks good at first glance, though I may suggest renaming --change-directory to something else so it's more obvious what it's doing when you just read that in a wks file. Perhaps --part-subdir, I don't know. Let's not bikeshed it too much though.

I do not care about the name, I have used tar as "inspiration"

-C, --directory=DIR
Change to DIR before performing any operations. This option is order-sensitive, i.e. it affects all options that follow.

If you have any preference on the name I will take it.

Thanks!

Quoted 5 lines

Thanks,

--
Paul Barker
Konsulko Group

Signature · 1 line
Ricardo Ribalda