Skip to content

Commit 1cb0a8a

Browse files
committed
framework rootfs/create-cache: add call_extension_method "rootfs_customize_package_list"
1 parent 99c3162 commit 1cb0a8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/functions/rootfs/create-cache.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ function calculate_rootfs_cache_id() {
1818

1919
declare -i short_hash_size=6
2020

21+
call_extension_method "rootfs_customize_package_list" <<- ROOTFS_CUSTOMIZE_PACKAGE_LIST
22+
expected to append arbitrary data about package list
23+
modifications to /tmp/rootfs_customize_package_list.txt.
24+
NOTE: hook implementations that do not write to this
25+
file will have no effect on the rootfs hashing.
26+
ROOTFS_CUSTOMIZE_PACKAGE_LIST
27+
local rootfs_customize_package_list_hash=""
28+
if [[ -e '/tmp/rootfs_customize_package_list.txt' ]]; then
29+
rootfs_customize_package_list_hash=$(sha256sum /tmp/rootfs_customize_package_list.txt)
30+
rm /tmp/rootfs_customize_package_list.txt
31+
fi
32+
2133
# get the hashes of the lib/ bash sources involved...
2234
declare hash_files="undetermined"
2335
calculate_hash_for_files "${SRC}"/lib/functions/rootfs/create-cache.sh "${SRC}"/lib/functions/rootfs/rootfs-create.sh
@@ -29,6 +41,7 @@ function calculate_rootfs_cache_id() {
2941
declare -a extension_hooks_hashed=("$(dump_extension_method_sources_functions "${extension_hooks_to_hash[@]}")")
3042
declare hash_hooks="undetermined"
3143
declare legacy_debootstrap="${LEGACY_DEBOOTSTRAP:-"no"}"
44+
extension_hooks_hashed+=("rootfs_customize_package_list=${rootfs_customize_package_list_hash}")
3245
hash_hooks="$(echo "${extension_hooks_hashed[@]}" LDB=${legacy_debootstrap,,} | sha256sum | cut -d' ' -f1)"
3346
declare hash_hooks_short="${hash_hooks:0:${short_hash_size}}"
3447

0 commit comments

Comments
 (0)