# How to build your own BSD distribution?



## instalis (Jun 9, 2022)

Hello. I'm interested in building a BSD distribution. What tools are best to use? I have experience in compiling Linux distributions.


----------



## SirDice (Jun 9, 2022)

I suggest you start by learning how to build(7) FreeBSD. Then read release(7) and study the scripts in /usr/src/release.


----------



## SirDice (Jun 9, 2022)

Oh, one thing to note, build(7) still mentions svn(1), but from 13.0 onward the source code moved to git(1).


----------



## instalis (Jun 9, 2022)

Is there a prospect of creating a BSD distribution? I want to do a experimental project "BSD for home use".


----------



## SirDice (Jun 9, 2022)

I strongly suggest to first start actually _using_ FreeBSD as-is.


----------



## stratact (Jun 9, 2022)

SirDice said:


> I strongly suggest to first start actually _using_ FreeBSD as-is.


If one were to build FreeBSD "from scratch" and use that build for making a distribution of it, how would the outcome be any different than doing what you have suggested by using an existing FreeBSD build for making a distribution?


----------



## Lamia (Jun 10, 2022)

Build freebsd from source to gain some insights
Setup a buildserver/updateserver to make your release  (there are resources in this forum)
Setup a dev env where the freebsd codebase is linked to the buildsystem. 
Hack, build, have fun.


----------



## Lamia (Jun 10, 2022)

See
https://docs.freebsd.org/en/articles/freebsd-update-server/ 
https://forums.freebsd.org/threads/how-to-create-a-freebsd-update-server-in-my-lan.69691/ 

A buildbot can be used to spin up poudriere for ports and so it can be used to make buildworld and buildkernel. You now need further automate these processes.


----------



## Geezer (Jun 10, 2022)

Dear OP, Freebsd is a great operating system, it is free, and you get support on this forum.

[Rhetorical]What is this misapprehension you have about making a '_distribution_'? [/Rhetorical]

There is no money in it. No glory.

One of the great things about the Freebsd world (as opposed to Linux), there is no particular need for distributions.


----------



## drhowarddrfine (Jun 10, 2022)

instalis said:


> I have experience in compiling Linux distributions.


You are confused. Linux distributions are based on the Linux kernel which then takes third party applications and software added on to create an operating system. FreeBSD already is a complete  operating system and does not need third party applications to become one.


instalis said:


> I want to do a experimental project "BSD for home use".


The way you make that is you take FreeBSD, already a complete operating system, and install the software you want to create something for the home user from the ports already available for FreeBSD.


----------



## Alain De Vos (Jun 10, 2022)

And add some configuration,tweaking, well chosen desktop background-color & window-decoration


----------



## Lamia (Jun 10, 2022)

I suppose making your own distribution means building the kernel and world ground up with your tweaks, and most likely, automating it for continuous development and integration in your infrastructure. All of the above point you at the direction.


----------



## zirias@ (Jun 10, 2022)

What's a "distribution" in your context?

This word can mean a lot of things. In a software context, a "distribution" could be any format for distributing software, like e.g. some binary package, or even a tarball as a "source distribution".

As others already stated, it seems you have "Linux distributions" in mind. Those are distributions of a _collection_ of software that's somewhat integrated to work well together. Well, FreeBSD package repositories are a _distribution_ (one of third-party software to work _on_ FreeBSD) in that sense, and the _ports_ are the technical foundation to create it. There are tools to create your own package repositories from ports using different build-time options, so in some sense, you already created your own distribution doing that. Of course, that's NOT a "BSD distribution", just one of software _for_ FreeBSD.

You might be confused by the name BSD (Berkeley Software Distribution) containing the word distribution. That's just for historic reasons, BSD started as an ever-growing collection of software (distributed as source code) _improving_ an existing Unix system. But eventually, it developed into a stand-alone operating system.

Linux is kind of an alien because it is *not* an OS, just a kernel, and typically combined with some GNU software (there are other options, see e.g. Android...) to form a complete OS. As a consequence, you can't use it without a distribution containing at least this software. Another consequence is there's never a clear definition of what is part of the OS and what isn't, these Linux distributions just place all the software they have to offer in huge repos.

This model just doesn't match for a BSD system. In FreeBSD's `src` repository, you have the _whole_ OS. There are quite some build-time options as well, so you could create a custom build, and even create installation media from it (everything needed for that is part of the system) ... distributing the result would be, kind of, a "BSD distribution". Once you start modifying actual code, the term "fork" would be more appropriate.

