0

I am building a customized kernel for RPi. The problem is that the RPi bootloader requires a vfat /boot partition whereas I intend to minimize the kernel size, so need to remove vfat support from kernel.

I have read Embedded Linux Primer and Linux Kernel Development books. From what I understood, it seems that /boot partition is used by bootloader to look for kernel and initramfs, among some other important files

I tried removing vfat support from the kernel while keeping /boot formatted as vfat. The kernel booted just fine. However, systemd stuck somewhere saying that it failed to mount /boot, whoch is perfectly fine since the kernel doesnt support vfat. Systemd then gave me a rescue shell.

I was wondering that since the RPi bootloader already supports vfat, and is able to load kernel without any issue, is there any way I can ask systemd not to mount /boot at all? As per my understanding, since the kernel is already loaded by this stage, the kernel doesnt need access to the /boot partition.

Any help will be appreciated.

1 Answer 1

1

systemd will try to mount the filesystems you have listed in /etc/fstab, so if you remove /boot from /etc/fstab it shouldn't try to mount it.

(I just tested this on a Fedora system, removed it from /etc/fstab and confirmed it wasn't mounted.)

systemd does have some code to treat EFI partitions specially, so maybe that's what you have on the RPi and that's what is triggering the mount... But that is typically implemented using an auto-mount unit, in other words, it will try to mount it only if someone looks inside /boot.

The logic to mount from /etc/fstab is implemented by systemd-fstab-generator and the logic to mount the EFI partition is implemented by systemd-gpt-auto-generator.

Another useful command is systemctl status /boot (when you have it mounted with the kernel that supports vfat), which can give you more hints on where it's coming from.

1
  • It was indeed simply a matter on commenting out the /boot line in fstab. Thanks.
    – Fulcrum
    Commented Jul 27, 2018 at 11:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .