diff --git a/usr/bin/archboot-aarch64-create-container.sh b/usr/bin/archboot-aarch64-create-container.sh index 31a14f5ca..077f437cb 100755 --- a/usr/bin/archboot-aarch64-create-container.sh +++ b/usr/bin/archboot-aarch64-create-container.sh @@ -26,8 +26,8 @@ fi if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then _pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1 _create_pacman_conf "${1}" "use_container_config" - _install_base_packages "${1}" other || exit 1 - _install_archboot "${1}" other || exit 1 + _install_base_packages "${1}" "use_binfmt" || exit 1 + _install_archboot "${1}" "use_binfmt" || exit 1 _fix_groups "${1}" _clean_mkinitcpio "${1}" _clean_cache "${1}" diff --git a/usr/bin/archboot-riscv64-create-container.sh b/usr/bin/archboot-riscv64-create-container.sh index 46c669cc3..e06eb0b70 100755 --- a/usr/bin/archboot-riscv64-create-container.sh +++ b/usr/bin/archboot-riscv64-create-container.sh @@ -26,8 +26,8 @@ fi if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then _pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1 _create_pacman_conf "${1}" "use_container_config" - _install_base_packages "${1}" other || exit 1 - _install_archboot "${1}" other || exit 1 + _install_base_packages "${1}" "use_binfmt" || exit 1 + _install_archboot "${1}" "use_binfmt" || exit 1 _fix_groups "${1}" _clean_mkinitcpio "${1}" _clean_cache "${1}" diff --git a/usr/lib/archboot/container.sh b/usr/lib/archboot/container.sh index be8b50c84..4b1faec94 100644 --- a/usr/lib/archboot/container.sh +++ b/usr/lib/archboot/container.sh @@ -143,21 +143,21 @@ _umount_special() { } _pacman_parameters() { - if [[ -z "${2}" ]]; then - _SYSTEMD="" - _PACMAN="pacman --root "${1}"" - _PACMAN_CACHEDIR="--cachedir "${_CACHEDIR}"" - else + if [[ "${2}" == "use_binfmt" ]]; then _SYSTEMD="systemd-nspawn -q -D "${1}"" _PACMAN="pacman" _PACMAN_CACHEDIR="" + else + _SYSTEMD="" + _PACMAN="pacman --root "${1}"" + _PACMAN_CACHEDIR="--cachedir "${_CACHEDIR}"" fi } _install_base_packages() { _PACMAN_COMMON="${_PACKAGES} --config ${_PACMAN_CONF} --ignore systemd-resolvconf --noconfirm" _pacman_parameters "${1}" "${2}" - if ! [[ -z "${2}" ]]; then + if [[ "${2}" == "use_binfmt" ]]; then [[ -d "${1}"/blankdb ]] || mkdir "${1}"/blankdb echo "Downloading ${_PACKAGES} to ${1} ..." ${_SYSTEMD} ${_PACMAN} -Syw ${_PACMAN_COMMON} --dbpath /blankdb >/dev/null 2>&1 || exit 1 @@ -169,7 +169,7 @@ _install_base_packages() { _install_archboot() { _PACMAN_COMMON="${_ARCHBOOT} --config "${_PACMAN_CONF}" --ignore systemd-resolvconf --noconfirm" _pacman_parameters "${1}" "${2}" - if [[ -z "${2}" ]]; then + if [[ "${2}" ]]; then _PACMAN_DB="--dbpath "${1}"/blankdb" # riscv64 need does not support local image at the moment [[ "${_RUNNING_ARCH}" == "riscv64" ]] && _GRAPHICAL_PACKAGES=""