Pack : Add iso pack support.

This commit is contained in:
Dmitry Voronin 2024-02-22 20:46:57 +03:00
parent b405b37871
commit 24da2c529f

View file

@ -45,6 +45,9 @@ function pack() {
"xz") "xz")
_pack_xz "${output}" "${targets[@]}" _pack_xz "${output}" "${targets[@]}"
;; ;;
"iso")
_pack_iso "${output}" "${targets[@]}"
;;
*) *)
_error "${target}: Format not supported." _error "${target}: Format not supported."
return 2 return 2
@ -130,6 +133,23 @@ function _pack_xz() {
pv "${2}" | xz -9e > "${1}" pv "${2}" | xz -9e > "${1}"
} }
function _pack_iso() {
local input=("${@:2}")
local output="${1}"
local args=()
for arg in ${input[@]}; do
[[ -d "${arg}" ]] || {
_error "${arg} is not a directory."
return 1
};
args+=("${arg}=${arg}")
done
genisoimage -J -r -pad -o "${output}" -graft-points "${args[@]}"
}
function _unpack_zip() { function _unpack_zip() {
unzip "${1}" unzip "${1}"
} }