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-09 09:59:28 +01:00
|
|
|
_ARCHBOOT="archboot"
|
|
|
|
_KEYRING="archlinux"
|
2022-02-08 17:01:21 +01:00
|
|
|
[[ -z "${1}" ]] && _usage
|
2021-09-25 14:02:02 +02:00
|
|
|
_DIR="$1"
|
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 ..."
|
|
|
|
echo "Create directories in ${_DIR} ..."
|
2022-02-08 17:01:21 +01:00
|
|
|
_prepare_pacman
|
|
|
|
_install_base_packages
|
2022-02-09 09:59:28 +01:00
|
|
|
_clean_mkinitcpio
|
|
|
|
_clean_cache
|
2022-02-08 17:01:21 +01:00
|
|
|
_install_archboot
|
|
|
|
_umount_special
|
2022-02-09 09:59:28 +01:00
|
|
|
_clean_container
|
2022-02-08 17:01:21 +01:00
|
|
|
_clean_archboot_cache
|
|
|
|
_generate_locales
|
|
|
|
_clean_locale
|
|
|
|
_generate_keyring
|
|
|
|
_copy_mirrorlist_and_pacman_conf
|
|
|
|
_change_pacman_conf
|
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-01-21 11:59:06 +01:00
|
|
|
sed -i -e '/^#\[testing\]/ { n ; s/^#// }' "${_DIR}/etc/pacman.conf"
|
|
|
|
sed -i -e '/^#\[community-testing\]/ { n ; s/^#// }' "${_DIR}/etc/pacman.conf"
|
|
|
|
sed -i -e 's:^#\[testing\]:\[testing\]:g' -e 's:^#\[community-testing\]:\[community-testing\]:g' "${_DIR}/etc/pacman.conf"
|
2021-09-27 11:33:47 +02:00
|
|
|
fi
|
2022-02-08 17:01:21 +01:00
|
|
|
_set_hostname
|
2021-10-15 09:16:30 +02:00
|
|
|
echo "Finished container setup in ${_DIR} ."
|
2022-02-09 09:04:53 +01:00
|
|
|
|