Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532084 - sys-kernel/genkernel - rework default config file so comments accurately reflect defaults, and to improve consistency
Summary: sys-kernel/genkernel - rework default config file so comments accurately refl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 21:39 UTC by Ben Kohler
Modified: 2019-03-23 09:52 UTC (History)
2 users (show)

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


Attachments
genkernel.conf patch (genkernel-conf-tweaks.patch,6.59 KB, patch)
2014-12-09 21:39 UTC, Ben Kohler
Details | Diff
genkernel-check-bools-with-isTrue.patch (genkernel-check-bools-with-isTrue.patch,6.45 KB, patch)
2014-12-10 20:35 UTC, Ben Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kohler gentoo-dev 2014-12-09 21:39:21 UTC
Created attachment 391308 [details, diff]
genkernel.conf patch

Hello,

The currently supplied /etc/genkernel.conf file has quite a few inconsistencies that could use some cleanup.  

It's almost random whether the commented example for an option matches the default setting, or is opposite the default setting.  I've fixed these where possible, although some defaults are arch-specific or the default is blank but an example non-blank setting is helpful... I've left those examples intact.

I have also fixed some minor inconsistencies in wording & formatting, and converted everything to use yes/no for bools, rather than a random mix of yes/no 1/0 etc.

If there's any question why something was changed, please let me know... as far as I know, none of these changes should affect the out-of-the-box genkernel behavior.  I'm hoping these changes will make it a little easier to configure, without having to wade through the source to see what an option's REAL default is.

Thanks!
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2014-12-10 01:12:31 UTC
I don't want this comment removed:

Default is "no" because genkernel is used in
# catalyst and stage building.

Are you sure these hunks are right? If they need a 1 or 0 then are you sure yes and no are also acceptable?

-#POSTCLEAR="1"
+#POSTCLEAR="no"

-#UNIONFS="1"
+#UNIONFS="no"

-#KERNEL_SOURCES="0"
+#KERNEL_SOURCES="yes"

-#BUILD_STATIC="1"
+#BUILD_STATIC="no"

-#GENZIMAGE="1"
+#GENZIMAGE="no"

-#ALLRAMDISKMODULES="1"
-#RAMDISKMODULES="0"
+#ALLRAMDISKMODULES="no"
+#RAMDISKMODULES="yes"

-#INTEGRATED_INITRAMFS="1"
+#INTEGRATED_INITRAMFS="no"

-#NETBOOT="1"
+#NETBOOT="no"

Is this a path or a file it wants? It reads like it wants a path to drop a file, not a specific filename.

-#KERNCACHE="/path/to/file"
+#KERNCACHE="/path/to/file.bz2"
Comment 2 Ben Kohler gentoo-dev 2014-12-10 02:28:25 UTC
Thanks for looking over this, I definitely want to make sure all these changes get a second look.  

(In reply to Rick Farina (Zero_Chaos) from comment #1)
> I don't want this comment removed:
> 
> Default is "no" because genkernel is used in
> # catalyst and stage building.
> 
> Are you sure these hunks are right? If they need a 1 or 0 then are you sure
> yes and no are also acceptable?
> 
> -#POSTCLEAR="1"
> +#POSTCLEAR="no"
> 
> -#UNIONFS="1"
> +#UNIONFS="no"
> 
> -#KERNEL_SOURCES="0"
> +#KERNEL_SOURCES="yes"
> 
> -#BUILD_STATIC="1"
> +#BUILD_STATIC="no"
> 
> -#GENZIMAGE="1"
> +#GENZIMAGE="no"
> 
> -#ALLRAMDISKMODULES="1"
> -#RAMDISKMODULES="0"
> +#ALLRAMDISKMODULES="no"
> +#RAMDISKMODULES="yes"
> 
> -#INTEGRATED_INITRAMFS="1"
> +#INTEGRATED_INITRAMFS="no"
> 
> -#NETBOOT="1"
> +#NETBOOT="no"

Good catch.  The first few of these I looked at, and in general most boolean options in genkernel.conf, do use isTrue() from gen_funcs.sh to test (so can accept true, yes, t, y, or 1, all case insensitive).  But a few of them compare directly to "1".  Another patch will be needed to fix these cases, but I do believe it should be done.  I'll try to get this patch ready soon.

> 
> Is this a path or a file it wants? It reads like it wants a path to drop a
> file, not a specific filename.
> 
> -#KERNCACHE="/path/to/file"
> +#KERNCACHE="/path/to/file.bz2"

This is definitely the output tbz2 filename, passed as a direct argument to tar -jcpf or tar -xjf.  I made this change to be more consistent with the other examples in this file, but I bet the change will go the other way once we have configurable compression.
Comment 3 Ben Kohler gentoo-dev 2014-12-10 20:35:35 UTC
Created attachment 391394 [details, diff]
genkernel-check-bools-with-isTrue.patch

This patch should fix the few cases where genkernel functions were testing directly against 1/0 rather than using the isTrue function
Comment 4 Ben Kohler gentoo-dev 2015-05-05 16:35:25 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #1)
> I don't want this comment removed:
> 
> Default is "no" because genkernel is used in
> # catalyst and stage building.
> 
I was just looking at this bug again today and realized I didn't address this point.  This config file comment is not accurate.  The default is yes.
Comment 5 Larry the Git Cow gentoo-dev 2019-03-23 09:52:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6454b9ed43325149f3ccb3bab35a42b745d0369b

commit 6454b9ed43325149f3ccb3bab35a42b745d0369b
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-03-23 00:47:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-03-23 08:05:33 +0000

    Convert all remaining options to yes/no values and use isTrue for consistency
    
    Closes: https://bugs.gentoo.org/532084
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 gen_bootloader.sh    |   6 +-
 gen_cmdline.sh       |  90 ++++++++++++++--------------
 gen_configkernel.sh  |  26 ++++----
 gen_determineargs.sh |  12 ++--
 gen_funcs.sh         |  16 ++---
 gen_initramfs.sh     |  18 +++---
 gen_moddeps.sh       |   2 +-
 gen_package.sh       |  20 +++----
 genkernel            |  66 ++++++++++-----------
 genkernel.conf       | 163 ++++++++++++++++++++++++++-------------------------
 10 files changed, 211 insertions(+), 208 deletions(-)