f2fs should be recognized by casper as a supported fs

Bug #2058826 reported by Adam Vodopjan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu iso images bundle the f2fs driver in initrd since 20.04, but casper does not recognize f2fs as a supported fs even in 24.04. Hence, the images cant loop-boot from f2fs partitions.

A 2-lines change is all that's required since 20.04 (casper-helpers since 22.04, previously this code was in lupin-helpers)

    --- casper-helpers
    +++ casper-helpers.new
    @@ -350,7 +350,7 @@
     is_supported_fs(){
         [ -z "${1}" ] && return 1
         case ${1} in
    - ext2|ext3|ext4|xfs|jfs|reiserfs|vfat|ntfs|iso9660|btrfs|udf)
    + ext2|ext3|ext4|xfs|jfs|f2fs|reiserfs|vfat|ntfs|iso9660|btrfs|udf)
                 return 0
                 ;;
         esac
    @@ -370,6 +370,7 @@
         modprobe reiserfs
         modprobe xfs
         modprobe jfs
    + modprobe f2fs
         modprobe vfat
         modprobe fuse
         [ "$quiet" != "y" ] && log_end_msg "...devs loaded..."

With some efforts (copy f2fs and crc32 modules from the squashed filesystem into the initrd) it works down to 18.04 live server and 15.10 desktop.

With such patch it works in 14.04.3 .. 14.04.6 desktop as well

    --- casper-helpers
    +++ casper-helpers.new
    @@ -46,7 +46,15 @@
             echo $FSTYPE
             return 0
         fi
    - /sbin/blkid -s TYPE -o value $1 2>/dev/null
    + /sbin/blkid -s TYPE -o value $1 2>/dev/null || {
    + # Check for f2fs
    + case "$(dd if="$1" skip=2 count=1 2>/dev/null)" in
    + "$(printf '\x10\x20\xf5\xf2')"*)
    + echo f2fs
    + return 0 ;;
    + esac
    + return 1
    + }
     }

     where_is_mounted() {

My script to apply the changes: https://github.com/slowpeek/ubuntu-remaster-f2fs

Adam Vodopjan (grozzly)
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Adam Vodopjan (grozzly) wrote :

The script from the post is deprecated now, I converted it into a generic "make casper aware of fs X, add kernel modules Y to the initrd" one.

You can get it here https://github.com/slowpeek/ubuntu-remaster-bbb and make 14.04+ images bootable from f2fs like this:

  ubuntu-remaster-f2fs input.iso output.iso

or, without the f2fs shortcut:

  ubuntu-remaster-bbb --fs f2fs --module f2fs,~crc32_generic,~crc32-pclmul input.iso output.iso

If using the docker image:

  ubuntu-remaster-bbb.docker --fs f2fs --module f2fs,~crc32_generic,~crc32-pclmul -- input.iso output.iso

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.