Compiling the new 2.6.26 Kernel for puppy

Using applications, configuring, problems
Message
Author
Bruce B

#31 Post by Bruce B »

MU wrote:So I also would appreciate, if someone writes a howto for the current kernel.
I'm writing this to everyone, not particularly Mark. Meaning this is not a reply to Mark specifically, just a reply to the question posed, with the intended audience being everyone.

If I could write an excellent howto, I would not do it. But, I'll make some comments about compiling.

Who compiled the Dingo 4.00 kernel? Frankly, I don't know, but think it was Barry. Moreover, who will compile the future kernels?

Two compiling considerations
  • * Do you want to compile from scratch?
    * Do you want to compile using the existing kernel options, and make modifications based on it?
(I've already said how to use the existing kernel options in this topic)

Using the correct source code
  • * you might have to rely on expert authoritative and informed
    opinion, in this case Barry, and;
    * and opt to ignore the README.txt file
The README.txt file, in this case, says that the source code identical to Puppy3 source, with updated squashfs. That it surprisingly compiles in Dingo, yet still works in Puppy3.

It makes no mention of being the source code for 4.00.
README.txt * wrote:This kernel is identical to that in Puppy3, except patched for Squashfs v3.3 instead of v3.2r2.

All the modules from Puppy3 still work with this new kernel, only 'squashfs.ko' is changed.

In fact, I was surprised. I compiled the kernel in Dingo, which has a different compiler and glibc versions than Puppy3, but all the modules from Puppy3 still load without complaint.
* http://puptrix.org/sources/kernel-2.6.2 ... README.txt

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#32 Post by MU »

Bruce, I want to compile for 3 reasons

1.) I could need a newer Kernel, as the old one might not support all new hardware.
Especially wifi is an issue

2.) I'd like to have multicore support. I do not have such a machine yet, but they are widespread meanwhile.

3.) My collegue encountered an issue. If he copies files over network on a machine with sata drives, there are sudden slowdowns. We need to verify, if this is related to the Kernel, or other issues.
As the newest test kernels in Puppy 4 seem to have a very different code for handling drives (no more "hd" , only "sd", we think, that the slowdown might be related to the old code in the Kernel 2.6.21.7. But this is just a vague guess.

So I intend to have a "Standard" Puppy Kernel without exotic addons.

As I maintain an own distro, it would be important, that I learn to compile a kernel on my own.
So I basically just had to learn, how to add Puppy specific patches like squashfs and aufs to a vanilla Kernel.

I am not under pressure with this, my idea was to deal closer with this topic in the end of the year, when I finished some other projects I work on.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

Bruce B

#33 Post by Bruce B »

Mark,
MU wrote:1.) I could need a newer Kernel, as the old one might not support all new hardware.
Especially wifi is an issue
In reading posts, I see where the OP claims that such and such a Puppy version has the wifi support, the other version doesn't. It is mostly discouraging for me to read, when the newer version doesn't have the support, but the older version did.

I recommend getting the expert advice of tempestuous. Explain what you want, to have a kernel that supports the broadest range of wifi possible. I'm sure he could and would help with the best advice you can get.

MU wrote:2.) I'd like to have multicore support. I do not have such a machine yet, but they are widespread meanwhile.
It seems to me for the last couple or three years all a person can buy are multicore machines or motherboards or CPUs. To some, Linux may be an OS for their old computer. Yeah, I think that support is very important.
MU wrote:3.) My collegue encountered an issue. If he copies files over network on a machine with sata drives, there are sudden slowdowns. We need to verify, if this is related to the Kernel, or other issues.
MU wrote:
I have no sata drives. I asked forum questions and got a general answer that Puppy supports sata.

I searched Puppy 4.00 files for some sata module keywords and found nothing. I search another distro's files with the same keywords and get hits.

