Formatted print of linux kernel config

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












As the options make menuconfig and make nconfig allow a nice way to configure the kernel options, are there any way to get this hierachical structure for print it?



Something similar to the "tree" command ouput.







share|improve this question












migrated from serverfault.com Mar 16 at 22:24


This question came from our site for system and network administrators.










  • 2




    I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
    – Jeff Schaller
    Mar 16 at 23:49














up vote
2
down vote

favorite
1












As the options make menuconfig and make nconfig allow a nice way to configure the kernel options, are there any way to get this hierachical structure for print it?



Something similar to the "tree" command ouput.







share|improve this question












migrated from serverfault.com Mar 16 at 22:24


This question came from our site for system and network administrators.










  • 2




    I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
    – Jeff Schaller
    Mar 16 at 23:49












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





As the options make menuconfig and make nconfig allow a nice way to configure the kernel options, are there any way to get this hierachical structure for print it?



Something similar to the "tree" command ouput.







share|improve this question












As the options make menuconfig and make nconfig allow a nice way to configure the kernel options, are there any way to get this hierachical structure for print it?



Something similar to the "tree" command ouput.









share|improve this question











share|improve this question




share|improve this question










asked Mar 16 at 22:19









Rfraile

26229




26229




migrated from serverfault.com Mar 16 at 22:24


This question came from our site for system and network administrators.






migrated from serverfault.com Mar 16 at 22:24


This question came from our site for system and network administrators.









  • 2




    I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
    – Jeff Schaller
    Mar 16 at 23:49












  • 2




    I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
    – Jeff Schaller
    Mar 16 at 23:49







2




2




I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
– Jeff Schaller
Mar 16 at 23:49




I haven't looked at it, but github.com/ulfalizer/Kconfiglib may be a starting point, if you're interested. In particular: github.com/ulfalizer/Kconfiglib/blob/master/examples/…
– Jeff Schaller
Mar 16 at 23:49










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Thanks to the replay of @jeff-schaller I did a contribution to the project Kconfiglib and now there is a new example script for this task. These are the steps to use it:



Inside the directory with the linux source, clone the repo:



root@23e196045c6f:/usr/src/linux-source-4.9# git clone git://github.com/ulfalizer/Kconfiglib.git
Cloning into 'Kconfiglib'...
remote: Counting objects: 3367, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 3367 (delta 64), reused 89 (delta 50), pack-reused 3259
Receiving objects: 100% (3367/3367), 1.25 MiB | 1.79 MiB/s, done.
Resolving deltas: 100% (2184/2184), done.


Patch the makefile:



root@23e196045c6f:/usr/src/linux-source-4.9# patch -p1 < Kconfiglib/makefile.patch
patching file scripts/kconfig/Makefile


Configure as needed, basically for get a .config file:



root@23e196045c6f:/usr/src/linux-source-4.9# make menuconfig


Run the script with the config file:



root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=.config

======== Linux/x86 4.9.65 Kernel Configuration ========

[*] 64-bit kernel (64BIT)
General setup
() Cross-compiler tool prefix (CROSS_COMPILE)
[ ] Compile also drivers which will not load (COMPILE_TEST)
() Local version - append to kernel release (LOCALVERSION)
[ ] Automatically append version information to the version string (LOCALVERSION_AUTO)
-*- Kernel compression mode
--> Gzip (KERNEL_GZIP)
Bzip2 (KERNEL_BZIP2)
LZMA (KERNEL_LZMA)
...


But the nice thing is that it is possible to pass differente kernel configurations and match the changes easily:



root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config1 > config1-list.txt

root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config2 > config2-list.txt


And finally now with a diff tool:



