RobertCNelson / boot-scripts

Just a bunch of useful scripts placed under /opt/scripts/
124 stars 131 forks source link

get_ext4_options in emmc/functions.sh doesn't disable metadata_csum/64bit on buster image #105

Open az143 opened 4 years ago

az143 commented 4 years ago

the code in question checks if mkeXfs version 1.43 is present and if so it disables metadata_csum and 64bit.

buster and thus your bone-eMMC-flasher-debian-10.1-console-armhf-2019-10-14-1gb.img.xz image has e2fsprogs version 1.44.5, which isn't detected by the current logic.

consequentially all filesystems created with this flasher (and any made with beaglebone-black-make-microSD-flasher-from-eMMC.sh) have these features on and u-boot is unwilling to write to them ("Unsupported feature metadata_csum found, not writing").

btw: your actual image also has these filesystem features enabled.

option one: adjust the version logic to also handle buster's 1.44.5 and up, e.g.

get_ext4_options() {
  # Debian Stretch, Buster e2fsprogs 1.43 and newer:
  # mfks.ext4 default to metadata_csum,64bit disable till u-boot works again..
  unset ext4_options

  # catches 1.43 to 1.49
  if ! LC_ALL=C mkfs.ext4 -V 2>&1|grep mke2fs|cut -f 2 -d " "|grep -Eq '^1\.4[3-9]' ; then
    ext4_options="${mkfs_options}"
  else
    ext4_options="${mkfs_options} -O ^metadata_csum,^64bit"
  fi
}

this works but i find it a bit brittle.

option two: remove the problematic features from the defaults in /etc/mke2fs.conf, and ship that adjusted config file with your image. i.e. mod the ext4 default features line below:

[fs_types]
        ext3 = {
                features = has_journal
        }
        ext4 = {
                features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
                inode_size = 256
        }

personally i'd use that approach as it'll automatically affect all mkfs.ext4 invocations made on that box, no matter whether they go via your flasher helpers or not.

RobertCNelson commented 4 years ago

@az143 sorry, getting back up to speed.. Yes u-boot ext4 options are still broken on u-boot 2019.10? for another board, let's just keep these disabled always.. i think we need to invert the logic.. if wheezy/jessie's mkfs.ext4 is found do the default (as the options make mkfs.ext4 bomb in old mkfs.ext4..), but for everything else disable the options..

Regards,