armbian-next: add logging with size of actual built rootfs in MiB; debug tmpfs in trap & after pkgs done

This commit is contained in:
Ricardo Pardini 2023-01-17 23:57:28 +01:00
parent 164db02af5
commit ce47db1e0a
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02
2 changed files with 16 additions and 0 deletions

View File

@ -188,6 +188,10 @@ function main_default_build_single() {
display_alert "Target directory" "${DEB_STORAGE}/" "info"
display_alert "File name" "${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb" "info"
fi
# At this point, the WORKDIR should be clean. Add debug info.
debug_tmpfs_show_usage "AFTER ALL PKGS BUILT"
# build rootfs, if not only kernel.
if [[ $KERNEL_ONLY != yes ]]; then

View File

@ -81,6 +81,16 @@ function build_rootfs_and_image() {
# clean up / prepare for making the image
umount_chroot "$SDCARD"
# obtain the size, in MiB, of "${SDCARD}" at this point.
declare -i rootfs_size_mib
rootfs_size_mib=$(du -sm "${SDCARD}" | awk '{print $1}')
display_alert "Actual rootfs size" "${rootfs_size_mib}MiB" ""
# warn if rootfs_size_mib is higher than the tmpfs_estimated_size
if [[ ${rootfs_size_mib} -gt ${tmpfs_estimated_size} ]]; then
display_alert "Rootfs actual size is larger than estimated tmpfs size" "${rootfs_size_mib}MiB > ${tmpfs_estimated_size}MiB" "wrn"
fi
# ------------------------------------ UP HERE IT's 'rootfs' stuff -------------------------------
#------------------------------------ DOWN HERE IT's 'image' stuff -------------------------------
@ -114,6 +124,8 @@ function list_installed_packages() {
function trap_handler_cleanup_rootfs_and_image() {
display_alert "Cleanup for rootfs and image" "trap_handler_cleanup_rootfs_and_image" "cleanup"
debug_tmpfs_show_usage "before cleanup of rootfs"
cd "${SRC}" || echo "Failed to cwd to ${SRC}" # Move pwd away, so unmounts work
# those will loop until they're unmounted.
umount_chroot_recursive "${SDCARD}" "SDCARD" || true