Kconfiglib with print_config_tree.py






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430693%2fformatted-print-of-linux-kernel-config%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Thanks to the replay of @jeff-schaller I did a contribution to the project Kconfiglib and now there is a new example script for this task. These are the steps to use it:



    Inside the directory with the linux source, clone the repo:



    root@23e196045c6f:/usr/src/linux-source-4.9# git clone git://github.com/ulfalizer/Kconfiglib.git
    Cloning into 'Kconfiglib'...
    remote: Counting objects: 3367, done.
    remote: Compressing objects: 100% (57/57), done.
    remote: Total 3367 (delta 64), reused 89 (delta 50), pack-reused 3259
    Receiving objects: 100% (3367/3367), 1.25 MiB | 1.79 MiB/s, done.
    Resolving deltas: 100% (2184/2184), done.


    Patch the makefile:



    root@23e196045c6f:/usr/src/linux-source-4.9# patch -p1 < Kconfiglib/makefile.patch
    patching file scripts/kconfig/Makefile


    Configure as needed, basically for get a .config file:



    root@23e196045c6f:/usr/src/linux-source-4.9# make menuconfig


    Run the script with the config file:



    root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=.config

    ======== Linux/x86 4.9.65 Kernel Configuration ========

    [*] 64-bit kernel (64BIT)
    General setup
    () Cross-compiler tool prefix (CROSS_COMPILE)
    [ ] Compile also drivers which will not load (COMPILE_TEST)
    () Local version - append to kernel release (LOCALVERSION)
    [ ] Automatically append version information to the version string (LOCALVERSION_AUTO)
    -*- Kernel compression mode
    --> Gzip (KERNEL_GZIP)
    Bzip2 (KERNEL_BZIP2)
    LZMA (KERNEL_LZMA)
    ...


    But the nice thing is that it is possible to pass differente kernel configurations and match the changes easily:



    root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config1 > config1-list.txt

    root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config2 > config2-list.txt


    And finally now with a diff tool:



    Kconfiglib with print_config_tree.py






    share|improve this answer
























      up vote
      1
      down vote



      accepted










      Thanks to the replay of @jeff-schaller I did a contribution to the project Kconfiglib and now there is a new example script for this task. These are the steps to use it:



      Inside the directory with the linux source, clone the repo:



      root@23e196045c6f:/usr/src/linux-source-4.9# git clone git://github.com/ulfalizer/Kconfiglib.git
      Cloning into 'Kconfiglib'...
      remote: Counting objects: 3367, done.
      remote: Compressing objects: 100% (57/57), done.
      remote: Total 3367 (delta 64), reused 89 (delta 50), pack-reused 3259
      Receiving objects: 100% (3367/3367), 1.25 MiB | 1.79 MiB/s, done.
      Resolving deltas: 100% (2184/2184), done.


      Patch the makefile:



      root@23e196045c6f:/usr/src/linux-source-4.9# patch -p1 < Kconfiglib/makefile.patch
      patching file scripts/kconfig/Makefile


      Configure as needed, basically for get a .config file:



      root@23e196045c6f:/usr/src/linux-source-4.9# make menuconfig


      Run the script with the config file:



      root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=.config

      ======== Linux/x86 4.9.65 Kernel Configuration ========

      [*] 64-bit kernel (64BIT)
      General setup
      () Cross-compiler tool prefix (CROSS_COMPILE)
      [ ] Compile also drivers which will not load (COMPILE_TEST)
      () Local version - append to kernel release (LOCALVERSION)
      [ ] Automatically append version information to the version string (LOCALVERSION_AUTO)
      -*- Kernel compression mode
      --> Gzip (KERNEL_GZIP)
      Bzip2 (KERNEL_BZIP2)
      LZMA (KERNEL_LZMA)
      ...


      But the nice thing is that it is possible to pass differente kernel configurations and match the changes easily:



      root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config1 > config1-list.txt

      root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config2 > config2-list.txt


      And finally now with a diff tool:



      Kconfiglib with print_config_tree.py






      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Thanks to the replay of @jeff-schaller I did a contribution to the project Kconfiglib and now there is a new example script for this task. These are the steps to use it:



        Inside the directory with the linux source, clone the repo:



        root@23e196045c6f:/usr/src/linux-source-4.9# git clone git://github.com/ulfalizer/Kconfiglib.git
        Cloning into 'Kconfiglib'...
        remote: Counting objects: 3367, done.
        remote: Compressing objects: 100% (57/57), done.
        remote: Total 3367 (delta 64), reused 89 (delta 50), pack-reused 3259
        Receiving objects: 100% (3367/3367), 1.25 MiB | 1.79 MiB/s, done.
        Resolving deltas: 100% (2184/2184), done.


        Patch the makefile:



        root@23e196045c6f:/usr/src/linux-source-4.9# patch -p1 < Kconfiglib/makefile.patch
        patching file scripts/kconfig/Makefile


        Configure as needed, basically for get a .config file:



        root@23e196045c6f:/usr/src/linux-source-4.9# make menuconfig


        Run the script with the config file:



        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=.config

        ======== Linux/x86 4.9.65 Kernel Configuration ========

        [*] 64-bit kernel (64BIT)
        General setup
        () Cross-compiler tool prefix (CROSS_COMPILE)
        [ ] Compile also drivers which will not load (COMPILE_TEST)
        () Local version - append to kernel release (LOCALVERSION)
        [ ] Automatically append version information to the version string (LOCALVERSION_AUTO)
        -*- Kernel compression mode
        --> Gzip (KERNEL_GZIP)
        Bzip2 (KERNEL_BZIP2)
        LZMA (KERNEL_LZMA)
        ...


        But the nice thing is that it is possible to pass differente kernel configurations and match the changes easily:



        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config1 > config1-list.txt

        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config2 > config2-list.txt


        And finally now with a diff tool:



        Kconfiglib with print_config_tree.py






        share|improve this answer












        Thanks to the replay of @jeff-schaller I did a contribution to the project Kconfiglib and now there is a new example script for this task. These are the steps to use it:



        Inside the directory with the linux source, clone the repo:



        root@23e196045c6f:/usr/src/linux-source-4.9# git clone git://github.com/ulfalizer/Kconfiglib.git
        Cloning into 'Kconfiglib'...
        remote: Counting objects: 3367, done.
        remote: Compressing objects: 100% (57/57), done.
        remote: Total 3367 (delta 64), reused 89 (delta 50), pack-reused 3259
        Receiving objects: 100% (3367/3367), 1.25 MiB | 1.79 MiB/s, done.
        Resolving deltas: 100% (2184/2184), done.


        Patch the makefile:



        root@23e196045c6f:/usr/src/linux-source-4.9# patch -p1 < Kconfiglib/makefile.patch
        patching file scripts/kconfig/Makefile


        Configure as needed, basically for get a .config file:



        root@23e196045c6f:/usr/src/linux-source-4.9# make menuconfig


        Run the script with the config file:



        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=.config

        ======== Linux/x86 4.9.65 Kernel Configuration ========

        [*] 64-bit kernel (64BIT)
        General setup
        () Cross-compiler tool prefix (CROSS_COMPILE)
        [ ] Compile also drivers which will not load (COMPILE_TEST)
        () Local version - append to kernel release (LOCALVERSION)
        [ ] Automatically append version information to the version string (LOCALVERSION_AUTO)
        -*- Kernel compression mode
        --> Gzip (KERNEL_GZIP)
        Bzip2 (KERNEL_BZIP2)
        LZMA (KERNEL_LZMA)
        ...


        But the nice thing is that it is possible to pass differente kernel configurations and match the changes easily:



        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config1 > config1-list.txt

        root@23e196045c6f:/usr/src/linux-source-4.9# make scriptconfig SCRIPT=Kconfiglib/examples/print_config_tree.py SCRIPT_ARG=/tmp/config2 > config2-list.txt


        And finally now with a diff tool:



        Kconfiglib with print_config_tree.py







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 20 at 9:45









        Rfraile

        26229




        26229






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430693%2fformatted-print-of-linux-kernel-config%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            The Forum (Inglewood, California)

            Palaiologos