F2FS filesystem doesn't support errors=remount-ro mount option master
authorMichael Prokop <mika@grml.org>
Tue, 19 Jan 2021 22:26:52 +0000 (23:26 +0100)
committerMichael Prokop <mika@grml.org>
Wed, 20 Jan 2021 10:17:15 +0000 (11:17 +0100)
Fixes:

| [   94.941005] F2FS-fs (sda1): Unrecognized mount option "errors=remount-ro" or missing value
| mount: /: mount point not mounted or bad option

Closes: grml/grml-debootstrap#163

chroot-script
grml-debootstrap

index a5f92c4..a27dd58 100755 (executable)
@@ -481,7 +481,15 @@ createfstab(){
 EOF
 
   if [ -n "$TARGET_UUID" ] ; then
-    echo "/dev/disk/by-uuid/${TARGET_UUID} /  auto    defaults,errors=remount-ro 0   1" >> /etc/fstab
+    local rootfs_mount_options=",errors=remount-ro"
+    case "${FILESYSTEM}" in
+      f2fs)
+        # errors=remount-ro is unsupported, see https://github.com/grml/grml-debootstrap/issues/163
+        rootfs_mount_options=""
+        ;;
+    esac
+
+    echo "/dev/disk/by-uuid/${TARGET_UUID} /  auto    defaults${rootfs_mount_options} 0   1" >> /etc/fstab
   else
     echo "Warning: couldn't identify target UUID for rootfs, your /etc/fstab might be incomplete."
   fi
index e51f7bf..586edd8 100755 (executable)
@@ -394,7 +394,7 @@ while :; do
     shift; _opt_debopt="$1"
     ;;
   --filesystem)        # Filesystem that should be used
-    shift; _opt_filesystem="$1"
+    shift; _opt_filesystem="$1" ; FILESYSTEM="${_opt_filesystem}"
     ;;
   --interactive)       # Use interactive mode (frontend)
     _opt_interactive=T
@@ -1671,6 +1671,7 @@ preparechroot() {
   [ -n "$EXTRAPACKAGES" ]       && echo "EXTRAPACKAGES='$(sed "s,','\\\\'',g" <<<"${EXTRAPACKAGES}")'"             >> "$CHROOT_VARIABLES"
   [ -n "$EFI" ]                 && echo "EFI='$(sed "s,','\\\\'',g" <<<"${EFI}")'"                                 >> "$CHROOT_VARIABLES"
   [ -n "$FALLBACK_MIRROR" ]     && echo "FALLBACK_MIRROR='$(sed "s,','\\\\'',g" <<<"${FALLBACK_MIRROR}")'"         >> "$CHROOT_VARIABLES"
+  [ -n "$FILESYSTEM" ]          && echo "FILESYSTEM='$(sed "s,','\\\\'',g" <<<"${FILESYSTEM}")'"                   >> "$CHROOT_VARIABLES"
   [ -n "$FORCE" ]               && echo "FORCE='$(sed "s,','\\\\'',g" <<<"${FORCE}")'"                             >> "$CHROOT_VARIABLES"
   [ -n "$GRMLREPOS" ]           && echo "GRMLREPOS='$(sed "s,','\\\\'',g" <<<"${GRMLREPOS}")'"                     >> "$CHROOT_VARIABLES"
   [ -n "$GRUB" ]                && echo "GRUB='$(sed "s,','\\\\'',g" <<<"${GRUB}")'"                               >> "$CHROOT_VARIABLES"