Gidi Gal <gidi.gal.li...@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

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

Reply via email to