← Back to team overview

curtin-dev team mailing list archive

[Merge] ~nexusprism/curtin:master into curtin:master

 

Alexander Koskovich has proposed merging ~nexusprism/curtin:master into curtin:master.

Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~nexusprism/curtin/+git/curtin/+merge/439880
-- 
Your team curtin developers is requested to review the proposed merge of ~nexusprism/curtin:master into curtin:master.
diff --git a/curtin/block/deps.py b/curtin/block/deps.py
index ec5fe83..8a310b6 100644
--- a/curtin/block/deps.py
+++ b/curtin/block/deps.py
@@ -63,6 +63,7 @@ def detect_required_packages_mapping(osfamily=DISTROS.debian):
             'ext2': ['e2fsprogs'],
             'ext3': ['e2fsprogs'],
             'ext4': ['e2fsprogs'],
+            'f2fs': ['f2fs-tools'],
             'jfs': ['jfsutils'],
             'iscsi': ['open-iscsi'],
             'lvm_partition': ['lvm2'],
@@ -82,6 +83,7 @@ def detect_required_packages_mapping(osfamily=DISTROS.debian):
             'ext2': ['e2fsprogs'],
             'ext3': ['e2fsprogs'],
             'ext4': ['e2fsprogs'],
+            'f2fs': ['f2fs-tools'],
             'jfs': [],
             'iscsi': ['iscsi-initiator-utils'],
             'lvm_partition': ['lvm2'],
@@ -101,6 +103,7 @@ def detect_required_packages_mapping(osfamily=DISTROS.debian):
             'ext2': ['e2fsprogs'],
             'ext3': ['e2fsprogs'],
             'ext4': ['e2fsprogs'],
+            'f2fs': ['f2fs-tools'],
             'jfs': ['jfsutils'],
             'iscsi': [],
             'lvm_partition': ['lvm2'],
diff --git a/curtin/block/mkfs.py b/curtin/block/mkfs.py
index ea5f09d..20ee7b8 100644
--- a/curtin/block/mkfs.py
+++ b/curtin/block/mkfs.py
@@ -16,6 +16,7 @@ mkfs_commands = {
     "ext2": "mkfs.ext2",
     "ext3": "mkfs.ext3",
     "ext4": "mkfs.ext4",
+    "f2fs": "mkfs.f2fs",
     "fat": "mkfs.vfat",
     "fat12": "mkfs.vfat",
     "fat16": "mkfs.vfat",
@@ -41,6 +42,7 @@ specific_to_family = {
 label_length_limits = {
     "btrfs": 256,
     "ext": 16,
+    "f2fs": 512,  # https://docs.kernel.org/filesystems/f2fs.html
     "fat": 11,
     "jfs": 16,  # see jfs_tune manpage
     "ntfs": 32,
@@ -54,6 +56,7 @@ family_flag_mappings = {
     # flag with no parameter
     "force": {"btrfs": "--force",
               "ext": "-F",
+              "f2fs": "-f",
               "fat": "-I",
               "jfs": "-q",
               "ntfs": "--force",
@@ -62,6 +65,7 @@ family_flag_mappings = {
               "xfs": "-f"},
     "label": {"btrfs": ("--label", "{label}"),
               "ext": ("-L", "{label}"),
+              "f2fs": ("-l", "{label}"),
               "fat": ("-n", "{label}"),
               "jfs": ("-L", "{label}"),
               "ntfs": ("--label", "{label}"),
@@ -70,18 +74,21 @@ family_flag_mappings = {
               "xfs": ("-L", "{label}")},
     # flag with no parameter, N.B: this isn't used/exposed
     "quiet": {"ext": "-q",
+              "f2fs": "-q",
               "ntfs": "-q",
               "reiserfs": "-q",
               "xfs": "--quiet"},
     "sectorsize": {
         "btrfs": ("--sectorsize", "{sectorsize}",),
         "ext": ("-b", "{sectorsize}"),
+        "f2fs": ("-w", "{sectorsize}"),
         "fat": ("-S", "{sectorsize}"),
         "ntfs": ("--sector-size", "{sectorsize}"),
         "reiserfs": ("--block-size", "{sectorsize}"),
         "xfs": ("-s", "{sectorsize}")},
     "uuid": {"btrfs": ("--uuid", "{uuid}"),
              "ext": ("-U", "{uuid}"),
+             "f2fs": ("-U", "{uuid}"),
              "reiserfs": ("--uuid", "{uuid}"),
              "swap": ("--uuid", "{uuid}"),
              "xfs": ("-m", "uuid={uuid}")},
diff --git a/curtin/block/schemas.py b/curtin/block/schemas.py
index 3278331..60807d9 100644
--- a/curtin/block/schemas.py
+++ b/curtin/block/schemas.py
@@ -4,7 +4,7 @@ _uuid_pattern = (
     r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')
 _path_dev = r'^/dev/[^/]+(/[^/]+)*$'
 _path_nondev = r'(^/$|^(/[^/]+)+$)'
-_fstypes = ['btrfs', 'ext2', 'ext3', 'ext4', 'fat', 'fat12', 'fat16', 'fat32',
+_fstypes = ['btrfs', 'ext2', 'ext3', 'ext4', 'f2fs', 'fat', 'fat12', 'fat16', 'fat32',
             'iso9660', 'vfat', 'jfs', 'ntfs', 'reiserfs', 'swap', 'xfs',
             'zfsroot']
 _ptable_unsupported = 'unsupported'
diff --git a/curtin/deps/__init__.py b/curtin/deps/__init__.py
index a9f38d1..689f952 100644
--- a/curtin/deps/__init__.py
+++ b/curtin/deps/__init__.py
@@ -30,6 +30,7 @@ REQUIRED_EXECUTABLES = [
     ('mkfs.vfat', 'dosfstools'),
     ('mkfs.btrfs', '^btrfs-(progs|tools)$'),
     ('mkfs.ext4', 'e2fsprogs'),
+    ('mkfs.f2fs', 'f2fs-tools'),
     ('mkfs.xfs', 'xfsprogs'),
     ('partprobe', 'parted'),
     ('sgdisk', 'gdisk'),
diff --git a/debian/control b/debian/control
index a35cbf6..0527580 100644
--- a/debian/control
+++ b/debian/control
@@ -25,6 +25,7 @@ Priority: extra
 Depends: bcache-tools,
          btrfs-progs | btrfs-tools,
          dosfstools,
+         f2fs-tools,
          file,
          gdisk,
          lvm2,

Follow ups