add preinit modularization work by Daniel Dickinson (cshore)
[openwrt/svn-archive/archive.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 remount,rw /dev/root /
9 }
10
11 check_for_mtd() {
12 check_skip || {
13 grep rootfs_data /proc/mtd >/dev/null 2>/dev/null || {
14 mount_no_mtd && pi_mount_skip_next=true
15 }
16 }
17 }
18
19 boot_hook_add preinit_mount_root check_for_mtd
20