ovl/squash
This commit is contained in:
parent
c4b7796bb3
commit
bb76a2f956
1 changed files with 20 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue