fix container creation

This commit is contained in:
Tobias Powalowski 2022-02-09 09:59:28 +01:00
parent f5df400815
commit b8ef052117
6 changed files with 24 additions and 24 deletions

View file

@ -6,8 +6,7 @@ _ARCHBOOT="archboot-arm"
_KEYRING="archlinuxarm" _KEYRING="archlinuxarm"
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage
_DIR="$1" _DIR="$1"
#shellcheck disable=SC2120 _parameters "$@"
_parameters
_root_check _root_check
echo "Starting container creation ..." echo "Starting container creation ..."
echo "Create directory ${_DIR} ..." echo "Create directory ${_DIR} ..."
@ -15,11 +14,11 @@ mkdir "${_DIR}"
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
_prepare_pacman _prepare_pacman
_install_base_packages _install_base_packages
_cleanmkinitcpio _clean_mkinitcpio
_cleancache _clean_cache
_install_archboot _install_archboot
_umount_special _umount_special
_cleancontainer _clean_container
_clean_archboot_cache _clean_archboot_cache
_generate_keyring _generate_keyring
_generate_locales _generate_locales
@ -30,12 +29,12 @@ fi
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_aarch64_pacman_chroot _aarch64_pacman_chroot
_aarch64_install_base_packages _aarch64_install_base_packages
_cleanmkinitcpio _clean_mkinitcpio
_cleancache _clean_cache
_aarch64_install_archboot _aarch64_install_archboot
_cleanmkinitcpio _clean_mkinitcpio
_cleancache _clean_cache
_cleancontainer _clean_container
_clean_locale _clean_locale
fi fi
_set_hostname _set_hostname

View file

@ -3,7 +3,7 @@
source /usr/lib/archboot/functions source /usr/lib/archboot/functions
source /usr/lib/archboot/iso_functions source /usr/lib/archboot/iso_functions
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage
_parameters $* _parameters "$@"
_root_check _root_check
_aarch64_check _aarch64_check
[[ "${_GENERATE}" == "1" ]] || _usage [[ "${_GENERATE}" == "1" ]] || _usage

View file

@ -2,21 +2,22 @@
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
source /usr/lib/archboot/functions source /usr/lib/archboot/functions
source /usr/lib/archboot/container_functions source /usr/lib/archboot/container_functions
_ARCHBOOT="archboot"
_KEYRING="archlinux"
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage
_DIR="$1" _DIR="$1"
#shellcheck disable=SC2120 _parameters "$@"
_parameters
_root_check _root_check
_x86_64_check _x86_64_check
echo "Starting container creation ..." echo "Starting container creation ..."
echo "Create directories in ${_DIR} ..." echo "Create directories in ${_DIR} ..."
_prepare_pacman _prepare_pacman
_install_base_packages _install_base_packages
_cleanmkinitcpio _clean_mkinitcpio
_cleancache _clean_cache
_install_archboot _install_archboot
_umount_special _umount_special
_cleancontainer _clean_container
_clean_archboot_cache _clean_archboot_cache
_generate_locales _generate_locales
_clean_locale _clean_locale

View file

@ -3,7 +3,7 @@
source /usr/lib/archboot/functions source /usr/lib/archboot/functions
source /usr/lib/archboot/iso_functions source /usr/lib/archboot/iso_functions
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage
_parameters $* _parameters "$@"
_root_check _root_check
_x86_64_check _x86_64_check
[[ "${_GENERATE}" == "1" ]] || _usage [[ "${_GENERATE}" == "1" ]] || _usage

View file

@ -28,7 +28,7 @@ _parameters() {
done done
} }
_cleancache() { _clean_cache() {
if [[ "${_CLEANUP_CACHE}" == "1" ]]; then if [[ "${_CLEANUP_CACHE}" == "1" ]]; then
# clean cache # clean cache
echo "Clean pacman cache in ${_DIR} ..." echo "Clean pacman cache in ${_DIR} ..."
@ -51,7 +51,7 @@ _aarch64_pacman_chroot() {
} }
# clean container from not needed files # clean container from not needed files
_cleancontainer() { _clean_container() {
if [[ "${_CLEANUP_CONTAINER}" == "1" ]]; then if [[ "${_CLEANUP_CONTAINER}" == "1" ]]; then
echo "Clean container, delete not needed files from ${_DIR} ..." echo "Clean container, delete not needed files from ${_DIR} ..."
rm -r "${_DIR}"/usr/include rm -r "${_DIR}"/usr/include
@ -61,7 +61,7 @@ _cleancontainer() {
} }
# remove mkinitcpio hooks to speed up process, remove not needed initramdisks # remove mkinitcpio hooks to speed up process, remove not needed initramdisks
_cleanmkinitcpio() { _clean_mkinitcpio() {
echo "Clean mkinitcpio from ${_DIR} ..." echo "Clean mkinitcpio from ${_DIR} ..."
[[ -e "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook" [[ -e "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook"
[[ -e "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook" [[ -e "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook" ]] && rm "${_DIR}/usr/share/libalpm/hooks/90-mkinitcpio-install.hook"

View file

@ -39,10 +39,10 @@ _buildserver_check() {
# generate locales # generate locales
_generate_locales() { _generate_locales() {
echo "Create locales in container ..." echo "Generate locales in container ..."
echo 'en_US ISO-8859-1' >> "${_DIR}/etc/locale.gen" >/dev/null 2>&1 echo 'en_US ISO-8859-1' >> "${_DIR}/etc/locale.gen"
echo 'en_US.UTF-8 UTF-8' >> "${_DIR}/etc/locale.gen" >/dev/null 2>&1 echo 'en_US.UTF-8 UTF-8' >> "${_DIR}/etc/locale.gen"
systemd-nspawn -D "${_DIR}" locale-gen >/dev/null 2>&1 systemd-nspawn -q -D "${_DIR}" locale-gen >/dev/null 2>&1
} }
_generate_keyring() { _generate_keyring() {