
# Add hook to remount the rom rootfs as read-only after do_mount_root() mounts it
do_remount_root_ro() {
        [ -d /rom/bin ] && echo "preinit - re-mounting root at /rom as read-only" ; mount /rom -o remount,ro
        if [ ! -d /overlay/upper ] ; then
                echo "preinit - force repair (-y) of /overlay"
                /usr/sbin/fsck.ext4 -y /dev/mmcblk1p4
                mount /dev/mmcblk1p4 /overlay
        fi
}

[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_mount_root do_remount_root_ro