Date: Wed, 21 Feb 2018 05:44:00 +0000 From: George Rosamond <george@ceetonetechnology.com> To: freebsd-arm@freebsd.org Subject: Re: Custom kernel for RPi2 and 3 Message-ID: <d1e2036f-fb9e-71fa-0918-8b904f16a807@ceetonetechnology.com> In-Reply-To: <20180221051801.GA73510@www.zefox.net> References: <20180220161900.GA2345@www.zefox.net> <c1a82728-a6cd-c972-9b54-73baca644528@zyxst.net> <20180221051801.GA73510@www.zefox.net>
next in thread | previous in thread | raw e-mail | index | archive | help
bob prohaska: > 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: This script can generate an /etc/src.conf based on the running system, extracted from /etc/src.conf(5). Since there's no standard /etc/src.conf through FreeBSD versions, it's a hassle to maintain without it. http://wiki.torbsd.org/doku.php?id=en:a_shell_script_to_convert_src.conf_5_contents_to_an_example_etc_src.conf_file HTH g
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d1e2036f-fb9e-71fa-0918-8b904f16a807>