cb743ea75cc9861f28ca6f25339a2992a8d5ac45
[openwrt/svn-archive/archive.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 mkdir -p /tmp/overlay
7 mount "$(find_mtd_part rootfs_data)" /tmp/overlay -t jffs2
8 }
9
10 jffs2_not_mounted() {
11 if [ "$pi_jffs2_mount_success" != "true" ]; then
12 return 0
13 else
14 return 1
15 fi
16 }
17
18 do_mount_jffs2() {
19 check_skip || {
20 find_mount_jffs2 && pi_jffs2_mount_success=true
21 }
22 }
23
24 boot_hook_add preinit_mount_root do_mount_jffs2
25