Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890720 - linux-info.eclass: strange breakage with the docker ebuild
Summary: linux-info.eclass: strange breakage with the docker ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 18:14 UTC by William Hubbs
Modified: 2023-01-16 21:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
docker-20.10.22-sync-checks.patch (docker-20.10.22-sync-checks.patch,5.61 KB, patch)
2023-01-13 18:14 UTC, William Hubbs
Details | Diff
docker-20.10.22-sync-checks.patch (docker-20.10.22-sync-checks.patch,5.61 KB, patch)
2023-01-14 21:58 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William Hubbs gentoo-dev 2023-01-13 18:14:10 UTC
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
Comment 1 William Hubbs gentoo-dev 2023-01-13 18:14:53 UTC
Created attachment 848388 [details, diff]
docker-20.10.22-sync-checks.patch

Here is the patch.
Comment 2 Mike Gilbert gentoo-dev 2023-01-13 19:57:22 UTC
Could you attach a build log with and without your patch applied?
Comment 3 Mike Pagano gentoo-dev 2023-01-13 23:46:38 UTC
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.
Comment 4 Mike Pagano gentoo-dev 2023-01-14 15:46:42 UTC
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.
Comment 5 Mike Gilbert gentoo-dev 2023-01-14 19:46:08 UTC
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.
Comment 6 William Hubbs gentoo-dev 2023-01-14 21:57:02 UTC
(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.
Comment 7 William Hubbs gentoo-dev 2023-01-14 21:58:50 UTC
Created attachment 848477 [details, diff]
docker-20.10.22-sync-checks.patch

This is the updated patch.
Comment 8 Larry the Git Cow gentoo-dev 2023-01-16 21:04:57 UTC
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(-)