revert last change

This commit is contained in:
Tobias Powalowski 2023-07-28 17:03:58 +02:00
parent 6c8fc5c55c
commit 6e4df221dd
17 changed files with 17 additions and 702 deletions

View file

@ -1,61 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
_root_check
echo "Starting container creation..."
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
_cachedir_check
_create_pacman_conf "${1}"
_prepare_pacman "${1}" || exit 1
_pacman_parameters "${1}"
_install_base_packages "${1}" || exit 1
#_install_custom_grub "${1}"
_clean_mkinitcpio "${1}"
_clean_cache "${1}"
_install_archboot "${1}" || exit 1
_umount_special "${1}" || exit 1
_clean_cache "${1}"
_clean_container "${1}"
_generate_keyring "${1}" || exit 1
_copy_mirrorlist_and_pacman_conf "${1}"
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_copy_archboot_defaults "${1}"
# enable [*-testing] if enabled in host
if grep -q "^\[core-testing" /etc/pacman.conf; then
echo "Enable [core-testing] and [extra-testing] repository in container..."
sed -i -e '/^#\[core-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e '/^#\[extra-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e 's:^#\[core-testing\]:\[core-testing\]:g' -e 's:^#\[extra-testing\]:\[extra-testing\]:g' "${1}/etc/pacman.conf"
fi
fi
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${1}" "use_binfmt"
_pacman_parameters "${1}" "use_binfmt"
_install_base_packages "${1}" "use_binfmt" || exit 1
_install_archboot "${1}" "use_binfmt" || exit 1
_clean_mkinitcpio "${1}"
_clean_container "${1}" 2>/dev/null
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_change_pacman_conf "${1}" || exit 1
_reproducibility "${1}"
_set_hostname "${1}" || exit 1
echo "Finished container setup in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/container.sh

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
. /usr/lib/archboot/repository.sh
_CACHEDIR="${_REPODIR}/var/cache/pacman/pkg"
[[ -z "${1}" ]] && _usage
_root_check
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
echo "Starting repository creation..."
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && (_x86_64_pacman_use_default || exit 1)
_cachedir_check
[[ "${_RUNNING_ARCH}" == "x86_64" ]] || _create_pacman_conf "${_REPODIR}"
_prepare_pacman "${_REPODIR}" || exit 1
_pacman_parameters "${_REPODIR}"
_download_packages "${_REPODIR}" || exit 1
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && _x86_64_pacman_restore || exit 1
_umount_special "${_REPODIR}" || exit 1
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${_REPODIR}" "use_binfmt"
_pacman_parameters "${_REPODIR}" "use_binfmt"
_download_packages "${_REPODIR}" "use_binfmt" || exit 1
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_move_packages "${_REPODIR}" "${1}" || exit 1
_cleanup_repodir "${_REPODIR}" || exit 1
_create_archboot_db "${1}" || exit 1
echo "Finished repository creation in ${_REPODIR}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/repository.sh

View file

@ -1,50 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/iso.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
[[ "${_GENERATE}" == "1" ]] || _usage
_root_check
_architecture_check
_config
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
# running system = aarch64 or x86_64
echo "Starting ISO creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_ucode || exit 1
if echo "${_BASENAME}" | grep -qw aarch64; then
_prepare_fedora_shim_bootloaders_aarch64 || exit 1
_prepare_uefi_AA64 || exit 1
fi
if echo "${_BASENAME}" | grep -qw x86_64; then
_prepare_fedora_shim_bootloaders_x86_64 || exit 1
_prepare_uefi_shell_tianocore || exit 1
_prepare_uefi_X64 || exit 1
_prepare_uefi_IA32 || exit 1
_prepare_memtest || exit 1
fi
_prepare_efitools_uefi || exit 1
_prepare_background || exit 1
_reproducibility
_prepare_uefi_image || exit 1
_reproducibility
_grub_mkrescue || exit 1
_reproducibility_iso || exit 1
else
# running system = riscv64
echo "Starting Image creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_extlinux_conf || exit 1
_reproducibility
_uboot || exit 1
fi
_create_cksum || exit 1
_cleanup_iso || exit 1
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
echo "Finished ISO creation."
else
echo "Finished Image creation."
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/iso.sh

View file