Having pata drives, I download files from ftp servers using wget. It downloads typically at around 450K on a fast server. Then it stops to 0, after a while it starts up again. On a big file like a cdrom size file this cycle repeats itself. It doesn't seem to matter what server I download from, or even the protocol (http,ftp) the behavior is the same. I think the behavior is on my end. Downloading packets faster than it can assemble and write them? I don't know.
MU wrote:As the newest test kernels in Puppy 4 seem to have a very different code for handling drives (no more "hd" , only "sd", we think, that the slowdown might be related to the old code in the Kernel 2.6.21.7. But this is just a vague guess.
The truth is in - the testing results, I suppose. I wonder if there is a generic SATA driver and optionally numerous controller specific modules available at compile time.
MU wrote:So I intend to have a "Standard" Puppy Kernel without exotic addons.

As I maintain an own distro, it would be important, that I learn to compile a kernel on my own.
So I basically just had to learn, how to add Puppy specific patches like squashfs and aufs to a vanilla Kernel.
Barry said the right and complete kernel source is at:
http://puptrix.org/sources/

Presumably:

http://puptrix.org/sources/kernel-2.6.21.7-dingo/

The filename says the patches applied. It doesn't mention anything about an aufs patch.

The unionfs and squashfs are patched. Maybe the current aufs is already in the base code for 2.6.21.7, if not, then what? More questions I suppose.

The aufs is one reason I'm hesitant to use that source, but it does have Barry's approval as the correct source for 4.00.
MU wrote:I am not under pressure with this, my idea was to deal closer with this topic in the end of the year, when I finished some other projects I work on.
I don't know how you manage to do as much as you do, but you do.

I think a person won't have any problem releasing a distro with two or even three kernels, compiled with different options.

Bruce

alcy
Posts: 143
Joined: Sun 04 May 2008, 18:24

#34 Post by alcy »

erikson wrote: Question: with your recompiled kernel, are you able to boot a Puppy live-CD (containing the recompiled vmlinuz) from external usb cd drive?
I did NOT *recompile* the existing kernel.

I compiled a new kernel, keeping the original one intact.

I haven't tried booting the live CD with the newly compiled kernel, but I don't see if there should be a problem in that. As far as boot up is concerned, doesn't it depend on my bios if it supports booting from a CD, rather than on my choice of kernel or whether its an external USB CD drive or an internal CD drive ? .

User avatar
shroomy_bee
Posts: 536
Joined: Sat 28 Jun 2008, 16:54
Contact:

#35 Post by shroomy_bee »

I'm not trying to put you on the spot or anything but I have to ask this because you wrote,
I had been wanting to do it just for fun, but there were technical reasons too:

1. Puppy 4, with the default kernel was unable to detect my external usb cd drive.
so why not check & see if it does boot from the CD (presumably it is now detected)?

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#36 Post by ttuuxxx »

MU wrote:Bruce, I want to compile for 3 reasons

1.) I could need a newer Kernel, as the old one might not support all new hardware.
Especially wifi is an issue

2.) I'd like to have multicore support. I do not have such a machine yet, but they are widespread meanwhile.

