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

39 lines
1.3 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
[[ -z "${1}" ]] && _usage
2022-02-09 09:59:28 +01:00
_parameters "$@"
_root_check
_x86_64_check
2022-10-02 16:33:37 +02:00
_cachedir_check
2021-10-15 09:16:30 +02:00
echo "Starting container creation ..."
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
2022-02-15 21:39:34 +01: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}"
2022-02-23 09:04:55 +01:00
_clean_container "${1}"
2022-10-24 08:05:07 +02:00
_download_graphical "${1}" || exit 1
_clean_cache "${1}"
_generate_keyring "${1}" || exit 1
_copy_mirrorlist_and_pacman_conf "${1}"
2022-03-19 10:07:31 +01:00
_copy_archboot_defaults "${1}"
_change_pacman_conf "${1}" || exit 1
# 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 ..."
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"
fi
2022-02-16 18:35:35 +01:00
_reproducibility "${1}"
_set_hostname "${1}" || exit 1
echo "Finished container setup in ${1} ."