After understanding all this, what exactly are you trying to achieve?


----------



## grahamperrin@ (Jun 15, 2022)

Welcome to FreeBSD Forums.



instalis said:


> … experimental project "BSD for home use".



Guides | FreeBSD Foundation includes an _introduction_; a _Guide to FreeBSD Desktop Distributions_.

Comparable to helloSystem: ravynOS – Finesse of macOS. Freedom of FreeBSD. I assume that Airyx became ravynOS.

Beyond the well-known distributions, discussions in FreeBSD include:

_CultBSD_ by christhegeek
something by … I remember his face here, but can't remember his name at the moment.
In some of those spaces, you'll gain a sense of the diverse approaches to building a home/desktop distro that's based on FreeBSD.

Some of this 2021 topic might interest you, don't be dissuaded by negativity:









						FreeBSD Kommunity Edition
					

Let's just brainstorm...  What would you expect a "FreeBSD Kommunity Edition" to be/offer? What would you like it to be/offer? Is there demand for such a thing? Would you like to see a *BSD Kommunity Edition? What is missing or should be better in base FreeBSD / in the KDE ports? Add your...




					forums.freebsd.org


----------



## grahamperrin@ (Jun 15, 2022)

grahamperrin@ said:


> something by … I remember his face here, but can't remember his name at the moment.



Found: Samuel Venable produced FreeBSD-13.0-RELEASE-amd64-KDE-Plasma

<https://forums.freebsd.org/threads/freebsd-kommunity-edition.78594/page-7#post-513391>
FreeBSD-13.0-RELEASE-amd64-KDE-Plasma (2021-05-22)
FreeBSD-13.0-RELEASE-amd64-KDE-Plasma (2021-06-23)


----------



## astyle (Jun 16, 2022)

grahamperrin@ said:


> Found: Samuel Venable produced FreeBSD-13.0-RELEASE-amd64-KDE-Plasma
> 
> <https://forums.freebsd.org/threads/freebsd-kommunity-edition.78594/page-7#post-513391>
> FreeBSD-13.0-RELEASE-amd64-KDE-Plasma (2021-05-22)
> FreeBSD-13.0-RELEASE-amd64-KDE-Plasma (2021-06-23)


Ah, yeah, he's youtubing about that these days.  Should we point ziomario in direction of Samuel Venable ? (Thread about-to-plan-to-create-a-video-series-about-freebsd-to-use-as-a-desktop.85420)

Now, the rest of the post is my contribution to the thread: FWIW, I'm doing a homebrew project with Poudriere, because I want packages compiled with my own options, and be upgradeable like on a phone. The way I see it, KDE should be upgradeable independently of everything else.

Thing is, it's not easy to get others to bandwagon around one person's ideas of what would be convenient, especially geeks like us. Big Tech companies (like Apple and Google) wrote the playbook, and they have the money to get devs to buy in and follow their ideas of what would be convenient.  Big Tech has org structure reinforced by money. Linux and BSD camps don't have that kind of clout. This is why the spin I put on my project is a _personal homebrew project_, rather than yet another 'Distribution' project on the Internet.  I still take advantage of other people's expertise - users on these Forums helped me solve many technical issues along the way.

Just getting a 'Distribution' project going - that takes a LOT of resources - renting servers on the Internet for building, hosting packages, forums, policing all that - beyond OP even clearing the technical hurdles of getting things to work the way they like.

Having your own project is nice. Learning experiences are good to have. But re-framing the approach to the whole enchilada (or at least being willing to do that) will get better results.


----------



## drhowarddrfine (Jun 17, 2022)

That's a "desktop distribution", not a FreeBSD operating system distribution. Big difference. It's still just a pre-configured FreeBSD.


----------



## ziomario (Jun 17, 2022)

Geezer said:


> One of the great things about the Freebsd world (as opposed to Linux), there is no particular need for distributions.



Dear,it's not so bad to have a lot of linux distributions. Even if they aren't a lot. There are a lot of derivates,yes. But in my vision of things,multipolarity rhymes with diversity that rhymes with freedom. And since the derivatives are many but every one belongs only to one of the 4 larger groups (Debian,Redhat,Arch,Suse) there is not so much fragmentation, to tell the truth.


----------



## SirDice (Jun 17, 2022)

Ehm, perhaps we should wait for the OP to return, OP hasn't been seen since they posted the question.


----------



