add preinit modularization work by Daniel Dickinson (cshore)
[openwrt-10.03/.git] / package / base-files / files / lib / preinit / 40_mount_jffs2
1 #!/bin/sh
2 # Copyright (C) 2006-2010 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4
5 find_mount_jffs2() {
6     mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2
7 }
8
9 jffs2_not_mounted() {
10     if [ "$pi_jffs2_mount_success" != "true" ]; then
11         return 0
12     else
13         return 1
14     fi
15 }
16
17 do_mount_jffs2() {
18     check_skip || {
19         find_mount_jffs2 && pi_jffs2_mount_success=true
20     }
21 }
22
23 boot_hook_add preinit_mount_root do_mount_jffs2
24