@ -1,72 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /etc/archboot/defaults
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
if echo "${_BASENAME}" | grep -qw aarch64; then
_PACMAN_ARCH_CHROOT="${_PACMAN_AARCH64_CHROOT}"
_PACMAN_ARCH="${_PACMAN_AARCH64}"
_ARCH_VERSION="ArchLinuxARM-aarch64-latest.tar.gz"
_SERVER_PACMAN_ARCH="${_SERVER_PACMAN_AARCH64}"
_LATEST_ARCH="http://os.archlinuxarm.org/os/${_ARCH_VERSION}"
_CAP_ARCH="AARCH64"
_ARCH="aarch64"
elif echo "${_BASENAME}" | grep -qw riscv64; then
_PACMAN_ARCH_CHROOT="${_PACMAN_RISCV64_CHROOT}"
_PACMAN_ARCH="${_PACMAN_RISCV64}"
_ARCH_VERSION="archriscv-20220727.tar.zst"
_SERVER_PACMAN_ARCH="${_SERVER_PACMAN_RISCV64}"
_LATEST_ARCH="https://archriscv.felixc.at/images/${_ARCH_VERSION}"
_CAP_ARCH="RISCV64"
_ARCH="riscv64"
fi
_usage () {
echo "CREATE ${_CAP_ARCH} PACMAN CHROOT"
echo "-----------------------------"
echo "This will create the ${_ARCH} pacman chroot tarball."
echo "usage: ${_BASENAME} <build-directory>"
exit 0
}
[[ -z "${1}" ]] && _usage
_root_check
echo "Starting container creation..."
# remove old files
[[ -f ${_PACMAN_ARCH_CHROOT} ]] && rm "${_PACMAN_ARCH_CHROOT}"{,.sig} 2>/dev/null
echo "Creating directory ${1}..."
mkdir -p "${1}"/"${_PACMAN_ARCH}"
echo "Downloading archlinux ${_ARCH}..."
! [[ -f ${_ARCH_VERSION} ]] && wget "${_LATEST_ARCH}" &>/dev/null
bsdtar -xf "${_ARCH_VERSION}" -C "${1}"
echo "Removing installation tarball..."
rm "${_ARCH_VERSION}"
sed -i -e '/^\[community\]/ { n ; s/^/#/ }' "${1}"/etc/pacman.conf
sed -i -e 's:^\[community\]:#\[community\]:g' "${1}"/etc/pacman.conf
_generate_keyring "${1}" || exit 1
_fix_network "${1}"
# update container to latest packages
echo "Installing pacman to container..."
mkdir -p "${1}/${_PACMAN_ARCH}/var/lib/pacman"
#shellcheck disable=SC2086
systemd-nspawn -D "${1}" pacman --root "/${_PACMAN_ARCH}" -Sy awk ${_KEYRING} --ignore systemd-resolvconf --noconfirm &>/dev/null
_generate_keyring "${1}/${_PACMAN_ARCH}" || exit 1
_fix_network "${1}/${_PACMAN_ARCH}"
_CLEANUP_CONTAINER="1" _clean_container "${1}/${_PACMAN_ARCH}" 2>/dev/null
_CLEANUP_CACHE="1" _clean_cache "${1}/${_PACMAN_ARCH}" 2>/dev/null
echo "Generating tarball..."
tar -acf "${_PACMAN_ARCH_CHROOT}" -C "${1}"/"${_PACMAN_ARCH}" . &>/dev/null || exit 1
echo "Removing ${1}..."
rm -r "${1}"
echo "Finished container tarball."
echo "Signing tarball..."
#shellcheck disable=SC2086
sudo -u "${_USER}" gpg ${_GPG} ${_PACMAN_ARCH_CHROOT} || exit 1
chown "${_USER}":"${_GROUP}" "${_PACMAN_ARCH_CHROOT}"{,.sig} || exit 1
echo "Uploading tarball to ${_SERVER}:${_SERVER_PACMAN_ARCH}..."
sudo -u "${_USER}" scp "${_PACMAN_ARCH_CHROOT}"{,.sig} "${_SERVER}:${_SERVER_PACMAN_ARCH}" || exit 1
echo "Finished."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/chroot-tarball.sh

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/release.sh
[[ -z "${1}" ]] && _usage
_root_check
_container_check
echo "Starting release creation in ${1}..."
_create_iso "$@" || exit 1
echo "Finished release creation in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/release.sh

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/server.sh
_root_check
_container_check
if echo "${_BASENAME}" | grep -qw riscv64 || echo "${_BASENAME}" | grep -qw aarch64; then
_update_pacman_chroot || exit 1
fi
_update_source
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_use_default || exit 1
fi
_server_release || exit 1
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_restore || exit 1
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/server-release.sh

View file

