From b23c0114cefba5228eb4e197077213db3a667d71 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sat, 7 Sep 2024 15:28:11 +0200 Subject: [PATCH] fix release script --- usr/lib/archboot/common.sh | 10 ++-------- usr/lib/archboot/release.sh | 24 +++++++++++++----------- usr/lib/archboot/uki.sh | 4 +++- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/usr/lib/archboot/common.sh b/usr/lib/archboot/common.sh index 10becb87f..cdfb1b4bb 100644 --- a/usr/lib/archboot/common.sh +++ b/usr/lib/archboot/common.sh @@ -2,12 +2,12 @@ # SPDX-License-Identifier: GPL-3.0-or-later # created by Tobias Powalowski . /etc/archboot/defaults -_AMD_UCODE="boot/amd-ucode.img" +_AMD_UCODE="/boot/amd-ucode.img" _CACHEDIR="/var/cache/pacman/pkg" _CONFIG_DIR="/etc/archboot" _DLPROG="curl -L -s" _FIX_PACKAGES="libelf libevent talloc gcc-libs glibc glib2 icu pcre2 nss terminus-font" -_INTEL_UCODE="boot/intel-ucode.img" +_INTEL_UCODE="/boot/intel-ucode.img" _KERNELPKG="linux" _KEYRING="archlinux-keyring" _LABEL="Exit" @@ -373,12 +373,6 @@ _create_cpio() { echo "Build complete." } -_run_ukify() { - /usr/lib/systemd/ukify build --linux="${_KERNEL}" \ - ${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \ - --os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" &>"${_NO_LOG}" -} - _reproducibility() { # Reproducibility: set all timestamps to 0 fd . "${1}" -u --min-depth 1 -X touch -hcd "@0" diff --git a/usr/lib/archboot/release.sh b/usr/lib/archboot/release.sh index 95167d3e0..105f70788 100644 --- a/usr/lib/archboot/release.sh +++ b/usr/lib/archboot/release.sh @@ -95,7 +95,7 @@ _create_iso() { for i in *.iso; do if echo "${i}" | rg -v 'local' | rg -vq 'latest'; then mv "${_W_DIR}/${_AMD_UCODE}" boot/ - mv "${_W_DIR}/${_KERNEL}" boot/ + mv "${_KERNEL}" boot/ if [[ "${_ARCH}" == "aarch64" ]]; then # replace aarch64 Image.gz with Image kernel for UKI # compressed image is not working at the moment @@ -120,17 +120,19 @@ _create_iso() { mv "${_W_DIR}/usr/share/licenses/amd-ucode" licenses/ [[ "${_ARCH}" == "x86_64" ]] && mv "${_W_DIR}/usr/share/licenses/intel-ucode" licenses/ echo "Generating Unified Kernel Images..." - _KERNEL="boot/${_KERNEL##*/})" + _KERNEL="boot/${_KERNEL##*/}" [[ -n "${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=${_INTEL_UCODE}" _AMD_UCODE="--initrd=${_AMD_UCODE}" rm -r "${_W_DIR:?}"/boot mv boot "${_W_DIR}" for initrd in ${_INITRD} ${_INITRD_LATEST} ${_INITRD_LOCAL}; do - [[ "${initrd}" == "${_INITRD}" ]] && _UKI="boot/${_NAME}-${_ARCH}.efi" - [[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/${_NAME}-latest-${_ARCH}.efi" - [[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/${_NAME}-local-${_ARCH}.efi" + [[ "${initrd}" == "${_INITRD}" ]] && _UKI="/boot/${_NAME}-${_ARCH}.efi" + [[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="/boot/${_NAME}-latest-${_ARCH}.efi" + [[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="/boot/${_NAME}-local-${_ARCH}.efi" #shellcheck disable=SC2086 - ${_NSPAWN} "${_W_DIR}" _run_ukify + ${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux="${_KERNEL}" \ + ${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \ + --os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" || exit 1 done # fix permission and timestamp mv "${_W_DIR}"/boot ./ @@ -163,17 +165,17 @@ _create_iso() { ${_NSPAWN} "${_W_DIR}" pacman -Q | sd '\r|\x1b\[[0-9;]*m|\x1b\[.[0-9]+[h;l]' '') >>Release.txt echo "Removing container ${_W_DIR}..." rm -r "${_W_DIR}" - if ! [[ "${_ARCH}" == "riscv64" ]]; then + if [[ "${_ARCH}" == "riscv64" ]]; then + echo "Creating img/ directory..." + mkdir img + mv ./*.img img/ + else echo "Creating iso/ directory..." mkdir iso mv ./*.iso iso/ echo "Creating uki/ directory..." mkdir uki mv boot/*.efi uki/ - else - echo "Creating img/ directory..." - mkdir img - mv ./*.img img/ fi echo "Generating b2sum..." for i in *; do diff --git a/usr/lib/archboot/uki.sh b/usr/lib/archboot/uki.sh index 2768814dd..df1c8f7b0 100644 --- a/usr/lib/archboot/uki.sh +++ b/usr/lib/archboot/uki.sh @@ -62,7 +62,9 @@ _systemd_ukify() { [[ -n "/${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=/${_INTEL_UCODE}" _AMD_UCODE="--initrd=/${_AMD_UCODE}" #shellcheck disable=SC2086 - _run_ukify || exit 1 + /usr/lib/systemd/ukify build --linux="${_KERNEL}" \ + ${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \ + --os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" &>"${_NO_LOG}" || exit 1 } _create_cksum() {