armbian-next: rootfs: reset UID of produced rootfs tarball; announce what is doing and what has done

This commit is contained in:
Ricardo Pardini
2023-01-22 18:24:16 +01:00
parent 6077d40f9b
commit 695bfb387b
2 changed files with 11 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ function cli_rootfs_run() {
# default build, but only invoke specific rootfs functions needed. It has its own logging sections.
do_with_default_build cli_rootfs_only_in_default_build < /dev/null # no stdin for this, so it bombs if tries to be interactive.
reset_uid_owner "${BUILT_ROOTFS_CACHE_FILE}"
display_alert "Rootfs build complete" "${BUILT_ROOTFS_CACHE_NAME}" "info"
display_alert "Rootfs build complete, file: " "${BUILT_ROOTFS_CACHE_FILE}" "info"
}
# This is run inside do_with_default_build(), above.
@@ -43,6 +48,8 @@ function cli_rootfs_only_in_default_build() {
LOG_SECTION="calculate_rootfs_cache_id" do_with_logging calculate_rootfs_cache_id
display_alert "Going to build rootfs" "packages_hash: '${packages_hash:-}' cache_type: '${cache_type:-}'" "info"
# "rootfs" CLI skips over a lot goes straight to create the rootfs. It doesn't check cache etc.
LOG_SECTION="create_new_rootfs_cache" do_with_logging create_new_rootfs_cache
}

View File

@@ -167,6 +167,10 @@ function create_new_rootfs_cache() {
# needed for backend to keep current only @TODO: still needed?
echo "$cache_fname" > "${cache_fname}.current"
# define a readonly global with the name of the cache
declare -g -r BUILT_ROOTFS_CACHE_NAME="${cache_name}"
declare -g -r BUILT_ROOTFS_CACHE_FILE="${cache_fname}"
return 0 # protect against possible future short-circuiting above this
}