From 5d93e311a894169946093956b79f9a27420d1677 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 07:03:46 +0200 Subject: [PATCH] alias/overlay --- sh/alias/overlay.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sh/alias/overlay.sh b/sh/alias/overlay.sh index 6357655..cfba5dd 100644 --- a/sh/alias/overlay.sh +++ b/sh/alias/overlay.sh @@ -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