[1/1] wic/plugins/images/direct: Allow changes in fstab on rootfs

Message ID 20220517184816.1348026-2-tobiasschmidl@siemens.com
State Accepted, archived
Commit 20d43a2599d7622b96e2fb0da87a886da1a3794a
Headers show
Series wic/plugins/images/direct: Allow changes in fstab on rootfs | expand

Commit Message

Tobias Schmidl May 17, 2022, 6:48 p.m. UTC
Allow wic to also manipulate the rootfs entry in fstab, which it
currently refuses to write. Reasons one might want to do that include
using systemd-growfs via --fsoptions on /
With this change / is now handled exactly the same as other
mountpoints, the former exception seemingly was not even documented.

Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
---
 scripts/lib/wic/plugins/imager/direct.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Ceresoli May 19, 2022, 1:34 p.m. UTC | #1
Hello Tobias,

Il giorno Tue, 17 May 2022 20:48:16 +0200
"Tobias Schmidl" <tobiasschmidl@siemens.com> ha scritto:

> Allow wic to also manipulate the rootfs entry in fstab, which it
> currently refuses to write. Reasons one might want to do that include
> using systemd-growfs via --fsoptions on /
> With this change / is now handled exactly the same as other
> mountpoints, the former exception seemingly was not even documented.
> 
> Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>

The autobuilders found some errors while building with this patch on my
testing branch:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3600/steps/15/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/3544/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3566/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/3606/steps/14/logs/stdio
Tobias Schmidl May 19, 2022, 3:07 p.m. UTC | #2
Hello Luca,

Am Donnerstag, dem 19.05.2022 um 15:34 +0200 schrieb Luca Ceresoli:
> 
> > Allow wic to also manipulate the rootfs entry in fstab, which it
> > currently refuses to write. Reasons one might want to do that include
> > using systemd-growfs via --fsoptions on /
> > With this change / is now handled exactly the same as other
> > mountpoints, the former exception seemingly was not even documented.
> > 
> > Signed-off-by: Tobias Schmidl <tobiasschmidl@siemens.com>
> 
> The autobuilders found some errors while building with this patch on my
> testing branch:
> 

thanks, will look into it.

Kind regards,

Tobias

Patch

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index da483daed5..c44159b235 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: