From 04c86478c3968aa9cdc8d910ed7517c742b695c7 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 2 Nov 2025 18:41:32 +0100 Subject: [PATCH] board/common: fix boot warnings, follow-up to 45efa94 In 45efa94 we introduced new mount options for the: 'aux', 'cfg', and 'var' partitions. To save boot time, we also disabled the periodic fsck check, which does not affect journal replay or other Ext4 safety or integrity checks. The latter involved calling tune2fs at runtime, but this caused the following to appear for the 'aux' partition, which is a reduced ext4 for systems that need to change U-Boot settings, e.g., to set MAC address on systems without a VPD. EXT4-fs: Mount option(s) incompatible with ext2 Note, this is a "bogus" warning, setting the fstypt to ext2 in fstab is not the way around this one. That's been tried. To make matters worse, the new mount option(s), e.g., 'commit=30', gave us another set of warnings from the kernel. This was due to the fstype being 'auto', so the kernel objected to options not being applicable to every filesystem it tried before ending up with extfs: squashfs: Unknown parameter 'commit' vfat: Unknown parameter 'commit' exfat: Unknown parameter 'commit' fuseblk: Unknown parameter 'commit' btrfs: Unknown parameter 'errors' This commit explicitly sets cfg and var to ext4, leaving mnt as auto, we also check before calling tune2fs that the partition/disk image is ext4. Signed-off-by: Joachim Wiberg --- board/common/rootfs/etc/fstab | 12 ++++++------ board/common/rootfs/usr/libexec/infix/mnt | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/board/common/rootfs/etc/fstab b/board/common/rootfs/etc/fstab index fc5850c7..70d11aac 100644 --- a/board/common/rootfs/etc/fstab +++ b/board/common/rootfs/etc/fstab @@ -15,9 +15,9 @@ cfgfs /config configfs nofail,noauto 0 0 # The chosen backing storage for the overlays placed on /cfg, /etc, # /home, /root, and /var, are determined dynamically by /usr/libexec/infix/mnt # depending on the available devices. -mnttmp /mnt/tmp tmpfs defaults 0 0 -LABEL=aux /mnt/aux auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0 -LABEL=var /mnt/var auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0 -LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0 -hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0 -/usr/libexec/infix/mnt# /cfg helper none 0 0 +mnttmp /mnt/tmp tmpfs defaults 0 0 +LABEL=aux /mnt/aux auto noatime,nodiratime,noauto,errors=remount-ro 0 0 +LABEL=var /mnt/var ext4 noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0 +LABEL=cfg /mnt/cfg ext4 noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0 +hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0 +/usr/libexec/infix/mnt# /cfg helper none 0 0 diff --git a/board/common/rootfs/usr/libexec/infix/mnt b/board/common/rootfs/usr/libexec/infix/mnt index fdc71f1a..852ead56 100755 --- a/board/common/rootfs/usr/libexec/infix/mnt +++ b/board/common/rootfs/usr/libexec/infix/mnt @@ -292,8 +292,10 @@ mount_rw() # TODO: Also look for UBI partitions - # - tune2fs -c 0 -i 0 LABEL="$1" 2>/dev/null + # Disable periodic fsck, yet keeping safety checks on ext4 + if grep "LABEL=$label" /etc/fstab |grep -q ext4; then + tune2fs -c 0 -i 0 LABEL="$1" 2>/dev/null + fi mount LABEL="$1" 2>/dev/null && return 0 return 1