]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
In the initrd script, use /dev/null instead of /dev2/null, and support
authorTheodore Ts'o <tytso@mit.edu>
Mon, 12 Apr 2004 16:10:50 +0000 (12:10 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 12 Apr 2004 16:10:50 +0000 (12:10 -0400)
converting the root filesystem from ext3 to ext2 and back.

debian/e2fsprogs.initrd

index 7f0f93dca0b3d3434de48f9c4e3313f1c67f9431..12e27152bdd37f73ef8bd11b9a6de450fcff63eb 100644 (file)
@@ -5,23 +5,26 @@ rootdev=$(cat proc/sys/kernel/real-root-dev)
 cmdline=$(cat /proc/cmdline)
 umount -n proc
 if [ $rootdev != 256 ]; then
-    mount -nt proc proc /proc
     mount -nt tmpfs tmpfs /dev2
-    mount -nt devfs devfs /devfs > /dev2/null 2>&1
+    mount -nt proc proc /proc 
+    mount -nt devfs devfs /devfs > /dev/null 2>&1
     get_device
     mount_device
     ext3root=`awk '!/^ *#/ { if (($2 == "/") && ($3 == "ext3")) {print $1;}}' < /mnt/etc/fstab`
-    umount -n /devfs > /dev2/null 2>&1
-    umount -n /mnt > /dev2/null 2>&1
-    umount /mnt > /dev2/null 2>&1
-    if test -n "$ext3root" ; then
+    ext2root=`awk '!/^ *#/ { if (($2 == "/") && ($3 == "ext2")) {print $1;}}' < /mnt/etc/fstab`
+    umount -n /devfs > /dev/null 2>&1
+    umount -n /mnt > /dev/null 2>&1
+    if test -n "$ext3root" -o -n "$ext2root" ; then
        mount -nt tmpfs tmpfs /etc
        echo >> /etc/fstab
-       TUNE2FS_SKIP_MOUNT_CHECK=yes
-       export TUNE2FS_SKIP_MOUNT_CHECK
-       /sbin/tune2fs -O has_journal /dev2/root2 > /dev2/null 2>&1
+       echo >> /etc/mtab
+       if test -n "$ext3root" ; then
+           /sbin/tune2fs -O has_journal /dev2/root2 > /dev/null 2>&1
+       else
+           /sbin/tune2fs -O ^has_journal /dev2/root2 > /dev/null 2>&1
+       fi
        umount -n /etc
     fi
     umount -n /dev2
-    umount -n /proc
+    umount -n /proc > /dev/null 2>&1
 fi