armbian-next: rootfs: adapt to new reality after huge refactor

- make `tmpfs_estimated_size` and `available_physical_memory_mib` readonly and global and only ever set once
- remove subshell from `get_rootfs_cache_list()`, new version `get_rootfs_cache_list_into_array_variable()` for sanity
- warns if `ROOT_FS_CREATE_ONLY=yes` is set during cached build path
- add a `wait_for_disk_sync()` after restoring rootfs cache
- fix logging sections for `build_rootfs_only()` and `prepare_rootfs_build_params_and_trap()` in `build_rootfs_and_image()`
- remove the logging section from `get_or_create_rootfs_cache_chroot_sdcard()` call in `build_rootfs_only()` (which is now itself logged)
- @TODO: `deploy_qemu_binary_to_chroot()` is leaking a qemu bin in rootfs cache!
This commit is contained in:
Ricardo Pardini
2023-01-22 16:09:38 +01:00
parent 28d89e2c91
commit 091ae1d27f
5 changed files with 54 additions and 24 deletions

View File

@@ -4,11 +4,10 @@ function build_rootfs_and_image() {
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"
declare -i tmpfs_estimated_size # in MiB; set by prepare_rootfs_build_params_and_trap()
prepare_rootfs_build_params_and_trap
LOG_SECTION="prepare_rootfs_build_params_and_trap" do_with_logging prepare_rootfs_build_params_and_trap
# get a basic rootfs, either from cache or from scratch
build_rootfs_only
LOG_SECTION="build_rootfs_only" do_with_logging build_rootfs_only # only occurrence of this
# stage: with a basic rootfs available, we mount the chroot and work on it
mount_chroot "${SDCARD}"
@@ -86,4 +85,3 @@ function list_installed_packages() {
display_alert "Recording list of installed packages" "asset log" "debug"
LOG_ASSET="installed_packages.txt" do_with_log_asset chroot_sdcard dpkg --get-selections "| grep -v deinstall | awk '{print \$1}' | cut -f1 -d':'"
}