fix /tmp/menhera.sh: line 178: /usr/bin/mount: No such file or directory

This commit is contained in:
James Swineson 2020-03-20 23:01:39 +08:00 committed by GitHub
parent 0a922ee794
commit d411f9d414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -175,7 +175,11 @@ menhera::swap_root() {
NEWROOT="/" NEWROOT="/"
# move mounts # move mounts
for i in dev proc sys run; do mount --move "${OLDROOT}/$i" "${NEWROOT}/$i"; done for i in dev proc sys run; do
if [ -d "${OLDROOT}/$i" ]; then
mount --move "${OLDROOT}/$i" "${NEWROOT}/$i"
fi
done
mount -t tmpfs -o size=100% tmpfs "${NEWROOT}/tmp" mount -t tmpfs -o size=100% tmpfs "${NEWROOT}/tmp"
mkdir -p "${WORKDIR}" mkdir -p "${WORKDIR}"