X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fbase-files%2Ffiles%2Flib%2Ffunctions%2Fboot.sh;h=8c3f27ba4fedbe22097abdf7f5e4486909f650be;hb=41d413b29cf9461f501c280e1ede2280f7932557;hp=a8832413501bfc949fc30888312c30b7558fe978;hpb=ec5075b896db066cf03f4ea4fd321602c761fe97;p=openwrt.git diff --git a/package/base-files/files/lib/functions/boot.sh b/package/base-files/files/lib/functions/boot.sh index a883241350..8c3f27ba4f 100644 --- a/package/base-files/files/lib/functions/boot.sh +++ b/package/base-files/files/lib/functions/boot.sh @@ -71,28 +71,28 @@ boot_run_hook() { find_mtd_part() { local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')" local PREFIX=/dev/mtdblock - + PART="${PART##mtd}" [ -d /dev/mtdblock ] && PREFIX=/dev/mtdblock/ echo "${PART:+$PREFIX$PART}" } jffs2_ready () { - mtdpart="$(find_mtd_part rootfs_data)" - [ -z "$mtdpart" ] && return 1 - magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"') - [ "$magic" != "deadc0de" ] + mtdpart="$(find_mtd_part rootfs_data)" + [ -z "$mtdpart" ] && return 1 + magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"') + [ "$magic" != "deadc0de" ] } dupe() { # cd $1 echo -n "creating directories... " { - cd $2 + cd $2 find . -xdev -type d echo "./dev ./overlay ./mnt ./proc ./tmp" # xdev skips mounted directories - cd $1 + cd $1 } | xargs mkdir -p echo "done" @@ -125,11 +125,13 @@ pivot() { # fopivot() { # root=$1 { - if grep -q mini_fo /proc/filesystems; then + if grep -q overlay /proc/filesystems; then + mount -t overlayfs -olowerdir=/,upperdir=$1 "overlayfs:$1" /mnt && root=/mnt + elif grep -q mini_fo /proc/filesystems; then mount -t mini_fo -o base=/,sto=$1 "mini_fo:$1" /mnt 2>&- && root=/mnt else mount --bind / /mnt - mount --bind -o union "$1" /mnt && root=/mnt + mount --bind -o union "$1" /mnt && root=/mnt fi } || { [ "$3" = "1" ] && {