mkarchiso: make bootstrap tarball extension part of the image_name
This shows the correct image file name in `_show_config` and simplifies actions with the `image_name` in other functions.
This commit is contained in:
parent
fa3aba32c8
commit
654e834f8c
2 changed files with 15 additions and 17 deletions
|
@ -17,6 +17,8 @@ Deprecated
|
||||||
Fixed
|
Fixed
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Show the correct image file name, including the extension, when building a bootstrap image.
|
||||||
|
|
||||||
Removed
|
Removed
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
@ -1687,34 +1687,20 @@ _add_xorrisofs_options_uefi-x64.grub.eltorito() {
|
||||||
|
|
||||||
# Build bootstrap image
|
# Build bootstrap image
|
||||||
_build_bootstrap_image() {
|
_build_bootstrap_image() {
|
||||||
local tarball_ext
|
|
||||||
|
|
||||||
# Set default tarball compression to uncompressed
|
# Set default tarball compression to uncompressed
|
||||||
if (( ! "${#bootstrap_tarball_compression[@]}" )); then
|
if (( ! "${#bootstrap_tarball_compression[@]}" )); then
|
||||||
bootstrap_tarball_compression=('cat')
|
bootstrap_tarball_compression=('cat')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set tarball extension
|
|
||||||
case "${bootstrap_tarball_compression[0]}" in
|
|
||||||
'cat') tarball_ext='' ;;
|
|
||||||
'bzip') tarball_ext='.b2z' ;;
|
|
||||||
'gzip') tarball_ext='.gz' ;;
|
|
||||||
'lrzip') tarball_ext='.lrz' ;;
|
|
||||||
'lzip') tarball_ext='.lz' ;;
|
|
||||||
'lzop') tarball_ext='.lzo' ;;
|
|
||||||
'zstd'|'zstdmt') tarball_ext='.zst' ;;
|
|
||||||
*) _msg_error 'Unsupported compression!' 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[[ -d "${out_dir}" ]] || install -d -- "${out_dir}"
|
[[ -d "${out_dir}" ]] || install -d -- "${out_dir}"
|
||||||
|
|
||||||
cd -- "${bootstrap_parent}"
|
cd -- "${bootstrap_parent}"
|
||||||
|
|
||||||
_msg_info "Creating bootstrap image..."
|
_msg_info "Creating bootstrap image..."
|
||||||
rm -f -- "${out_dir:?}/${image_name:?}${tarball_ext}"
|
rm -f -- "${out_dir:?}/${image_name:?}"
|
||||||
bsdtar -cf - "root.${arch}" "pkglist.${arch}.txt" | "${bootstrap_tarball_compression[@]}" >"${out_dir}/${image_name}${tarball_ext}"
|
bsdtar -cf - "root.${arch}" "pkglist.${arch}.txt" | "${bootstrap_tarball_compression[@]}" >"${out_dir}/${image_name}"
|
||||||
_msg_info "Done!"
|
_msg_info "Done!"
|
||||||
du -h -- "${out_dir}/${image_name}${tarball_ext}"
|
du -h -- "${out_dir}/${image_name}"
|
||||||
cd -- "${OLDPWD}"
|
cd -- "${OLDPWD}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2034,6 +2020,16 @@ _build_buildmode_bootstrap() {
|
||||||
[[ -d "${work_dir}" ]] || install -d -- "${work_dir}"
|
[[ -d "${work_dir}" ]] || install -d -- "${work_dir}"
|
||||||
install -d -m 0755 -o 0 -g 0 -- "${pacstrap_dir}"
|
install -d -m 0755 -o 0 -g 0 -- "${pacstrap_dir}"
|
||||||
|
|
||||||
|
# Set tarball extension
|
||||||
|
case "${bootstrap_tarball_compression[0]}" in
|
||||||
|
'bzip') image_name="${image_name}.b2z" ;;
|
||||||
|
'gzip') image_name="${image_name}.gz" ;;
|
||||||
|
'lrzip') image_name="${image_name}.lrz" ;;
|
||||||
|
'lzip') image_name="${image_name}.lz" ;;
|
||||||
|
'lzop') image_name="${image_name}.lzo" ;;
|
||||||
|
'zstd'|'zstdmt') image_name="${image_name}.zst" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
[[ "${quiet}" == "y" ]] || _show_config
|
[[ "${quiet}" == "y" ]] || _show_config
|
||||||
_run_once _make_pacman_conf
|
_run_once _make_pacman_conf
|
||||||
_run_once _make_packages
|
_run_once _make_packages
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue