Kernel build script

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

Kernel build script

#1 Post by Iguleder »

I wrote a script which builds the kernel automatically. It has three input fields:
- A kernel version
- A kernel sources mirror
- An Aufs major version

... and a valid configuration file for the kernel version specified.

This is beta-quality software, so don't get too excited. At the moment, you can use it to build linux_kernel-2.6.32-40-lts.pet, a very very very very very, but VERY good kernel. It's very solid and the building kit also patches it with BFS, which makes it fly on weak hardware. Power consumption is very low.

The main idea behind this kit is allowing Puppy developers to compile a kernel (let's say it's 2.6.32) and once later kernels of the same series come out, compile them the same way the first one was built to maintain compatibility and reduce the risk of breaking something. In other words - the ability to update the kernel safely and transparently to the user.

If you wonder why it's so good - here's my story with kernel updates - my 2010 netbook's sound card was unsupported on Linux because two pins were not handled in the HDA driver. The required fix came in 2.6.35.7, which was the most recent kernel version back then, but it was also backported to 2.6.32.29. I couldn't use any Puppy, because no puplet had a kernel with that fix. Those kernel updates add more than just bug fixes - they also add security, hardware support and features. That's why they're so important.

The kit provides compatibility by automatically patching the kernel to appear as its major version - for example, 2.6.32.40 is patched to appear as 2.6.32, so if you build nvidia or ATI drivers against 2.6.32.39 and the kernel gets updated, you won't get any X startup failure, BSOD, CPU melting or whatever. Everything will work just fine. It is particularly useful for Wary or any puplets that stick with one kernel for some time. The Lupu guys could do occasional updates to the 2.6.33.2 kernel ... but it's too late :cry:

Also, it patches the kernel to be quiet (that's the way Puppy kernels are, traditionally) and reduces the number of available consoles (TTYs) from 8 to 5, because 3 are unused and waste precious memory.

The kit consists of four components:
- build.sh - the script which does the real magic
- DOTconfig - a kernel .config file
- patches - a directory with kernel patches to apply
- aufs-allow-sfs.patch - Barry's traditional, must-have patch to allow Squashfs to be used with Aufs.

Just run build.sh to make your own linux_kernel-2.6.32-40-lts. It's very easy - takes 1-2 hours. The result packages can be used with Woof.

As a PoC, I built a kernel (the result was a 20 MB PET, without any stripping) and used it with EZ-Woof to produce a conservative Lupu 5.2.5, it used 57 MB of RAM with nothing running. Pretty good.

EDIT: you can find my kernel here; the script used to build it is in the parent directory. It has one small fix on top of the attached script.
Attachments
kernel-kit.tar.bz2
(89.35 KiB) Downloaded 1076 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
divisionmd
Posts: 606
Joined: Sat 14 Jul 2007, 20:42

#2 Post by divisionmd »

Hello Iguleder,

- Very nice work looking forward to testing this.

Best regards,
Johan

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#3 Post by Aitch »

Hey Iggy

Can this be used to reconfigure a kernel, if, say you want SCSI bootup support, PXE enabled, or some PCMCIA feature that wasn't enabled?

btw puppyluvr has done a 539 - 529 plus typo ( :wink: ) Lupu with 2.6.38.4 kernel

http://www.murga-linux.com/puppy/viewtopic.php?p=520175

Aitch :)

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#4 Post by 8-bit »

I just wanted to pass along that Barry likes your kernel build script and talks about it on his blog.
He also talked about doing away with the kernel subversion number on kernel builds
to save on not having to recompile driver modules for each subversion.

So as has already been said, Good Work!

stu90

#5 Post by stu90 »

Nice one Iguleder - i made a build with EZ-woof using your kernel .pet and updated:
flash
gnome-mplayer
geko-mediaplayer
mtpaint
lupu-update

With htop and scrot running it was using just less than 50mb or ram :D

cheers.

Image
Last edited by stu90 on Thu 12 May 2011, 16:21, edited 1 time in total.

gcmartin

Re: Kernel build script

#6 Post by gcmartin »

Iguleder wrote: ... kernel (the result was a 20 MB PET, without any stripping) and used it with EZ-Woof to produce a conservative Lupu 5.2.5, it used 57 MB of RAM with nothing running. Pretty good.
Hi @Iguleder. Great.
2 Questions
  1. Would you post your PUP525 ISO for review, please?
  2. Will this script also work for the work we see with kernel builds by @Pemasu?
Thanks in advance

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#7 Post by Iguleder »

I guess I'll generate a new ISO tomorrow if I find the time :)

And yes - it should work with any kernel, as long as you provide working patches and a matching configuration file. You'll have to tweak and test the script too, but just once :)
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

stu90

#8 Post by stu90 »

Here is my lucid 525 EZ-woof build.

Full Lucid Puppy with updated:
kernel - 2.6.32-40-lts
flash
gnome-mplayer
geko-mediaplayer
mtpaint
lupu-update
mint openbox theme
changed icon set and wallpaper

(screen shot in my post above)
http://smokey01.com/stu90/lupu-540.iso
md5: 45c80dd429d6839875dfea8bf4febd14

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#9 Post by Iguleder »