@ -1,61 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
_root_check
echo "Starting container creation..."
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
_cachedir_check
_create_pacman_conf "${1}"
_prepare_pacman "${1}" || exit 1
_pacman_parameters "${1}"
_install_base_packages "${1}" || exit 1
#_install_custom_grub "${1}"
_clean_mkinitcpio "${1}"
_clean_cache "${1}"
_install_archboot "${1}" || exit 1
_umount_special "${1}" || exit 1
_clean_cache "${1}"
_clean_container "${1}"
_generate_keyring "${1}" || exit 1
_copy_mirrorlist_and_pacman_conf "${1}"
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_copy_archboot_defaults "${1}"
# enable [*-testing] if enabled in host
if grep -q "^\[core-testing" /etc/pacman.conf; then
echo "Enable [core-testing] and [extra-testing] repository in container..."
sed -i -e '/^#\[core-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e '/^#\[extra-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e 's:^#\[core-testing\]:\[core-testing\]:g' -e 's:^#\[extra-testing\]:\[extra-testing\]:g' "${1}/etc/pacman.conf"
fi
fi
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${1}" "use_binfmt"
_pacman_parameters "${1}" "use_binfmt"
_install_base_packages "${1}" "use_binfmt" || exit 1
_install_archboot "${1}" "use_binfmt" || exit 1
_clean_mkinitcpio "${1}"
_clean_container "${1}" 2>/dev/null
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_change_pacman_conf "${1}" || exit 1
_reproducibility "${1}"
_set_hostname "${1}" || exit 1
echo "Finished container setup in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/container.sh

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
. /usr/lib/archboot/repository.sh
_CACHEDIR="${_REPODIR}/var/cache/pacman/pkg"
[[ -z "${1}" ]] && _usage
_root_check
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
echo "Starting repository creation..."
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && (_x86_64_pacman_use_default || exit 1)
_cachedir_check
[[ "${_RUNNING_ARCH}" == "x86_64" ]] || _create_pacman_conf "${_REPODIR}"
_prepare_pacman "${_REPODIR}" || exit 1
_pacman_parameters "${_REPODIR}"
_download_packages "${_REPODIR}" || exit 1
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && _x86_64_pacman_restore || exit 1
_umount_special "${_REPODIR}" || exit 1
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${_REPODIR}" "use_binfmt"
_pacman_parameters "${_REPODIR}" "use_binfmt"
_download_packages "${_REPODIR}" "use_binfmt" || exit 1
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_move_packages "${_REPODIR}" "${1}" || exit 1
_cleanup_repodir "${_REPODIR}" || exit 1
_create_archboot_db "${1}" || exit 1
echo "Finished repository creation in ${_REPODIR}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/repository.sh

View file

@ -1,50 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/iso.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
[[ "${_GENERATE}" == "1" ]] || _usage
_root_check
_architecture_check
_config
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
# running system = aarch64 or x86_64
echo "Starting ISO creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_ucode || exit 1
if echo "${_BASENAME}" | grep -qw aarch64; then
_prepare_fedora_shim_bootloaders_aarch64 || exit 1
_prepare_uefi_AA64 || exit 1
fi
if echo "${_BASENAME}" | grep -qw x86_64; then
_prepare_fedora_shim_bootloaders_x86_64 || exit 1
_prepare_uefi_shell_tianocore || exit 1
_prepare_uefi_X64 || exit 1
_prepare_uefi_IA32 || exit 1
_prepare_memtest || exit 1
fi
_prepare_efitools_uefi || exit 1
_prepare_background || exit 1
_reproducibility
_prepare_uefi_image || exit 1
_reproducibility
_grub_mkrescue || exit 1
_reproducibility_iso || exit 1
else
# running system = riscv64
echo "Starting Image creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_extlinux_conf || exit 1
_reproducibility
_uboot || exit 1
fi
_create_cksum || exit 1
_cleanup_iso || exit 1
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
echo "Finished ISO creation."
else
echo "Finished Image creation."
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/iso.sh

View file

