public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] linux-info.eclass: check_extra_config requires a configured kernel
@ 2011-11-04 12:59 "Paweł Hajdan, Jr."
  2011-11-04 13:13 ` Fabio Erculiani
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: "Paweł Hajdan, Jr." @ 2011-11-04 12:59 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2640 bytes --]

check_extra_config requires a configured kernel
(/usr/src/linux/.config), while I think it should also be satisfied by
/proc/config.gz (i.e. just a way to verify the config, not necessarily
kernel built locally).

An example use case is www-client/chromium, which makes sure the kernel
will support its sandbox. It's generally a bad idea to run without full
sandboxing support (it can work without kernel support, just doesn't
prevent a compromised renderer from connecting to network or sending
signals to processes).

My suggestion is to replace the following code fregment:

if [[ ${config_required} == 0 ]]; then
    # In the case where we don't require a .config, we can now bail out
    # if the user has no .config as there is nothing to do. Otherwise
    # code later will cause a failure due to missing .config.
    if ! linux_config_exists; then
        ewarn "Unable to check for the following kernel config options due"
        ewarn "to absence of any configured kernel sources or compiled"
        ewarn "config:"
        for config in ${CONFIG_CHECK}; do
            local_error="ERROR_${config#\~}"
            msg="${!local_error}"
            if [[ "x${msg}" == "x" ]]; then
                local_error="WARNING_${config#\~}"
                msg="${!local_error}"
            fi
            ewarn " - ${config#\~}${msg:+ - }${msg}"
        done
        ewarn "You're on your own to make sure they are set if needed."
        export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
        return 0
    fi
else
    require_configured_kernel
fi

With something more like this:

# In the case where we don't require a .config, we can now bail out
# if the user has no .config as there is nothing to do. Otherwise
# code later will cause a failure due to missing .config.
if ! linux_config_exists; then
    ewarn "Unable to check for the following kernel config options due"
    ewarn "to absence of any configured kernel sources or compiled"
    ewarn "config:"
    for config in ${CONFIG_CHECK}; do
        local_error="ERROR_${config#\~}"
        msg="${!local_error}"
        if [[ "x${msg}" == "x" ]]; then
            local_error="WARNING_${config#\~}"
            msg="${!local_error}"
        fi
        ewarn " - ${config#\~}${msg:+ - }${msg}"
    done
    ewarn "You're on your own to make sure they are set if needed."
    export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
    if [[ ${config_required} == 0 ]]; then
        return 0
    else
        die "unable to check for required kernel options"
    fi
fi

Thoughts?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-11-05 23:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 12:59 [gentoo-dev] linux-info.eclass: check_extra_config requires a configured kernel "Paweł Hajdan, Jr."
2011-11-04 13:13 ` Fabio Erculiani
2011-11-04 13:23 ` Patrick Lauer
2011-11-04 13:33   ` Nirbheek Chauhan
2011-11-04 14:46 ` Mike Gilbert
2011-11-04 15:11   ` Fabio Erculiani
2011-11-04 15:29     ` Ian Stakenvicius
2011-11-04 15:54       ` Fabio Erculiani
2011-11-04 21:18     ` Robin H. Johnson
2011-11-04 22:02       ` Fabio Erculiani
2011-11-04 22:12         ` Robin H. Johnson
2011-11-04 22:16           ` Fabio Erculiani
2011-11-04 21:16 ` Robin H. Johnson
2011-11-05 23:14   ` Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox