From b8ef05211746327a26b70fa13c137bc70db4f5fd Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Wed, 9 Feb 2022 09:59:28 +0100 Subject: [PATCH] fix container creation --- usr/bin/archboot-aarch64-create-container.sh | 19 +++++++++---------- usr/bin/archboot-aarch64-iso.sh | 2 +- usr/bin/archboot-x86_64-create-container.sh | 11 ++++++----- usr/bin/archboot-x86_64-iso.sh | 2 +- usr/lib/archboot/container_functions | 6 +++--- usr/lib/archboot/functions | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/usr/bin/archboot-aarch64-create-container.sh b/usr/bin/archboot-aarch64-create-container.sh index 8e4dc418d..9353bd19f 100755 --- a/usr/bin/archboot-aarch64-create-container.sh +++ b/usr/bin/archboot-aarch64-create-container.sh @@ -6,8 +6,7 @@ _ARCHBOOT="archboot-arm" _KEYRING="archlinuxarm" [[ -z "${1}" ]] && _usage _DIR="$1" -#shellcheck disable=SC2120 -_parameters +_parameters "$@" _root_check echo "Starting container creation ..." echo "Create directory ${_DIR} ..." @@ -15,11 +14,11 @@ mkdir "${_DIR}" if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then _prepare_pacman _install_base_packages - _cleanmkinitcpio - _cleancache + _clean_mkinitcpio + _clean_cache _install_archboot _umount_special - _cleancontainer + _clean_container _clean_archboot_cache _generate_keyring _generate_locales @@ -30,12 +29,12 @@ fi if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then _aarch64_pacman_chroot _aarch64_install_base_packages - _cleanmkinitcpio - _cleancache + _clean_mkinitcpio + _clean_cache _aarch64_install_archboot - _cleanmkinitcpio - _cleancache - _cleancontainer + _clean_mkinitcpio + _clean_cache + _clean_container _clean_locale fi _set_hostname diff --git a/usr/bin/archboot-aarch64-iso.sh b/usr/bin/archboot-aarch64-iso.sh index bf91a402d..6054cb7f2 100755 --- a/usr/bin/archboot-aarch64-iso.sh +++ b/usr/bin/archboot-aarch64-iso.sh @@ -3,7 +3,7 @@ source /usr/lib/archboot/functions source /usr/lib/archboot/iso_functions [[ -z "${1}" ]] && _usage -_parameters $* +_parameters "$@" _root_check _aarch64_check [[ "${_GENERATE}" == "1" ]] || _usage diff --git a/usr/bin/archboot-x86_64-create-container.sh b/usr/bin/archboot-x86_64-create-container.sh index 34cd25748..2e96dbfcd 100755 --- a/usr/bin/archboot-x86_64-create-container.sh +++ b/usr/bin/archboot-x86_64-create-container.sh @@ -2,21 +2,22 @@ # created by Tobias Powalowski source /usr/lib/archboot/functions source /usr/lib/archboot/container_functions +_ARCHBOOT="archboot" +_KEYRING="archlinux" [[ -z "${1}" ]] && _usage _DIR="$1" -#shellcheck disable=SC2120 -_parameters +_parameters "$@" _root_check _x86_64_check echo "Starting container creation ..." echo "Create directories in ${_DIR} ..." _prepare_pacman _install_base_packages -_cleanmkinitcpio -_cleancache +_clean_mkinitcpio +_clean_cache _install_archboot _umount_special -_cleancontainer +_clean_container _clean_archboot_cache _generate_locales _clean_locale diff --git a/usr/bin/archboot-x86_64-iso.sh b/usr/bin/archboot-x86_64-iso.sh index 042f3755d..874586ef4 100755 --- a/usr/bin/archboot-x86_64-iso.sh +++ b/usr/bin/archboot-x86_64-iso.sh @@ -3,7 +3,7 @@ source /usr/lib/archboot/functions source /usr/lib/archboot/iso_functions [[ -z "${1}" ]] && _usage -_parameters $* +_parameters "$@" _root_check _x86_64_check [[ "${_GENERATE}" == "1" ]] || _usage diff --git a/usr/lib/archboot/container_functions b/usr/lib/archboot/container_functions index d000539b9..dfb3f3968 100644 --- a/usr/lib/archboot/container_functions +++ b/usr/lib/archboot/container_functions @@ -28,7 +28,7 @@ _parameters() { done } -_cleancache() { +_clean_cache() { if [[ "${_CLEANUP_CACHE}" == "1" ]]; then # clean cache echo "Clean pacman cache in ${_DIR} ..." @@ -51,7 +51,7 @@ _aarch64_pacman_chroot() { } # clean container from not needed files -_cleancontainer() { +_clean_container() { if [[ "${_CLEANUP_CONTAINER}" == "1" ]]; then echo "Clean container, delete not needed files from ${_DIR} ..." rm -r "${_DIR}"/usr/include @@ -61,7 +61,7 @@ _cleancontainer() { } # remove mkinitcpio hooks to speed up process, remove not needed initramdisks -_cleanmkinitcpio() { +_clean_mkinitcpio() { echo "Clean mkinitcpio from ${_DIR} ..." [[ -e "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook" [[ -e "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook" diff --git a/usr/lib/archboot/functions b/usr/lib/archboot/functions index 22024144e..787dbd351 100644 --- a/usr/lib/archboot/functions +++ b/usr/lib/archboot/functions @@ -39,10 +39,10 @@ _buildserver_check() { # generate locales _generate_locales() { - echo "Create locales in container ..." - echo 'en_US ISO-8859-1' >> "${_DIR}/etc/locale.gen" >/dev/null 2>&1 - echo 'en_US.UTF-8 UTF-8' >> "${_DIR}/etc/locale.gen" >/dev/null 2>&1 - systemd-nspawn -D "${_DIR}" locale-gen >/dev/null 2>&1 + echo "Generate locales in container ..." + echo 'en_US ISO-8859-1' >> "${_DIR}/etc/locale.gen" + echo 'en_US.UTF-8 UTF-8' >> "${_DIR}/etc/locale.gen" + systemd-nspawn -q -D "${_DIR}" locale-gen >/dev/null 2>&1 } _generate_keyring() {