]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
wic: added fspassno parameter to partition
authorClaudius Heine <ch@denx.de>
Sun, 15 May 2022 06:36:00 +0000 (12:06 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 May 2022 22:18:23 +0000 (23:18 +0100)
The `fspassno` parameter allows to overwrite the value of the last
column (`fs_passno`) in the /etc/fstab of the target root file system.
This allows to have periodic file system checks.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/help.py
scripts/lib/wic/ksparser.py
scripts/lib/wic/partition.py
scripts/lib/wic/plugins/imager/direct.py

index 4ff7470a6a799f004efebdb2d8e4bdada23bbffb..73e3380cde177cfd838e918a21193a49614ebe86 100644 (file)
@@ -940,6 +940,12 @@ DESCRIPTION
                       quotes.  If not specified, the default string is
                       "defaults".
 
+         --fspassno: Specifies the order in which filesystem checks are done
+                     at boot time by fsck.  See fs_passno parameter of
+                     fstab(5).  This parameter will be copied into the
+                     /etc/fstab file of the installed system.  If not
+                     specified the default value of "0" will be used.
+
          --label label: Specifies the label to give to the filesystem
                         to be made on the partition. If the given
                         label is already in use by another filesystem,
index 0df9eb0d057d6718a669b153d173eeaea8527c77..a49b7b97c4eae8980b3a02ec75d26af0cc72a23f 100644 (file)
@@ -155,6 +155,7 @@ class KickStart():
         part.add_argument('--change-directory')
         part.add_argument("--extra-space", type=sizetype("M"))
         part.add_argument('--fsoptions', dest='fsopts')
+        part.add_argument('--fspassno', dest='fspassno')
         part.add_argument('--fstype', default='vfat',
                           choices=('ext2', 'ext3', 'ext4', 'btrfs',
                                    'squashfs', 'vfat', 'msdos', 'erofs',
index 09e491dd494d27ebb558bd983545560c2c250c4f..e50871b8d74952cfcf1828c6118ed2483e68b868 100644 (file)
@@ -33,6 +33,7 @@ class Partition():
         self.include_path = args.include_path
         self.change_directory = args.change_directory
         self.fsopts = args.fsopts
+        self.fspassno = args.fspassno
         self.fstype = args.fstype
         self.label = args.label
         self.use_label = args.use_label
index 4d0b836ef6036e522baab879952b024422abe20c..da483daed5f2c9a0f5c591339ec5f38950a723c1 100644 (file)
@@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
                 device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
 
             opts = part.fsopts if part.fsopts else "defaults"
+            passno = part.fspassno if part.fspassno else "0"
             line = "\t".join([device_name, part.mountpoint, part.fstype,
-                              opts, "0", "0"]) + "\n"
+                              opts, "0", passno]) + "\n"
 
             fstab_lines.append(line)
             updated = True