• [gentoo-user] Fwd: Creating a custom kernel from a -bin kernel

    From Andrew Lowe@21:1/5 to All on Wed Oct 9 22:40:02 2024
    For some reason this didn't go through yesterday so, once again......


    -------- Forwarded Message --------
    Subject: Creating a custom kernel from a -bin kernel
    Date: Sat, 5 Oct 2024 18:55:50 +0800
    From: Andrew Lowe <agl@wht.com.au>
    Reply-To: agl@wht.com.au
    Organization: Wombat High Tech
    To: gentoo-user@lists.gentoo.org

    Dear all,
    I'm in the process of building a new machine. To get things up and running I've decided to go with the gentoo-sources-bin kernel initially,
    then once I get things basically working as I want I will go back to
    building my kernels manually.

    I've now reached that point, "hand rolling" the kernel, but it is a pain, the first time round, getting things right.

    I have a recollection of reading somewhere online mention of a script that will take the .config file from the "-bin" kernel and then
    modprobe, I think, each listed module in turn to see if it is actually
    being used and subsequently writing a new .config file that now only
    contains the modules/options that the specific machine needs.

    Is this a mythical script that I have dreamt up after a long day and too much chocolate or does it actually exist and does anyone have a link.

    Thanks for any thoughts,

    Andrew

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Oct 9 23:08:46 2024
    Hi Andrew,

    On Sunday 6 October 2024 15:16:46 BST Andrew Lowe wrote:
    For some reason this didn't go through yesterday so, once again......


    -------- Forwarded Message --------
    Subject: Creating a custom kernel from a -bin kernel
    Date: Sat, 5 Oct 2024 18:55:50 +0800
    From: Andrew Lowe <agl@wht.com.au>
    Reply-To: agl@wht.com.au
    Organization: Wombat High Tech
    To: gentoo-user@lists.gentoo.org

    Dear all,
    I'm in the process of building a new machine. To get things up and running I've decided to go with the gentoo-sources-bin kernel initially,
    then once I get things basically working as I want I will go back to
    building my kernels manually.

    I've now reached that point, "hand rolling" the kernel, but it is a pain, the first time round, getting things right.

    I have a recollection of reading somewhere online mention of a
    script
    that will take the .config file from the "-bin" kernel and then
    modprobe, I think, each listed module in turn to see if it is actually
    being used and subsequently writing a new .config file that now only
    contains the modules/options that the specific machine needs.

    Is this a mythical script that I have dreamt up after a long day and too much chocolate or does it actually exist and does anyone have a link.

    Thanks for any thoughts,

    Andrew

    Have a look at this page:

    https://wiki.gentoo.org/wiki/Kernel/Configuration

    In particular, take notice of 'make localmodconfig'.

    Once you have a customised kernel as you like it and it boots successfully,
    you can copy your good /usr/src/linux/.config to any subsequently emerged new gentoo-source kernel trees and run 'make oldconfig' thereafter, to only have
    to deal with new kernel options.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmcG/u4ACgkQseqq9sKV Zxmtzg/9E8HGG0exCoeaiajQa77xq39n7i6jaa5FBJAVz17zR1d4IQsl+9Glnnsh yQvAXA28sVrIOFDAfpnJ7zHJwV/AwCOepoCBX6EmyAoQYBnZcSNQj7lkuvl0pEkL HBWdffReYuiGxDBC0ws6IH97YsJPBEJHO5FrOxcwHJFl4bmzU0E4/MmZQeFV28vW J2ieSr3s662iMAGN5G0nzRvfiScmQ4ZZdNzeRt0juV19d+WV8ZaX3Ki2kG7r2Z5y zW0Ny4DIGnymsOxxWB89Rh0+AT/+/apzJ1nzebi1K+XB8BI69XfRJrhJb/UKHk1k XCZAR7u1nGO2syVn2rFtqtxyhXBse+Q+Sh8nbjsQE4MYy4PKURmiDs2xWXFsHJwx 19N04HArGP08s+AFX2ZsoOQAoY6AJEFiiU1ogBYSPDv5bilyQHM01SloDqRERclh jcjMiorT8BYN1raT7HuTOcStV64vRdVB44iNcwOd6YNDRxtYBu8usQtUV4D+GSDf e5qxJeqd5IoDt7ioKz7ZpZl3Vyu1IQMeRH5gQ2CfKKZeD6Qj5WDtnxkmRDu+0n14 uhXYIQ7SGo81ujhjfpnfr9ltOUYC/spMpNbMBpppYCeusUNQvgw838S/oYEphy9x Hv7QSd1ucFjxgTV2c69jmQ7z/LEyCLcNPmrEqCsGjeX2MS7kivQ=
    =VDLH
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Michael on Thu Oct 10 02:50:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------X3clBkzRq8e0qi9cOHE26lZH
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 10/9/24 6:08 PM, Michael wrote:
    I have a recollection of reading somewhere online mention of a
    script
    that will take the .config file from the "-bin" kernel and then
    modprobe, I think, each listed module in turn to see if it is actually
    being used and subsequently writing a new .config file that now only
    contains the modules/options that the specific machine needs.

    Is this a mythical script that I have dreamt up after a long day and
    too much chocolate or does it actually exist and does anyone have a link.

    Thanks for any thoughts,

    Andrew

    Have a look at this page:

    https://wiki.gentoo.org/wiki/Kernel/Configuration

    In particular, take notice of 'make localmodconfig'.

    Once you have a customised kernel as you like it and it boots successfully, you can copy your good /usr/src/linux/.config to any subsequently emerged new
    gentoo-source kernel trees and run 'make oldconfig' thereafter, to only have to deal with new kernel options.


    See also https://wiki.gentoo.org/wiki/Modprobed-db

    "make localmodconfig" will only handle what your current system state is
    using right at that second -- modprobed-db maintains a database over
    time of the modules that "make localmodconfig" would see, which means
    you can run the -bin kernel for a bit under your usual workloads and
    then activate "make localmodconfig" via that database without worrying
    about "an important module I often use was not loaded today specifically because I didn't run the program which needs it today. Now the newly
    built kernel doesn't have that module at all, oops".


    --
    Eli Schwartz

    --------------X3clBkzRq8e0qi9cOHE26lZH--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZwcjZwUDAAAAAAAKCRCEp9ErcA0vVx9N AP9M/Ge4iSmQRX7qqBePUQLg7rnEOEnuWLyA8qF8075e9gEAyOVlbXG0JgMdGtixY09+MuM/GCkq o+NqGu6ggbdTkQg=
    =mE4V
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)