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