}
pivot() { # <new_root> <old_root>
- mount -o noatime,move /proc $1/proc && \
+ /bin/mount -o noatime,move /proc $1/proc && \
pivot_root $1 $1$2 && {
- mount -o noatime,move $2/dev /dev
- mount -o noatime,move $2/tmp /tmp
- mount -o noatime,move $2/sys /sys 2>&-
- mount -o noatime,move $2/overlay /overlay 2>&-
+ /bin/mount -o noatime,move $2/dev /dev
+ /bin/mount -o noatime,move $2/tmp /tmp
+ /bin/mount -o noatime,move $2/sys /sys 2>&-
+ /bin/mount -o noatime,move $2/overlay /overlay 2>&-
return 0
}
}
root=$1
{
if grep -q overlay /proc/filesystems; then
- mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt && root=/mnt
+ /bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt && root=/mnt
elif grep -q mini_fo /proc/filesystems; then
- mount -t mini_fo -o noatime,base=/,sto=$1 "mini_fo:$1" /mnt 2>&- && root=/mnt
+ /bin/mount -t mini_fo -o noatime,base=/,sto=$1 "mini_fo:$1" /mnt 2>&- && root=/mnt
else
- mount --bind -o noatime / /mnt
- mount --bind -o noatime,union "$1" /mnt && root=/mnt
+ /bin/mount --bind -o noatime / /mnt
+ /bin/mount --bind -o noatime,union "$1" /mnt && root=/mnt
fi
} || {
[ "$3" = "1" ] && {
- mount | grep "on $1 type" 2>&- 1>&- || mount -o noatime,bind $1 $1
+ /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o noatime,bind $1 $1
dupe $1 $rom
}
}
ramoverlay() {
mkdir -p /tmp/root
- mount -t tmpfs -o noatime,mode=0755 root /tmp/root
+ /bin/mount -t tmpfs -o noatime,mode=0755 root /tmp/root
fopivot /tmp/root /rom 1
}
}
supivot() { # <new_root> <old_root>
- mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1
+ /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
- mount -o noatime,move /proc $1/proc && \
+ /bin/mount -o noatime,move /proc $1/proc && \
pivot_root $1 $1$2 || {
- umount -l $1 $1
+ /bin/umount -l $1 $1
return 1
}
- mount -o noatime,move $2/sys /sys
- mount -o noatime,move $2/dev /dev
- mount -o noatime,move $2/tmp /tmp
- mount -o noatime,move $2/overlay /overlay 2>&-
+ /bin/mount -o noatime,move $2/sys /sys
+ /bin/mount -o noatime,move $2/dev /dev
+ /bin/mount -o noatime,move $2/tmp /tmp
+ /bin/mount -o noatime,move $2/overlay /overlay 2>&-
return 0
}
exit 1
}
- mount -o remount,ro /mnt
- umount -l /mnt
+ /bin/mount -o remount,ro /mnt
+ /bin/umount -l /mnt
grep /overlay /proc/mounts > /dev/null && {
- mount -o noatime,remount,ro /overlay
- umount -l /overlay
+ /bin/mount -o noatime,remount,ro /overlay
+ /bin/umount -l /overlay
}
# spawn a new shell from ramdisk to reduce the probability of cache issues
}
rootfs_type() {
- mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }'
+ /bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }'
}
get_image() { # <source> [ <command> ]