2022-02-15 12:12:55 +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
|
|
|
|
. /usr/lib/archboot/repository.sh
|
2022-02-15 12:12:55 +01:00
|
|
|
_ARCHBOOT="archboot-arm"
|
|
|
|
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
|
2022-02-20 10:15:57 +01:00
|
|
|
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
|
2022-02-19 13:40:50 +01:00
|
|
|
_CACHEDIR="${_REPODIR}/var/cache/pacman/pkg"
|
2022-02-15 12:12:55 +01:00
|
|
|
[[ -z "${1}" ]] && _usage
|
|
|
|
_root_check
|
|
|
|
echo "Starting repository creation ..."
|
|
|
|
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
|
2022-09-30 15:54:22 +02:00
|
|
|
_cachedir_check
|
2022-05-30 20:37:57 +02:00
|
|
|
_create_pacman_conf "${_REPODIR}"
|
2022-02-19 13:40:50 +01:00
|
|
|
_prepare_pacman "${_REPODIR}" || exit 1
|
2022-10-02 10:33:14 +02:00
|
|
|
_pacman_parameters "${_REPODIR}"
|
2022-02-19 13:40:50 +01:00
|
|
|
_download_packages "${_REPODIR}" || exit 1
|
|
|
|
_umount_special "${_REPODIR}" || exit 1
|
2022-02-15 12:12:55 +01:00
|
|
|
fi
|
|
|
|
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
|
2022-10-01 08:57:41 +02:00
|
|
|
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
|
2022-10-03 21:25:18 +02:00
|
|
|
_create_pacman_conf "${_REPODIR}" "use_binfmt"
|
2022-10-02 10:33:14 +02:00
|
|
|
_pacman_parameters "${_REPODIR}" "use_binfmt"
|
2022-10-02 21:26:50 +02:00
|
|
|
_download_packages "${_REPODIR}" "use_binfmt" || exit 1
|
2022-02-15 12:12:55 +01:00
|
|
|
fi
|
2022-02-19 13:40:50 +01:00
|
|
|
_move_packages "${_REPODIR}" "${1}" || exit 1
|
|
|
|
_cleanup_repodir "${_REPODIR}" || exit 1
|
2022-02-15 12:12:55 +01:00
|
|
|
_create_archboot_db "${1}" || exit 1
|
2022-02-19 13:40:50 +01:00
|
|
|
echo "Finished repository creation in ${_REPODIR} ."
|