Support F2FS in VMs by including f2fs driver in grub-mkimage
[grml-debootstrap.git] / grml-debootstrap
index 97b1927..e51f7bf 100755 (executable)
@@ -183,10 +183,18 @@ fi
 # }}}
 
 # early helper functions {{{
-GOOD='\e[32;01m'
-BAD='\e[31;01m'
-WARN='\e[33;01m'
-NORMAL='\e[0m'
+# skip colors when running within a dumb terminal
+if [ "${TERM}" = "dumb" ] ; then
+  GOOD=
+  BAD=
+  WARN=
+  NORMAL=
+else
+  GOOD='\e[32;01m'
+  BAD='\e[31;01m'
+  WARN='\e[33;01m'
+  NORMAL='\e[0m'
+fi
 
 einfo() {
   einfon "$1\\n"
@@ -1523,7 +1531,16 @@ if [[ -z "${GRUB}" ]] || ! dd if="${GRUB}" bs=512 count=1 2>/dev/null | cat -v |
       ;;
   esac
   dd if="${MNTPOINT}/usr/lib/grub/i386-pc/boot.img" of="${ORIG_TARGET}" conv=notrunc bs=440 count=1
-  chroot "${MNTPOINT}" grub-mkimage -O i386-pc -p "(hd0,msdos1)/boot/grub" -o /tmp/core.img biosdisk part_msdos ext2
+  case "${_opt_filesystem}" in
+    f2fs)
+      chroot "${MNTPOINT}" grub-mkimage -O i386-pc -p "(hd0,msdos1)/boot/grub" -o /tmp/core.img biosdisk part_msdos f2fs
+      ;;
+      # NOTE - we might need to distinguish between further filesystems
+      *)
+      chroot "${MNTPOINT}" grub-mkimage -O i386-pc -p "(hd0,msdos1)/boot/grub" -o /tmp/core.img biosdisk part_msdos ext2
+      ;;
+  esac
+
   dd if="${MNTPOINT}/tmp/core.img" of="${ORIG_TARGET}" conv=notrunc seek=1
   rm -f "${MNTPOINT}/tmp/core.img"
 fi