From bb76a2f956d83c3d1ee0e50c2e46a86f1692e45b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 12:53:01 +0100 Subject: [PATCH] ovl/squash --- sh/alias/overlay.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/sh/alias/overlay.sh b/sh/alias/overlay.sh index 65f1c46..307c470 100644 --- a/sh/alias/overlay.sh +++ b/sh/alias/overlay.sh @@ -82,6 +82,26 @@ a__overlay_root_mount() { ) } +ors() { a__overlay_root_squash "${@}"; } +a__overlay_root_squash() { + local directory="${1}" + local file + local level="${2}" + if [ -n "${directory}" ]; then + if mkdir "${directory}"; then + [ -n "${level}" ] || level="18" + for file in "vmlinuz" "initrd.img"; do + cp "overlay/mount/${file}" "${directory}" + done + mksquashfs \ + "overlay/mount" "${directory}/filesystem.squashfs" \ + -noappend \ + -comp "zstd" -Xcompression-level "${level}" + chown --recursive 1000:1000 "${directory}" + fi + fi +} + oru() { a__overlay_root_unmount "${@}"; } a__overlay_root_unmount() { ( @@ -118,23 +138,3 @@ a__overlay_root_unmount() { return 7 fi } - -ors() { a__overlay_root_squash "${@}"; } -a__overlay_root_squash() { - local directory="${1}" - local file - local level="${2}" - if [ -n "${directory}" ]; then - if mkdir "${directory}"; then - [ -n "${level}" ] || level="18" - for file in "vmlinuz" "initrd.img"; do - cp "overlay/mount/${file}" "${directory}" - done - mksquashfs \ - "overlay/mount" "${directory}/filesystem.squashfs" \ - -noappend \ - -comp "zstd" -Xcompression-level "${level}" - chown --recursive 1000:1000 "${directory}" - fi - fi -}