Cache creation cleanup (#4036)
* Cache creation cleanup Closing https://github.com/armbian/build/issues/3531 * Remove monthoffset parameter from action script * - address displaying which variant is needed - remove not needed text - change ROOT_FS_CREATE_ONLY to yes / no
This commit is contained in:
parent
1f8d905f1d
commit
be8b2dcf01
14
.github/workflows/update-cache.yml
vendored
14
.github/workflows/update-cache.yml
vendored
@ -19,11 +19,6 @@ on:
|
||||
- 'config/desktop/**'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
monthoffset:
|
||||
description: Forced month offset
|
||||
required: true
|
||||
default: 0
|
||||
|
||||
jobs:
|
||||
|
||||
@ -111,7 +106,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'minimal:uefi-x86'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -133,7 +127,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'server:uefi-x86'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -155,7 +148,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'desktop:uefi-x86'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -177,7 +169,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'minimal:tinkerboard'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -200,7 +191,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'server:tinkerboard'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -221,7 +211,6 @@ jobs:
|
||||
|
||||
with:
|
||||
variant: 'desktop:tinkerboard'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -243,7 +232,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'minimal:uefi-arm64'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -265,7 +253,6 @@ jobs:
|
||||
with:
|
||||
|
||||
variant: 'server:uefi-arm64'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
@ -286,7 +273,6 @@ jobs:
|
||||
|
||||
with:
|
||||
variant: 'desktop:uefi-arm64'
|
||||
monthoffset: ${{ inputs.monthoffset }}
|
||||
rootfscache_version: ${{ needs.release-start.outputs.rootfscache_version }}
|
||||
|
||||
secrets:
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#
|
||||
debootstrap_ng()
|
||||
{
|
||||
display_alert "Starting rootfs and image building process for" "${BRANCH} ${BOARD} ${RELEASE} ${DESKTOP_APPGROUPS_SELECTED} ${DESKTOP_ENVIRONMENT} ${BUILD_MINIMAL}" "info"
|
||||
display_alert "Checking for rootfs cache" "$(echo "${BRANCH} ${BOARD} ${RELEASE} ${DESKTOP_APPGROUPS_SELECTED} ${DESKTOP_ENVIRONMENT} ${BUILD_MINIMAL}" | tr -s " ")" "info"
|
||||
|
||||
[[ $ROOTFS_TYPE != ext4 ]] && display_alert "Assuming $BOARD $BRANCH kernel supports $ROOTFS_TYPE" "" "wrn"
|
||||
|
||||
@ -130,17 +130,13 @@ create_rootfs_cache()
|
||||
local cache_fname=${SRC}/cache/rootfs/${cache_name}
|
||||
local display_name=${RELEASE}-${cache_type}-${ARCH}.${packages_hash:0:3}...${packages_hash:29}.tar.lz4
|
||||
|
||||
[[ "$ROOT_FS_CREATE_ONLY" == force ]] && break
|
||||
|
||||
if [[ -f ${cache_fname} && -f ${cache_fname}.aria2 ]]; then
|
||||
if [[ -f ${cache_fname} && -f ${cache_fname}.aria2 && "$ROOT_FS_CREATE_ONLY" != "yes" ]]; then
|
||||
rm ${cache_fname}*
|
||||
display_alert "Partially downloaded file. Re-start."
|
||||
download_and_verify "_rootfs" "$cache_name"
|
||||
fi
|
||||
|
||||
display_alert "Checking local cache" "$display_name" "info"
|
||||
|
||||
if [[ -f ${cache_fname} && -n "$ROOT_FS_CREATE_ONLY" ]]; then
|
||||
if [[ -f ${cache_fname} && "$ROOT_FS_CREATE_ONLY" == "yes" ]]; then
|
||||
echo "$cache_fname" > $cache_fname.current
|
||||
display_alert "Checking cache integrity" "$display_name" "info"
|
||||
sudo lz4 -tqq ${cache_fname}
|
||||
@ -150,27 +146,14 @@ create_rootfs_cache()
|
||||
[[ -n ${SUDO_USER} ]] && sudo chown -R ${SUDO_USER}:${SUDO_USER} "${DEST}"/images/
|
||||
echo "${GPG_PASS}" | sudo -H -u ${SUDO_USER} bash -c "gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes ${cache_fname}" || exit 1
|
||||
fi
|
||||
break
|
||||
elif [[ -f ${cache_fname} ]]; then
|
||||
break
|
||||
else
|
||||
elif [[ "$ROOT_FS_CREATE_ONLY" != "yes" ]]; then
|
||||
display_alert "searching on servers"
|
||||
download_and_verify "_rootfs" "$cache_name"
|
||||
[[ -f ${cache_fname} ]] && break
|
||||
fi
|
||||
|
||||
# if aria2 file exists download didn't succeeded
|
||||
if [[ -f $cache_fname && ! -f $cache_fname.aria2 ]]; then
|
||||
|
||||
# speed up checking
|
||||
if [[ -n "$ROOT_FS_CREATE_ONLY" ]]; then
|
||||
echo "$cache_fname" > $cache_fname.current
|
||||
umount --lazy "$SDCARD"
|
||||
rm -rf $SDCARD
|
||||
# remove exit trap
|
||||
trap - INT TERM EXIT
|
||||
exit
|
||||
fi
|
||||
|
||||
local date_diff=$(( ($(date +%s) - $(stat -c %Y $cache_fname)) / 86400 ))
|
||||
display_alert "Extracting $display_name" "$date_diff days old" "info"
|
||||
pv -p -b -r -c -N "[ .... ] $display_name" "$cache_fname" | lz4 -dc | tar xp --xattrs -C $SDCARD/
|
||||
@ -179,7 +162,7 @@ create_rootfs_cache()
|
||||
echo "nameserver $NAMESERVER" >> $SDCARD/etc/resolv.conf
|
||||
create_sources_list "$RELEASE" "$SDCARD/"
|
||||
else
|
||||
display_alert "... remote not found" "Creating new rootfs cache for $RELEASE" "info"
|
||||
display_alert "Creating new rootfs cache for" "$RELEASE" "info"
|
||||
|
||||
# stage: debootstrap base system
|
||||
if [[ $NO_APT_CACHER != yes ]]; then
|
||||
@ -393,7 +376,7 @@ create_rootfs_cache()
|
||||
fi
|
||||
|
||||
# used for internal purposes. Faster rootfs cache rebuilding
|
||||
if [[ -n "$ROOT_FS_CREATE_ONLY" ]]; then
|
||||
if [[ "$ROOT_FS_CREATE_ONLY" == "yes" ]]; then
|
||||
umount --lazy "$SDCARD"
|
||||
rm -rf $SDCARD
|
||||
# remove exit trap
|
||||
|
||||
Loading…
Reference in New Issue
Block a user