From 0278ea94f8ca52b5024550db5f97b4abda013fad Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 30 Apr 2023 15:24:51 +0200 Subject: [PATCH] reformat messages --- usr/lib/archboot/iso.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/usr/lib/archboot/iso.sh b/usr/lib/archboot/iso.sh index 2c1c4c27a..be54bb8f2 100644 --- a/usr/lib/archboot/iso.sh +++ b/usr/lib/archboot/iso.sh @@ -52,31 +52,35 @@ _config() { # https://sourceware.org/bugzilla/show_bug.cgi?id=29009 # - only left option is extlinux support in u-boot loader _prepare_kernel_initramfs_files() { - echo "Preparing kernel and initramfs..." #shellcheck disable=SC1090 source "${_PRESET}" mkdir -p "${_ISODIR}"/EFI/{BOOT,TOOLS} mkdir -p "${_ISODIR}/boot" - if [[ -f "./init-${_ARCH}.img" ]]; then - echo "Using existing ./init-${_ARCH}.img initramfs..." - cp ./init-${_ARCH}.img ${_ISODIR}/boot/ - else - echo "Creating init-${_ARCH}.img initramfs..." - archboot-cpio.sh -c "/etc/archboot/${_ARCH}-init.conf" -k "${ALL_kver}" -g "${_ISODIR}/boot/init-${_ARCH}.img" || exit 1 - # save init ramdisk for further images - cp ${_ISODIR}/boot/init-${_ARCH}.img ./ - fi - #shellcheck disable=SC2154 - archboot-cpio.sh -c "${MKINITCPIO_CONFIG}" -k "${ALL_kver}" -g "${_ISODIR}/boot/initramfs-${_ARCH}.img" || exit 1 - # delete cachedir on archboot environment - [[ "$(cat /etc/hostname)" == "archboot" ]] && rm -rf /var/cache/pacman/pkg # needed to hash the kernel for secureboot enabled systems + echo "Preparing kernel..." if [[ "${_ARCH}" == "x86_64" || "${_ARCH}" == "riscv64" ]]; then install -m644 "${ALL_kver}" "${_ISODIR}/boot/vmlinuz-${_ARCH}" fi if [[ "${_ARCH}" == "aarch64" ]]; then install -m644 "${ALL_kver}" "${_ISODIR}/boot/Image-${_ARCH}.gz" fi + if [[ -f "./init-${_ARCH}.img" ]]; then + echo "Using existing init-${_ARCH}.img..." + cp ./init-${_ARCH}.img ${_ISODIR}/boot/ + else + echo "Preparing init-${_ARCH}.img..." + archboot-cpio.sh -c "/etc/archboot/${_ARCH}-init.conf" -k "${ALL_kver}" -g "${_ISODIR}/boot/init-${_ARCH}.img" || exit 1 + # save init ramdisk for further images + cp ${_ISODIR}/boot/init-${_ARCH}.img ./ + fi + echo "Preparing initramfs-${_ARCH}.img..." + #shellcheck disable=SC2154 + archboot-cpio.sh -c "${MKINITCPIO_CONFIG}" -k "${ALL_kver}" -g "${_ISODIR}/boot/initramfs-${_ARCH}.img" || exit 1 + # delete cachedir on archboot environment + if grep -qw 'archboot' /etc/hostname; then + echo "Removing /var/cache/pacman/pkg..." + rm -rf /var/cache/pacman/pkg + fi } _prepare_ucode() {