diff --git a/etc/archboot/aarch64-local.conf b/etc/archboot/aarch64-local.conf index 9f4789bea..3c53bd94f 100644 --- a/etc/archboot/aarch64-local.conf +++ b/etc/archboot/aarch64-local.conf @@ -12,7 +12,7 @@ FILES=() # Please change the hooks only if you know what you are doing. HOOKS=(udev keyboard archboot_base_common archboot_base_latest \ archboot_installer_common archboot_installer_latest archboot_kexec \ -archboot_licenses archboot_installer_local) +archboot_licenses archboot_cache) # COMPRESSION # Use this to compress the initramfs image. By default, gzip compression diff --git a/etc/archboot/aarch64-update_installer.conf b/etc/archboot/aarch64-update_installer.conf index d2bbc8532..8c51b8587 100644 --- a/etc/archboot/aarch64-update_installer.conf +++ b/etc/archboot/aarch64-update_installer.conf @@ -10,10 +10,10 @@ FILES=() # SETUP # # Please change the hooks only if you know what you are doing. -HOOKS=(archboot_base archboot_base_cleanup archboot_firmware archboot_firmware_cleanup \ -archboot_base_common archboot_base_common_cleanup archboot_filesystems \ -archboot_filesystems_cleanup archboot_net archboot_net_cleanup block dmraid lvm2 \ -encrypt btrfs keyboard archboot_acpi archboot_kms udev archboot_cpufreq \ +HOOKS=(archboot_cache archboot_cache_cleanup archboot_base archboot_base_cleanup \ +archboot_firmware archboot_firmware_cleanup archboot_base_common archboot_base_common_cleanup \ +archboot_filesystems archboot_filesystems_cleanup archboot_net archboot_net_cleanup \ +block dmraid lvm2 encrypt btrfs keyboard archboot_acpi archboot_kms udev archboot_cpufreq \ archboot_devicemapper archboot_hypervisor archboot_linux_atm \ archboot_net_common archboot_platform archboot_wireless archboot_wireless_staging \ archboot_installer_common archboot_installer archboot_installer_cleanup archboot_tz \ diff --git a/etc/archboot/x86_64-local.conf b/etc/archboot/x86_64-local.conf index 9f4789bea..3c53bd94f 100644 --- a/etc/archboot/x86_64-local.conf +++ b/etc/archboot/x86_64-local.conf @@ -12,7 +12,7 @@ FILES=() # Please change the hooks only if you know what you are doing. HOOKS=(udev keyboard archboot_base_common archboot_base_latest \ archboot_installer_common archboot_installer_latest archboot_kexec \ -archboot_licenses archboot_installer_local) +archboot_licenses archboot_cache) # COMPRESSION # Use this to compress the initramfs image. By default, gzip compression diff --git a/etc/archboot/x86_64-update_installer.conf b/etc/archboot/x86_64-update_installer.conf index d567eef7c..ba9f28a95 100644 --- a/etc/archboot/x86_64-update_installer.conf +++ b/etc/archboot/x86_64-update_installer.conf @@ -10,11 +10,11 @@ FILES=() # SETUP # # Please change the hooks only if you know what you are doing. -HOOKS=(archboot_base archboot_base_cleanup archboot_firmware archboot_firmware_cleanup \ -archboot_base_common archboot_base_common_cleanup archboot_filesystems \ -archboot_filesystems_cleanup archboot_net archboot_net_cleanup block dmraid lvm2 encrypt \ -btrfs keyboard archboot_acpi archboot_kms udev archboot_cpufreq archboot_devicemapper \ -archboot_pcspkr archboot_hypervisor archboot_linux_atm archboot_net_common \ +HOOKS=(archboot_cache archboot_cache_cleanup archboot_base archboot_base_cleanup \ +archboot_firmware archboot_firmware_cleanup archboot_base_common archboot_base_common_cleanup \ +archboot_filesystems archboot_filesystems_cleanup archboot_net archboot_net_cleanup block \ +dmraid lvm2 encrypt btrfs keyboard archboot_acpi archboot_kms udev archboot_cpufreq +archboot_devicemapper archboot_pcspkr archboot_hypervisor archboot_linux_atm archboot_net_common \ archboot_dmidecode archboot_platform archboot_wireless archboot_wireless_staging \ archboot_installer_common archboot_installer archboot_installer_cleanup archboot_tz \ archboot_keymap archboot_motd archboot_hwdetect archboot_mdadm mdadm_udev archboot_lvm2 \ diff --git a/usr/lib/archboot/functions b/usr/lib/archboot/functions index 407a98379..703b9a523 100644 --- a/usr/lib/archboot/functions +++ b/usr/lib/archboot/functions @@ -98,3 +98,9 @@ _fix_aarch64_network() { rm "${1}"/etc/resolv.conf echo "nameserver 8.8.8.8" > "${1}"/etc/resolv.conf } + +_create_archboot_db() { + echo "Creating archboot repository db ..." + #shellcheck disable=SC2046 + LANG=C repo-add -q "${1}"/archboot.db.tar.gz $(find "${1}"/ -type f ! -name '*.sig') +} diff --git a/usr/lib/archboot/release_functions b/usr/lib/archboot/release_functions index c9c6dc7ea..611fd3830 100644 --- a/usr/lib/archboot/release_functions +++ b/usr/lib/archboot/release_functions @@ -25,7 +25,8 @@ _create_iso() { mkdir -p "${1}" cd "${1}" || exit 1 # create container - archboot-"${_ARCH}"-create-container.sh "${_W_DIR}" -cc -cp --install-source="${2}" || exit 1 + archboot-"${_ARCH}"-create-container.sh "${_W_DIR}" -cc --install-source="${2}" || exit 1 + _create_archboot_db "${_W_DIR}"/var/cache/pacman/pkg # generate tarball in container, umount tmp it's a tmpfs and weird things could happen then echo "Generate ISO ..." # generate iso in container diff --git a/usr/lib/archboot/repository_functions b/usr/lib/archboot/repository_functions index f583ff0db..9c37777d0 100644 --- a/usr/lib/archboot/repository_functions +++ b/usr/lib/archboot/repository_functions @@ -37,8 +37,3 @@ _cleanup_repodir() { rm -r "${1}" } -_create_archboot_db() { - echo "Creating archboot repository db ..." - #shellcheck disable=SC2046 - LANG=C repo-add -q "${1}"/archboot.db.tar.gz $(find "${1}"/ -type f ! -name '*.sig') -} diff --git a/usr/lib/initcpio/install/archboot_cache b/usr/lib/initcpio/install/archboot_cache new file mode 100644 index 000000000..b9b560421 --- /dev/null +++ b/usr/lib/initcpio/install/archboot_cache @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Created by Tobias Powalowski + +build () +{ + add_full_dir /var/cache/pacman/pkg +} + +help () +{ +cat< + +build () +{ + rm -r /var/cache/pacman/pkg +} + +help () +{ +cat< - -build () -{ - source /etc/archboot/defaults - # only include cachedir on booted archboot or container - for i in "${_ISO_HOME_SOURCE}""${_DIR}"/*;do - [[ ! -L "${i}" ]] && add_file "$i" "/var/cache/pacman/pkg/$(basename $i)" - done - # fix symlinks - add_symlink "/var/cache/pacman/pkg/archboot.db" "/var/cache/pacman/pkg/archboot.db.tar.gz" - add_symlink "/var/cache/pacman/pkg/archboot.files" "/var/cache/pacman/pkg/archboot.files.tar.gz" -} - -help () -{ -cat<