WIP: Use config fragments for kernel configuration
Adds support for config fragments - small diffs which define what kernel config options must be disabled/enabled.
Use
Diff must be named "
Example: for base defconfig sprd_sharkl3_defconfig
and arch aarch64
the file name will be sprd_sharkl3_defconfig.aarch64
The file needs to be created manually (e.g. with touch), it can be empty.
Related: #1824 , pmaports!1812
Merge request reports
Activity
added 1 commit
- 5f9ab601 - WIP: Use config fragments for kernel configuration
By HenriDellal on 2020-12-14T15:50:58
This seems to work pretty well for me, converted linux-postmarketos-allwinner for me locally using megi's defconfig
How would this work with kernel packages that support multiple arches?
edit: the kconfig check at the end of the edit is broken and I can't disable CONFIG_ANDROID_BINDERFS
By Martijn Braam on 2020-12-17T15:22:10
Edited by AdministratorIt doesn't work with multiple arches, currently I use this: !2006 (diffs)
Speaking of kconfig check, I guess it's broken because of not being able to disable that option. Does this issue change if you set the option value manually in the diff file?
By HenriDellal on 2020-12-17T15:22:10
Seems like I found the cause of problem with kernel config option not being applied.
make savedefconfig
loses the option's state. According to example from initial post,CONFIG_VT
is not saved, because there are known changed states of the inheriting options. Though, when the config and diff are merged and make is done on the resulted config, the VT option's state is lost.If the uncompressed kernel configs are compared, the bigger diff is generated, but it can be modified manually to minify still and it is reliable.
Diff example:
CONFIG_VT=y # CONFIG_CONSOLE_TRANSLATIONS is not set CONFIG_DUMMY_CONSOLE=y CONFIG_DUMMY_CONSOLE_COLUMNS=80 CONFIG_DUMMY_CONSOLE_ROWS=25 # CONFIG_FRAMEBUFFER_CONSOLE is not set CONFIG_HW_CONSOLE=y # CONFIG_SPEAKUP is not set # CONFIG_VT_CONSOLE is not set # CONFIG_VT_HW_CONSOLE_BINDING is not set
By HenriDellal on 2020-12-17T18:53:30
added 3 commits
-
5f9ab601...1eac61bc - 2 commits from branch
postmarketOS:master
- 51ca873d - WIP: Use config fragments for kernel configuration
By HenriDellal on 2020-12-17T19:48:01
-
5f9ab601...1eac61bc - 2 commits from branch
added 1 commit
- 2234cca3 - WIP: Use config fragments for kernel configuration
By HenriDellal on 2020-12-17T19:54:24
added 31 commits
-
2234cca3...69b75432 - 29 commits from branch
postmarketOS:master
- 55303c77 - WIP: Use config fragments for kernel configuration
- 16c55eb4 - WIP: Add support for multiple arches (untested)
By HenriDellal on 2021-02-02T17:17:17
-
2234cca3...69b75432 - 29 commits from branch
added 21 commits
-
16c55eb4...5c1c1266 - 19 commits from branch
postmarketOS:master
- 88e08fa1 - WIP: Use config fragments for kernel configuration
- ca3896dc - WIP: Add support for multiple arches (untested)
By HenriDellal on 2021-03-17T13:48:47
-
16c55eb4...5c1c1266 - 19 commits from branch
added 5 commits
-
ca3896dc...2406597f - 4 commits from branch
postmarketOS:master
- 4ce4736e - WIP: Use config fragments for kernel configuration
By HenriDellal on 2021-03-20T22:41:15
-
ca3896dc...2406597f - 4 commits from branch
added 1 commit
- e0d581bd - WIP: Use config fragments for kernel configuration
By HenriDellal on 2021-03-21T07:58:17
added 7 commits
-
e0d581bd...a440556a - 6 commits from branch
postmarketOS:master
- 7c9623dc - WIP: Use config fragments for kernel configuration
By HenriDellal on 2021-03-30T22:27:54
-
e0d581bd...a440556a - 6 commits from branch
Afaik msm8916-mainline folks generate defconfig by
make msm8916_defconfig pmos.config
without usage of scripts like diffconfig, mergeconfig.Also this implementation lacks the
pmos.config
file with default required pmos options for mainline kernel. For example: https://github.com/msm8916-mainline/linux/blob/master/kernel/configs/pmos.configThe way I see how kernel fragments support should be done is that it should be somehow generated using pmos.config for kernel APKBUILDs that declare support for config fragments. This would obviously work for mainline kernels only, (otherwise we'll have to keep multiple versions of pmos.config files for each kernel version range).
By Alexey Min on 2021-04-30T16:42:32
Edited by AdministratorThat is a good point, thanks. This way it should be possible to get rid of
kconfig check
for mainline kernels, I guess? I think that pmos.config can be created from pmb.config information, this way it could be more flexible, e.g. Anbox-related config options can be disabled if needed. The only concern I have is thatmake defconfig config
won't work on downstream, but that is still to be checked.By HenriDellal on 2021-04-30T16:42:32
This way it should be possible to get rid of
kconfig check
for mainline kernels, I guess?For those who declare support for config fragments at least
without usage of scripts like diffconfig, mergeconfig.
Btw I'm not saying those scripts are completely useless, maybe there is no way to implement saving config frmagment in kconfig edit without them. I'm not sure what is the best way to do it.
To extend my thoughts above: as I remember from previous discussuions, the resulting config should be generated as a sum of:
- linux kernel
defconfig
(example is arm64 defconfig for arm64) which comes from kernel itself -
pmos.config
fragment with OS-specific options, presumably this file is stored in pmbootstrap (or generated, maybe) - package-specific config fragment that comes from the package (with SoC-specific options, and drivers for peripherals supported by this kernel package)
By Alexey Min on 2021-04-30T17:10:15
- linux kernel
added 17 commits
-
7c9623dc...4eba7f62 - 14 commits from branch
postmarketOS:master
- a7ce89f7 - WIP: Use config fragments for kernel configuration
- 53235c94 - Move code for getting required kernel options in separate function
- 0f930465 - Add support for pmos.config
By HenriDellal on 2021-05-17T12:08:08
Toggle commit list-
7c9623dc...4eba7f62 - 14 commits from branch
added 37 commits
-
0f930465...6afd35eb - 34 commits from branch
postmarketOS:master
- 19a3ad15 - WIP: Use config fragments for kernel configuration
- cb8a3a7e - Move code for getting required kernel options in separate function
- d8ac3442 - Add support for pmos.config
By HenriDellal on 2021-06-26T07:25:27
Toggle commit list-
0f930465...6afd35eb - 34 commits from branch
Thanks for working on this!
I have a bit mixed feelings about this magic auto-generated
pmos.config
(generated by thecreate_pmos_config()
). It's nice to avoid the duplication given we already have the existing lists from kconfig check.On the other hand, this looks like it makes building the kernel packages entirely dependent on pmbootstrap, they can no longer be built properly without it. I think so far most of the pmbootstrap-specific features were optional addons (e.g. building with native gcc, kconfig check, ...). The APKBUILDs itself were mostly standalone and could theoretically be built outside of postmarketOS, or upstreamed to Alpine.
This also requires pmbootstrap changes for all kernel config changes, which should generally be something pmaports-specific (e.g. slightly different on stable/edge branch for new experimental things).
I wonder if there is a good way to have the kconfig check configuration, or config fragments in some pmaports package (e.g.
devicepkg-dev
, though I'd prefer if it was a separate package). The kconfig check in pmbootstrap could parse it from there.Also, somehow we need to keep envkernel in mind. At the moment it's convenient to do
make msm8916_defconfig pmos.config
in envkernel when buildinglinux-postmarketos-qcom-msm8916
but I'm not sure how to do this with the automatically generated pmos kernel config fragment.By Minecrell on 2021-06-26T14:53:17
Using pmos.config is not mandatory. At this moment, if APKBUILD's options contain
!pmb:kconfigcheck
, pmos.config is empty. New option can be created to handle this case and to not affect kconfig check availability.Moving kernel config requirements to separate package is a good idea, the question is what is the best way to implement this change.
By HenriDellal on 2021-06-26T16:04:40
added 34 commits
-
d8ac3442...ba07c4cf - 31 commits from branch
postmarketOS:master
- f3a41ea7 - WIP: Use config fragments for kernel configuration
- 545b1fb7 - Move code for getting required kernel options in separate function
- a4139b95 - Add support for pmos.config
By HenriDellal on 2021-08-02T11:54:40
Toggle commit list-
d8ac3442...ba07c4cf - 31 commits from branch