X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fbase-files%2Ffiles%2Flib%2Ffunctions.sh;h=e05108c76598750d552a4a2511e74b87aeb1073e;hb=3489fabdc6eeea2a276a2a1fb05b9baf4d8de275;hp=e7ca02a655f04225553186f79b72fcb87bc7a99f;hpb=076014b7039fc6092057e170d0f202d30ca8606f;p=openwrt.git diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index e7ca02a655..e05108c765 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -533,40 +533,6 @@ boot_run_hook() { done } -jffs2_ready() { - 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 - find . -xdev -type d - echo "./dev ./overlay ./mnt ./proc ./tmp" - # xdev skips mounted directories - cd $1 - } | xargs mkdir -p - echo "done" - - echo -n "setting up symlinks... " - for file in $(cd $2; find . -xdev -type f;); do - case "$file" in - ./rom/note) ;; #nothing - ./etc/config*|\ - ./usr/lib/opkg/info/*) cp -af $2/$file $file;; - *) ln -sf /rom/${file#./*} $file;; - esac - done - for file in $(cd $2; find . -xdev -type l;); do - cp -af $2/${file#./*} $file - done - echo "done" -} - pivot() { # /bin/mount -o noatime,move /proc $1/proc && \ pivot_root $1 $1$2 && { @@ -579,23 +545,8 @@ pivot() { # } fopivot() { # - root=$1 - { - if grep -q overlay /proc/filesystems; then - /bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt && root=/mnt - elif grep -q mini_fo /proc/filesystems; then - /bin/mount -t mini_fo -o noatime,base=/,sto=$1 "mini_fo:$1" /mnt 2>&- && root=/mnt - else - /bin/mount --bind -o noatime / /mnt - /bin/mount --bind -o noatime,union "$1" /mnt && root=/mnt - fi - } || { - [ "$3" = "1" ] && { - /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o noatime,bind $1 $1 - dupe $1 $rom - } - } - pivot $root $2 + /bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt + pivot /mnt $2 } ramoverlay() {