mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
rearrange the pacman cache inclusion
This commit is contained in:
parent
ca55ae2b48
commit
4b018aa3c6
11 changed files with 49 additions and 45 deletions
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
|
14
usr/lib/initcpio/install/archboot_cache
Normal file
14
usr/lib/initcpio/install/archboot_cache
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
{
|
||||
add_full_dir /var/cache/pacman/pkg
|
||||
}
|
||||
|
||||
help ()
|
||||
{
|
||||
cat<<HELPEOF
|
||||
This hook includes /var/cache/pacman/pkg.
|
||||
HELPEOF
|
||||
}
|
16
usr/lib/initcpio/install/archboot_cache_cleanup
Normal file
16
usr/lib/initcpio/install/archboot_cache_cleanup
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
{
|
||||
rm -r /var/cache/pacman/pkg
|
||||
}
|
||||
|
||||
help ()
|
||||
{
|
||||
cat<<HELPEOF
|
||||
This hook removes /var/cache/pacman/pkg
|
||||
for update installer routine.
|
||||
DO NOT USE ON REGULAR SYSTEM!.
|
||||
HELPEOF
|
||||
}
|
|
@ -10,12 +10,6 @@ build ()
|
|||
add_file "/usr/lib/archboot/release_functions"
|
||||
add_file "/usr/bin/archboot-setup.sh" "/usr/bin/setup"
|
||||
add_file "/usr/bin/archboot-quickinst.sh" "/usr/bin/quickinst"
|
||||
# only include cachedir on booted archboot or container
|
||||
if [[ -e "/etc/hostname" ]]; then
|
||||
[[ "$(cat /etc/hostname)" == "archboot" ]] && add_full_dir "/var/cache/pacman/pkg"
|
||||
else
|
||||
add_full_dir "/var/cache/pacman/pkg"
|
||||
fi
|
||||
}
|
||||
|
||||
help ()
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
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<<HELPEOF
|
||||
This hook includes the archboot sources to
|
||||
/var/cache/pacman/pkg for local installation.
|
||||
HELPEOF
|
||||
}
|
Loading…
Reference in a new issue