Uploaded a package with extra, third-party drivers:
agrsm048pci-2.1.60-20100108-patched1
agrsm06pci-2.1.80-20100106-patched1
agrsm-11c11040-2.1.80-20091225-patched1
dgcmodem-1.13
intel-536-537
ltmodem-20100102
ndiswrapper-2729
orinoco_usb-git11122010
pctel-0.9.7-9-rht-11-patched1
slmodem-2.9.11-20100303-patched1
sysprof-1.0.12
ungrab-winmodem-20090716
8 MB, quite big - but it's worth it if you need any of those :)
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
James C
Posts: 6618
Joined: Thu 26 Mar 2009, 05:12
Location: Kentucky

#10 Post by James C »

stu90 wrote:Here is my lucid 525 EZ-woof build.

Full Lucid Puppy with updated:
kernel - 2.6.32-40-lts
flash
gnome-mplayer
geko-mediaplayer
mtpaint
lupu-update
mint openbox theme
changed icon set and wallpaper

(screen shot in my post above)
http://smokey01.com/stu90/lupu-540.iso
md5: 45c80dd429d6839875dfea8bf4febd14
Since I can't find a thread for this I'll make a quick post here. :) Did a frugal install on the old P4 test box and everything appears to be working correctly ootb.

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#11 Post by Iguleder »

Started a Woof build of dpup from Debian Squeeze, I want to give this kernel some serious testing. If everything works well, I might turn this into a puplet.

I want to do a build script for a later kernel too, probably 2.6.39. This could be a very good tool for the IcePuppy and Lite front, in the struggle against old kernels. :)
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#12 Post by pemasu »

I want to do a build script for a later kernel too, probably 2.6.39. This could be a very good tool for the IcePuppy and Lite front
:P :) :D

stu90

#13 Post by stu90 »

James C wrote:
stu90 wrote:Here is my lucid 525 EZ-woof build.

Full Lucid Puppy with updated:
kernel - 2.6.32-40-lts
flash
gnome-mplayer
geko-mediaplayer
mtpaint
lupu-update
mint openbox theme
changed icon set and wallpaper

(screen shot in my post above)
http://smokey01.com/stu90/lupu-540.iso
md5: 45c80dd429d6839875dfea8bf4febd14
Since I can't find a thread for this I'll make a quick post here. :) Did a frugal install on the old P4 test box and everything appears to be working correctly ootb.
Hi James C thanks for testing - did this one have any problems with boot to desktop?

Been using this build for a couple of days and not run into any problems myself - finding 2.6.32-40-lts kernel to be nice and stable as well as light on resources.

cheers.

User avatar
James C
Posts: 6618
Joined: Thu 26 Mar 2009, 05:12
Location: Kentucky

#14 Post by James C »

stu90 wrote: Hi James C thanks for testing - did this one have any problems with boot to desktop?

Been using this build for a couple of days and not run into any problems myself - finding 2.6.32-40-lts kernel to be nice and stable as well as light on resources.

cheers.
Went straight to the desktop this time, only thing I had to do was the internet connection.
According to Htop, under no load this was only using 41 mb of ram, pretty good.
Really nothing bad to report. :)

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#15 Post by Iguleder »

I rebuilt pretty much all 5.2.5's applications and compiled extras, like xbindkeys, acpid, acpitool, deadbeef, geany, etc' - I want to build a "lite" 5.2.5 with these and 2.6.32.x to see how light I can get it while maintaining usability.

I do this experiment both because 01micko is interested in this kernel for a "retro" 5.3 and because I have an evil plan to (help) maintain a conservative 5.3 branch, if there is any interest. Sort of the middle between Wary and 5.3 - recent packages with frozen libraries and kernel, but newish applications, built for new hardware and people who appreciate stability.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

The kernel has the ability to include the initrd when built, have you considered adding such a beast?

+ easy install, fast boot, simple tracking, easier version control
- kernel may need to be rebuilt if the initrd is modified

Perhaps only do it if configured to do so?

I've done it once before with an lzma'd kernel with fairly impressive results, but I was working with an "extreme" minimal kernel and everything (including X) as a single static multicall binary in the initrd (a real painful learning experience btw)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#17 Post by Iguleder »

That would be very problematic, since it requires integration with Woof ... but I have a cooler idea in mind - a JIT kernel build script that integrates with Woof to produce a UniPup :)

Interesting, I'll check this out.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#18 Post by Lobster »

Guys :roll:

(I am such a nag)
Are we anywhere near to having a kernel base for Saluki?
http://puppylinux.org/wikka/Puppy6

Sorry for nagging :oops:
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#19 Post by Iguleder »

I'm lost my interest in Saluki. While the nice "static or not static" conversation goes on in the Saluki front, the real hard work is done on the 5.3 and Wary fronts, by people who work more and talk less.

I wanted a kernel build script and wrote one. That's how I work. Enough talking and planning of a project without any product so far ... it's time to bring features to the table and that's what 01micko and the 5.3 guys do, unlike Saluki. I decided to join this effort.

So if you ask me - no, I won't help with Saluki's kernel ... well, at least I won't do it actively. However, this can be a kernel if the Saluki team wants it.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#20 Post by 01micko »

I really like your script Iguleder.

of course I have some suggestions :lol: :D

Being hard coded to 2.6.32 isn't a bad thing just a restrictive thing.

You could easy adjust to use any sauce you want.. with special cases for the LTS branches.

I just compiled 2.6.37.6 basically following your script manually. It may need a break at the configuration part where "make gconfig" (or whatever config option) could be run to configure the source. (hehe.. make xconfig is nice.. but needs qt :0 )

Cheers!
Puppy Linux Blog - contact me for access

Post Reply