How to Compile Kernel

Hi everyone, I'm looking for a guide that explains well how to compile your own kernel, adapting it to your needs. I noticed that the installation without src was 2 GB, I compiled the kernel, removed /usr/src and the kernel.old but I found 4.7 GB, why?? Thank you
 

build(7), src.conf(5), make.conf(5), and release(7).
Could you provide me with the correct procedure to install src and once compiled into the kernel remove the previous one and clean up the system. I would need to create a system with the essentials. Thank you
 


You understand that FreeBSD is a complete OS, right? It's more than a kernel.
Yes and I'm very passionate about the OS. I'm trying to implement a system optimized for a given hardware that fits in as little space as possible.
 
Look, I'm trying to recover some machines to use as a backup repository by structuring the potential of zfs and rsync. So I'm trying to limit the space and resources used by the system
 


You understand that FreeBSD is a complete OS, right? It's more than a kernel.
Sorry, but I can't find the procedure to clean up the system once the kernel has been compiled and the new one installed. I would like to remove src the old kernel and the paths used to compile it essentially what is no longer needed

Thank you
 
Sorry, but I can't find the procedure to clean up the system once the kernel has been compiled and the new one installed. I would like to remove src the old kernel and the paths used to compile it essentially what is no longer needed

Thank you
It depends what method you use. If you use the buildkernel method the obj is under /usr/obj. If you use the old configure method everything is in /usr/src/sys/amd64/compile/IDENT. The new method is too murky for me; I like everything in one directory
 
If you're space constraint you're not going to be building on the device itself. I presume you do the actual building on some other machine, create an image there and transfer that image to said device. There would be no files in /usr/obj, or /usr/src on the target image unless you actually copied them there.

It's honestly very unclear what files, or which things, need removing?
 
No, I'm a beginner. I am currently working on the machine directly. But I would like to understand how to standardize updating my installations with images. Do you have any guidance? Thank you
 
I don't see myself as a beginner, but even then, building a custom image to fit a few machines that I do have - that's a LOT of work to get right.

Reading through the thread, I get the impression that OP has a few older machines with relatively limited resources, but no 'builder' machine that actually has the metal that is up to the task.

Dunno if OP realizes it, but a single ZFS pool can very well have datasets that live on separate hosts (host's OS doesn't even matter) and talk over the LAN.

It probably makes more sense for OP to have a successful, minimal FreeBSD install on each host (no src or debug or extra libs), and to set aside the rest of the disk to a specific dataset for the backup repo.

OP doesn't even need rsync - zfs send and zfs receive will do the job.

OP should probably try to hand-draw a diagram of what I'm trying to suggest - visualizing things often helps make sense of suggestions people make. :)
 
Back
Top