Skip to content
Snippets Groups Projects

WIP: Use config fragments for kernel configuration

Merged Imported Administrator requested to merge config-diffs into master

Adds support for config fragments - small diffs which define what kernel config options must be disabled/enabled.

Use

kconfignametodefinethebasedefconfig.Note:"_kconfig_name to define the base defconfig. Note: "
_config" must be removed from APKBUILD.

Diff must be named "

kconfigname._kconfig_name.
arch"

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

Edited by Administrator

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator added 1 commit · Imported

    added 1 commit

    • 5f9ab601 - WIP: Use config fragments for kernel configuration

    Compare with previous version

    By HenriDellal on 2020-12-14T15:50:58

    • Author Owner

      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 Administrator
    • Author Owner

      It 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

    • Author Owner

      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

    • Please register or sign in to reply
  • Administrator added 3 commits · Imported

    added 3 commits

    Compare with previous version

    By HenriDellal on 2020-12-17T19:48:01

  • Administrator added 1 commit · Imported

    added 1 commit

    • 2234cca3 - WIP: Use config fragments for kernel configuration

    Compare with previous version

    By HenriDellal on 2020-12-17T19:54:24

  • Administrator added 31 commits · Imported

    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)

    Compare with previous version

    By HenriDellal on 2021-02-02T17:17:17

  • Administrator added 21 commits · Imported

    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)

    Compare with previous version

    By HenriDellal on 2021-03-17T13:48:47

  • Administrator added 5 commits · Imported

    added 5 commits

    Compare with previous version

    By HenriDellal on 2021-03-20T22:41:15

  • Administrator added 1 commit · Imported

    added 1 commit

    • e0d581bd - WIP: Use config fragments for kernel configuration

    Compare with previous version

    By HenriDellal on 2021-03-21T07:58:17

  • Administrator changed the description · Imported

    changed the description

    By HenriDellal on 2021-03-22T09:17:12

  • Administrator added 7 commits · Imported

    added 7 commits

    Compare with previous version

    By HenriDellal on 2021-03-30T22:27:54

    • Author Owner

      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.config

      The 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 Administrator
    • Author Owner

      That 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 that make defconfig config won't work on downstream, but that is still to be checked.

      By HenriDellal on 2021-04-30T16:42:32

    • Author Owner

      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:

      1. linux kernel defconfig (example is arm64 defconfig for arm64) which comes from kernel itself
      2. pmos.config fragment with OS-specific options, presumably this file is stored in pmbootstrap (or generated, maybe)
      3. 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

    • Please register or sign in to reply
  • Administrator added 17 commits · Imported

    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

    Compare with previous version

    By HenriDellal on 2021-05-17T12:08:08

  • Author Owner

    The current state is: kconfig edit and build seem to work, kconfig check doesn't. The weird thing is that kconfig edit runs check in the end and it works as well.

    Check related pmaports!1812 for updated devicepkg-dev and testing commits.

    By HenriDellal on 2021-05-17T12:31:38

  • Administrator added 37 commits · Imported

    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

    Compare with previous version

    By HenriDellal on 2021-06-26T07:25:27

  • Author Owner

    So I can tell that kconfig check works as expected now, review can be started, I think.

    By HenriDellal on 2021-06-26T07:36:58

    • Author Owner

      Thanks for working on this!

      I have a bit mixed feelings about this magic auto-generated pmos.config (generated by the create_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 building linux-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

    • Author Owner

      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

    • Please register or sign in to reply
  • Administrator added 1 deleted label · Imported

    added 1 deleted label

  • Administrator added 34 commits · Imported

    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

    Compare with previous version

    By HenriDellal on 2021-08-02T11:54:40

  • Administrator removed 1 deleted label · Imported

    removed 1 deleted label

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading