On Mon, 22 Mar 2021 14:11:58 +0200, Gidi Gal said:

> I am new to kernel development, currently working on
> https://kernelnewbies.org/FirstKernelPatch. I reached the step "Install
> your changes" in "Modifying a driver on native Linux". I would like to
> separate my developed kernel and my installed kernel and to switch between
> the two in order to test my changes. I am not sure that my tutorial
> explains how to do that.

Well... the first rule of thumb is to make sure that your kernel release name
will be different one way or another.  CONFIG_LOCALVERSION is a good way to
ensure it, while linux-next kernels and git-bisect kernels have their own way
of naming themselves.  It's also what shows up in uname -r.

What I have in /boot at the moment:

[/boot] ls vmlinuz-*
vmlinuz-5.10.0-0.rc6.20201204git34816d20f173.92.fc34.x86_64  
vmlinuz-5.10.0-rc4-next-20201117-dirty  vmlinuz-5.11.0-rc3-next-20210114-dirty
vmlinuz-5.10.0-next-20201215                                 
vmlinuz-5.10.0-rc6-next-20201203        vmlinuz-5.12.0-rc1-next-20210302-dirty
vmlinuz-5.10.0-next-20201223-dirty                           
vmlinuz-5.10.0-rc6-next-20201207        vmlinuz-5.12.0-rc2-next-20210309-dirty
vmlinuz-5.10.0-rc1-00257-gcf9446cc8e6d-dirty                 
vmlinuz-5.10.0-rc7-next-20201208        vmlinuz-5.8.0-next-20200807
vmlinuz-5.10.0-rc1-next-20201030                             
vmlinuz-5.11.0-rc2-next-20210105-dirty  vmlinuz-5.8.0-rc1-next-20200616

Each has a matching config-, System.map-, and initramfs- file in /boot, a grub2
config entry in /boot/loader/entries/, and the loadable modules in
subdirectories under /lib/modules/`uname -r`.  So if you back up /boot
and /lib/modules, you should be able to recover from any issues.  Note
that on many systems, /boot is ext4, but there's a /boot/efi that's vfat that
kernel installs shouldn't be touching, but you want a copy in case an update
of grub goes astray...

This is probably a good time to back up your *entire* system, because lots
of Bad Things can happen even when you're not testing a new kernel.

If you want to double-check what your just-built kernel is called, you can use
'make kernelrelease' to tell you.  As long as that's different from any
installed kernel, you shouldn't have any issues with files getting overlaid.

'make install' will look for a script 'installkernel' that does some of the
heavy lifting, like building an initramfs, adding grub entries, and the like.
That usually lives in /sbin/installkernel, but if you create your own and have
it before /sbin in $PATH, it will get used.

Attachment: pgpXFP1w9y4Ip.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to