1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-05 16:54:59 +02:00
openwrt-xburst/package/base-files/files/sbin/mount_root
mbm 3fef5a6916 mount_root should only mount the root
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7418 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-05-31 12:09:08 +00:00

26 lines
553 B
Bash
Executable File

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
. /etc/functions.sh
jffs2_ready () {
mtdpart="$(find_mtd_part rootfs_data)"
magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
[ "$magic" != "deadc0de" ]
}
grep rootfs_data /proc/mtd >/dev/null 2>/dev/null && {
. /bin/firstboot
mtd unlock rootfs_data
jffs2_ready && {
echo "switching to jffs2"
mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2 && \
fopivot /jffs /rom
} || {
echo "jffs2 not ready yet; using ramdisk"
ramoverlay
}
} || {
mtd unlock rootfs
mount -o remount,rw /dev/root /
}