## ziomario (Jun 17, 2022)

astyle said:


> Ah, yeah, he's youtubing about that these days.  Should we point ziomario in direction of Samuel Venable ? (Thread about-to-plan-to-create-a-video-series-about-freebsd-to-use-as-a-desktop.85420)



I'm evaluating these days which road to take. After having read all your comments I felt more intrigued by doing some scripts to visually automate all the various tasks for the management of the OS than doing a collection of videos for youtube.


----------



## astyle (Jun 17, 2022)

ziomario said:


> I'm evaluating these days which road to take. After having read all your comments I felt more intrigued by doing some scripts to visually automate all the various tasks for the management of the OS than doing a collection of videos for youtube.


I think this is a pretty sane approach here.


----------



## Alain De Vos (Jun 17, 2022)

A few words come to my mind: bhyve,virtualbox,jail;ansible.


----------



## ziomario (Jun 18, 2022)

Alain De Vos said:


> A few words come to my mind: bhyve,virtualbox,jail;ansible.



I'm not thinking about these "complicated" methods,but to some little visual scripts to automate even the more complicated automated scripts.


----------



## ziomario (Jun 18, 2022)

astyle said:


> I think this is a pretty sane approach here.



I know,but if I do something like this,I should say bye to money. Even if I was able to create a large collection of scripts,I suspect that it will be not easy to earn money from their selling.


----------



## Geezer (Jun 18, 2022)

ziomario said:


> ... some little visual scripts ...



What is a 'visual script'? It is something that runs in an X session, or something using curses in a text console?


----------



## ziomario (Jun 18, 2022)

they need an X session. I found an interesting tool (at least to my "eyes") called Sikulix. It works by recognizing a precise portion of screen because it uses the OCR technology. So,in theory everything can be automated with the maximum precision. And it is very easy to create a script. There is no need to have programming skills.


----------



## Geezer (Jun 18, 2022)

Are you going to port this tool to FreeBSD? It could then be a dependency of the port that you could make that would include your useful scripts.


----------



## ziomario (Jun 18, 2022)

It works on FreeBSD almost out of the box. To work correctly it needs that some packages are installed before. The whole installation procedure can be also automated but this time with a simple bash script. What do u think ? Did u give a look at the tool ?


----------



## jbo (Jun 18, 2022)

ziomario said:


> with a simple bash script.


If you want to go down this road: Please - don't write bash scripts.
Bash scripts are "incompatible" with the most popular shells in FreeBSD (sh, csh, zsh, fish, ...)
Just good old `#!/bin/sh` should do


----------



## ziomario (Jun 18, 2022)

Sure,but when I used Linux I learnt how to write easy bash scripts,but they will not work if I will use sh,csh,zsh,fish and so on. So,it's not faster to install the bash tool from the ports and write scripts im bash because I already have some knowledge ?


----------



## jbo (Jun 18, 2022)

ziomario said:


> Sure,but when I used Linux I learnt how to write easy bash scripts,but they will not work if I will use sh,csh,zsh,fish and so on. So,it's not faster to install the bash tool from the ports and write scripts im bash because I already have some knowledge ?


Well... this depends on your goal.
If your goal is to present something that the vast majority of FreeBSD users are able/willing to use/test/contribute, then shells/bash is going to be a blocker for some.
If your goal is to make something quickly without acquiring more/different knowledge, then I think your entire undertaking might not turn out the way you imagine.

I know several individuals which refuse to use/install shells/bash. I tend to include myself in that list.
Just look at the CVEs of bash...
In general, you want to use as many "native" / "base" tools as possible. There are plenty of shells. Bash is definitely one of the least commonly used one as far as I can tell.

This is of course just my opinion.

But please... This is really not the thread for this. Let's start a new/dedicated thread if you want to continue talking about this:


SirDice said:


> Ehm, perhaps we should wait for the OP to return, OP hasn't been seen since they posted the question.


----------



## astyle (Jun 18, 2022)

ziomario said:


> I know,but if I do something like this,I should say bye to money. Even if I was able to create a large collection of scripts,I suspect that it will be not easy to earn money from their selling.


If you want money, then FreeBSD forums is not the place to look for money-making ideas. And while there are VC platforms out there, it's a pretty cutthroat world where personal safety and sanity is the collateral. It's a Catch-22, only you can resolve it for yourself. Money means no time for FreeBSD. FreeBSD means no time for money. It's that simple. Yeah, unpleasant to consider, but this whole planet revolves on far more daemonic choices than that. Suck it up and go for money instead of FreeBSD.


