How to switch kernels between Puppy versions

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

super simple kernel switching

#151 Post by jrb »

This is a 9 year old thread and the original content is pretty outdated. Changing kernels in newer Puppies is pretty simple, type "change_kernels" in a terminal and it will walk you through the process. I thought I would post a link to my kernel switching made super simple post anyway, just because (for frugal installs) it is "super simple". :wink:

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#152 Post by Mike Walsh »

Mornin', jrb.

Despite the statement in your last post about being pretty outdated, the advice has worked fine for an 'upgraded' spin of Racy 5.5.1 I've just put together.

I've upgraded the k3.0.66 kernel for Precise's k3.9.11, upgraded the glibc from 2.10.1 to 2.20, included Barry's '5.5 to 5.5.1 Service Pack', ditto with the 'new-look' v2 of the PPM, and added sundry other bits'n'bobs. It's all worked very nicely, mate; good, simple, clear instructions. And those Pup-build tools are extremely handy..!

Thanks a bunch. Cheers!


Mike. :wink:

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#153 Post by jrb »

Mike Walsh wrote:Mornin', jrb.

Despite the statement in your last post about being pretty outdated, the advice has worked fine for an 'upgraded' spin of Racy 5.5.1 I've just put together.

I've upgraded the k3.0.66 kernel for Precise's k3.9.11, upgraded the glibc from 2.10.1 to 2.20, included Barry's '5.5 to 5.5.1 Service Pack', ditto with the 'new-look' v2 of the PPM, and added sundry other bits'n'bobs. It's all worked very nicely, mate; good, simple, clear instructions. And those Pup-build tools are extremely handy..!

Thanks a bunch. Cheers!


Mike. :wink:
Hi Mike,
Glad it worked for you. :D I had forgotten about posting those Pup-build tools. I'm still using them regularly, although I've modified them a lot. Will have to polish them up and repost I guess. Are you going to offer up your "new" Racy?

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#154 Post by Mike Walsh »

jrb wrote:Hi Mike,
Glad it worked for you. :D I had forgotten about posting those Pup-build tools. I'm still using them regularly, although I've modified them a lot. Will have to polish them up and repost I guess. Are you going to offer up your "new" Racy?
Ermmm..... I'm in two minds about that, at the moment. It's my very first attempt at doing anything with a Puppy, at all. Not done with Woof, or anything like that, simply manually adding stuff/altering stuff until it's how I myself want it, followed by re-building the system SFS, and making an ISO out if it. Not that I need that part for personal use.....it just goes on a USB to try it.

At least it boots, even with a re-named SFS, so I must have got that bit about the DISTRO_SPECS right, after all.....

TBH, if I publish it I'm afraid I shall make myself look even more of an idiot than I already do..! :oops: :roll: (And I don't think I could handle the criticism... ) :shock: :razz: :lol: :lol:

tuxtoo and I are in the middle of a bit of a project with Racy ATM; we shall make an announcement if, as & when we're summat like ready. Not before.....and that's all I'm saying for now. :D


Mike. :wink:

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#155 Post by Mike Walsh »

@ jrb:-

I'm perhaps taking this thing to extremes, but I've taken the next logical step; I now have a version of Racy 5.5.1 running with Tarhpup's 3.14.79 kernel, along with a zdrv for the firmware.....thereby bringing Racy a bit more into line with more modern Pups. Since Tahr's native glibc is 2.19, it's much closer to the 2.20 package from battleshooter, which is now the default glibc in Racy.

It's similar to what nic007 has done with his personal 'Puplet; I think I'm right in saying he has a version of Precise running the kernel from Tahrpup. I found there's a lot of Precise stuff that seems right at home in Racy, so I'm scratching around in the right sort of area.....

Needs some flaws sorting out, though.... :roll: :oops: :)


Mike. :wink:

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#156 Post by nic007 »

Using Tahr's kernel for Racy is very useful as it also adds adrv, ydrv etc. capabilities Only "problem" I have with Racy, is the outdated Xorg (well, I think that's part of the issue) because playing high quality videos seem to use a lot of processing power, much more than newer Puppy's.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#157 Post by Mike Walsh »

