This commit is contained in:
Marc Beninca 2025-07-27 14:47:23 +02:00
parent 46058c59a6
commit ea3c077d05
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,7 +1,7 @@
# overlay functions to manipulate squashfs manually
#= obm
a__overlay_bind_mount() {
rwx_overlay_bind_mount() {
local directory
for directory in "dev" "dev/pts" "proc" "sys"; do
if ! mount --bind "/${directory}" "overlay/mount/${directory}"; then
@ -12,7 +12,7 @@ a__overlay_bind_mount() {
}
#= obu
a__overlay_bind_unmount() {
rwx_overlay_bind_unmount() {
local directory
for directory in "sys" "proc" "dev/pts" "dev"; do
if ! umount --lazy "overlay/mount/${directory}"; then
@ -23,30 +23,35 @@ a__overlay_bind_unmount() {
}
#= ocr
a__overlay_command_root() {
rwx_overlay_command_root() {
chroot \
"overlay/mount" "${@}"
}
#= ocu
a__overlay_command_user() {
rwx_overlay_command_user() {
chroot \
--userspec "1000:1000" \
"overlay/mount" "${@}"
}
#= omm
a__overlay_mirror_mount() {
mount --make-rslave --rbind "/deb" "overlay/mount/deb"
rwx_overlay_mirror_mount() {
mount \
--make-rslave \
--rbind "/deb" "overlay/mount/deb"
}
#= omu
a__overlay_mirror_unmount() {
umount --recursive "overlay/mount/deb"
rwx_overlay_mirror_unmount() {
umount \
--recursive \
"overlay/mount/deb"
}
#= orm
a__overlay_root_mount() {
#| mount
rwx_overlay_root_mount() {
local root="${1}"
if [ -z "${root}" ]; then
rwx_log_error "No root target directory"
@ -85,7 +90,11 @@ a__overlay_root_mount() {
}
#= ors
a__overlay_root_squash() {
#| mkdir
#| cp
#| mksquashfs
#| chown
rwx_overlay_root_squash() {
local directory="${1}"
local file
local level="${2}"
@ -105,7 +114,12 @@ a__overlay_root_squash() {
}
#= oru
a__overlay_root_unmount() {
#| umount
#| rmdir
#| rm
#| umount
#| rmdir
rwx_overlay_root_unmount() {
(
if ! cd "overlay"; then
rwx_log_error "Unable to move into overlay directory"