----------



## ziomario (Jun 18, 2022)

astyle said:


> If you want money, then FreeBSD forums is not the place to look for money-making ideas. And while there are VC platforms out there, it's a pretty cutthroat world where personal safety and sanity is the collateral. It's a Catch-22, only you can resolve it for yourself. Money means no time for FreeBSD. FreeBSD means no time for money. It's that simple. Yeah, unpleasant to consider, but this whole planet revolves on far more daemonic choices than that. Suck it up and go for money instead of FreeBSD.



Don't get me wrong. I don't want to make big money with FreeBSD. I just want only supplement my pension with a small amount of money. My aim is to survive,not to start a business.


----------



## astyle (Jun 18, 2022)

ziomario said:


> Don't get me wrong. I don't want to make big money with FreeBSD. I just want only supplement my pension with a small amount of money. My aim is to survive,not to start a business.


Just remember, the aim of these forums is technical help, not money help. 

You gotta first figure out what people are willing to pay for, and then figure out if there's a usable opportunity for you. Order matters. Make sure you don't have the playbook backwards, then it will work out.


----------



## christhegeek (Jul 2, 2022)

CultBSD will return .... along with my channel , but i just wanted to have a more well done installer and use zfs by default cause some people might need it to learn more.
But moving to zfs would help cause you can load a compressed zfs on Ram and this is something good.
When i made  of CultBSD i had barely a year on FreeBSD also it was something like fast-food project haven't invested much time and had my script for generating a complete desktop and a better pc back then so it took me zero time to make.  What i wanted to say was that we need the coolest and most best-looking FreeBSD based project you can make (like garuda is for linux)  so we can attract more users using Unix Porn etc 
The second statement i wanted to make was that its stupid to load to Ram directories that the os will almost never attempt to write on while booting and using the live image so you can make a better Project more loaded with features and software and cool themes and icons.
  Also this project doubled as a portable FreeBSD based Os that you could clone on a usb  and take it with you so the installer was made for this so it won't cause any problems when the target disk was a usb stick or an external disk.

   I stopped this project cause i didn't wanted to be something made fast and poorly and not have good quality scripts and applications.
Of course i will stick with Qt in the future too , cause i like Qt framework .

All these if i believe its something worth doing .




grahamperrin@ said:


> Welcome to FreeBSD Forums.
> 
> 
> 
> ...


----------



## christhegeek (Aug 13, 2022)

ziomario said:


> Don't get me wrong. I don't want to make big money with FreeBSD. I just want only supplement my pension with a small amount of money. My aim is to survive,not to start a business.


If you want to make your own FreeBSD based project why won't you start by forking furybsd and modify its scripts ?
If you want to be able to make any amount of money you should go with linux the easiest would be to make an ubuntu based distro  , arch linux has already every kind of distro.
But to start making money you need to work hard and also advertise your work on youtube making videos etc  , on reddit twitter etc etc.


----------



## cy@ (Aug 13, 2022)

instalis said:


> Hello. I'm interested in building a BSD distribution. What tools are best to use? I have experience in compiling Linux distributions.


Why? I'm not being rhetorical or anything. When embarking on a project such as this one must have a goal or set of goals in mind. What problem are you trying to solve? What is the goal of this exercise? The answer to this question will tell you whether a) maybe contributing to FreeBSD to make it better might be a better idea or b) whatever problem you're trying to solve could be solved in a less work intensive way.

If you don't have any background in building software, let alone in the FreeBSD build system, ports, etc., this would be a steep learning curve.


----------



## cakelover (Aug 22, 2022)

zirias@ said:


> After understanding all this, what exactly are you trying to achieve?


long time freebsd user here.  I started on 4.x many decades ago.  I have used linux, mostly rhel & fedora.   Most, if not all linux distros achieve confusion and userland being messed up in one way or another.

I often wish there was a "linux" distro that had sane freebsd like choices and user land.   I come across these posts about yet another fork, and think this simple truth.

Read the handbook.  Handbook & the freebsd documentation, which is stellar, explains things.

It would be better use of the time putting the handbook into a full 2 hour, bookmarked video.

I can say, There is zero need for another BSD, there is a need to make the handbook into an AI Help bot.


----------



## freezr (Aug 23, 2022)

Ah... the good Linux habits to change theme, icon set and background to make a brand new distro...


----------

