-
Notifications
You must be signed in to change notification settings - Fork 34
Description
I'm using meta-secure-core along with the kernel-initramfs.bb recipe to build a signed initramfs image.
I've recently noticed that calling bitbake my-image
will invariably rebuild the initramfs as well as the final target image even if no changes have been made.
Digging a bit further with bitbake-diffsigs
, I noticed that:
NOTE: Starting bitbake server...
Hash for task dependency my-image:do_create_runtime_spdx changed from eb687ab5276dec49cf419a085a704ca515e29a115d53051852ee01b7f548efe4 to b065b48c78308f9aa309f9fe32c237d160077ba637015e574a59273aacbd0e16
Hash for task dependency kernel-initramfs:do_create_spdx changed from 8820e3e2b86a0027726cc1ea28dce133d0db7dca940b0c03a2208cc14758189b to b6cb634cfc639cb3be2f334f1dffcfc680fa5cb7a057cc89c6c71191a82ec57a
Hash for task dependency kernel-initramfs:do_package changed from 9802330cd94fa410179896e11274c889a61110fa16c9d5d8fd06cd72ecbb8e1b to 307db4e7af5900903410c4054826d90db6be6641b7e695fbb5fc7e6595b8558b
Hash for task dependency kernel-initramfs:do_deploy changed from 47b87c823513cc2688d25da0ab07a7603c537e6a2527a21d8156074f672ddfe0 to 8df2bf7c7c70914606263512cbac9e98f217723a4de53f1626fab485b4778780
Hash for task dependency kernel-initramfs:do_initrdsig changed from 3e571994af3c758392156c618f73871cde698fed30df1c884adb62d07b5092bf to f6c51056355987bf481fd7b80e51ea7eaa00ec4420d6dbe090f854938b87e5e6
Hash for task dependency kernel-initramfs:do_sign changed from 4f766734b99c73e9ce80daad8c8463694a222b8ba3334ad3a77236529bbbe0ad to 83eb37b4792e982636ae5fad79617cf4fb5492de7a61061d9d3b7dec97302194
Hash for task dependency kernel-initramfs:do_install changed from 1cf6115d58bc2f0625bc9ab6b0818056fe12869a6f68ec1005e0e1978a37fe74 to d8bf53bb5f93b9171d56ac42d8e735ce11014092af0eb99e5ebe42ae87685054
Taint (by forced/invalidated task) changed from nostamp(uuid4):615e061b-2ee0-4fb7-9a1b-9dd037c00921 to nostamp(uuid4):1746675f-a4c3-46da-b8c8-b04a294b0163
So the do_install
task of the kernel-initramfs
recipe invalidates the cache on each build for some reason.
Looking at the kernel-initramfs-efi-secure-boot.inc
file, we see the following section:
# Always fetch the latest initramfs image
do_install[nostamp] = "1"
This invalidates the cache. From the bitbake documentation:
[nostamp]: When set to “1”, tells BitBake to not generate a stamp file for a task, which implies the task should always be executed.
Caution
Any task that depends (possibly indirectly) on a [nostamp] task will always be executed as well. This can cause unnecessary rebuilding if you are not careful.
Looking at the git history did not reveal anything.
I've temporarily disabled this behavior in my layer by doing the following:
python () {
d.delVarFlag("do_install", "nostamp")
}
I think the usage of the nostamp
flag should be reevaluated here. What do you think?