How to switch kernels between Puppy versions

How to do things, solutions, recipes, tutorials
Message
Author
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: :)

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

#171 Post by Mike Walsh »

Hi, Nick.

Yah; I think I see what I was doing wrong. I've been 'mixing & matching', haven't I?....except I don't think I've got the 'matching' part anywhere near right..!

I so wanted to end up with a set of ISO files where the base SFS was called 'puppy_racy_5.5.1.sfs', and the zdrv was called 'zdrv_racy_5.5.1.sfs'. However, I'm beginning to realise that Tahr's 'init' script - and other stuff! - would need far more extensive editing than I subjected it to, if every reference to 'distro' names & 'spec' names', etc is going to be completely correct.

I do not have sufficient confidence in my ability to catch every last little item, unfortunately.... :oops:

I thought it would be sufficient simply to rename the base & zdrv in the 'init' script.....but of course, if I do that, then everything else is going to need to match, isn't it?

*sheesh*

No, like you say, it's going to be a 'bastard' Puppy anyway.....it's the performance that counts, not whether every last 't' is crossed, and every last 'i' dotted. That's just being anal about it..!

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

I'll use your guidelines. I'm pretty sure I've got the zdrv right; I know I spent quite a while checking that the stuff in Tahr's zdrv had been removed from Racy's base SFS. I think it's the re-naming, and making doubly sure that items are where they should be, and that the right names are being looked for by the 'init' script.....that's where the problem lies.

As things stand, the poor wee 'hybrid' doesn't know whether it's coming or going.....

(*Bad Mike..!*) :lol:

I'll get back to you after another session with 'Racy 5.5.1'. See if I can get it right this time..!!

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

[EDIT:-] Yep; just checked. I thought I had. What reference there is to etc/modules/ and /lib/modules (/lib/firmware is entirely in the zdrv) in the base Racy SFS is identical to that of the Tahr base SFS before the zdrv gets loaded.

No, the booting-up wasn't the issue; if I didn't have all that correct it wouldn't have booted anyway. It's the save-file creation, shutting-down & saving that's been biting my ass..... :roll:

(Instead of using the 'proven' method that works, I was trying to be all clever, wasn't I? Only it 'backfired'... :roll: ) Never mind. We live & learn.


Mike. :wink:
Last edited by Mike Walsh on Mon 21 Oct 2019, 14:01, edited 3 times in total.

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

#172 Post by nic007 »

Just shout if you want me to upload my already customised base sfs. The racy kernel swop is a little more difficult than usual because the standard racy does not have a seperate zdrv by default as mentioned. I have Racy 5.5 with Tahr 605 kernel. Works flawlessly.

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

#173 Post by Mike Walsh »

@ Nic:-

Wonder if this makes any difference?

You're using the Tahr 6.0.5 k3.14.20, yes? What I'm attempting to use here is the Tahr 6.0.6 k3.14.79, OK? The difference being (I remember this, because 6.0 CE was the very first Pup I used full-time, and I upgraded all the way through to 605 via Phil's 'Service Packs') the original Tahr was built using the older Woof-CE build setup, shortly after it came 'on-line'. 606, on the other hand, has been put together using the newer, heavily upgraded Woof-CE build-system.

I'm thinking a lot of the scripts have probably been upgraded, too....

Huh. I've only just realised this, y'know. I think I'd better look at the 'original' Tahr; see just what the differences are. I hadn't realised you were using 605 till just now. It just never occurred to me; I put 605 'out to pasture' around 18 months ago, and have been using 606 ever since....

Be that as it may, I'm in the process of re-building right now, so I will let you know what happens.


Mike. :wink:
Last edited by Mike Walsh on Mon 21 Oct 2019, 21:45, edited 1 time in total.

Dry Falls
Posts: 616
Joined: Tue 16 Dec 2014, 23:37
Location: Upper Columbia

#174 Post by Dry Falls »

Hi Mike. In my experience fooling with lighthouse, I've discovered/concluded that the initrd.gz (or xz, q, etc) is what contains the init script which is essential to the distro you're running. For ex., I think the init script is what makes lighthouse light. They're not readily interchangeable. The zdrive is only the kernel modules sfs renamed. It will contain /lib/modules and /etc/modules and probably aufs utilities if aufs is built into the kernel. So in your base (eg,. puppy_racy.sfs), remove the contents of those directories. Also, /user/include if it contains kernel headers (built in to some older pups or the devx). Also aufs libraries if you have them (they're compiled with each new kernel) in /usr/lib). Best to explore the new zdrive first (mount in rox) and remove the corresponding files in the base. But keep your original initrd! Then you don't need (nor want) to change any scripts like shutdown.config.

