How to switch between installed kernel and developed kernel
Gidi Gal
gidi.gal.linux at gmail.com
Mon Mar 22 13:53:19 EDT 2021
I am grateful for your replies, Brend, Valdis and Bjørn.
I did some backups, decided for now to try and run my kernel on my native
Linux, until I prepare a VM for testing.
I tried to install my kernel. The output showed some errors (I copied the
install log at the bottom of this email). I think these errors led to an
"invalid signature" error later on when I rebooted my machine.
I would be grateful if you could take a look and comment about possible
solutions. Regarding my CONFIG_LOCALVERSION, it is set as follows:
CONFIG_LOCALVERSION="-GIDI_DEV"
Here is the installation output (if there's a different preferable way to
attach such info, please let me know) :
gidi at gidi-Precision-3510:~/git/kernels/staging$ sudo make modules_install
install
[sudo] password for gidi:
INSTALL arch/x86/crypto/aesni-intel.ko
...
INSTALL sound/soundcore.ko
DEPMOD 5.12.0-rc3-GIDI_DEV+
sh ./arch/x86/boot/install.sh 5.12.0-rc3-GIDI_DEV+ arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal
5.12.0-rc3-GIDI_DEV+ /boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
run-parts: executing /etc/kernel/postinst.d/dkms 5.12.0-rc3-GIDI_DEV+
/boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
* dkms: running auto installation service for kernel 5.12.0-rc3-GIDI_DEV+
[ OK ]
run-parts: executing /etc/kernel/postinst.d/initramfs-tools
5.12.0-rc3-GIDI_DEV+ /boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
update-initramfs: Generating /boot/initrd.img-5.12.0-rc3-GIDI_DEV+
dpkg: warning: version '5.12.0-rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0-rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
W: Possible missing firmware /lib/firmware/amdgpu/vangogh_gpu_info.bin for
module amdgpu
...
W: Possible missing firmware /lib/firmware/i915/dg1_dmc_ver2_02.bin for
module i915
dpkg: warning: version '5.12.0-rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0-rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
run-parts: executing /etc/kernel/postinst.d/pm-utils 5.12.0-rc3-GIDI_DEV+
/boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
run-parts: executing /etc/kernel/postinst.d/zz-update-grub
5.12.0-rc3-GIDI_DEV+ /boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+~old' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+' has bad syntax: invalid
character in revision number
Found linux image: /boot/vmlinuz-5.12.0-rc3-GIDI_DEV+
Found initrd image: /boot/initrd.img-5.12.0-rc3-GIDI_DEV+
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+~old' has bad syntax: invalid
character in revision number
dpkg: warning: version '5.12.0~rc3-GIDI_DEV+~old' has bad syntax: invalid
character in revision number
Found linux image: /boot/vmlinuz-5.12.0-rc3-GIDI_DEV+.old
Found initrd image: /boot/initrd.img-5.12.0-rc3-GIDI_DEV+
Found linux image: /boot/vmlinuz-5.4.0-64-generic
Found initrd image: /boot/initrd.img-5.4.0-64-generic
Found linux image: /boot/vmlinuz-5.4.0-58-generic
Found initrd image: /boot/initrd.img-5.4.0-58-generic
Adding boot menu entry for UEFI Firmware Settings
done
Thanks,
Gidi
On Mon, Mar 22, 2021 at 2:59 PM Bjørn Mork <bjorn at mork.no> wrote:
> Gidi Gal <gidi.gal.linux at gmail.com> writes:
>
> > 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. If you have a link that proposes a workflow for
> > this request (or if my tutorial does explain this workflow and I'm
> missing
> > the exact paragraph that does that) please let me know.
>
> The answer depends on your choice of bootloader, distro etc.
>
> But one way to do this is to build a native kernel package for your
> distro and simply install that like any other package. So instead of
>
> make -j2; sudo make modules_install install
>
> you'll do somethong like (or maybe give a more explicit version than '*')
>
> make -j2 bindeb-pkg; sudo dpkg -i ../linux-image-*.deb
>
> or similare with "binrpm-pkg" for the RPM based distros.
>
> With this you'll end up with your testing kernel as an additional choice
> in the bootloader menu, keeping all your previously installed kernels as
> alternatives.
>
> Note that this way of testing is quite slow since you'll rebuild
> everythng and reboot a bare metal machine. There are easier ways to
> test many kernel changes, like rebuilding only one module and load it in
> your running kernel. And there is of course always a very real risk of
> crashing, and possibly thrashing too... So if you can, you might want
> to run test your kernels on a virtual machine, or some other test
> machine, instead of your development machine.
>
>
> Bjørn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20210322/c59f70da/attachment.html>
More information about the Kernelnewbies
mailing list