Questions about development Workflow

Hello!
I have some questions regarding the workflow for kernel development, since I saw multiple possibilities and since I want go get into the devel process I want to know tbe advantages and disadvantages of the various options.

1. Simplest one
Clone the src tree into /usr/src, hack on it, compile + install, reboot. If not bootable boot old kernel.

2. Get vm image, run image in bhyve. Now basically the same as above, just that I reboot the VM

3. Clone src tree into /usr/src, hack on it, create abvm image using release and start using bhyve

That are the possibilities I have heard of and I'd like to know if there's an "official" way to go for or what I shouldn't do.

Thanks!
 
the below is not official or anything

you don't have to have the source code under /usr/src, it can be anywhere (so it won't interfere with updates, etc)
also you can build a different version or arch than the build host has
otherwise a vm will boot faster than real hw
also if you build with -DNO_CLEAN -DNO_MODULES it will be fast enough on moderate hardware
 
No what works best for you. You can even do a virtualbox on mx-linux and run the usb-memstick and install on a virtual hard disk and hack on it.
Or bare metal. It's all the same.

Or in a jail.
 
compile + install, reboot. If not bootable boot old kernel.
Install under a different name INSTKERNNAME=kernel.TEST for example, leave a GENERIC in place. Don't put yourself in a position where you are overwriting a kernel.old with a broken test kernel. Then you'll have nothing to fall-back on. The boot menu lets you select a kernel to use and boot. nextboot(8) is also useful. So are boot environments of course, if you really mess things up.
Code:
     INSTKERNNAME       If set, specify an alternative name to build and
                        install for the various kernel make targets.

Get vm image, run image in bhyve. Now basically the same as above, just that I reboot the VM
Depends entirely on what in the kernel do you plan on messing with? A VM might be useful, add a serial port and you could do remote kernel debugging in the VM from the host.
 
Hello!
I have some questions regarding the workflow for kernel development, since I saw multiple possibilities and since I want go get into the devel process I want to know tbe advantages and disadvantages of the various options.

1. Simplest one
Clone the src tree into /usr/src, hack on it, compile + install, reboot. If not bootable boot old kernel.

2. Get vm image, run image in bhyve. Now basically the same as above, just that I reboot the VM

3. Clone src tree into /usr/src, hack on it, create abvm image using release and start using bhyve

That are the possibilities I have heard of and I'd like to know if there's an "official" way to go for or what I shouldn't do.

Thanks!

Doing it the "official" way FreeBSD developers do it is really not much more effort, IMHO.

For example, to get a 14.3-RELEASE src tree into $HOME/src.git, assuming you have devel/git already installed, run:

git clone -b release/14.3.0 https://git.freebsd.org/src.git $HOME/src.git

(you can change $HOME/src.git in the above command to alter where git will put your new src tree)

And if you want to work against a different tag/version (such as 14-STABLE or 15-RELEASE), you can edit the git clone -b parameter value accordingly.

By doing it the "official" way, then at any moment you can run
git diff
to see all your local changes. This option is slightly more effort, but the benefits seem worth it. You can also run
git log
to examine developer commit log messages (sorted by date).
 
For O/S development you will need a machine (VM or physical) running 16-CURRENT. All development is tested on 16-CURRENT before being applied to the stable branches.

Years ago I ran stable with a machine or partition with -CURRENT. I replaced that with -CURRENT on all my systems at home. -CURRENT does have its moments but generally it's very stable.

I'm writing this on an HP 840 running 16-CURRENT updated this morning.
 
Back
Top