Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 21:18:01 -0800
From:      bob prohaska <fbsd@www.zefox.net>
To:        tech-lists <tech-lists@zyxst.net>
Cc:        freebsd-arm@freebsd.org, bob prohaska <fbsd@www.zefox.net>
Subject:   Re: Custom kernel for RPi2 and 3
Message-ID:  <20180221051801.GA73510@www.zefox.net>
In-Reply-To: <c1a82728-a6cd-c972-9b54-73baca644528@zyxst.net>
References:  <20180220161900.GA2345@www.zefox.net> <c1a82728-a6cd-c972-9b54-73baca644528@zyxst.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 21, 2018 at 02:18:21AM +0000, tech-lists wrote:
> On 20/02/2018 16:19, bob prohaska wrote:
> > Does anyone have a recipe for building a custom RPi2 or RPi3 kernel?
> 
> for rpi2 I comment out /remove what I don't need [0]. On rpi3 if I'll
> use GENERIC-NODEBUG, or comment out what's not needed. But
> GENERIC-NODEBUG is good and still has *some* ability to debug. I get a
> smaller system by adding WITHOUT= statements to various bits that will
> never be used in the context. man 5 src.conf
> 

It's not trivial to figure out which of those "WITHOUTs" apply to the Pi2
or Pi3. I was hoping for a pointer to a list or perhaps a more restrictive
starting point. Still, it _is_ a starting point, thank you!

How much did the resulting kernel shrink? Seems to me I only shaved
less than 1 meg (~11 meg became ~10meg) by tampering with GENERIC.
It didn't seem worth the effort if that's all that can be accomplished. 
My hope was to trim it by maybe half...  Perhaps that's fantasy...  

One sidelight was all the kernel modules that get compiled. It would
be nice, if not necessary, to omit compiling those that aren't needed.


> > I tried it, by simply commenting out drivers I didn't recognize in
> > GENERIC, but after much trial-by-error the kernel didn't shrink a lot.
> > Having since learned that GENERIC is the tail of a much larger beast,
> > perhaps there's a more intelligent method.
> > 
> 
> Are you compiling on the pi? I don't because it's painfully slow and bad
> for the microsd. I cross-compile on a faster machine using
> https://github.com/freebsd/crochet - basically do this every time
> there's a problem/vulnerability that can't be patched and building world
> is needed.
>
Yes, compiling on the Pi. That way the test machines will start having
flash problems before the "production" machines and I'll have time to
replace storage media before there's a data loss.

Thanks very much!

bob prohaska
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180221051801.GA73510>