diff --git a/usr/bin/archboot-aarch64-create-container.sh b/usr/bin/archboot-aarch64-create-container.sh index 3f667e4be..6c69fc583 100755 --- a/usr/bin/archboot-aarch64-create-container.sh +++ b/usr/bin/archboot-aarch64-create-container.sh @@ -9,8 +9,7 @@ _DIR="$1" _parameters "$@" _root_check echo "Starting container creation ..." -echo "Create directory ${_DIR} ..." -mkdir "${_DIR}" +[[ -d "${_DIR}" ]] || (echo "Create directory ${_DIR} ..."; mkdir "${_DIR}") if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then _prepare_pacman || exit 1 _install_base_packages || exit 1 @@ -18,11 +17,11 @@ if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then _clean_cache || exit 1 _install_archboot || exit 1 _umount_special || exit 1 + _generate_locales || exit 1 + _clean_locale _clean_container || exit 1 _clean_archboot_cache _generate_keyring || exit 1 - _generate_locales || exit 1 - _clean_locale _copy_mirrorlist_and_pacman_conf _change_pacman_conf || exit 1 fi @@ -34,9 +33,9 @@ if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then _aarch64_install_archboot || exit 1 _clean_mkinitcpio || exit 1 _clean_cache || exit 1 - _clean_container || exit 1 _generate_locales || exit 1 _clean_locale + _clean_container || exit 1 fi _set_hostname || exit 1 echo "Finished container setup in ${_DIR} ." diff --git a/usr/bin/archboot-x86_64-create-container.sh b/usr/bin/archboot-x86_64-create-container.sh index f9611a6fe..44696816d 100755 --- a/usr/bin/archboot-x86_64-create-container.sh +++ b/usr/bin/archboot-x86_64-create-container.sh @@ -10,17 +10,17 @@ _parameters "$@" _root_check _x86_64_check echo "Starting container creation ..." -echo "Create directories in ${_DIR} ..." +[[ -d "${_DIR}" ]] || (echo "Create directory ${_DIR} ..."; mkdir "${_DIR}") _prepare_pacman || exit 1 _install_base_packages || exit 1 _clean_mkinitcpio || exit 1 _clean_cache || exit 1 _install_archboot || exit 1 _umount_special || exit 1 -_clean_container || exit 1 -_clean_archboot_cache _generate_locales || exit 1 _clean_locale +_clean_container || exit 1 +_clean_archboot_cache _generate_keyring || exit 1 _copy_mirrorlist_and_pacman_conf _change_pacman_conf || exit 1 diff --git a/usr/lib/archboot/container_functions b/usr/lib/archboot/container_functions index a0c1d8e1c..5bb682f67 100644 --- a/usr/lib/archboot/container_functions +++ b/usr/lib/archboot/container_functions @@ -80,6 +80,7 @@ _clean_archboot_cache() { _prepare_pacman() { # prepare pacman dirs + echo "Create directories in ${_DIR} ..." mkdir -p "${_DIR}/var/lib/pacman" mkdir -p "${_CACHEDIR}" [[ -e "${_DIR}/proc" ]] || mkdir -m 555 "${_DIR}/proc" @@ -129,7 +130,6 @@ _aarch64_install_archboot() { systemd-nspawn -q -D "${_DIR}" /bin/bash -c "pacman -Sy ${_ARCHBOOT} --ignore systemd-resolvconf --noconfirm" >/dev/null 2>&1 } - _copy_mirrorlist_and_pacman_conf() { # copy local mirrorlist to container echo "Create pacman config and mirrorlist in container..."