2022-01-07 09:08:50 +01:00
|
|
|
#!/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"
|
2022-02-08 17:01:21 +01:00
|
|
|
[[ -z "${1}" ]] && _usage
|
2022-02-09 09:59:28 +01:00
|
|
|
_parameters "$@"
|
2022-02-08 17:01:21 +01:00
|
|
|
_root_check
|
2022-01-07 09:08:50 +01:00
|
|
|
echo "Starting container creation ..."
|
2022-02-15 12:12:55 +01:00
|
|
|
[[ -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}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_prepare_pacman "${1}" || exit 1
|
2022-10-02 09:32:08 +02:00
|
|
|
_pacman_parameters "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_install_base_packages "${1}" || exit 1
|
2022-02-23 09:04:55 +01:00
|
|
|
_clean_mkinitcpio "${1}"
|
|
|
|
_clean_cache "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_install_archboot "${1}" || exit 1
|
2022-05-17 18:19:02 +02:00
|
|
|
_clean_cache "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_umount_special "${1}" || exit 1
|
2022-05-04 21:48:20 +02:00
|
|
|
_fix_groups "${1}"
|
2022-02-22 07:00:53 +01:00
|
|
|
_clean_container "${1}"
|
2022-02-09 16:58:09 +01:00
|
|
|
_clean_archboot_cache
|
2022-02-15 12:12:55 +01:00
|
|
|
_generate_keyring "${1}" || exit 1
|
|
|
|
_copy_mirrorlist_and_pacman_conf "${1}"
|
2022-01-09 14:05:36 +01:00
|
|
|
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
|
2022-06-03 21:23:33 +02:00
|
|
|
_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
|
2022-01-09 14:05:36 +01:00
|
|
|
fi
|
2022-04-18 15:10:27 +02:00
|
|
|
_change_pacman_conf "${1}" || exit 1
|
2022-02-16 18:35:35 +01:00
|
|
|
_reproducibility "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_set_hostname "${1}" || exit 1
|
|
|
|
echo "Finished container setup in ${1} ."
|