My 2 cents,
df

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

#175 Post by Mike Walsh »

Hallo, df.

Yeah. ( :lol: ) Um....like I said, this is totally new territory for me..! (*shakes head in bewilderment*)

Anyway, I've finally got what I was after; a working Racy 5.5.1 (including the 'Service Pack'), a 2.20 glibc, and the Tahrpup kernel. I took the line of 'least resistance' in the end, and simply re-named the rebuilt Racy base SFS to 'puppy_tahr_6.0.5', along with using Tahr's initrd.gz, vmlinuz and the zdrv. Oh, and also using Tahr's shutdown scripts. Not what I wanted, but using Racy's didn't work, and those from 606 which I was trying earlier, I just got a very rapid, high-speed shutdown; not even the offer of a save-file, etc.

So there's mention of Tahrpup all over the place.....so what? I'm not releasing it; this was more for personal satisfaction than anything else, just so's I can say that I have at least had a go..!

Nic's advice has been invaluable, as were jrb's 'pupbuild-tools'. (Maybe they are 'out-of-date', as he puts it, but for a Pup way past its first flush of youth (!), they worked bloody well..! :lol: )

AND.....as a result, in my own inimitable way I now understand Pup's 'modus operandi' a wee bit better than I did a week or two ago....! So it's been far from a waste of time.


Mike. :wink:

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

#176 Post by nic007 »

Just another remark - the original racy initrd.gz script does not implement the adrv, ydrv functionality of the tahr kernel. That's another important reason to use the tahr initrd.gz or an edited version thereof and one of the main reasons I wanted to use the tahr kernel with racy.

ol1mp
Posts: 1
Joined: Thu 12 Dec 2019, 11:12

problem with compile kernel

#177 Post by ol1mp »

Hello.
Poblem 1.
I try to compile kernel 5.4.2 with busybox 1.31.1 by instruction of rufwoof from
page 11.
Compilation make on bionicpup64
I have error on step:

Code: Select all

 make distclean defconfig
           scipts/basic/fixdep.c105:10 fatal error /usr/include/sys/types.h
           /usr/include/sys/types.h -> /usr/include/x86_64-linux/gnu/sys/types.h
           /usr/include/x86_64-linux/gnu/sys/types.h -> /usr/include/x86_64-linux/gnu/sys/types.h
So I have looping symlinks.
A load devx....sfs

OK, a mounted devx but not copied files from it to root.
So Problem1. SOLVED.


PROBLEM2: May be here exists other options how to mount devx without copy ?
PROBLEM3: How to create devx for kernel ?
PROBLEM4: Kernel compiled and loaded but only console.
with old initrd write that can not mount pop_new device.
So i cann't use new kernel.

thank you for your help.

kyle1974
Posts: 11
Joined: Wed 29 Apr 2020, 16:28

Updating BionicPup Kernel?

#178 Post by kyle1974 »

Hi

How do I check which Kernel I am on please and is it easy to update if needed? I am the latest version of BionicPup 8 and have all updates and it is on a full install.

Thank you
Kyle

ozsouth
Posts: 858
Joined: Fri 01 Jan 2010, 22:08
Location: S.E Australia

#179 Post by ozsouth »

To find which kernel you are using, in a terminal run: uname -a
Note: you don't say whether your Puppy is 32bit or 64bit. There are many pre-made 'huge kernels' available, BUT NOT ALL ARE SUITABLE for your Puppy version.
See: https://archive.org/download/Puppy_Linux_Huge-Kernels
Updating a full install is difficult. The term Frugal Install is a misnomer, as it with a savefolder (or savefile) is the recommended way to install Puppy & then you could run the 'change_kernels' script in a terminal.
The only way I can think to update a full install is to download an appropriate huge kernel, copy it to a fresh usb frugal install of Puppy & expand all the files into a folder on that usb stick, boot that other install of Puppy on the pc to update & replace the files on your original with ones on the usb stick - very difficult - make one mistake & it won't run. Do ENTIRELY at your own risk - personally I wouldn't do it - I'd start over with a savefolder - which looks like a full install anyway.

Post Reply