@ nic007:-

Nic, did you ever have shut-down issues when using Tahr's kernel in the older Puppies? I only ask, because while this will happily create a save-file, it seems extremely reluctant to actually use it.....and often needs a second shutdown 'prompt' before it'll save & power-off.

I don't mind admitting, this is completely new territory for me, and I'm way out of my comfort-zone.....so it's more than likely I've made a shed-load of mistakes, so far..! Advice will be appreciated from those who've 'gone before'.

(BTW, your 'post-count' as of the last post is now the exact same as the version of Racy's original kernel; k3.0.66. How's that for coincidental, huh?) :lol:


Mike. :wink:
Last edited by Mike Walsh on Sun 20 Oct 2019, 10:32, edited 1 time in total.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#158 Post by jrb »

Mike Walsh wrote:@ nic007:-

Nic, did you ever have shut-down issues when using Tahr's kernel in the older Puppies?
Mike, since you have a working zdrv you should be able to use my kernel switching made super simple scripts to quickly try some other kernels.

As I remember I had a few issues with xorg when I tried a newer kernel in racy, the desktop was shifted to the right and wrapped around. Very wierd. :? But I never pursued it.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#159 Post by nic007 »

Hi, Mike - I don't have shutdown issues and as you are aware, I do not run a savefile. I do however remember having these issues you are referring to when testing my precise puplet with tahr kernel and a savefile before releasing it to the community. This is some time ago but if I remember correctly the issues were resolved by replacing the shutdown scripts of the base puppy (in this case precise) with that of the "donor" puppy (ie. tahr). So in short - when doing a kernel swap, I would replace initrd.gz (or make a customised one), vmlinuz and the shutdown scripts (found in /usr/sbin and /etc/rc.d) as part of the process.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#160 Post by Mike Walsh »

Hi, Nick.

Ah, the 'pratfalls' of attempting something for the very first time in totally alien territory..... :D

Thanks for the heads-up. I will investigate, do some re-building, do some experimenting .....and see what happens. (Kinda makes sense, in a way, 'cos I've already found you need more stuff from the 'donor' Puppy than you would at first imagine.....)

I'll report back, as & when. Watch this space... :)

