Building part of world

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Oct 30 06:15:22 PDT 2004


On 2004-10-29 23:30, Brad Waite <freebsd at wcubed.net> wrote:
> > 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.
>
> Wow, Giorgos, this really *does* help.  It never dawned on me that FBSD
> even supported loadable kernel modules.  Feel kinda sheepish now, but hey,
> I guess you learn something new every day.
>
> In my stumbling around since you've enlightened me, I noticed a sk/ dir in
> /usr/src/sys/modules, and in there a Makefile.  'make install' apparently
> builds the .ko and installs it into /modules.
>
> Am I missing something here, or is this the way to go?

No, you're not missing anything.  I used the environment variables to keep the
/usr/src tree as clean as possible, but what you describe works too :-)



More information about the freebsd-questions mailing list