2021-09-10 20:21:23 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
2022-02-08 17:01:21 +01:00
|
|
|
source /usr/lib/archboot/functions
|
|
|
|
source /usr/lib/archboot/container_functions
|
2022-02-15 12:12:55 +01:00
|
|
|
_CACHEDIR="${1}/var/cache/pacman/pkg"
|
2022-02-09 09:59:28 +01:00
|
|
|
_ARCHBOOT="archboot"
|
|
|
|
_KEYRING="archlinux"
|
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
|
|
|
|
_x86_64_check
|
2021-10-15 09:16:30 +02:00
|
|
|
echo "Starting container creation ..."
|
2022-02-15 12:12:55 +01:00
|
|
|
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
|
2022-02-15 21:39:34 +01:00
|
|
|
_create_pacman_conf "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_prepare_pacman "${1}" || exit 1
|
|
|
|
_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
|
|
|
|
_umount_special "${1}" || exit 1
|
2022-02-23 09:04:55 +01:00
|
|
|
_generate_locales "${1}"
|
|
|
|
_clean_container "${1}"
|
2022-02-10 14:22:59 +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-03-19 10:07:31 +01:00
|
|
|
_copy_archboot_defaults "${1}"
|
2022-02-15 12:12:55 +01:00
|
|
|
_change_pacman_conf "${1}" || exit 1
|
2021-09-27 11:33:47 +02:00
|
|
|
# enable [testing] if enabled in host
|
2022-01-21 11:59:06 +01:00
|
|
|
if grep -q "^\[testing" /etc/pacman.conf; then
|
2021-10-15 09:16:30 +02:00
|
|
|
echo "Enable [testing] repository in container ..."
|
2022-02-15 12:12:55 +01:00
|
|
|
sed -i -e '/^#\[testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
|
|
|
|
sed -i -e '/^#\[community-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
|
|
|
|
sed -i -e 's:^#\[testing\]:\[testing\]:g' -e 's:^#\[community-testing\]:\[community-testing\]:g' "${1}/etc/pacman.conf"
|
2021-09-27 11:33:47 +02:00
|
|
|
fi
|
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} ."
|
2022-02-09 09:04:53 +01:00
|
|
|
|