archboot/usr/bin/archboot-aarch64-create-container.sh

43 lines
1.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
# created by Tobias Powalowski <tpowa@archlinux.org>
2022-03-21 22:32:56 +01:00
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
2022-02-09 08:59:04 +01:00
_ARCHBOOT="archboot-arm"
[[ -z "${1}" ]] && _usage
2022-02-09 09:59:28 +01:00
_parameters "$@"
_root_check
echo "Starting container creation ..."
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
2022-02-08 20:41:57 +01:00
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
2022-10-02 16:33:37 +02:00
_cachedir_check
2022-04-26 20:15:50 +02:00
_create_pacman_conf "${1}"
_prepare_pacman "${1}" || exit 1
2022-10-02 09:32:08 +02:00
_pacman_parameters "${1}"
_install_base_packages "${1}" || exit 1
2022-02-23 09:04:55 +01:00
_clean_mkinitcpio "${1}"
_clean_cache "${1}"
_install_archboot "${1}" || exit 1
_clean_cache "${1}"
_umount_special "${1}" || exit 1
2022-05-04 21:48:20 +02:00
_fix_groups "${1}"
_clean_container "${1}"
2022-02-09 16:58:09 +01:00
_clean_archboot_cache
_generate_keyring "${1}" || exit 1
_copy_mirrorlist_and_pacman_conf "${1}"
fi
2022-02-08 20:41:57 +01:00
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
2022-10-01 08:57:41 +02:00
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
_create_pacman_conf "${1}" "use_container_config"
2022-10-02 09:32:08 +02:00
_pacman_parameters "${1}" "use_binfmt"
2022-10-02 22:15:11 +02:00
_install_base_packages "${1}" "use_binfmt" || exit 1
_install_archboot "${1}" "use_binfmt" || exit 1
2022-05-04 21:48:20 +02:00
_fix_groups "${1}"
2022-02-23 09:04:55 +01:00
_clean_mkinitcpio "${1}"
_clean_cache "${1}"
2022-02-22 08:14:58 +01:00
_clean_container "${1}" 2>/dev/null
fi
_change_pacman_conf "${1}" || exit 1
2022-02-16 18:35:35 +01:00
_reproducibility "${1}"
_set_hostname "${1}" || exit 1
echo "Finished container setup in ${1} ."