From 496ef2073ee09ab1415fc4d5966043e529022d76 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 11 Jul 2019 19:45:41 +0200 Subject: [PATCH] Try to check FS on boot --- root/package/base-files/files/lib/preinit/80_mount_root | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/root/package/base-files/files/lib/preinit/80_mount_root b/root/package/base-files/files/lib/preinit/80_mount_root index 762512bc..ec254a82 100644 --- a/root/package/base-files/files/lib/preinit/80_mount_root +++ b/root/package/base-files/files/lib/preinit/80_mount_root @@ -17,5 +17,8 @@ do_mount_root() { tar xzf sysupgrade.tgz } } - +[ -n "$(mount | grep ext4 | grep ro)" ] && { + [ -e /dev/mmcblk0p2 ] && /usr/sbin/e2fsck -y -v -f /dev/mmcblk0p2 >/dev/null 2>&1 + [ -e /dev/sda2 ] && /usr/sbin/e2fsck -y -v -f /dev/sda2 >/dev/null 2>&1 +} [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root