sgielen / picl-k3os-image-generator

Generate images for k3os compatible with various armv8/aarch64/arm64 devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Perform an fsck of the root filesystem before booting k3os

sgielen opened this issue · comments

In init.preinit, if the filesystem is still mounted read-only, we could perform an fsck to ensure integrity of the root device.

If that changes anything, we should reboot to ensure the filesystem driver doesn't get confused. Since this may trigger a reboot loop, we should print a clear message to the screen and wait for a few seconds before rebooting.

If fsck didn't change anything, the filesystem was OK and we can continue k3os boot.

If the filesystem is already mounted read-write (perhaps the kernel cmdline is incorrect?) we could try to mount it read-only, in the same way init.resizefs does, then perform the fsck like above.