* [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device
@ 2022-09-29 12:57 Markus Volk
2022-09-29 13:08 ` Alexander Kanavin
2022-09-29 15:32 ` Richard Purdie
0 siblings, 2 replies; 6+ messages in thread
From: Markus Volk @ 2022-09-29 12:57 UTC (permalink / raw)
To: openembedded-core; +Cc: ross.burton, Markus Volk
Remove the hardcoded root device entry from fstab when updating to
avoid duplicate entries.
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index da483daed5..fd86a094d9 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
updated = False
for part in self.parts:
if not part.realnum or not part.mountpoint \
- or part.mountpoint == "/" or not part.mountpoint.startswith('/'):
+ or not part.mountpoint.startswith('/'):
continue
if part.use_uuid:
@@ -145,6 +145,11 @@ class DirectPlugin(ImagerPlugin):
fstab_lines.append(line)
updated = True
+ for line in fstab_lines:
+ if '/dev/root' in line:
+ fstab_lines.remove(line)
+ updated = True
+
if updated:
self.updated_fstab_path = os.path.join(self.workdir, "fstab")
with open(self.updated_fstab_path, "w") as f:
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device
2022-09-29 12:57 [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device Markus Volk
@ 2022-09-29 13:08 ` Alexander Kanavin
2022-09-29 15:10 ` Markus Volk
2022-09-29 15:32 ` Richard Purdie
1 sibling, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2022-09-29 13:08 UTC (permalink / raw)
To: Markus Volk; +Cc: openembedded-core, ross.burton
Can you describe in more detail what the problem is (e.g. an example
of incorrect output), and what changes with this patch?
Alex
On Thu, 29 Sept 2022 at 14:58, Markus Volk <f_l_k@t-online.de> wrote:
>
> Remove the hardcoded root device entry from fstab when updating to
> avoid duplicate entries.
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
> scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
> index da483daed5..fd86a094d9 100644
> --- a/scripts/lib/wic/plugins/imager/direct.py
> +++ b/scripts/lib/wic/plugins/imager/direct.py
> @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> updated = False
> for part in self.parts:
> if not part.realnum or not part.mountpoint \
> - or part.mountpoint == "/" or not part.mountpoint.startswith('/'):
> + or not part.mountpoint.startswith('/'):
> continue
>
> if part.use_uuid:
> @@ -145,6 +145,11 @@ class DirectPlugin(ImagerPlugin):
> fstab_lines.append(line)
> updated = True
>
> + for line in fstab_lines:
> + if '/dev/root' in line:
> + fstab_lines.remove(line)
> + updated = True
> +
> if updated:
> self.updated_fstab_path = os.path.join(self.workdir, "fstab")
> with open(self.updated_fstab_path, "w") as f:
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#171186): https://lists.openembedded.org/g/openembedded-core/message/171186
> Mute This Topic: https://lists.openembedded.org/mt/93993381/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device
2022-09-29 13:08 ` Alexander Kanavin
@ 2022-09-29 15:10 ` Markus Volk
0 siblings, 0 replies; 6+ messages in thread
From: Markus Volk @ 2022-09-29 15:10 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core, ross.burton
[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]
Sure. I've sent a v2
Am Do, 29. Sep 2022 um 15:08:48 +0200 schrieb Alexander Kanavin
<alex.kanavin@gmail.com>:
> Can you describe in more detail what the problem is (e.g. an example
> of incorrect output), and what changes with this patch?
>
> Alex
>
> On Thu, 29 Sept 2022 at 14:58, Markus Volk <f_l_k@t-online.de
> <mailto:f_l_k@t-online.de>> wrote:
>>
>> Remove the hardcoded root device entry from fstab when updating to
>> avoid duplicate entries.
>>
>> Signed-off-by: Markus Volk <f_l_k@t-online.de
>> <mailto:f_l_k@t-online.de>>
>> ---
>> scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/lib/wic/plugins/imager/direct.py
>> b/scripts/lib/wic/plugins/imager/direct.py
>> index da483daed5..fd86a094d9 100644
>> --- a/scripts/lib/wic/plugins/imager/direct.py
>> +++ b/scripts/lib/wic/plugins/imager/direct.py
>> @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
>> updated = False
>> for part in self.parts:
>> if not part.realnum or not part.mountpoint \
>> - or part.mountpoint == "/" or not
>> part.mountpoint.startswith('/'):
>> + or not part.mountpoint.startswith('/'):
>> continue
>>
>> if part.use_uuid:
>> @@ -145,6 +145,11 @@ class DirectPlugin(ImagerPlugin):
>> fstab_lines.append(line)
>> updated = True
>>
>> + for line in fstab_lines:
>> + if '/dev/root' in line:
>> + fstab_lines.remove(line)
>> + updated = True
>> +
>> if updated:
>> self.updated_fstab_path = os.path.join(self.workdir,
>> "fstab")
>> with open(self.updated_fstab_path, "w") as f:
>> --
>> 2.34.1
>>
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#171187):
> <https://lists.openembedded.org/g/openembedded-core/message/171187>
> Mute This Topic: <https://lists.openembedded.org/mt/93993381/3618223>
> Group Owner: openembedded-core+owner@lists.openembedded.org
> <mailto:openembedded-core+owner@lists.openembedded.org>
> Unsubscribe:
> <https://lists.openembedded.org/g/openembedded-core/unsub>
> [f_l_k@t-online.de <mailto:f_l_k@t-online.de>]
> -=-=-=-=-=-=-=-=-=-=-=-
>
[-- Attachment #2: Type: text/html, Size: 2742 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device
2022-09-29 12:57 [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device Markus Volk
2022-09-29 13:08 ` Alexander Kanavin
@ 2022-09-29 15:32 ` Richard Purdie
2022-09-29 15:56 ` Markus Volk
[not found] ` <17195FE5AE38CC13.31922@lists.openembedded.org>
1 sibling, 2 replies; 6+ messages in thread
From: Richard Purdie @ 2022-09-29 15:32 UTC (permalink / raw)
To: Markus Volk, openembedded-core; +Cc: ross.burton
On Thu, 2022-09-29 at 14:57 +0200, Markus Volk wrote:
> Remove the hardcoded root device entry from fstab when updating to
> avoid duplicate entries.
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
> scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
> index da483daed5..fd86a094d9 100644
> --- a/scripts/lib/wic/plugins/imager/direct.py
> +++ b/scripts/lib/wic/plugins/imager/direct.py
> @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> updated = False
> for part in self.parts:
> if not part.realnum or not part.mountpoint \
> - or part.mountpoint == "/" or not part.mountpoint.startswith('/'):
> + or not part.mountpoint.startswith('/'):
> continue
>
> if part.use_uuid:
> @@ -145,6 +145,11 @@ class DirectPlugin(ImagerPlugin):
> fstab_lines.append(line)
> updated = True
>
> + for line in fstab_lines:
> + if '/dev/root' in line:
> + fstab_lines.remove(line)
> + updated = True
> +
Do we need to worry here about whether we're actually adding a new root
entry? Is there a case it does need to be preserved?
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-09-29 16:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 12:57 [oe-core][PATCH] wic-imager-direct.py: use fstab update also for root device Markus Volk
2022-09-29 13:08 ` Alexander Kanavin
2022-09-29 15:10 ` Markus Volk
2022-09-29 15:32 ` Richard Purdie
2022-09-29 15:56 ` Markus Volk
[not found] ` <17195FE5AE38CC13.31922@lists.openembedded.org>
2022-09-29 16:27 ` Markus Volk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox