mount
This commit is contained in:
parent
6840588cd5
commit
3b979057c1
1 changed files with 20 additions and 20 deletions
|
@ -4,36 +4,36 @@ local file
|
||||||
if [ "${directory}" ] ; then
|
if [ "${directory}" ] ; then
|
||||||
directory="$(realpath "${directory}")"
|
directory="$(realpath "${directory}")"
|
||||||
file="${directory}/filesystem.squashfs"
|
file="${directory}/filesystem.squashfs"
|
||||||
if mkdir 'overlay' ; then
|
if mkdir "overlay" ; then
|
||||||
cd 'overlay'
|
cd "overlay"
|
||||||
mkdir {lower,upper,work,mount}
|
mkdir {lower,upper,work,mount}
|
||||||
if mount "${file}" 'lower' ; then
|
if mount "${file}" "lower" ; then
|
||||||
mount -t 'overlay' 'overlay' 'mount' \
|
mount -t "overlay" "overlay" "mount" \
|
||||||
-o lowerdir='lower',upperdir='upper',workdir='work'
|
-o lowerdir="lower",upperdir="upper",workdir="work"
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo 'KO: directory?'
|
echo "KO: directory?"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
uo() {
|
uo() {
|
||||||
cd 'overlay'
|
cd "overlay"
|
||||||
if umount 'mount' ; then
|
if umount "mount" ; then
|
||||||
rmdir 'mount'
|
rmdir "mount"
|
||||||
rm --recursive 'upper' 'work'
|
rm --recursive "upper" "work"
|
||||||
if umount 'lower' ; then
|
if umount "lower" ; then
|
||||||
rmdir 'lower'
|
rmdir "lower"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
rmdir 'overlay'
|
rmdir "overlay"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mr() {
|
mr() {
|
||||||
for f in 'dev' 'dev/pts' 'proc' 'sys' ; do
|
for f in "dev" "dev/pts" "proc" "sys" ; do
|
||||||
mount --bind "/${f}" "overlay/mount/${f}"
|
mount --bind "/${f}" "overlay/mount/${f}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -50,18 +50,18 @@ chroot \
|
||||||
"
|
"
|
||||||
|
|
||||||
ur() {
|
ur() {
|
||||||
for f in 'sys' 'proc' 'dev/pts' 'dev' ; do
|
for f in "sys" "proc" "dev/pts" "dev" ; do
|
||||||
umount --lazy "overlay/mount/${f}"
|
umount --lazy "overlay/mount/${f}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mm() {
|
mm() {
|
||||||
mount --make-rslave --rbind '/deb' 'overlay/mount/deb'
|
mount --make-rslave --rbind "/deb" "overlay/mount/deb"
|
||||||
}
|
}
|
||||||
|
|
||||||
um() {
|
um() {
|
||||||
umount --recursive 'overlay/mount/deb'
|
umount --recursive "overlay/mount/deb"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,12 +70,12 @@ local directory="${1}"
|
||||||
local level="${2}"
|
local level="${2}"
|
||||||
if [ "${directory}" ] ; then
|
if [ "${directory}" ] ; then
|
||||||
if mkdir "${directory}" ; then
|
if mkdir "${directory}" ; then
|
||||||
[ "${level}" ] || level='18'
|
[ "${level}" ] || level="18"
|
||||||
cp overlay/mount/{vmlinuz,initrd.img} "${directory}"
|
cp overlay/mount/{vmlinuz,initrd.img} "${directory}"
|
||||||
mksquashfs \
|
mksquashfs \
|
||||||
'overlay/mount' "${directory}/filesystem.squashfs" \
|
"overlay/mount" "${directory}/filesystem.squashfs" \
|
||||||
-noappend \
|
-noappend \
|
||||||
-comp 'zstd' -Xcompression-level "${level}"
|
-comp "zstd" -Xcompression-level "${level}"
|
||||||
chown --recursive 1000:1000 "${directory}"
|
chown --recursive 1000:1000 "${directory}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue