
Build your own Linux - ashitlerferad
http://www.buildyourownlinux.com/
======
fizixer
I was about to go hard on this because I came across a similar link a few days
ago that had absolutely no mention of the excellent existing project on this
topic, the LFS project [1].

This page does make multiple mentions of it, but in a very offhanded way.

I would encourage the people behind this url to make a case upfront about why
someone should use this link as opposed to directly going to LFS, and what do
they have that LFS doesn't.

[1] [http://www.linuxfromscratch.org](http://www.linuxfromscratch.org)

~~~
pavement
LFS feels like a dead project. The project presents itself as a "book."

Some of the provided tarballs are riddled with old vulnerabilities (and served
over insecure channels ( _!!!_ ) with no integrity checks), and thus it is
relegated to educational purposes only, and should not be used for building a
secure, general purpose system.

Does it support SATA and UEFI boot disks yet?

~~~
agumonkey
beside that, LFS on its own was weirdly useless to understand linux. More like
linux toolchain / sed tutorial. I made a bootable LFS twice but it was
strangely broken. BLFS is where linux knowledge is IMO.

~~~
pfranz
I guess it depends where you want the knowledge. When LFS first got started
(and a few years before), I found at that time as a home-user, I often had to
build the kernel myself (maybe I was trying too hard to be cutting edge), know
more about booting (LILO and GRUB), and on occasion I messed up bootable
partitions. Recently, I was trying to build a custom version of GCC and
dependencies and found LFS docs helpful.

From looking over the BLFS now, I haven't had a lot of use-cases for building
more userland-ish things. I've tried to avoid compiling X or Display Managers
and stick to package managers if I wanted to try a new Desktop Environment.
I've found Arch docs (or man pages) really helpful in configuring these kinds
of things when I do need it. I can see this being more useful if I wanted to
be more of a sysadmin. I remember trying to customize PAM and setup Kerberos
years ago and feeling like there wasn't much help putting this all together or
troubleshooting (it may have been prior to BLFS).

When you said "weirdly useless to understand linux" do you mean the linux
kernel in the literal sense? Or the low level system stuff of how things are
put together?

~~~
agumonkey
I meant the whole linux system, not the kernel. I guess I'm wrong since it's
not gnu/linux from scratch. But the two are entangled.

------
ytjohn
These days, for the situations in which I want to make my own distro, I go to
[buildroot]. I recently (well, 2 years ago) built an image to replace DOS on a
Pentium 75 system. Built an small distro containing nothing more than a a
couple users and minicom, with minicom attaching to the serial port, and ssh
access. Sure, I could have done this with a raspberry pi and a usb serial
adapter, but this was more of an educational side project. I was already re-
using the PC power supply and case to power a standalone APRS setup, and
figured I should be able to re-use the computer and serial port to provide
remote access.

[buildroot]: [https://buildroot.org/](https://buildroot.org/)

~~~
helper
+1 for buildroot. I've used it both professionally and on personal projects.
All of my rpi projects run on tiny buildroot images (usually with a single go
binary). I love that it produces an image I can write straight to an SD card
that is ready to go without me having to plug the RPI into a monitor to
configure it.

However LFS and BYOL aren't really about making it easy to build a "distro".
They really are about learning how all the pieces fit together.

------
newscracker
The harder part of building a Linux distribution/system would be getting to
use the hardware you have and exploiting its full potential, especially those
that are not built with Linux in mind.

I switched an old Mac to run Linux sometime ago and have documented issues I
faced and the limitations I still live with. Most of it is related to decent
trackpad support, GUI options for apps/functions I need, and the customization
of keyboard shortcuts system wide (coming from OS X/macOS). A lot of
information as well as applications I found were simply outdated and not
maintained. I've also spent quite a bit of time just to get the system in a
shape that's a bit more amenable to me (as opposed to adjusting myself
completely to how a specific distribution of desktop Linux works by default).
It's nowhere close to perfect for me, but it's the best choice with constant
OS/security updates for old hardware that's unsupported by the manufacturer
(Apple, in this case).

My advice to anyone wanting to use Linux would be to look for hardware that
has been built with Linux in mind. That will save you time, which you can then
use to do more productive work/learning (unless your area of interest is in
learning about hardware compatibility, developing drivers yourself, tweaking
various config files, etc.).

~~~
marbu
> look for hardware that has been built with Linux in mind

This boils down to a simple thing to check: Are drives for this piece of
hardware included in vanilla kernel?

If the answer is yes, it's a good sign, even more when the driver comes from
the company building the hw.

------
xurukefi
> Our goal is to produce a small, sleek system well-suited for hosting
> containers or being employed as a virtual machine.

This is probably one of the few use cases where building your own linux distro
is a sensible idea.

Other projects like LFS encourage desktop users to build their own linux-
distro, which is beyond insanity in my opinion. Keeping an LFS system up to
date with security patches should be virtually impossible unless you set aside
a decent portion of your daily free time for this task, which probably nobody
is willing to do. I can see how building your own linux distro is educational
and fun, but in terms of security and maintenance it is an absolute nightmare.

~~~
czep
> Keeping an LFS system up to date with security patches should be virtually
> impossible unless you set aside a decent portion of your daily free time for
> this task

It's really not that hard once you know what software is actually on your
system. LFS enforces discipline because you're less likely to blindly install
hundreds of useless packages just because your distro bundles them. On a nice
svelte system, all you need to do is monitor a few mailing lists and decide if
something is worth upgrading.

More often than not, you'll be able to patch your systems faster than a distro
will be able to release an update, because the source is in your hands at the
same time.

------
dopeboy
Tangent - when I was 18, I wanted to be hardcore. I thought I was above Fedora
and a (then up and coming) Ubuntu. So I printed out the compile-from-scratch
manual for Gentoo. It was a solid 20 pages front and back. I made it four
pages in and gave up.

This link gave me flashbacks to that manual.

~~~
jiggunjer
4 Pages? That's the table of contents and the introduction :p

------
zengid
Funny how I was just looking for something like this. Just finished a
whirlwind summer semester using Gentoo in a course on Linux admin, so I've
been wanting to dig in a bit deeper.

~~~
pfranz
Back in my day it was
[http://www.linuxfromscratch.org/](http://www.linuxfromscratch.org/)

Anyone familiar enough with both to know the difference? I used the LFS docs
recently when trying to build a custom version of GCC.

~~~
joshumax
Looks like this site may go into some more detail of how the specific packages
interact to create a "standard" Linux distribution more than the LFS series
does; but I'm not sure how much has changed regarding that in recent times...
Even the faded BLFS book I was gifted in 6th grade seems to be more focused on
just getting the packages built and installed into the LFS root than going in
depth about their internals/function. Even though tools like
buildroot/OE/Yocto offer much better tools to make a Linux from scratch, I
think both of these offer a great way to quickly gain at least some insight
into Linux + userspace

------
enriquto
how feasible would it be to build a true 64 bit system ? (i.e., the ints are
also 64 bits)

~~~
majewsky
That's not what "64-bit system" means. "64-bit system" means that _addresses_
(i.e. pointers) are 64 bits wide, not ints.

~~~
smitherfield
And I believe all the major 64-bit instruction sets actually use 48-bit
addresses at present, so software/compilers can use the top 16 as tag bits.
(In addition to the bottom 3, assuming alignment on 8-byte boundaries).

~~~
wvenable
The address space in x86-64 is specifically designed to prevent the use of
unused address bits for tag bits.

"The AMD specification requires that the most significant 16 bits of any
virtual address, bits 48 through 63, must be copies of bit 47 (in a manner
akin to sign extension). If this requirement is not met, the processor will
raise an exception."

[https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_d...](https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details)

~~~
userbinator
That applies only when you are actually using such an address for an access;
you are free to store anything in those upper 16 bits as long as they are
masked off when it's actually used to access memory.

