From 24da2c529fc7b9e27a5b787510f9467972ef1366 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 22 Feb 2024 20:46:57 +0300 Subject: [PATCH] Pack : Add iso pack support. --- .config/bash/module/Pack.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.config/bash/module/Pack.sh b/.config/bash/module/Pack.sh index 7c6ab7e..f882f29 100644 --- a/.config/bash/module/Pack.sh +++ b/.config/bash/module/Pack.sh @@ -45,6 +45,9 @@ function pack() { "xz") _pack_xz "${output}" "${targets[@]}" ;; + "iso") + _pack_iso "${output}" "${targets[@]}" + ;; *) _error "${target}: Format not supported." return 2 @@ -130,6 +133,23 @@ function _pack_xz() { 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() { unzip "${1}" }