Menu

Installing-Upgrading Kernel During Persistent Live Session

bryan starr

In this scenario you have booted from a persistent live session and need or want to upgrade your kernel or install a different one.
For the Live system to work it must be a aufs patched kernel or it will not boot!
You can get aufs patched kernel sources from xanmod.org if using a Slackware based system, choose one of my pre-made kernels or if using the Debian Stretch/Buster versions just search synaptic for "aufs" and install aufs-dkms and aufs-tools and whatever debian kernel you select will have aufs in it. Additionally you can get premade Xanmod kernels thru the Xanmod repositories for Debian.

Ok, so in either /root/Linux-live-2.1/initramfs or /root/Tomas-M-linux-live-d27460d/initramfs you'll find the script initramfs_create and in the tools folder 2 scripts- initramfs_repack and initramfs_unpack.

First you need to install your new kernel and kernel modules.

Then, you need to open your file manager and go into /root/Tomas-M-linux-live-d27460d/ or /root/Linux-live-2.1/ and edit the config for your new kernel as the script initramfs/initramfs_create will go off the config file for looking for new kernel modules, etc.

Example: we're gonna install my 5.0.8-xanmod5 kernel into one of my Slacker Live distros, install the kernel and modules packages.
Now, edit the config so it says this

VMLINUZ=/boot/vmlinuz-5.0.8-xanmod5

KERNEL=5.0.8-xanmod5

Now go into the initramfs folder, open a terminal there or cd there "cd /root/Tomas-M-linux-live-d27460d/initramfs and invoke the initramfs_create
like so
./initramfs_create and it will create a new initrfs.img in /tmp named for example Slacker-initramfs-8257.img, whatever it's name for your distro, copy it to /run/initramfs/memory/data/ and either rename it initrfs.img or initrfs2.img if you want to keep your original initrfs.img.
cp -r /tmp/Slacker-initramfs-8257.img /run/initramfs/memory/data/

Now copy the kernel vmlinuz-5.0.8-xanmod5 from /boot to /run/initramfs/memory/data/
cp -r /boot/vmlinuz-5.0.8-xanmod5 /run/initramfs/memory/data/

Now edit your syslinux.cfg or grub.cfg if booting persistent off hard drive.
Now reboot into your new kernel/initrfs.img