3.) My collegue encountered an issue. If he copies files over network on a machine with sata drives, there are sudden slowdowns. We need to verify, if this is related to the Kernel, or other issues.
As the newest test kernels in Puppy 4 seem to have a very different code for handling drives (no more "hd" , only "sd", we think, that the slowdown might be related to the old code in the Kernel 2.6.21.7. But this is just a vague guess.

So I intend to have a "Standard" Puppy Kernel without exotic addons.

As I maintain an own distro, it would be important, that I learn to compile a kernel on my own.
So I basically just had to learn, how to add Puppy specific patches like squashfs and aufs to a vanilla Kernel.

I am not under pressure with this, my idea was to deal closer with this topic in the end of the year, when I finished some other projects I work on.
Mark
Mark I have 3 sata2 hard drives on my building pc, 320,500,750 gigs I never had any problems transferring data between them.
The only problem I have is with the latest one. I had a io error
I can only retrieve software on that drive, It no longer saves fles.
I don't know if that has to do with the kernel in puppy 4.0 or not.
I always figured it would be nice to have Barry's configure code for 4.0 kernel compiling, so we all could see what Barry used to compile. It really would help a few of us understand compiling a kernel better, If we had a example to go off.
ttuuxxx
Attachments
ntfs%20warning.png
(10.46 KiB) Downloaded 1436 times
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

alcy
Posts: 143
Joined: Sun 04 May 2008, 18:24

#37 Post by alcy »

shroomy_bee wrote:I'm not trying to put you on the spot or anything but I have to ask this because you wrote,

so why not check & see if it does boot from the CD (presumably it is now detected)?
So I guess I need to make a remaster, right ?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#38 Post by MU »

ttuuxx, the problem appears only, if you copy over network.
E.g. if you copy via Samba to an attached computer.
My colleague was away for some days, but now also will check, if it happens via ftp.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#39 Post by kirk »

I'm using 2.6.26.3 right now with aufs and squashfs-lzma on a frugal install . Compiling a new kernel is not too hard. Doing it with only a frugal install is more challenging. Barry is a pretty organized fellow. Just use his kernel patching notes found here:

http://puptrix.org/sources/kernel-2.6.2 ... quired.txt

to put on what ever patches you need/want.

Copy Puppy's .config into your new kernel source. Make any changes you want to the config file. Then do:

# make oldconfig

This will generate a new config file based on the old one. You'll be asked about any new kernel options. Here's a great web site if you need info on config options: http://cateee.net/lkddb/web-lkddb/

Then type:

# make

and then

# make modules_install

When it's done you'll find your compressed kernel in arch/x86/boot/bzimage. You can rename bzimage to vmlinuz if you like. Your modules will be in /lib/modules.

Note: If you want to use squashfs-lzma with 2.6.26 you'll need a patch. If someone needs it I can dig it up.

Then you'll need to replace the modules in initrd with your new ones, extract the initrd:

# gunzip initrd.gz
# mkdir puppy-init
# cd puppy-init
# cat ../initrd | cpio -d -i

Replace the modules. Then you'll need to depmod the initrd. You can do this if your currently running your new kernel:

# depmod -b <path to extracted initrd>

And then zip your initrd back up:

# cd puppy-init
# find . | cpio -o -H newc | gzip -9 > ../initrd.gz

Again depmod will only work if you are running your new kernel. That can be a problem if your running a frugal install. I don't have a spare partition for a full hard drive install, so I do it with a frugal. You'll need to add depmod to your initrd, the one included in Puppy at /sbin is static so just copy that one into your new initrd and zip it up.

You'll also want to get your main sfs file ready. Extract your sfs file to a folder. If you're running Puppy 4.1 you'll want to rename the file /etc/ modules/firmware.dep.<kernel version> to your new kernel version and replace the modules in /lib/modules

Then boot your new kernel and initrd with pfix=rdsh. Here's a sample grub entry:

title Puppy fatdog-rdsh (on /dev/sda4)
rootnoverify(hd0,3)
kernel /20fd/vmlinuz loglevel=7 psubdir=20fd pfix=rdsh
initrd /20fd/initrd.gz

Once it boots to a prompt, mount the drive that has your extracted initrd (must be a kernel built-in FS type, ext2/3 and drive type, no usb drives) . Then do:

# depmod -b <path to extracted initrd>
# depmod -b <path to extracted sfs file>

Reboot into normal Puppy, remove depmod from your initrd and zip it up again. Mksquashfs your new main sfs file and try it out.

Then for more fun, after booting your new puppy, you can link in your kernel source and compile all of the extra kernel modules like the modem drivers and extra wifi drivers.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#40 Post by MU »

kirk, fantastic, many thanks :D
A very good start for my first experiments!
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
shroomy_bee
Posts: 536
Joined: Sat 28 Jun 2008, 16:54
Contact:

#41 Post by shroomy_bee »

Alcy:

a remaster? I don't follow you. As far as I know, 'remaster' means the same thing as 'recompile' - but don't quote me on that, cause the first time I heard 'remaster' used in this context was yesterday, when I was searching a security forum elsewhere for posts on recompiles.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#42 Post by ttuuxxx »

shroomy_bee wrote:Alcy:

a remaster? I don't follow you. As far as I know, 'remaster' means the same thing as 'recompile' - but don't quote me on that, cause the first time I heard 'remaster' used in this context was yesterday, when I was searching a security forum elsewhere for posts on recompiles.
A lot of puppy derivatives are remaster, basically it takes a image of what you have while running live and makes a iso out of it, or you could also use puppy unleashed script which is different. The reason why he is asking to remaster, is because he made some really big changes and wanted to see if they actually worked after reboot, and if so he could upload his new iso and share it with us.
Or a simpler way to understand is
a remaster is everything you've done from a pristine state and builds a iso image of the end result.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#43 Post by John Doe »

kirk wrote:I'm using 2.6.26.3 right now with aufs and squashfs-lzma on a frugal install .
Sounds cool. I'm trying to jump a full install up to 2.6.26.5 right now.

Only two of the patches for the latest puppy don't work. The others give a few "offset" messages, but they seem to work ok.

I fixed one and attached it (ti_usb_3410_5052-2.6.26.5.diff). Don't even know what this is for, but I figured it's in there now I should fix it for whoever. I only had to fix 3 hunks and it was mainly line issue problems. Should work ok.

Kirk, where did you find LZMA patch that works with 2.6.26x?
When it's done you'll find your compressed kernel in arch/x86/boot/bzimage.
Can anyone think of a reason why my bzimage is not correct?

I've compiled the kernel before and had no problems so I'm at a loss right now.

Using DOTconfig-K2.6.25.16-26AUG08-STANDARD and BK's patched source my bzimage ends up at 16K and ROX says:

"Linux kernel x86 boot executable RO-rootFS, root_dev 0x802, Normal VGA"

The kernel in Puppy is 1590K and ROX says:

"Linux kernel x86 boot executable RO-rootFS, root_dev 0x1601, swap_dev 0x1, Normal VGA"

Obviously something is wrong. I've done all manner of 'make', 'make modules', 'make bzImage' and it's there but doesn't work and the previous problems are there.
Attachments
ti_usb_3410_5052-2.6.26.5.diff.gz
ti_usb_3410_5052.dff for kernel 2.6.26.5 (probably 1-4 also)
(1.93 KiB) Downloaded 443 times

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#44 Post by kirk »

For squashfs-lzma the normal patches are here: http://www.squashfs-lzma.org/

Use Barry's 4300_squashfs-3.3.patch kernel patch instead of the one included in the squashfs-3.3 package. And use Barry's instructions for patching Puppy 2.17 found in patches-required.txt.

Kernel 2.6.26 won't load a tainted module (previous kernels would just post a message and load it) I've attached a patch for 2.6.26.3 to make it load tainted modules as in the past. You might have to edit it for a newer kernel. Change into you kernel source directory and do a patch -p1 < ../linux*.diff

I didn't use all the patches that Barry did. Some are known not to work with 2.6.26 and some I had no interest in. I used these patches:

Loglevel
Squashfs-lzma (like in 2.17)
splice-2.6.23.patch
fsync_super-2.6.19.patch
deny_write_access.patch

I didn't use the linux-lzma patch, don't really see the need unless your doing a unipup, or the gprs patches or unionfs.

I don't know why your kernel isn't working. I've never had to do "make bzimage" I'll attach my config file for 2.6.26.3. Note that I've changed a few options like Pentium3, SMP, tickless. That off the top of my head.

Also, the squashfs-lzma modules are compiled separate from the kernel, so they can be compiled for the stock kernel if someone wants.
Attachments
dot.config.gz
(18.67 KiB) Downloaded 440 times
linux-2.6.26-kernel-module.c.diff.gz
(364 Bytes) Downloaded 400 times

alcy
Posts: 143
Joined: Sun 04 May 2008, 18:24

#45 Post by alcy »

kirk wrote:
Then you'll need to replace the modules in initrd with your new ones, extract the initrd:

# gunzip initrd.gz
# mkdir puppy-init
# cd puppy-init
# cat ../initrd | cpio -d -i

Replace the modules. Then you'll need to depmod the initrd. You can do this if your currently running your new kernel:

# depmod -b <path to extracted initrd>

And then zip your initrd back up:

# cd puppy-init
# find . | cpio -o -H newc | gzip -9 > ../initrd.gz

Again depmod will only work if you are running your new kernel. That can be a problem if your running a frugal install. I don't have a spare partition for a full hard drive install, so I do it with a frugal. You'll need to add depmod to your initrd, the one included in Puppy at /sbin is static so just copy that one into your new initrd and zip it up.

You'll also want to get your main sfs file ready. Extract your sfs file to a folder. If you're running Puppy 4.1 you'll want to rename the file /etc/ modules/firmware.dep.<kernel version> to your new kernel version and replace the modules in /lib/modules

Then boot your new kernel and initrd with pfix=rdsh. Here's a sample grub entry:

title Puppy fatdog-rdsh (on /dev/sda4)
rootnoverify(hd0,3)
kernel /20fd/vmlinuz loglevel=7 psubdir=20fd pfix=rdsh
initrd /20fd/initrd.gz

Once it boots to a prompt, mount the drive that has your extracted initrd (must be a kernel built-in FS type, ext2/3 and drive type, no usb drives) . Then do:

# depmod -b <path to extracted initrd>
# depmod -b <path to extracted sfs file>

Reboot into normal Puppy, remove depmod from your initrd and zip it up again. Mksquashfs your new main sfs file and try it out.
Hey kirk, I don't really know the significance of this part of the procedure you've posted, about the initrd.gz. Is it something specific to the frugal install, and if not, why have I been able to get away without doing any of it, and still be running the new kernel (which works fine) ? Please help ! (I have a full install Puppy 4)

User avatar
shroomy_bee
Posts: 536
Joined: Sat 28 Jun 2008, 16:54
Contact:

#46 Post by shroomy_bee »

ttuuxxx,

Do you mean the remaster method is for a standard Pup that has had things like applications added and configs setup - like the liveCD session saving (ie - it amends the existing boot CD image so it boots to whatever you changed it to)?

I was asking, the other questions, because I wondered if the USB CD was able to boot. It was said that the recompile had been done already, so would you really have to remaster a recompile, if it is already booting into the recompile?

kirk
Posts: 1553
Joined: Fri 11 Nov 2005, 19:04
Location: florida

#47 Post by kirk »

Hey kirk, I don't really know the significance of this part of the procedure you've posted, about the initrd.gz. Is it something specific to the frugal install...
Full installs don't use the initrd.gz.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#48 Post by ttuuxxx »

shroomy_bee wrote:ttuuxxx,

Do you mean the remaster method is for a standard Pup that has had things like applications added and configs setup - like the liveCD session saving (ie - it amends the existing boot CD image so it boots to whatever you changed it to)?

I was asking, the other questions, because I wondered if the USB CD was able to boot. It was said that the recompile had been done already, so would you really have to remaster a recompile, if it is already booting into the recompile?
Yes it builds an iso image of everything you installed/removed etc and builds you a bootable working release :)
Menu/setup/remaster puppy live-cd
Heres a tip about remastering
when the script tells you to look in tmp/root
delete that root folder and copy the real root folder into /tmp/
that way you get a perfect image.
make sure you don't have any passwords etc save on the web browser, or that gets remastered also and basically you could give you email accounts away,lol
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#49 Post by John Doe »

