alias/overlay

This commit is contained in:
Marc Beninca 2025-07-06 07:03:46 +02:00
parent 8911523e83
commit 5d93e311a8
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,4 +1,6 @@
obm() { a__overlay_bind_mount "${@}"; }
# overlay functions to manipulate squashfs manually
#= obm
a__overlay_bind_mount() {
local directory
for directory in "dev" "dev/pts" "proc" "sys"; do
@ -9,7 +11,7 @@ a__overlay_bind_mount() {
done
}
obu() { a__overlay_bind_unmount "${@}"; }
#= obu
a__overlay_bind_unmount() {
local directory
for directory in "sys" "proc" "dev/pts" "dev"; do
@ -20,30 +22,30 @@ a__overlay_bind_unmount() {
done
}
ocr() { a__overlay_command_root "${@}"; }
#= ocr
a__overlay_command_root() {
chroot \
"overlay/mount" "${@}"
}
ocu() { a__overlay_command_user "${@}"; }
#= ocu
a__overlay_command_user() {
chroot \
--userspec "1000:1000" \
"overlay/mount" "${@}"
}
omm() { a__overlay_mirror_mount "${@}"; }
#= omm
a__overlay_mirror_mount() {
mount --make-rslave --rbind "/deb" "overlay/mount/deb"
}
omu() { a__overlay_mirror_unmount "${@}"; }
#= omu
a__overlay_mirror_unmount() {
umount --recursive "overlay/mount/deb"
}
orm() { a__overlay_root_mount "${@}"; }
#= orm
a__overlay_root_mount() {
local root="${1}"
if [ -z "${root}" ]; then
@ -82,7 +84,7 @@ a__overlay_root_mount() {
)
}
ors() { a__overlay_root_squash "${@}"; }
#= ors
a__overlay_root_squash() {
local directory="${1}"
local file
@ -102,7 +104,7 @@ a__overlay_root_squash() {
fi
}
oru() { a__overlay_root_unmount "${@}"; }
#= oru
a__overlay_root_unmount() {
(
if ! cd "overlay"; then