Boot partition not checked

Systemd is giving me warnings that the vfat boot partition is an unchecked filesystem when it mounts it.

Systemd does have the logic to run fsck on filesystems before mounting them, but it’s not happening.

The problem is how Mender creates the fstab boot partition entry in

printf "%-20s %-20s %-10s %-21s %-2s %s\n" ${tmpBootPart} ${MENDER_BOOT_PART_MOUNT_LOCATION} ${MENDER_BOOT_PART_FSTYPE} ${MENDER
_BOOT_PART_FSTAB_OPTS} 0 0 >> ${IMAGE_ROOTFS}${sysconfdir}/fstab

That final 0 on the end of the fstab line is the fsck pass number. 0 means don’t check. It really should be set to 2 since it’s not the rootfs. Once this is set, systemd’s fstab generator will create a fsck unit for the partition and check it.

There could be another MENDER_BOOT_PART_x variable to set this. Or it could just always be 2. If the partition is not clean, it’s really the best thing to run fsck and try to repair it. Since the environment stuff gets changed with every boot it’s already going to be written to. Using a fat fs with an error in it often makes the error get worse.

Thanks for the suggestion. Do you feel like submitting a PR for this?

@kacf do you have any thoughts?

I agree, it should always be 2. I was knee deep in this section just recently, so I just quickly went ahead and changed it: