diff --git a/usr/bin/archboot-aarch64-create-container.sh b/usr/bin/archboot-aarch64-create-container.sh deleted file mode 100755 index c80a4a7a0..000000000 --- a/usr/bin/archboot-aarch64-create-container.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/container.sh -[[ -z "${1}" ]] && _usage -_parameters "$@" -_root_check -echo "Starting container creation ..." -[[ -d "${1}" ]] || (echo "Create 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 - _clean_mkinitcpio "${1}" - _clean_cache "${1}" - _install_archboot "${1}" || exit 1 - _clean_cache "${1}" - _umount_special "${1}" || exit 1 - _fix_groups "${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 "^\[testing" /etc/pacman.conf; then - 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 - 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 - _fix_groups "${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} ." diff --git a/usr/bin/archboot-aarch64-create-container.sh b/usr/bin/archboot-aarch64-create-container.sh new file mode 120000 index 000000000..19a1ddda2 --- /dev/null +++ b/usr/bin/archboot-aarch64-create-container.sh @@ -0,0 +1 @@ +../lib/archboot/run/container.sh \ No newline at end of file diff --git a/usr/bin/archboot-aarch64-create-repository.sh b/usr/bin/archboot-aarch64-create-repository.sh deleted file mode 100755 index defefe8cb..000000000 --- a/usr/bin/archboot-aarch64-create-repository.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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 "Create 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} ." diff --git a/usr/bin/archboot-aarch64-create-repository.sh b/usr/bin/archboot-aarch64-create-repository.sh new file mode 120000 index 000000000..55850aaed --- /dev/null +++ b/usr/bin/archboot-aarch64-create-repository.sh @@ -0,0 +1 @@ +../lib/archboot/run/repository.sh \ No newline at end of file diff --git a/usr/bin/archboot-aarch64-iso.sh b/usr/bin/archboot-aarch64-iso.sh deleted file mode 100755 index f5e8f74e9..000000000 --- a/usr/bin/archboot-aarch64-iso.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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_initramfs_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_initramfs_files_RISCV64 || 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 diff --git a/usr/bin/archboot-aarch64-iso.sh b/usr/bin/archboot-aarch64-iso.sh new file mode 120000 index 000000000..b86f31830 --- /dev/null +++ b/usr/bin/archboot-aarch64-iso.sh @@ -0,0 +1 @@ +../lib/archboot/run/iso.sh \ No newline at end of file diff --git a/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh b/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh deleted file mode 100755 index 07f598640..000000000 --- a/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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} " - 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 "Create directory ${1} ..." -mkdir -p "${1}"/"${_PACMAN_ARCH}" -echo "Downloading archlinux ${_ARCH} ..." -! [[ -f ${_ARCH_VERSION} ]] && wget "${_LATEST_ARCH}" >/dev/null 2>&1 -bsdtar -xf ${_ARCH_VERSION} -C "${1}" -echo "Removing installation tarball ..." -rm ${_ARCH_VERSION} -_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 2>&1 -_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 2>&1 || exit 1 -echo "Removing ${1} ..." -rm -r "${1}" -echo "Finished container tarball." -echo "Sign 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." diff --git a/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh b/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh new file mode 120000 index 000000000..fc93ac8c9 --- /dev/null +++ b/usr/bin/archboot-aarch64-pacman-chroot-tarball.sh @@ -0,0 +1 @@ +../lib/archboot/run/chroot-tarball.sh \ No newline at end of file diff --git a/usr/bin/archboot-aarch64-release.sh b/usr/bin/archboot-aarch64-release.sh deleted file mode 100755 index cc2f1233a..000000000 --- a/usr/bin/archboot-aarch64-release.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/release.sh -[[ -z "${1}" ]] && _usage -_root_check -_container_check -echo "Start release creation in ${1} ..." -_create_iso "$@" || exit 1 -_create_boot || exit 1 -_create_cksum || exit 1 -echo "Finished release creation in ${1} ." - diff --git a/usr/bin/archboot-aarch64-release.sh b/usr/bin/archboot-aarch64-release.sh new file mode 120000 index 000000000..e19eefaec --- /dev/null +++ b/usr/bin/archboot-aarch64-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/release.sh \ No newline at end of file diff --git a/usr/bin/archboot-aarch64-server-release.sh b/usr/bin/archboot-aarch64-server-release.sh deleted file mode 100755 index 3df76d414..000000000 --- a/usr/bin/archboot-aarch64-server-release.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -. /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 diff --git a/usr/bin/archboot-aarch64-server-release.sh b/usr/bin/archboot-aarch64-server-release.sh new file mode 120000 index 000000000..8f8e843ec --- /dev/null +++ b/usr/bin/archboot-aarch64-server-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/server-release.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-create-container.sh b/usr/bin/archboot-riscv64-create-container.sh deleted file mode 100755 index c80a4a7a0..000000000 --- a/usr/bin/archboot-riscv64-create-container.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/container.sh -[[ -z "${1}" ]] && _usage -_parameters "$@" -_root_check -echo "Starting container creation ..." -[[ -d "${1}" ]] || (echo "Create 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 - _clean_mkinitcpio "${1}" - _clean_cache "${1}" - _install_archboot "${1}" || exit 1 - _clean_cache "${1}" - _umount_special "${1}" || exit 1 - _fix_groups "${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 "^\[testing" /etc/pacman.conf; then - 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 - 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 - _fix_groups "${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} ." diff --git a/usr/bin/archboot-riscv64-create-container.sh b/usr/bin/archboot-riscv64-create-container.sh new file mode 120000 index 000000000..19a1ddda2 --- /dev/null +++ b/usr/bin/archboot-riscv64-create-container.sh @@ -0,0 +1 @@ +../lib/archboot/run/container.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-create-repository.sh b/usr/bin/archboot-riscv64-create-repository.sh deleted file mode 100755 index defefe8cb..000000000 --- a/usr/bin/archboot-riscv64-create-repository.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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 "Create 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} ." diff --git a/usr/bin/archboot-riscv64-create-repository.sh b/usr/bin/archboot-riscv64-create-repository.sh new file mode 120000 index 000000000..55850aaed --- /dev/null +++ b/usr/bin/archboot-riscv64-create-repository.sh @@ -0,0 +1 @@ +../lib/archboot/run/repository.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-iso.sh b/usr/bin/archboot-riscv64-iso.sh deleted file mode 100755 index f5e8f74e9..000000000 --- a/usr/bin/archboot-riscv64-iso.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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_initramfs_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_initramfs_files_RISCV64 || 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 diff --git a/usr/bin/archboot-riscv64-iso.sh b/usr/bin/archboot-riscv64-iso.sh new file mode 120000 index 000000000..b86f31830 --- /dev/null +++ b/usr/bin/archboot-riscv64-iso.sh @@ -0,0 +1 @@ +../lib/archboot/run/iso.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh b/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh deleted file mode 100755 index 07f598640..000000000 --- a/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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} " - 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 "Create directory ${1} ..." -mkdir -p "${1}"/"${_PACMAN_ARCH}" -echo "Downloading archlinux ${_ARCH} ..." -! [[ -f ${_ARCH_VERSION} ]] && wget "${_LATEST_ARCH}" >/dev/null 2>&1 -bsdtar -xf ${_ARCH_VERSION} -C "${1}" -echo "Removing installation tarball ..." -rm ${_ARCH_VERSION} -_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 2>&1 -_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 2>&1 || exit 1 -echo "Removing ${1} ..." -rm -r "${1}" -echo "Finished container tarball." -echo "Sign 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." diff --git a/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh b/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh new file mode 120000 index 000000000..fc93ac8c9 --- /dev/null +++ b/usr/bin/archboot-riscv64-pacman-chroot-tarball.sh @@ -0,0 +1 @@ +../lib/archboot/run/chroot-tarball.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-release.sh b/usr/bin/archboot-riscv64-release.sh deleted file mode 100755 index cc2f1233a..000000000 --- a/usr/bin/archboot-riscv64-release.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/release.sh -[[ -z "${1}" ]] && _usage -_root_check -_container_check -echo "Start release creation in ${1} ..." -_create_iso "$@" || exit 1 -_create_boot || exit 1 -_create_cksum || exit 1 -echo "Finished release creation in ${1} ." - diff --git a/usr/bin/archboot-riscv64-release.sh b/usr/bin/archboot-riscv64-release.sh new file mode 120000 index 000000000..e19eefaec --- /dev/null +++ b/usr/bin/archboot-riscv64-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/release.sh \ No newline at end of file diff --git a/usr/bin/archboot-riscv64-server-release.sh b/usr/bin/archboot-riscv64-server-release.sh deleted file mode 100755 index 3df76d414..000000000 --- a/usr/bin/archboot-riscv64-server-release.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -. /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 diff --git a/usr/bin/archboot-riscv64-server-release.sh b/usr/bin/archboot-riscv64-server-release.sh new file mode 120000 index 000000000..8f8e843ec --- /dev/null +++ b/usr/bin/archboot-riscv64-server-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/server-release.sh \ No newline at end of file diff --git a/usr/bin/archboot-x86_64-create-container.sh b/usr/bin/archboot-x86_64-create-container.sh deleted file mode 100755 index c80a4a7a0..000000000 --- a/usr/bin/archboot-x86_64-create-container.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/container.sh -[[ -z "${1}" ]] && _usage -_parameters "$@" -_root_check -echo "Starting container creation ..." -[[ -d "${1}" ]] || (echo "Create 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 - _clean_mkinitcpio "${1}" - _clean_cache "${1}" - _install_archboot "${1}" || exit 1 - _clean_cache "${1}" - _umount_special "${1}" || exit 1 - _fix_groups "${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 "^\[testing" /etc/pacman.conf; then - 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 - 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 - _fix_groups "${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} ." diff --git a/usr/bin/archboot-x86_64-create-container.sh b/usr/bin/archboot-x86_64-create-container.sh new file mode 120000 index 000000000..19a1ddda2 --- /dev/null +++ b/usr/bin/archboot-x86_64-create-container.sh @@ -0,0 +1 @@ +../lib/archboot/run/container.sh \ No newline at end of file diff --git a/usr/bin/archboot-x86_64-create-repository.sh b/usr/bin/archboot-x86_64-create-repository.sh deleted file mode 100755 index defefe8cb..000000000 --- a/usr/bin/archboot-x86_64-create-repository.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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 "Create 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} ." diff --git a/usr/bin/archboot-x86_64-create-repository.sh b/usr/bin/archboot-x86_64-create-repository.sh new file mode 120000 index 000000000..55850aaed --- /dev/null +++ b/usr/bin/archboot-x86_64-create-repository.sh @@ -0,0 +1 @@ +../lib/archboot/run/repository.sh \ No newline at end of file diff --git a/usr/bin/archboot-x86_64-iso.sh b/usr/bin/archboot-x86_64-iso.sh deleted file mode 100755 index f5e8f74e9..000000000 --- a/usr/bin/archboot-x86_64-iso.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /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_initramfs_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_initramfs_files_RISCV64 || 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 diff --git a/usr/bin/archboot-x86_64-iso.sh b/usr/bin/archboot-x86_64-iso.sh new file mode 120000 index 000000000..b86f31830 --- /dev/null +++ b/usr/bin/archboot-x86_64-iso.sh @@ -0,0 +1 @@ +../lib/archboot/run/iso.sh \ No newline at end of file diff --git a/usr/bin/archboot-x86_64-release.sh b/usr/bin/archboot-x86_64-release.sh deleted file mode 100755 index cc2f1233a..000000000 --- a/usr/bin/archboot-x86_64-release.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# created by Tobias Powalowski -. /usr/lib/archboot/common.sh -. /usr/lib/archboot/release.sh -[[ -z "${1}" ]] && _usage -_root_check -_container_check -echo "Start release creation in ${1} ..." -_create_iso "$@" || exit 1 -_create_boot || exit 1 -_create_cksum || exit 1 -echo "Finished release creation in ${1} ." - diff --git a/usr/bin/archboot-x86_64-release.sh b/usr/bin/archboot-x86_64-release.sh new file mode 120000 index 000000000..e19eefaec --- /dev/null +++ b/usr/bin/archboot-x86_64-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/release.sh \ No newline at end of file diff --git a/usr/bin/archboot-x86_64-server-release.sh b/usr/bin/archboot-x86_64-server-release.sh deleted file mode 100755 index 3df76d414..000000000 --- a/usr/bin/archboot-x86_64-server-release.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -. /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 diff --git a/usr/bin/archboot-x86_64-server-release.sh b/usr/bin/archboot-x86_64-server-release.sh new file mode 120000 index 000000000..8f8e843ec --- /dev/null +++ b/usr/bin/archboot-x86_64-server-release.sh @@ -0,0 +1 @@ +../lib/archboot/run/server-release.sh \ No newline at end of file