6a7bd307f8b9b6f052536d14ed0ece727f87758d
[openwrt.git] / package / base-files / files / lib / preinit / 10_check_for_mtd
1 #!/bin/sh
2
3 # Copyright (C) 2006-2010 OpenWrt.org
4 # Copyright (C) 2010 Vertical Communications
5
6 mount_no_mtd() {
7     mtd unlock rootfs
8     mount -o noatime,remount,rw /dev/root /
9 }
10
11 check_for_mtd() {
12     check_skip || {
13         grep -qs rootfs_data /proc/mtd || {
14             mount_no_mtd && pi_mount_skip_next=true
15         }
16     }
17 }
18
19 boot_hook_add preinit_mount_root check_for_mtd
20