@ -1,72 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /etc/archboot/defaults
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
if echo "${_BASENAME}" | grep -qw aarch64; then
_PACMAN_ARCH_CHROOT="${_PACMAN_AARCH64_CHROOT}"
_PACMAN_ARCH="${_PACMAN_AARCH64}"
_ARCH_VERSION="ArchLinuxARM-aarch64-latest.tar.gz"
_SERVER_PACMAN_ARCH="${_SERVER_PACMAN_AARCH64}"
_LATEST_ARCH="http://os.archlinuxarm.org/os/${_ARCH_VERSION}"
_CAP_ARCH="AARCH64"
_ARCH="aarch64"
elif echo "${_BASENAME}" | grep -qw riscv64; then
_PACMAN_ARCH_CHROOT="${_PACMAN_RISCV64_CHROOT}"
_PACMAN_ARCH="${_PACMAN_RISCV64}"
_ARCH_VERSION="archriscv-20220727.tar.zst"
_SERVER_PACMAN_ARCH="${_SERVER_PACMAN_RISCV64}"
_LATEST_ARCH="https://archriscv.felixc.at/images/${_ARCH_VERSION}"
_CAP_ARCH="RISCV64"
_ARCH="riscv64"
fi
_usage () {
echo "CREATE ${_CAP_ARCH} PACMAN CHROOT"
echo "-----------------------------"
echo "This will create the ${_ARCH} pacman chroot tarball."
echo "usage: ${_BASENAME} <build-directory>"
exit 0
}
[[ -z "${1}" ]] && _usage
_root_check
echo "Starting container creation..."
# remove old files
[[ -f ${_PACMAN_ARCH_CHROOT} ]] && rm "${_PACMAN_ARCH_CHROOT}"{,.sig} 2>/dev/null
echo "Creating directory ${1}..."
mkdir -p "${1}"/"${_PACMAN_ARCH}"
echo "Downloading archlinux ${_ARCH}..."
! [[ -f ${_ARCH_VERSION} ]] && wget "${_LATEST_ARCH}" &>/dev/null
bsdtar -xf "${_ARCH_VERSION}" -C "${1}"
echo "Removing installation tarball..."
rm "${_ARCH_VERSION}"
sed -i -e '/^\[community\]/ { n ; s/^/#/ }' "${1}"/etc/pacman.conf
sed -i -e 's:^\[community\]:#\[community\]:g' "${1}"/etc/pacman.conf
_generate_keyring "${1}" || exit 1
_fix_network "${1}"
# update container to latest packages
echo "Installing pacman to container..."
mkdir -p "${1}/${_PACMAN_ARCH}/var/lib/pacman"
#shellcheck disable=SC2086
systemd-nspawn -D "${1}" pacman --root "/${_PACMAN_ARCH}" -Sy awk ${_KEYRING} --ignore systemd-resolvconf --noconfirm &>/dev/null
_generate_keyring "${1}/${_PACMAN_ARCH}" || exit 1
_fix_network "${1}/${_PACMAN_ARCH}"
_CLEANUP_CONTAINER="1" _clean_container "${1}/${_PACMAN_ARCH}" 2>/dev/null
_CLEANUP_CACHE="1" _clean_cache "${1}/${_PACMAN_ARCH}" 2>/dev/null
echo "Generating tarball..."
tar -acf "${_PACMAN_ARCH_CHROOT}" -C "${1}"/"${_PACMAN_ARCH}" . &>/dev/null || exit 1
echo "Removing ${1}..."
rm -r "${1}"
echo "Finished container tarball."
echo "Signing tarball..."
#shellcheck disable=SC2086
sudo -u "${_USER}" gpg ${_GPG} ${_PACMAN_ARCH_CHROOT} || exit 1
chown "${_USER}":"${_GROUP}" "${_PACMAN_ARCH_CHROOT}"{,.sig} || exit 1
echo "Uploading tarball to ${_SERVER}:${_SERVER_PACMAN_ARCH}..."
sudo -u "${_USER}" scp "${_PACMAN_ARCH_CHROOT}"{,.sig} "${_SERVER}:${_SERVER_PACMAN_ARCH}" || exit 1
echo "Finished."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/chroot-tarball.sh

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/release.sh
[[ -z "${1}" ]] && _usage
_root_check
_container_check
echo "Starting release creation in ${1}..."
_create_iso "$@" || exit 1
echo "Finished release creation in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/release.sh

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/server.sh
_root_check
_container_check
if echo "${_BASENAME}" | grep -qw riscv64 || echo "${_BASENAME}" | grep -qw aarch64; then
_update_pacman_chroot || exit 1
fi
_update_source
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_use_default || exit 1
fi
_server_release || exit 1
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_restore || exit 1
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/server-release.sh

View file