(Thinking about it, just confirm for me, please? I've so far found /usr/sbin/shutdownconfig, and /etc/rc.d/rc.shutdown. That sound about right? Um...do I need the .pot & .pupdev files as well? Rc.network? Rc.firewall?)

Cheers.


Mike. :wink:

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#161 Post by nic007 »

Only the shutdown scripts. Replace it before attempting to make a new savefile or trying to use an existing one. I'm not so sure what will happen if you want to use an existing savefile with the new kernel but you'll have to rename it anyway.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#162 Post by Mike Walsh »

Mm...

Well, that WORKS.....at least, the way it works would suit you down to the ground. It shuts down cleanly, but I'm not even getting the shut-down options now. No offer to create a save-file, so.....I'm guessing there's more stuff needs 'transplanting'?

Anybody have any ideas on this one? Remember, I'm not using Woof-CE for a 'clean', ground-up build.....merely modifying an existing Pup, with stuff from a newer one.

I'm all ears........


Mike. :wink:

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#163 Post by Mike Walsh »

Okay.

For this particular instance, the solution seems to be to use Tahrpup's /etc/rc.d/rc.shutdown script, but to retain Racy's original /usr/sbin/shutdownconfig. First shut-down now asks you to create a save-file (or not); if yes, it creates it, saves to it, and shuts down cleanly.

Curiously, doing things this way appears to have had an unintended, yet beneficial side-effect! Subsequent shutdowns sit on 'Racy_Puppy is shutting down' for around 20-30 seconds, then, just when you've convinced yourself that nothing's going to happen and Pup has decided to 'hang', a window pops-up, asking whether you wish to save the session to the save-file or not.

I'm guessing this is, of course, somehow linked in to PupMode selection via the EventManager. This behaviour will suit a lot of Puppians, since many of you prefer to execute manual 'saves' at your discretion, so I may just leave this as it is. :D

Depending upon selection, Pup then 'saves' (or not), and shuts down cleanly.

------------------------------------------------------------

This is on a USB 'test' install. I now need to burn an ISO of the new Racy to disk (again!), and see what happens this time around.

Back soon..!


Mike. :wink:

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#164 Post by rufwoof »

Everyone with your familiarity should build their own kernel at some point Mike. This for instance will compile the 4.19.80 kernel with the 1.30.1 busybox

Download and load the devX.sfs for the Puppy you're running and create/run a script containing ...

Code: Select all

# Modify the following two wget's to the latest 
# stable/long term choices you prefer
wget http://kernel.org/pub/linux/kernel/v4.x/linux-4.19.80.tar.xz
wget http://busybox.net/downloads/busybox-1.30.1.tar.bz2
mkdir bootfiles
tar -xvf linux-4.19.80.tar.xz
tar -xvf busybox-1.30.1.tar.bz2
cd busybox-1.30.1
make distclean defconfig
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
make busybox install
cd _install
rm -f linuxrc
mkdir dev proc sys
echo '#!/bin/sh' > init
echo 'dmesg -n 1' >> init
echo 'mount -t devtmpfs none /dev' >> init
echo 'mount -t proc none /proc' >> init
echo 'mount -t sysfs none /sys' >> init
echo 'setsid cttyhack /bin/sh' >> init
chmod +x init
find . | cpio -R root:root -H newc -o | gzip > ../../bootfiles/initrd.gz
cd ../../linux-4.19.80
N=`nproc`
N=`expr $N + 1`
make -j$N mrproper defconfig bzImage
cp arch/x86/boot/bzImage ../bootfiles/vmlinuz
... and (perhaps some hours later) you'll have a vmlinuz and initrd.gz in the bootfiles folder that you can use to boot. That will be cli only, but all your own work and using native Linux kernel and busybox source code. Typically around a 8MB final vmlinuz alongside a 1.5MB initrd.

Once compiled once, you can run make again and the next build will run through quicker provided you don't reconfigure it (such as running make menuconfig or editing the .config file).

Instead of a separate initrd you can replace the one in linux-4.19.80/usr/initramfs_data.cpio with a cpio (not compressed) initrd and when built that will have that initrd contained within the vmlinuz, so only that vmlinuz is required in order to boot the system.

Most initrd's tend to be gzip'd so you first have to gzip -d decompress the file, and you can extract the cpio using

mkdir extracted
cd extracted
cat ../initrd | cpio -id

and modify anything within that and reform it again using

find . | cpio -o -H newc >../initramfs_data.cpio

See https://www.kernel.org/ and https://busybox.net/

Edit :
Looking at https://www.kernel.org/category/releases.html 4.14 kernel has a longer end of life (EOL) date ... 2024, so perhaps I should have used the 4.14.150 choice (as on the kernel.org front page) in the above script
Last edited by rufwoof on Sun 20 Oct 2019, 16:26, edited 1 time in total.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#165 Post by Mike Walsh »

Hm.
rufwoof wrote:Everyone with your familiarity should build their own kernel at some point Mike.
Perhaps. For some.....maybe.

I'm not that much of a 'geek', Ruffers. And never will be.

[*shrug*]


Mike. :wink:

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#166 Post by mikeslr »

Thanks, rufwoof, for the detailed instructions. Maybe someday. :).

Currently my mind is only functioning at about 60% --cold, maybe? So, following the logic of your recipe I'm not certain that the resulting kernel will include important modules: those pertaining to the 'merge filesystem' and/or overlay. IIRC, these have to be added to kernels built the 'ordinary Linux way.'

Could you clarify.

Thanks, again.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#167 Post by rufwoof »

The default kernels nowadays support overlayfs but IIRC you have to modify the default kernel .config to enable it. aufs has to be added separately.
EDIT: downloaded and CONFIG_OVERLAY_FS wasn't set, so set it and compiled and overlayfs mounting worked fine. 8.5MB kernel, 1.5MB initrd. Replaced the initrd with a 7.5MB fatdog initrd (gzip'd, with the kernel modules sfs removed), and set wifi net connection boot parameters and that booted the same kernel with wifi net connected OK.

