Compile a FreeBSD kernel to include VIMAGE support; Install jib and jng; Create a zfs data set for basejail; Configuring the jail.conf on the host; Enable and start jail service; Let us see all steps in details to configure a FreeBSD Jail with vnet and ZFS. Configure/compile vnet kernel. You must compile FreeBSD kernel. FreeBSD has pretty good documentation. If you want to use a kernel function or data-structure, it is probably covered in section 9 of the manual pages. You can list all the manual pages in that section with ls /usr/share/man/man9/ less. Or you can use the apropos command. Since you want to implement a syscall, start with e.g. Apropos syscall.
Active4 years, 9 months ago
Is there any proper way to build a minimal kernel for FreeBSD? The FreeBSD Handbook has the lack of information about this. By default
/boot/kernel
directory has the pretty big size - around 450MB. I want to minimize kernel fingerprint and remove all unnecessary kernel modules and options. Should I use 'NO_MODULES'
option in /etc/make.conf
? Or use C compilation flags?powerthrash
powerthrashpowerthrash
2 Answers
Minecraft hack client 1.8. There are a number of things you can do to reduce the size and number of files in
/boot/kernel
.Possibly the best space saving is to be had by setting
WITHOUT_KERNEL_SYMBOLS
in /etc/src.conf
(if this file doesn't already exist, just create it), and the next time you installkernel
, the debug symbol files won't be installed. It's safe to delete them now, if you need the space immediately (rm /boot/kernel/*.symbols
)There are a few
make.conf
settings that control what modules are built:NO_MODULES
- disable building of modules completelyMODULES_OVERRIDE
- specify the modules you want to buildWITHOUT_MODULES
- list of modules that should not be built
The
NO_MODULES
option is probably a bit too heavy-handed, so a judicious combination of the other two is a better choice. If you know exactly which modules you want, you can simply set them in MODULES_OVERRIDE
. Note that WITHOUT_MODULES
is evaluated afterMODULES_OVERRIDE
, so any module named in both lists will not be built.If you really want to suppress building of all modules, you can use
NO_MODULES
, and ensure that all required drivers and modules are statically compiled into the kernel. Download windows xp solitaire. Each driver's manpage shows the appropriate lines to add to your kernel config file, so you should be able to figure out what you need.If you still find that space is a problem, or if you just want to strip down the kernel as much as possible, you can edit your kernel config to remove any devices and subsystems your machine doesn't support, or which you are sure you won't want to use. The build system is pretty sensible, and if you inadvertently remove a module required by one still active in the config, you will get a failed build and an error message explaining what went wrong.
Although it can be extremely tedious, the best approach is to take small steps, removing one or two things at a time and ensuring that the resultant configuration both builds and boots correctly. Whatever you do, though, I highly recommend you make a copy of
/usr/src/sys/<arch>/config/GENERIC
, and edit the copy. If you ever get so muddled that the only recourse is to start from the default config, you'll be glad you've still got the GENERIC
file on your system!In order to build your custom kernel, you can either pass the name of the config on the command line as
D_Byemake KERNCONF=MYKERNCONF buildkernel
, or you can set KERNCONF
in /etc/make.conf
. Make sure you place the custom config file in /usr/src/sys/<arch>/config
and the build system will be able to find it.Freebsd Cross Compile Kernel
D_Bye11.2k11 gold badge3434 silver badges2727 bronze badges
'Proper' kernel is a relative notion and depends on your needs. People who need to ask about building kernel have no business building one. By the way how did you come up with the 450 MB size of FreeBSD kernel
here
Predrag PunosevacPredrag Punosevac