schlitt.info - php, photography and private stuff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Tobias Schlitt :Date: Fri, 09 Jan 2009 12:34:32 +0100 :Revision: 2 :Copyright: CC by-nc-sa ================= Making the kernel ================= :Description: Since my new baby is not fully working under Gentoo, yet, I'm updating my kernel each time a new version of gentoo-sources occurs in portage. If you are configuring your kernel by hand, you know what that means every time (at least for me it did): Since `my new baby`__ is not fully working under `Gentoo`__, yet, I'm updating my kernel each time a new version of gentoo-sources occurs in portage. If you are configuring your kernel by hand, you know what that means every time (at least for me it did): .. __: http://schlitt.info/applications/blog/index.php?/archives/563-My-now-notebook.html .. __: http://gentoo.org - Move around /usr/src/linux symlink - Copy .config - $ make oldconfig - $ make (before that make clean, if you re-compile a kernel) - $ make modules_install - $ module-rebuild rebuild, to rebuild external modules on Gentoo - Copy files to /boot - Add the new kernel to the grub menu - Activate it as the default one Time to integrate these steps into `a little script`__. .. __: http://files.schlitt.info/misc/t61p/makekernel.sh.txt This one takes over all the mess from above. It hides a lot of nasty output from me, but allows me to watch it through a temporary log file if I tend to. It creates the rudimentary entries in my grub.conf above all others so that the new kernel is active by default. `The script`__ (rename it to .sh only, make it executable and run it as root) should be adjustable to your needs within minutes. Maybe someone finds it useful. Please leave me a comment if you do and also if you don't! .. __: http://files.schlitt.info/misc/t61p/makekernel.sh.txt .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 Trackbacks ========== Comments ======== - Chuck Burgess at Thu, 27 Sep 2007 16:49:57 +0200 I'll have to compare yours to the one I put together two years ago on my Gentoo box at home. I'd set mine up to do nearly all that yours does... I didn't copy the oldconfig, because I'd read in the Gentoo manual somewhere that I shouldn't assume the same kernel config options would all be in the new kernels, so I was afraid to let it always reuse oldconfig. Have you not had any issues with reusing oldconfig in the new kernels? If not, maybe I've been overprotective. - Tobias Struckmeier at Thu, 27 Sep 2007 19:42:56 +0200 Its "module-rebuild rebuild" :) - Toby at Thu, 27 Sep 2007 19:58:17 +0200 Hi Chuck! Tell me about the differences after your comparison. :) You cannot safely rely on old .config files, that is true. But, at least from my experiences, it is safe to import those via $ make oldconfig. This will ask the user what to do with new settings and automatically deprecate unsupported settings. Regards, Toby - Toby at Thu, 27 Sep 2007 20:00:46 +0200 Hi Tobi! :) Thanks for your hint, I changed it. Luckily it was only wrong here, not in the script itself. ;) Cheers! Toby - Chuck Burgess at Thu, 27 Sep 2007 21:53:34 +0200 Ah, did not know "make oldconfig" would do that... I _have_ been overprotective :P In fact, given my distractions with new boxes over the last year, my Gentoo kernel is way behind (~2.6.17 I think), because I didn't want to take the time to study the kernel config differences. Based on this, I might do a go-for-broke kernel upgrade this weekend. I'll repost my script here when I get home later... til then, I'll see you on #pear :) - Chuck Burgess at Fri, 28 Sep 2007 03:03:25 +0200 My script is at http://pastebin.com/f59f747dd I noticed after pasting it that I have a couple of steps commented out (probably from my last usage of it a year ago), not to mention a few STUB functions I never got around to implementing. The main obvious difference is mine not using "make oldconfig"... I have a step that copies over the old config but runs "make menuconfig", in order to "review/set kernel parameters". Yours is far more refined than mine is, with more logging and exception handling. I think our steps are roughly the same, though again your implementation is more refined and therefore looks more robust than mine. I notice that I don't do a "make clean" at all, probably because my assumption is I'm running this on a kernel I've not yet built at all yet. I wonder if that's bitten me in the arse in the past if I had to rebuild an existing kernel... hmmmmm. I'm tempted to take yours and give it a whirl on my box, moving one kernel step up at a time and see how I like it. That'll be fun^H^H^Hwork for the weekend :P - Chuck Burgess at Sun, 30 Sep 2007 04:54:20 +0200 Used your script to upgrade 2.6.17-r7 to -r8 (very small update I know). I'm impressed at how your script required no input from me at all. Key differences I saw in the results: - kernel file naming ("kernel-" vs. "vmlinuz-"); - mine creates some symlinks in /boot that yours doesn't (System.map, config, vmlinuz); - your grub entry used "/boot" in the kernel path whereas mine does not (perhaps because I have /boot on its own partition); - your grub entry shows "sda3" where mine needs "hda3"; - my grub entry has "udev" shown at the end of the kernel line, but yours doesn't; - I had to manually re-emerge my wireless drivers; That upgrade seemed to work once I got those few things worked out, so I'll step through another few updates. - Chuck Burgess at Mon, 01 Oct 2007 02:17:32 +0200 I added in a simple loop to make those symlinks in /boot that I'm accustomed to seeing (System.map, config, vmlinuz) that point to the "last one built" kernel version. However, the one change I made that you might consider adding to yours up near the top is - alias make="make -j`expr 1 + \`grep \"model name\" /proc/cpuinfo | wc -l \``" in order to gain some parallelism in the build. It helped my builds go quicker. Oh, I also changed the HEAD_LINE_COUNT decrementer from "-= 1" to "-= 2", so that the "Generated by" comment line stayed with its kernel block whenever new entries got added... by having "1" there, the new kernel block gets inserted between the previous block's comment and content. - Chuck Burgess at Mon, 01 Oct 2007 02:57:03 +0200 Heh... figured out my "had to compile my wifi drivers manually" snafu... Just had to toy with modules-rebuild to get it set with the correct driverset. Turns out mine was set to still try building an old wifi driver that's no longer on my system. Now, your script runs the full build, nothing extra for me to do but reboot when it finishes. With that "make -j" parallel option, I'm running a full build on my single core Athlon in about 10 minutes. Sweet! - Chuck Burgess at Mon, 01 Oct 2007 03:23:31 +0200 Okay, all done: Sep 30 2006 linux-2.6.17-gentoo-r7 Sep 29 21:11 linux-2.6.17-gentoo-r8 Sep 29 22:02 linux-2.6.18-gentoo-r2 Sep 29 22:23 linux-2.6.18-gentoo-r3 Sep 29 22:48 linux-2.6.18-gentoo-r4 Sep 29 23:05 linux-2.6.18-gentoo-r5 Sep 30 17:59 linux-2.6.18-gentoo-r6 Sep 30 18:33 linux-2.6.19-gentoo-r5 Sep 30 18:50 linux-2.6.20-gentoo-r7 Sep 30 19:14 linux-2.6.20-gentoo-r8 Sep 30 19:28 linux-2.6.21-gentoo-r4 Sep 30 19:43 linux-2.6.22-gentoo-r2 Sep 30 19:56 linux-2.6.22-gentoo-r5 Sep 30 20:11 linux-2.6.22-gentoo-r8 I still laugh when I see it was exactly one year ago the last time I did a kernel update. I think I can safely say I have stress-tested your script and am very happy with its performance. - DelicateBlog.com at Fri, 30 Mar 2012 19:26:07 +0200 The topics presented vary between Unicode news and PHP's dirty secrets, by Derick, Sebastians usual introduction on PHPUnit, XUL in theory and praxis by Karola/Arne and a talk about deployment of PHP applications by David Coallier. Beside that, Jan will talk about next generation web storage with CouchDB, Henri Bergius is joining us for session about personal information management with Midgard, Falko Menge will inform us on web services with PHP and Guillaume Jarysta-Dautel will present a session about rich internet applications. - Blog PR 4 U at Thu, 05 Apr 2012 13:28:11 +0200 This article is well thought out and full of good information. Many Thanks for taking time to bring this together into one article.