@ -1,61 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
_root_check
echo "Starting container creation..."
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
_cachedir_check
_create_pacman_conf "${1}"
_prepare_pacman "${1}" || exit 1
_pacman_parameters "${1}"
_install_base_packages "${1}" || exit 1
#_install_custom_grub "${1}"
_clean_mkinitcpio "${1}"
_clean_cache "${1}"
_install_archboot "${1}" || exit 1
_umount_special "${1}" || exit 1
_clean_cache "${1}"
_clean_container "${1}"
_generate_keyring "${1}" || exit 1
_copy_mirrorlist_and_pacman_conf "${1}"
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_copy_archboot_defaults "${1}"
# enable [*-testing] if enabled in host
if grep -q "^\[core-testing" /etc/pacman.conf; then
echo "Enable [core-testing] and [extra-testing] repository in container..."
sed -i -e '/^#\[core-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e '/^#\[extra-testing\]/ { n ; s/^#// }' "${1}/etc/pacman.conf"
sed -i -e 's:^#\[core-testing\]:\[core-testing\]:g' -e 's:^#\[extra-testing\]:\[extra-testing\]:g' "${1}/etc/pacman.conf"
fi
fi
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${1}" "use_binfmt"
_pacman_parameters "${1}" "use_binfmt"
_install_base_packages "${1}" "use_binfmt" || exit 1
_install_archboot "${1}" "use_binfmt" || exit 1
_clean_mkinitcpio "${1}"
_clean_container "${1}" 2>/dev/null
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_change_pacman_conf "${1}" || exit 1
_reproducibility "${1}"
_set_hostname "${1}" || exit 1
echo "Finished container setup in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/container.sh

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh
. /usr/lib/archboot/repository.sh
_CACHEDIR="${_REPODIR}/var/cache/pacman/pkg"
[[ -z "${1}" ]] && _usage
_root_check
[[ -d "${1}" ]] || (echo "Creating directory ${1}..."; mkdir "${1}")
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
echo "Starting repository creation..."
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
# running system = creating system
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && (_x86_64_pacman_use_default || exit 1)
_cachedir_check
[[ "${_RUNNING_ARCH}" == "x86_64" ]] || _create_pacman_conf "${_REPODIR}"
_prepare_pacman "${_REPODIR}" || exit 1
_pacman_parameters "${_REPODIR}"
_download_packages "${_REPODIR}" || exit 1
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && _x86_64_pacman_restore || exit 1
_umount_special "${_REPODIR}" || exit 1
else
# running system != creating system
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | grep -qw aarch64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
fi
if echo "${_BASENAME}" | grep -qw riscv64; then
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
fi
_create_pacman_conf "${_REPODIR}" "use_binfmt"
_pacman_parameters "${_REPODIR}" "use_binfmt"
_download_packages "${_REPODIR}" "use_binfmt" || exit 1
else
echo "Error: binfmt usage is only supported on x86_64!"
exit 1
fi
fi
_move_packages "${_REPODIR}" "${1}" || exit 1
_cleanup_repodir "${_REPODIR}" || exit 1
_create_archboot_db "${1}" || exit 1
echo "Finished repository creation in ${_REPODIR}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/repository.sh

View file

@ -1,50 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/iso.sh
[[ -z "${1}" ]] && _usage
_parameters "$@"
[[ "${_GENERATE}" == "1" ]] || _usage
_root_check
_architecture_check
_config
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
# running system = aarch64 or x86_64
echo "Starting ISO creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_ucode || exit 1
if echo "${_BASENAME}" | grep -qw aarch64; then
_prepare_fedora_shim_bootloaders_aarch64 || exit 1
_prepare_uefi_AA64 || exit 1
fi
if echo "${_BASENAME}" | grep -qw x86_64; then
_prepare_fedora_shim_bootloaders_x86_64 || exit 1
_prepare_uefi_shell_tianocore || exit 1
_prepare_uefi_X64 || exit 1
_prepare_uefi_IA32 || exit 1
_prepare_memtest || exit 1
fi
_prepare_efitools_uefi || exit 1
_prepare_background || exit 1
_reproducibility
_prepare_uefi_image || exit 1
_reproducibility
_grub_mkrescue || exit 1
_reproducibility_iso || exit 1
else
# running system = riscv64
echo "Starting Image creation..."
_prepare_kernel_initrd_files || exit 1
_prepare_extlinux_conf || exit 1
_reproducibility
_uboot || exit 1
fi
_create_cksum || exit 1
_cleanup_iso || exit 1
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
echo "Finished ISO creation."
else
echo "Finished Image creation."
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/iso.sh

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/release.sh
[[ -z "${1}" ]] && _usage
_root_check
_container_check
echo "Starting release creation in ${1}..."
_create_iso "$@" || exit 1
echo "Finished release creation in ${1}."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/release.sh

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
. /usr/lib/archboot/common.sh
. /usr/lib/archboot/server.sh
_root_check
_container_check
if echo "${_BASENAME}" | grep -qw riscv64 || echo "${_BASENAME}" | grep -qw aarch64; then
_update_pacman_chroot || exit 1
fi
_update_source
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_use_default || exit 1
fi
_server_release || exit 1
if echo "${_BASENAME}" | grep -qw x86_64; then
_x86_64_pacman_restore || exit 1
fi
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -0,0 +1 @@
../lib/archboot/run/server-release.sh