Building part of world
Giorgos Keramidas
keramida at ceid.upatras.gr
Fri Oct 29 13:26:10 PDT 2004
On 2004-10-29 13:37, Dan Nelson <dnelson at allantgroup.com> wrote:
> In the last episode (Oct 29), Brad Waite said:
> > I'm trying to update my sys/pci/if_sk.c and would like to be able to
> > build several versions without having to build the entire world.
>
> Since that's a kernel driver, you only have to build a new kernel.
An even better approach in the case of a single kernel driver is to leave it
commented out in the kernel config file. Then it will be built as a module by
default. After at least one buildworld/buildkernel cycle has finished
correctly with this configuration, you can use the already populated /usr/obj
tree to build just this module:
# cd /usr/src/sys/i386/conf
# config -g -d /usr/obj/usr/src/sys/MYKERNEL MYKERNEL
# cd /usr/obj/usr/src/sys/MYKERNEL
# make depend && make && make install
If you have only touched a single .c file, the 'make depend' step is AFAIK
optional. The rest should finish pretty fast.
Brave people might even get away by building the sk module only, by
emulating the specific part of the kernel build:
# cd /usr/src/sys/modules/sk
# env MAKEOBJDIRPREFIX=/tmp/sk \
KMODDIR=/boot/kernel DEBUG_FLAGS="-g" MACHINE=i386 \
KERNBUILDDIR="/usr/obj/usr/src/sys/MYKERNEL" make obj
# env MAKEOBJDIRPREFIX=/tmp/sk \
KMODDIR=/boot/kernel DEBUG_FLAGS="-g" MACHINE=i386 \
KERNBUILDDIR="/usr/obj/usr/src/sys/MYKERNEL" make all
If all this works, you can just kldload the new if_sk.ko from
`/tmp/sk/usr/src/sys/modules/sk' to test your changes.
HTH,
Giorgos
More information about the freebsd-questions
mailing list