Blob Blame History Raw
From 9f521f76a007437083559dc2997570c88386d56c Mon Sep 17 00:00:00 2001
From: tpg <tpgxyz@gmail.com>
Date: Thu, 30 Jun 2016 21:26:42 +0200
Subject: [PATCH] add support to F2FS filesystem (fsck)

---
 NEWS                               | 3 +++
 modules.d/03rescue/module-setup.sh | 2 +-
 modules.d/95debug/module-setup.sh  | 2 +-
 modules.d/99fs-lib/fs-lib.sh       | 5 +++++
 modules.d/99fs-lib/module-setup.sh | 5 ++++-
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 6d1cd0a..1ec8881 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,9 @@ systemd:
 - add /etc/machine-info
 - fixed systemd-escape call for names beginning with "-"
 
+filesystems:
+- add support to F2FS filesystem (fsck)
+
 network:
 - fix carrier detection
 - correctly set mac address for ip=...:<mtu>:<mac>
diff --git a/modules.d/03rescue/module-setup.sh b/modules.d/03rescue/module-setup.sh
index f9dfcda..9267914 100755
--- a/modules.d/03rescue/module-setup.sh
+++ b/modules.d/03rescue/module-setup.sh
@@ -15,6 +15,6 @@ depends() {
 install() {
     inst_multiple -o ps grep more cat rm strace free showmount \
         ping netstat rpcinfo vi scp ping6 ssh \
-        fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
+        fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
 }
 
diff --git a/modules.d/95debug/module-setup.sh b/modules.d/95debug/module-setup.sh
index 97b2a30..39debd8 100755
--- a/modules.d/95debug/module-setup.sh
+++ b/modules.d/95debug/module-setup.sh
@@ -16,7 +16,7 @@ install() {
     inst_multiple -o cat ls ps grep more cat rm strace free showmount \
                   ping netstat rpcinfo vi scp ping6 ssh find vi \
                   tcpdump cp less hostname mkdir \
-                  fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
+                  fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
 
     grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
 }
diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh
index 672d027..5c83155 100755
--- a/modules.d/99fs-lib/fs-lib.sh
+++ b/modules.d/99fs-lib/fs-lib.sh
@@ -47,6 +47,11 @@ fsck_able() {
             _drv="_drv=e2fsck fsck_drv_com" &&
             return 0
             ;;
+        f2fs)
+	    type fsck.f2fs >/dev/null 2>&1 &&
+	    _drv="_drv=fsck.f2fs fsck_drv_com" &&
+	    return 0
+	    ;;
         jfs)
             type jfs_fsck >/dev/null 2>&1 &&
             _drv="_drv=jfs_fsck fsck_drv_com" &&
diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh
index f4dbc94..a29a350 100755
--- a/modules.d/99fs-lib/module-setup.sh
+++ b/modules.d/99fs-lib/module-setup.sh
@@ -20,6 +20,9 @@ echo_fs_helper() {
         ext?)
             echo -n " e2fsck "
             ;;
+	f2fs)
+	    echo -n " fsck.f2fs "
+	    ;;
         jfs)
             echo -n " jfs_fsck "
             ;;
@@ -68,7 +71,7 @@ install() {
         _helpers="\
             umount mount /sbin/fsck*
             xfs_db xfs_check xfs_repair xfs_metadump
-            e2fsck jfs_fsck reiserfsck btrfsck
+            e2fsck fsck.f2fs jfs_fsck reiserfsck btrfsck
         "
         if [[ $hostonly ]]; then
             _helpers="umount mount "