All, I am working on cleaning up the docker ebuild, and I found a strange breakage with linux-info.eclass. My kernel config is not in /usr/src/linux/.config. However, it is in /proc/config.gz and /lib/modules/$(uname -r)/build/.config. The current docker ebuild finds the kernel config with no problem. However, if I apply the attached patch to clean it up, it fails to find the kernel config. Am I doing something wrong in the patch or is this an eclass bug? Thanks, William
Created attachment 848388 [details, diff] docker-20.10.22-sync-checks.patch Here is the patch.
Could you attach a build log with and without your patch applied?
You're hitting this and on the original ebuild config_required is 0, since some CONFIG_CHECKS have no ~ or have !~ then config_required is being set to 1 and then the breakage occurs shortly after. # Determine if we really need a .config. The only time when we don't need # one is when all of the CONFIG_CHECK options are prefixed with "~". for config in ${CONFIG_CHECK}; do if [[ "${config:0:1}" != "~" ]]; then config_required=1 break fi done This looks like a linux-info bug to me. Which I will look harder at tomorrow. I don't need your build logs, it fails spectacularly here.
Hey William, Right now, linux-info requires a .config for those checks. I imagine a /proc/config.gz for the specific kernel version without a .config file is a valid configuration, but right now it will fail in the scenario.
So basically, the checks for USER_NS, SECCOMP, SECCOMP_FILTER, and CGROUP_PIDS don't have a tilde in front of them, which makes them fatal. You should definitely put a tilde in front of those options anyway; there's no reason to make the ebuild fail if the user hasn't enabled them. They should receive a warning only.
(In reply to Mike Pagano from comment #3) > You're hitting this and on the original ebuild config_required is 0, > > since some CONFIG_CHECKS have no ~ or have !~ then config_required is being > set to 1 and then the breakage occurs shortly after. (In reply to Mike Gilbert from comment #5) > So basically, the checks for USER_NS, SECCOMP, SECCOMP_FILTER, and > CGROUP_PIDS don't have a tilde in front of them, which makes them fatal. > > You should definitely put a tilde in front of those options anyway; there's > no reason to make the ebuild fail if the user hasn't enabled them. They > should receive a warning only. I agree that the options that did not have ~ should have ~, so I fixed that. Also, with the options that had !~, I want a warning if the options were *not* set. I found that to do that I should use ~!. This is also fixed. I will attach the new patch shortly. (In reply to Mike Pagano from comment #4) > Hey William, > > Right now, linux-info requires a .config for those checks. > > I imagine a /proc/config.gz for the specific kernel version without a > .config file is a valid configuration, but right now it will fail in the > scenario. /proc/config.gz is the valid configuration for the running kernel, so if you find it and you only care about the running kernel, you really don't need to look anywhere else, even for a situation where a config is required. Another place to look for the config for the running kernel is /lib/modules/$(uname -r)/build/.config. If you find the config for the running kernel it in one of these places, I don't think you have to mess with /usr/src/* at all. Let me know what you think.
Created attachment 848477 [details, diff] docker-20.10.22-sync-checks.patch This is the updated patch.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5d4de5ed682ac0c70fa87c8cab6b35bed51c979 commit c5d4de5ed682ac0c70fa87c8cab6b35bed51c979 Author: Mike Pagano <mpagano@gentoo.org> AuthorDate: 2023-01-16 21:04:34 +0000 Commit: Mike Pagano <mpagano@gentoo.org> CommitDate: 2023-01-16 21:04:34 +0000 linux-info.eclass: Chk for existance of .config/config.gz when opts req In the instance where CONFIG_* settings are required and not optional, make sure there is either a .config or a config.gz to check Closes: https://bugs.gentoo.org/890720 Signed-off-by: Mike Pagano <mpagano@gentoo.org> eclass/linux-info.eclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)