You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
553 B
25 lines
553 B
#!/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 /
|
|
}
|
|
|