mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
use CACHEDIR
This commit is contained in:
parent
01ad59a658
commit
b86a989dd3
4 changed files with 13 additions and 13 deletions
|
@ -201,12 +201,12 @@ _install_archboot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#_install_custom_grub() {
|
#_install_custom_grub() {
|
||||||
# [[ -e /var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst ]] && \
|
# [[ -e "${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst ]] && \
|
||||||
# cp "/var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst" \
|
# cp ""${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst" \
|
||||||
# "${1}/var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst"
|
# "${1}"${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst"
|
||||||
# [[ -e /var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig ]] && \
|
# [[ -e "${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig ]] && \
|
||||||
# cp "/var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig" \
|
# cp ""${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig" \
|
||||||
# "${1}/var/cache/pacman/pkg/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig"
|
# "${1}"${_CACHEDIR}"/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig"
|
||||||
#}
|
#}
|
||||||
|
|
||||||
_copy_mirrorlist_and_pacman_conf() {
|
_copy_mirrorlist_and_pacman_conf() {
|
||||||
|
|
|
@ -47,8 +47,8 @@ _create_iso() {
|
||||||
# generate local iso in container
|
# generate local iso in container
|
||||||
#if [[ "${_ARCH}" == "x86_64" ]]; then
|
#if [[ "${_ARCH}" == "x86_64" ]]; then
|
||||||
# echo "Adding custom grub..."
|
# echo "Adding custom grub..."
|
||||||
# ${_DLPROG} -O --output-dir "${_W_DIR}/var/cache/pacman/pkg "https://archboot.com/src/grub/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst" "
|
# ${_DLPROG} -O --output-dir "${_W_DIR}${_CACHEDIR} "https://archboot.com/src/grub/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst" "
|
||||||
# ${_DLPROG} -O --output-dir "${_W_DIR}/var/cache/pacman/pkg "https://archboot.com/src/grub/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig"
|
# ${_DLPROG} -O --output-dir "${_W_DIR}${_CACHEDIR} "https://archboot.com/src/grub/grub-2:2.06.r533.g78bc9a9b2-1-x86_64.pkg.tar.zst.sig"
|
||||||
#fi
|
#fi
|
||||||
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g -s \
|
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_ARCH}-iso.sh -g -s \
|
||||||
-c=${_CONFIG_LOCAL} -i=${_ISONAME}-local-${_ARCH}" || exit 1
|
-c=${_CONFIG_LOCAL} -i=${_ISONAME}-local-${_ARCH}" || exit 1
|
||||||
|
|
|
@ -12,7 +12,7 @@ _cleanup_cache() {
|
||||||
# remove packages from cache
|
# remove packages from cache
|
||||||
#shellcheck disable=SC2013
|
#shellcheck disable=SC2013
|
||||||
for i in $(grep 'installed' /var/log/pacman.log | cut -d ' ' -f 4); do
|
for i in $(grep 'installed' /var/log/pacman.log | cut -d ' ' -f 4); do
|
||||||
rm -rf /var/cache/pacman/pkg/"${i}"-[0-9]*
|
rm -rf "${_CACHEDIR}/${i}"-[0-9]*
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ _create_container() {
|
||||||
# add the db too on reboot
|
# add the db too on reboot
|
||||||
install -D -m644 "${_LOCAL_DB}" "${_W_DIR}""${_LOCAL_DB}"
|
install -D -m644 "${_LOCAL_DB}" "${_W_DIR}""${_LOCAL_DB}"
|
||||||
if [[ -n "${_L_INSTALL_COMPLETE}" ]]; then
|
if [[ -n "${_L_INSTALL_COMPLETE}" ]]; then
|
||||||
"archboot-${_RUNNING_ARCH}-create-container.sh" "${_W_DIR}" -cc --install-source=file:///var/cache/pacman/pkg >"${_LOG}" 2>&1 || exit 1
|
"archboot-${_RUNNING_ARCH}-create-container.sh" "${_W_DIR}" -cc --install-source=file://${_CACHEDIR} >"${_LOG}" 2>&1 || exit 1
|
||||||
fi
|
fi
|
||||||
# needed for checks
|
# needed for checks
|
||||||
cp "${_W_DIR}""${_LOCAL_DB}" "${_LOCAL_DB}"
|
cp "${_W_DIR}""${_LOCAL_DB}" "${_LOCAL_DB}"
|
||||||
|
@ -348,7 +348,7 @@ _new_image() {
|
||||||
_progress "1" "Removing files from /..."
|
_progress "1" "Removing files from /..."
|
||||||
_clean_archboot
|
_clean_archboot
|
||||||
_clean_kernel_cache
|
_clean_kernel_cache
|
||||||
[[ -d var/cache/pacman/pkg ]] && rm -f /var/cache/pacman/pkg/*
|
[[ -d "${_CACHEDIR}" ]] && rm -f "${_CACHEDIR}"/*
|
||||||
mkdir /archboot
|
mkdir /archboot
|
||||||
cd /archboot || exit 1
|
cd /archboot || exit 1
|
||||||
_W_DIR="$(mktemp -u archboot-release.XXX)"
|
_W_DIR="$(mktemp -u archboot-release.XXX)"
|
||||||
|
@ -358,7 +358,7 @@ _new_image() {
|
||||||
_create_container &
|
_create_container &
|
||||||
_progress_wait "2" "20" "Generating container in ${_W_DIR}..." "10"
|
_progress_wait "2" "20" "Generating container in ${_W_DIR}..." "10"
|
||||||
_progress "21" "Create archboot.db in ${_W_DIR}..."
|
_progress "21" "Create archboot.db in ${_W_DIR}..."
|
||||||
_create_archboot_db "${_W_DIR}"/var/cache/pacman/pkg > "${_LOG}"
|
_create_archboot_db "${_W_DIR}${CACHEDIR}" > "${_LOG}"
|
||||||
# riscv64 does not support kexec at the moment
|
# riscv64 does not support kexec at the moment
|
||||||
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
|
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
|
||||||
# removing not working lvm2 from latest image
|
# removing not working lvm2 from latest image
|
||||||
|
@ -367,7 +367,7 @@ _new_image() {
|
||||||
# generate local iso in container, umount tmp it's a tmpfs and weird things could happen then
|
# generate local iso in container, umount tmp it's a tmpfs and weird things could happen then
|
||||||
: > "${_W_DIR}"/.archboot
|
: > "${_W_DIR}"/.archboot
|
||||||
(${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*; archboot-${_RUNNING_ARCH}-iso.sh -g -s -p=${_PRESET_LOCAL} \
|
(${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*; archboot-${_RUNNING_ARCH}-iso.sh -g -s -p=${_PRESET_LOCAL} \
|
||||||
-i=${_ISONAME}-local-${_RUNNING_ARCH}" > "${_LOG}"; rm -rf "${_W_DIR}"/var/cache/pacman/pkg/*; rm "${_W_DIR}"/.archboot) &
|
-i=${_ISONAME}-local-${_RUNNING_ARCH}" > "${_LOG}"; rm -rf "${_W_DIR}${_CACHEDIR}"/*; rm "${_W_DIR}"/.archboot) &
|
||||||
_ram_check
|
_ram_check
|
||||||
_progress_wait "23" "55" "Generating local ISO..." "10"
|
_progress_wait "23" "55" "Generating local ISO..." "10"
|
||||||
# generate latest iso in container
|
# generate latest iso in container
|
||||||
|
|
Loading…
Reference in a new issue