[arch-projects] [mkinitcpio][PATCH 2/6] install/fsck: use fsck.ext4 for ext[234]

Dave Reisner d at falconindy.com
Sat Mar 3 17:47:40 EST 2012


e2fsprogs makes a lot of hardlinks for its fsck tools. If ext[234] is
detected, add the fsck.ext4 binary and add symlinks.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
I'm not thrilled with the ext[234] hack, but I also don't like the idea of
duplicating hardlinks as separate files on the image.

 install/fsck |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/install/fsck b/install/fsck
index 9d9943b..b820063 100644
--- a/install/fsck
+++ b/install/fsck
@@ -3,12 +3,22 @@
 build() {
     local added=0
 
+    add_fsck() {
+        if [[ $1 = ext[234] ]]; then
+            add_binary fsck.ext4
+            add_symlink /usr/bin/fsck.ext2 fsck.ext4
+            add_symlink /usr/bin/fsck.ext3 fsck.ext4
+        else
+            add_binary "fsck.$1"
+        fi
+    }
+
     if (( ! fs_autodetect_failed )) && [[ $rootfstype$usrfstype ]]; then
         if [[ $rootfstype ]]; then
-            add_binary fsck.$rootfstype && (( ++added ))
+            add_fsck $rootfstype && (( ++added ))
         fi
         if [[ $usrfstype && $usrfstype != $rootfstype ]]; then
-            add_binary fsck.$usrfstype && (( ++added ))
+            add_fsck $usrfstype && (( ++added ))
         fi
     else
         for fsck in "$BASEDIR"/sbin/fsck.*; do
-- 
1.7.9.2



More information about the arch-projects mailing list