WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved]: how to boot alternate kernel of same architecture  (Read 8711 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1817
Re: [Solved]: how to boot alternate kernel of same architecture
« Reply #15 on: October 07, 2024, 10:45:57 PM »
In summary, to use a different distro's kernel in TCL (assuming same architecture and alien glib version =< TCL glib version):

1. change alien kernel's filename to vmlinuz64 (or vmlinuz) and put it in TCL's boot directory
2. add the entire /lib/modules/<alien_kernel_version> directory to corepure64.gz (or core.gz) (warning: massive bloat)
3. add modprobe -a squashfs zram ext4 sd_mod ahci (assuming you use ext4) to top of /etc/init.d/tc-config in corepure64.gz (or core.gz)
4. $ sed -i '/KERNEL/ d' /etc/sysconfig/tcedir/optional/*.dep

Again, I do not run any TCL machines like this and do not recommend this setup. It was just a fun hacking exercise.
« Last Edit: October 07, 2024, 11:03:14 PM by GNUser »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1519
Re: [Solved]: how to boot alternate kernel of same architecture
« Reply #16 on: October 08, 2024, 08:26:35 AM »
If you take the alien kernel modules and run https://github.com/tinycorelinux/sorter on it, you can separate thing into the -KERNEL.tcz extensions.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1817
Re: [Solved]: how to boot alternate kernel of same architecture
« Reply #17 on: October 08, 2024, 08:39:05 AM »
Thanks for the tip, Paul. Good to know--that's much better than the kludge in step #4 of my summary.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1817
Re: [Solved]: how to boot alternate kernel of same architecture
« Reply #18 on: October 08, 2024, 09:26:11 AM »
Just a quick follow-up: With Paul_123's solution all the sorted modules can be moved out of the rootfs, of course.

Another alternative is to keep step 2 (i.e., all alien kernel modules go into the bloated rootfs) but change step 4: Instead of editing .dep files, create dummy extensions (wireless-5.10.0-9-amd64.tcz, graphics-5.10.0-9-amd64.tcz, etc.) and place them into tce/optional just to satisfy dependencies.

Ok, time to put my system back together. Vanilla TCL is the best.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1817
Re: [Solved]: how to boot alternate kernel of same architecture
« Reply #19 on: Today at 08:29:25 AM »
Here's my summary of how to use kernel and modules from a different distro on TCL x86_64 (tested and working on TCL15 x86_64 with kernel and modules copied from Devuan). The alien kernel and modules must have been built for the same architecture as your TCL system, obviously. Also, alien glib version needs to be =< TCL glib version.

1. rename alien kernel to vmlinuz64 and put it in your boot/ directory

2. remaster corepure64.gz with:
    a. /lib/modules/<version> directory with all the alien kernel modules copied from the other distro
    b. add modprobe -a squashfs zram ext4 sd_mod ahci to top of /etc/init.d/tc-config, just after the shebang

This is very hacky, makes corepure64.gz huge, and is not recommended except for testing purposes.

« Last Edit: Today at 08:43:48 AM by GNUser »