… to build a BSD distribution … Something that will teach me step by step how to do this.
Hello,What should a "BSD distribution" be? As I explained earlier, today's BSDs are complete operating systems, the D in the name is historic. They also typically come with their own distribution of 3rd-party software (packages) built from ports.
Linux is only a kernel, you need quite some userspace tools to create a full OS (and the "base tools" typically come from GNU). That's why following LFS, you have to build a lot of packages just to get a working base system. With a BSD, you get the whole system in a single source tree, and you can build and install from that in a few simple steps. The process for FreeBSD is described in the handbook and there are reference docs in manpages like build(7) and release(7).
So, the word "distribution" makes little sense here, you just build and install it. If you want to change anything, you'd actually create a "fork".
Finally, for building 3rd-party software, there's already a well-working framework with ports to build and install packages from upstream sources. And there are tools likepoudriereto automate bulk builds and reliably create a package repository.
All a "BSD distribution" could mean would be to combine the base system (maybe slightly modified) with a predefined and preconfigured set of 3rd-party packages, like some systems are doing in order to provide some "out of the box FreeBSD desktop" or whatever.
Linux is only a kernel, you need quite some userspace tools to create a full OS (and the "base tools" typically come from GNU). That's why following LFS, you have to build a lot of packages just to get a working base system. With a BSD, you get the whole system in a single source tree, and you can build and install from that in a few simple steps.
Can you explain the phrase the whole system in a single source tree?
In all my experience, having to pull together all the bits and pieces necessary to build some working GNU/Linux "OS" is a major drawback. Actually, you should get an idea about it when reading LFS. How many packages do you have to build, in the correct order, applying all sorts of hacks and patches to make them work together, just to have a working system? LFS gives you one possible "recipe", there are countless other possibilities. None will ever work without patching the one or other thing, as all components are developed in isolated projects, Linux, several GNU projects, and a variety of third-party projects ... like e.g. nowadays, you certainly want base tools supporting bzip2, lzma, most likely zstd as well, which are all coming from different (non-GNU) upstream projects, but e.g. GNU coreutils can link and use them ....Isn't GNU/Linux better in this regard? You can have a package in your distribution and not have a package. How about the BSD?
Hello,src - FreeBSD source tree
cgit.freebsd.org
In all my experience, having to pull together all the bits and pieces necessary to build some working GNU/Linux "OS" is a major drawback. Actually, you should get an idea about it when reading LFS. How many packages do you have to build, in the correct order, applying all sorts of hacks and patches to make them work together, just to have a working system? LFS gives you one possible "recipe", there are countless other possibilities. None will ever work without patching the one or other thing, as all components are developed in isolated projects, Linux, several GNU projects, and a variety of third-party projects ... like e.g. nowadays, you certainly want base tools supporting bzip2, lzma, most likely zstd as well, which are all coming from different (non-GNU) upstream projects, but e.g. GNU coreutils can link and use them ....
In contrast to that, when FreeBSD includes some 3rd party component, it's pulled into the tree and all the integration and maintenance work is done. Build a single source tree, get a working system, simple as that.
The only possible downside is endless debates about what should be part of base and what not. Although it's simple in theory (the minimal useful base system), it's often possible to discuss individual components. The build system is already flexible, see e.g. src.conf(5), you can configure which components you want to build and install, but for that, you have to build and install from source. But then, have a look at upcoming PkgBase. All it adds is the possibility to build a set of many binary packages (instead of a single large one) from the single source tree. So, perfect integration of all components will stay, still users will be able to only install the components they want, without building themselves.
Where it traditionally was in every unixy source tree: in the sys subdirectory.Where exactly is the FreeBSD kernel?
Whoa, whoa, whoa... slow down...Hello,
Thank again.
Where exactly is the FreeBSD kernel? In Linux, you can download and install it separately.
I thought that's where the compiled kernel gets copied/installed... Sources are still in /usr/src/ ...Where it traditionally was in every unixy source tree: in the sys subdirectory.
Where exactly is the FreeBSD kernel? In Linux, you can download and install it separately.
ports collection |
kernel and world |
% pwd
/boot
% ls -dhln kernel*
drwxr-xr-x 2 0 0 862B 13 Jan 20:01 kernel
drwxr-xr-x 2 0 0 862B 13 Jan 20:02 kernel.GENERIC-NODEBUG
drwxr-xr-x 2 0 0 856B 16 Nov 01:30 kernel.GENERIC-NODEBUG.old
drwxr-xr-x 2 0 0 862B 4 Jan 03:21 kernel.old
% uname -aKU
FreeBSD mowa219-gjp4-zbook-freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #1 main-n267555-e3c7b76fa810-dirty: Sat Jan 13 19:34:36 GMT 2024 grahamperrin@mowa219-gjp4-zbook-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1500010 1500010
%
Kernel installation is a pretty advanced topic...
make installkernel? ?The compiled kernel gets installed to /boot/kernel. And /usr/src is where you typically place the source tree, but any other location works as well as long as you let the build system know.I thought that's where the compiled kernel gets copied/installed... Sources are still in /usr/src/ ...Where it traditionally was in every unixy source tree: in the sys subdirectory.