It does not do the correct thing.
This is what debian/rules.d/2-binary-arch.mk does. It does not specify the --file, but seems to expect that it can start with annotations and it should find the flavour annotations. Looking at the annotations script, it seems like it looks in debian/debian.env. Aha!
Looking at the lowlatency source debian/debian.env, it seems like I do need to change this file.
Cross your fingers. Edited debian/debian.env to be DEBIAN=debian.myflav. Tried
And it did the right thing. Yay.
Building now, which is slow. But I think this is it.
I ended up changing debian/debian.env back.
I changed debian/rules.d/2-binary-arch.mk and debian/rules.d/4-checks.mk to call with the --file to the myflav annotations. This is a work-around. But, seems to be working for now.
Well, the build doesnāt error. My new kernel modules are compiled according the configs in myflav annotations. But it does not build any debians. The last thing it does is a module check:
Yes. That failed spectacularly. It seems like the build expects more to be in debian.myflav than just config/annotations. Looking at jammy lowlatency-next, I think thatās the case. Anyway, my plan is to follow the model of debian.lowlatency for debian.myflav, including debian/debian.env to point to my debian.myflav directory.
So, I was able to get a kernel built. I took some notes.
Create debian.myflav directory
Add debian.myflav/config/annotations
Add flavour to debian.master annotations FLAVOURS:
Change debian/debian.env to DEBIAN=debian.myflav
Add debian.myflav/rules.d/amd64.mk with updated flavour
Add debian.myflav/changelog
In debian/rules.d/2-binary-arch.mk, the annotations script initially creates a correct .config.
But, during the build something saves .config as .config.old and creates a new .config (from kconfig, I think) which is not correct. And, debian/rules.d/4-checks.mk calls the annotations script which does not like it. Added work-around
Need to add debian.myflav/control.stub.in
Add debian.myflav/rules.d/hooks.mk
And copyright file
And control.d files, including new vars.myflav.
And abi directory and files, with myflav versions in amd64
And although I made sure modules.myflav was correct, in debian/rules.d/4-checks.mk, module-check-% is failing ā probably caused by bad modules.myflav in abi/amd64/. Work-around by removing module-check-%
And I get a complete build. I have not tested it.
I am worried about:
Why .config is regenerated after annotations call in debian/rules.d/2-binary-arch.mk builds it correctly,
Why I canāt get module-check in debian/rules.d/4-checks.mk to work.
I think that Jammy lowlatency-next is building because of a little luck.
Finally, I noticed that you must be connected to the internet for a kernel build to work. I have all the source, what does it need from the internet?
I had similar problems building a custom kernel flavour and in the end it was because I set CONFIG_IMA_DEFAULT_HASH_SHA256 to 'y' in debian.master/config/annotations but CONFIG_IMA_DEFAULT_HASH_SHA1 was also set to y, which was incompatible. Iām using debian/scripts/misc/annotations --arch amd64 --flavour foobar --update config.flavour.foobar to edit debian.master/config/annotations, and that script only updates the options you tell it to, itās not smart enough to find and fix incompatible options. Adding CONFIG_IMA_DEFAULT_HASH_SHA1=n to config.flavour.foobar fixed the problem.