1 |
check_extra_config requires a configured kernel |
2 |
(/usr/src/linux/.config), while I think it should also be satisfied by |
3 |
/proc/config.gz (i.e. just a way to verify the config, not necessarily |
4 |
kernel built locally). |
5 |
|
6 |
An example use case is www-client/chromium, which makes sure the kernel |
7 |
will support its sandbox. It's generally a bad idea to run without full |
8 |
sandboxing support (it can work without kernel support, just doesn't |
9 |
prevent a compromised renderer from connecting to network or sending |
10 |
signals to processes). |
11 |
|
12 |
My suggestion is to replace the following code fregment: |
13 |
|
14 |
if [[ ${config_required} == 0 ]]; then |
15 |
# In the case where we don't require a .config, we can now bail out |
16 |
# if the user has no .config as there is nothing to do. Otherwise |
17 |
# code later will cause a failure due to missing .config. |
18 |
if ! linux_config_exists; then |
19 |
ewarn "Unable to check for the following kernel config options due" |
20 |
ewarn "to absence of any configured kernel sources or compiled" |
21 |
ewarn "config:" |
22 |
for config in ${CONFIG_CHECK}; do |
23 |
local_error="ERROR_${config#\~}" |
24 |
msg="${!local_error}" |
25 |
if [[ "x${msg}" == "x" ]]; then |
26 |
local_error="WARNING_${config#\~}" |
27 |
msg="${!local_error}" |
28 |
fi |
29 |
ewarn " - ${config#\~}${msg:+ - }${msg}" |
30 |
done |
31 |
ewarn "You're on your own to make sure they are set if needed." |
32 |
export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}" |
33 |
return 0 |
34 |
fi |
35 |
else |
36 |
require_configured_kernel |
37 |
fi |
38 |
|
39 |
With something more like this: |
40 |
|
41 |
# In the case where we don't require a .config, we can now bail out |
42 |
# if the user has no .config as there is nothing to do. Otherwise |
43 |
# code later will cause a failure due to missing .config. |
44 |
if ! linux_config_exists; then |
45 |
ewarn "Unable to check for the following kernel config options due" |
46 |
ewarn "to absence of any configured kernel sources or compiled" |
47 |
ewarn "config:" |
48 |
for config in ${CONFIG_CHECK}; do |
49 |
local_error="ERROR_${config#\~}" |
50 |
msg="${!local_error}" |
51 |
if [[ "x${msg}" == "x" ]]; then |
52 |
local_error="WARNING_${config#\~}" |
53 |
msg="${!local_error}" |
54 |
fi |
55 |
ewarn " - ${config#\~}${msg:+ - }${msg}" |
56 |
done |
57 |
ewarn "You're on your own to make sure they are set if needed." |
58 |
export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}" |
59 |
if [[ ${config_required} == 0 ]]; then |
60 |
return 0 |
61 |
else |
62 |
die "unable to check for required kernel options" |
63 |
fi |
64 |
fi |
65 |
|
66 |
Thoughts? |