mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 05:26:58 +02:00
build_sysext: Generate reports
This commit is contained in:
parent
ec723be9d9
commit
e69801b982
21
build_sysext
21
build_sysext
@ -59,7 +59,8 @@ FLAGS "$@" || exit 1
|
|||||||
|
|
||||||
eval set -- "${FLAGS_ARGV}"
|
eval set -- "${FLAGS_ARGV}"
|
||||||
|
|
||||||
. "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1
|
source "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1
|
||||||
|
source "${BUILD_LIBRARY_DIR}/reports_util.sh" || exit 1
|
||||||
|
|
||||||
if [[ -z "${FLAGS_build_dir}" ]]; then
|
if [[ -z "${FLAGS_build_dir}" ]]; then
|
||||||
die "Need a build directory to be specified with a --build_dir option"
|
die "Need a build directory to be specified with a --build_dir option"
|
||||||
@ -88,8 +89,14 @@ _get_sysext_arch() {
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
umount "${BUILD_DIR}/fs-root" "${BUILD_DIR}/install-root" "${BUILD_DIR}/workdir" 2>/dev/null || true
|
local dirs=(
|
||||||
rm -rf "${BUILD_DIR}/fs-root" "${BUILD_DIR}/install-root" "${BUILD_DIR}/workdir" || true
|
"${BUILD_DIR}/fs-root"
|
||||||
|
"${BUILD_DIR}/install-root"
|
||||||
|
"${BUILD_DIR}/workdir"
|
||||||
|
"${BUILD_DIR}/img-rootfs"
|
||||||
|
)
|
||||||
|
umount "${dirs[@]}" 2>/dev/null || true
|
||||||
|
rm -rf "${dirs[@]}" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ ${#} -lt 1 ]]; then
|
if [[ ${#} -lt 1 ]]; then
|
||||||
@ -169,3 +176,11 @@ all_fields=(
|
|||||||
printf '%s\n' "${all_fields[@]}" >"${BUILD_DIR}/install-root/usr/lib/extension-release.d/extension-release.${SYSEXTNAME}"
|
printf '%s\n' "${all_fields[@]}" >"${BUILD_DIR}/install-root/usr/lib/extension-release.d/extension-release.${SYSEXTNAME}"
|
||||||
mksquashfs "${BUILD_DIR}/install-root" "${BUILD_DIR}/${SYSEXTNAME}.raw"
|
mksquashfs "${BUILD_DIR}/install-root" "${BUILD_DIR}/${SYSEXTNAME}.raw"
|
||||||
rm -rf "${BUILD_DIR}"/{fs-root,install-root,workdir}
|
rm -rf "${BUILD_DIR}"/{fs-root,install-root,workdir}
|
||||||
|
|
||||||
|
# Generate reports
|
||||||
|
mkdir "${BUILD_DIR}/img-rootfs"
|
||||||
|
mount -rt squashfs -o loop,nodev "${BUILD_DIR}/${SYSEXTNAME}.raw" "${BUILD_DIR}/img-rootfs"
|
||||||
|
write_contents "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_contents.txt"
|
||||||
|
write_contents_with_technical_details "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_contents_wtd.txt"
|
||||||
|
write_disk_space_usage_in_paths "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_disk_usage.txt"
|
||||||
|
umount "${BUILD_DIR}/img-rootfs"
|
||||||
|
Loading…
Reference in New Issue
Block a user