# Trimming kernel

## freke

Running on headless APU/APU2 (https://www.pcengines.ch/apu2c4.htm) from mSATA SSDs - I'd like to keep kernel (/kernel-compiletime) as small as possible.

dmesg from APU1D4 - http://bpaste.net/show/79d96da5604e

.config from APU1D4 - http://bpaste.net/show/929f6dff45cb

lspci from APU1D4 - http://bpaste.net/show/341a1fb3efaa

lshw from APU1D4 - http://bpaste.net/show/d4529aa4f9ac

dmesg from APU2C4 - https://paste.pound-python.org/show/vnyxgoa7OsO95fmA5juX/

.config from APU2C4 - https://paste.pound-python.org/show/yxjhYmI2qDNbx6kgVicY/

lspci from APU2C4 - https://paste.pound-python.org/show/yi4A9YE8EbZM7TDRAZAu/

lshw from APU2C4 - https://paste.pound-python.org/show/XML4vQ1MFZntBxeaw20M/

Is there anything I need/want to fix (ie. I got alot of probably - not needed - modules compiled, I don't see them loaded using lsmod.

TIA to anyone taking their time  :Smile: 

----------

## audiodef

Pappy's Kernel Seeds were great for this, but that project isn't maintained any more.

This tool will help, though: https://kmuto.jp/debian/hcl/

You'll need the output of:

```

lspci -n

```

This will cover the drivers needed for the hardware you have. 

For the rest... There is a lot of stuff in defconfig that you will probably not need, but it depends entirely on your hardware and your willingness to weed through the config and disable stuff you don't want. 

It would be nice to have a "make minconfig" that requires the user to enable the required drivers (with the tool above, for example) and little other than what's necessary to get a system up and running.

----------

## NeddySeagoon

freke,

Pappys seeds lives on in the shape of Pappys preconfigs

----------

## toralf

```
scripts/kconfig/streamline_config.pl
```

----------

## 1clue

I used to use Pappy's seeds too.

Here's what I do:

Get a list of your hardware (lshw, lspci, lsusb, ...)

Prune out the devices you don't need.

Get device drivers for the list you have, and absolutely nothing else.

The rest of it is more problematic.

Get a list of the apps that you need.

Get a list of kernel flags they need, or that you need in conjunction with these apps.

Work out to your entire dependency tree.

Enable those options.

Get a working kernel.

Prune unnecessary options sparingly, recompile the kernel, retest.

Repeat until you're sick of it.

----------

## Goverp

 *audiodef wrote:*   

> ...
> 
> It would be nice to have a "make minconfig" that requires the user to enable the required drivers (with the tool above, for example) and little other than what's necessary to get a system up and running.

 

Read up on 

```
make localmodconfig

make localyesconfig
```

----------

## Zucca

All this time... I've been

```
zcat /proc/config.gz > .config && make oldconfig
```

... Sometimes tweaking using menuconfig or nconfig.

I guess "It didn't need fixing".

So... Ladies and gentlemen, where can I find meanings for all these kernel configuration tools?

----------

## audiodef

 *NeddySeagoon wrote:*   

> 
> 
> Pappys seeds lives on in the shape of Pappys preconfigs

 

Yes!   :Very Happy: 

Also, app-portage/cpuid2cpuflags might be useful.

----------

## Ant P.

 *Zucca wrote:*   

> So... Ladies and gentlemen, where can I find meanings for all these kernel configuration tools?

 

`make help`

----------

## NeddySeagoon

Team,

There is this method from 2005.

In the last 13 years a lot more options have been added to the kernel.

It follows that you need more coffee.

----------

## freke

Thx for the feedback, and sorry for the late reply - been pretty busy at work  :Sad: 

Adding another APU2C4 tomorrow and trying out the 4.16.0 kernel - going to check out some of the links  :Very Happy: 

Thanks

 *NeddySeagoon wrote:*   

> It follows that you need more coffee.

 

I'm all in for coffee  :Smile: 

----------