re: config file

Kirk, thanks for the config file. I checked it out and removed all the excellent fine tuning you did for your processor (dropped it back to be 'PC' with Puppy). Looks like we have the same idea of what new config options would be best for this newer kernel. I kept oplc, eeepc, laptop hibernate and the new NTFS w/write options (maybe a few random other wifi light things).

Also added a tcpip option to guard against syn floods (IP: TCP syncookie support (disabled per default) SYN_COOKIES). It needs a '1' at /proc/sys/net/ipv4/tcp_syncookies to start up, athough untested by me yet, but thought it would be a good option to have.

file is attached below.

re: lzma for kernel

Found the correct patch for the 2.6.26x kernel series and attached it. Spent two days trying to rewrite the old one only to get to the point where I could compile it fine, but when I booted the machine just catastrophically shutdown when trying to decompress the kernel. Looks like there is some new logic in the latest patch that makes it all work ok now.

Built after installing lzma utils ver 4.32.7 (btw, that's what that 16k problem was. I need to read error messages more fully when frustrated). Built a kernel with each of gzip, bzip2 and lzma today for testing. I'm running 2.6.26.5 on a full install right now.

re: squashfs-lzma


great info. I'm going to play around with Squash/LZMA and AUFS next.
...tainted module (previous kernels would just post a message and load it) I've attached a patch for 2.6.26.3 to make it load tainted modules as in the past.
thanks for the insight. dropped the patch into a my patch directory. neat logic to have around but I'll probably shoot for leaving it out as I'm one of those 'tinfoil hat wearing' types.

###

@all
, the config attached doesn't have lzma or bzip2 enable. one would need to do that manually. my personal favorite (i don't believe yet spoken of in this thread) is 'make gconfig'. it's the gtk version.
Attachments
DOTconfig-K2.6.26.5-28SEP08-STANDARD.gz
(18.69 KiB) Downloaded 355 times
linux-lzma-2.6.26.3.u.gz
(19.7 KiB) Downloaded 366 times

Bruce B

#50 Post by Bruce B »

John Doe,

Please explain exactly what the above post is about. Is the distributor not providing you with access the complete kernel source code? Is this something you cooked up, in spite of having access to the complete source code? Please explain.

Bruce

Post Reply