I pretty much used aufs exclusively until after I started testing wiaks build scripts and have switched over to overlayfs since (in this read/write sfs script for instance). From my just basic/general usage perspective that's worked well for me.

The easier way to build a more puppy supporting kernel would be to download the pup's kernel sources and compile that. My earlier posting was just a short intro of building the standard kernel with busybox.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#168 Post by nic007 »

Mike Walsh wrote:Mm...

Well, that WORKS.....at least, the way it works would suit you down to the ground. It shuts down cleanly, but I'm not even getting the shut-down options now. No offer to create a save-file, so.....I'm guessing there's more stuff needs 'transplanting'?

Anybody have any ideas on this one? Remember, I'm not using Woof-CE for a 'clean', ground-up build.....merely modifying an existing Pup, with stuff from a newer one.

I'm all ears........


Mike. :wink:
As I said, a time ago since I did this and I may have changed other things too but I did get it right. Tell you what, I have a Racy puplet with Tahr kernel and I'll check it with regards to this shutdown/savefile issues. I'll get back to you, just a bit busy currently.

Okay, I've checked a few things. Easiest and least problematic method: Use the initrd.gz, vmlinuz, zdrv of the donor Puppy. In this case you don't have to replace the shutdown scripts (keep the old ones). Your base sfs, zdrv and savefile will have the names of the donor puppy (the Tahr distribution). Make sure the base sfs and zdrv are correctly named before first boot. I had no problems with the creation of the savefile which was now called tahrsave or any booting issues fterwards. The other method is to make a customised initrd.gz (to have new puplet names) and replace the shutdown scripts as mentioned in the previous post (DO NOT USE RACY'S initrd.gz). The latter method also works for me BUT I get a message at every bootup asking whether the savefile should be updated for use with the current Puppy. I'll go with the first method although the file names may be confusing..but what the heck, it's a bastardised Puppy afterall.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#169 Post by Mike Walsh »

@ nic007:-
nic007 wrote:As I said, a time ago since I did this and I may have changed other things too but I did get it right. Tell you what, I have a Racy puplet with Tahr kernel and I'll check it with regards to this shutdown/savefile issues. I'll get back to you, just a bit busy currently.
No worries; no rush. It would be very much appreciated if you could.

I do have one other question, regarding 'saves'. For some reason, I cannot save any changes to the desktop appearance/setup. It wouldn't be anything to do with that X11R6/X11R7 stuff by any chance, would it?

Every boot, it's back to the default 'as-is' desktop. Kind of annoying, when you like to 'customize' as much as I do.....


Mike. :wink:

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#170 Post by nic007 »

Mike Walsh wrote:@ nic007:-
nic007 wrote:As I said, a time ago since I did this and I may have changed other things too but I did get it right. Tell you what, I have a Racy puplet with Tahr kernel and I'll check it with regards to this shutdown/savefile issues. I'll get back to you, just a bit busy currently.
No worries; no rush. It would be very much appreciated if you could.

I do have one other question, regarding 'saves'. For some reason, I cannot save any changes to the desktop appearance/setup. It wouldn't be anything to do with that X11R6/X11R7 stuff by any chance, would it?

Every boot, it's back to the default 'as-is' desktop. Kind of annoying, when you like to 'customize' as much as I do.....


Mike. :wink:
Check the added information in my last post. Everything should work when using the first method, also all desktop changes (I changed backgrounds and icons in my tests) should work. If you still have problems, you must be doing something else wrong with the swop. Remember to edit the racy base sfs as this distribution has the kernel included in the base sfs by default. So you need to check the contents of the donor zdrv and delete all corresponding in the racy base sfs. So in effect you will make a new racy base sfs without the original kernel and boot that with the donor zdrv. If you still have a problem, I am willing to upload my base racy sfs (minus the kernel stuff and the old browser).....and so doing your work for you :wink: :)

Post Reply