From: "Daniel Gomez" <daniel@qtec.com>
To: openembedded-core@lists.openembedded.org
Cc: dagmcr@gmail.com, paul@pbarker.dev,
richard.purdie@linuxfoundation.org,
Daniel Gomez <daniel@qtec.com>
Subject: [OE-core][RFC][PATCH][dunfell] wic: Add --use-stock-fstab option
Date: Fri, 6 Aug 2021 11:23:37 +0200 [thread overview]
Message-ID: <20210806092337.81924-1-daniel@qtec.com> (raw)
In-Reply-To: <f5204c03e3394a38e6663e56b0072d9d65bcc34d.camel@linuxfoundation.org>
When embeddding rootfs image (e.g. 'rootfs-dir') as a partition we
might want to keep the stock fstab for that image. In such case, use
this option to not update the fstab and use the stock one instead.
This option allows to specify which partitions get the updated fstab
and which get the stock fstab.
Example:
part /export --source rootfs --rootfs-dir=hockeycam-image
--fstype=ext4 --label export --align 1024 --use-stock-fstab
part / --source rootfs --fstype=ext4 --label rootfs --align 1024
Signed-off-by: Daniel Gomez <daniel@qtec.com>
---
The commit-id ce682a73b7447652f898ce1d1d0416a456df5416 reverted the
functionality to restore the stock/original fstab file in a rootfs
partition image (wic plugin).
Add back such functionality with an option to the user to select which
fstab will be used for each partition by adding the --use-stock-fstab.
In this case, the user will select whether or not the stock fstab will
be updated or kept.
If you agree with the patch I'll adapt it to the master branch.
Daniel
scripts/lib/wic/ksparser.py | 1 +
scripts/lib/wic/partition.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 452a160232..64933e0a5b 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -184,6 +184,7 @@ class KickStart():
part.add_argument('--use-uuid', action='store_true')
part.add_argument('--uuid')
part.add_argument('--fsuuid')
+ part.add_argument('--use-stock-fstab', action='store_true')
bootloader = subparsers.add_parser('bootloader')
bootloader.add_argument('--append')
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 85f9847047..c9e45773de 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -54,6 +54,7 @@ class Partition():
self.uuid = args.uuid
self.fsuuid = args.fsuuid
self.type = args.type
+ self.use_stock_fstab = args.use_stock_fstab
self.updated_fstab_path = None
self.has_fstab = False
self.update_fstab_in_rootfs = False
@@ -286,7 +287,7 @@ class Partition():
(self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir)
exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
- if self.updated_fstab_path and self.has_fstab:
+ if self.updated_fstab_path and self.has_fstab and not self.use_stock_fstab:
debugfs_script_path = os.path.join(cr_workdir, "debugfs_script")
with open(debugfs_script_path, "w") as f:
f.write("cd etc\n")
--
2.30.2
next prev parent reply other threads:[~2021-08-06 9:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 15:03 [OE-core][RFC][PATCH][dunfell] wic: direct: Use stock fstab in partitions Daniel Gomez
2021-08-05 15:31 ` Richard Purdie
2021-08-06 9:23 ` Daniel Gomez [this message]
2021-08-06 10:02 ` [OE-core][RFC][PATCH][dunfell] wic: Add --use-stock-fstab option Richard Purdie
2021-08-06 10:29 ` Paul Barker
2021-08-06 13:27 ` Daniel Gomez
2021-08-06 9:35 ` [OE-core][RFC][PATCH][dunfell] wic: direct: Use stock fstab in partitions Daniel Gomez
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=20210806092337.81924-1-daniel@qtec.com \
--to=daniel@qtec.com \
--cc=dagmcr@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul@pbarker.dev \
--cc=richard.purdie@linuxfoundation.org \
/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