X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/4dbef44bbe1e83c15e58bd4eb6f3aa61fb6af025..80c7b4465b24b96dfb9c6eb48f124ce7fec01823:/package/base-files/files/lib/functions/boot.sh diff --git a/package/base-files/files/lib/functions/boot.sh b/package/base-files/files/lib/functions/boot.sh index a4ec7be5b..8c3f27ba4 100644 --- a/package/base-files/files/lib/functions/boot.sh +++ b/package/base-files/files/lib/functions/boot.sh @@ -71,7 +71,7 @@ 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}" @@ -88,11 +88,11 @@ 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" ] && {