So I Installed Bedrock Linux...

Created at:

Last update:

(this page is licensed under CC-BY-4.0)


Strap in, this is quite rambly! And yes, this post is basically an excuse for dumping my previous setups.

Introduction

I use various linux distros on my computers. My first distro was debian, which i had installed on my desktop computer back in summer of 2022. I got interested in it after learning about the philosophy of free and open source software and i wanted to try out windowmaker. After liking that setup a lot, i installed debian on my thinkpad t520 and riced it, which i do have some shots of it:

My debian setup on t520; first two photos are from march 2023, the last one is from december 2022. I took these from my smasnug s9+, which i still use to this day.

Sometime later, i wanted to try out manjaro since it wasn’t as bleeding edge as arch, and i wanted newer packages that what debian stable provided. I ended up switching back to debian after having bizarre issues such as not being able to play music on vlc if i opened luanti (formerly minetest). Around december of 2022, i jumped straight into gentoo on my desktop computer, and it became my daily driving distribution of choice.

My gentoo setup in march 2023, excluding some small cosmetic changes, it still remains pretty much the same today.

After i enrolled into college — with possibly one of the most difficult majors in existence — i installed debian on my hp folio laptop (which from now on i will refer to as “tinfoil”) to take notes quickly. I picked debian over gentoo since that laptop is my school computer, and i wanted easier maintenance over full control. It has an i7-4600U cpu, which is designed for battery life more than performance. Here is the photo of the tinfoil:

Here's tinfoil, my college mate for 3 years. I call it tinfoil, since it is paper thin and the chassis look like is made of aluminum; even though it is reinforced magnesium.

Tinfoil is not the fastest machine i have, but it was fine for taking notes, writing reports and surfing the net. Then i tried to run openscad. It sucked ass; the machine struggled to render a model that i made in realtime. Viewing the compiled model was fine, but preview mode was really slow. Also, we have learned to use the matlab language for fancy numerical calculations. I realized that tinfoil may not be up to the task anymore, since i may need to do lengthy computational tasks with matlab/ octave and do design in openscad and kicad for my graduation project.

I’ve acquired a thinkpad p53 a year ago, which is the most powerful machine i have, and as you might’ve guessed it, installed gentoo on it to run a minecraft server for playing with my bestie. At least, that was the plan; the server ran fine, but because of the heavy studies, we couldn’t find a good time to play. So it sat on my desk for nearly a year, begging to be used once again to unleash its true power — until today.

I picked up the p53 from its graveyard, and gave it a good update it needed to become the shining star of my computation tasks.

Preparation for rebirth.

El Problema

One of the problems with linux distributions is that while most of the components underneath them, such as the kernel and the userland, are the same; there exists a package management fragmentation. My daily driver, gentoo, uses portage; debian and its derivatives use apt, arch uses pacman, red hat and fedora use rpm, and so on. This causes problems when you want to install software that only exists in another distribution’s packages that are not compatible with the current system you’re using. This happened to me in gentoo, where some of the software that i wanted to use was on arch’s aur, so there was no integrated way to install them. Either i had to look for third party repositories in gentoo, or i had to find alternatives for the software that i wanted.

Flatpak exists, which is used for distributing software in a more distro agnostic way; however, flatpak doesn’t share the common dependencies, which causes to use more disk space when more packages are installed, and not all packages are available on it, so it doesn’t really solve my problem. What if i combined gentoo, arch and other distributions in such a way that i can access a lot of packages and run them seamlessly? There may be a solution for that.

Bedrock linux, according to their page, is a meta linux distribution. It allows you to mix and match different components from different and typically incompatible distributions. In short, you can make your own linux distro amalgam — or alloy if you prefer — with bedrock. Here is the full intro text from bedrock[1]:

Bedrock Linux is a meta Linux distribution which allows users to mix-and-match components from other, typically incompatible distributions. Bedrock integrates these components into one largely cohesive system.

For example, one could have:

All at the same time and working together mostly as though they were packaged for the same distribution.

This is it, i can mix components from distributions that i want and run them natively! It felt like a dream come true. Since i haven’t tried bedrock before, i decided to install it on my p53 for testing. (This is going to be my new college laptop btw)

Installing Bedrock

Before installing bedrock, i wanted to prepare the already installed gentoo system by updating. It took a while, but i got some screenshots of it:

Synchronizing the repositories, upgrading the system and changing the hostname.

Since i intended to use this machine as a server, i had disabled the graphical session; so i did everything in the framebuffer console. As a final touch, i renamed my system and user account from xenia@xenia to ami@mercury.

I initially picked the name “xenia” as a companion to my desktop’s system name, which is tux. Xenia is a mascot that was one of the candidates for the linux kernel project, made way back in 1996 (happy 30th anniversary!). Initially, it was named “linux fox”, but after its rediscovery in 2019, it was named xenia [2, 3, 4]. Buut, after i finished the five seasons of sailor moon, i decided to change it to mercury instead. Because, y’know, sailor mercury has a ubiquitous pocket computer to fight foes with precision. And i could relate to her a lot. The name ami is taken from the sailor mercury’s actual name: ami mizuno.

Enough with that, let’s get back to the installation! After updating the system and changing the account name, i rebooted and installed bedrock into my system, which to be honest was very quick and uneventful. Just install the script and run it like this:

mercury ~ # bash ./bedrock-linux-0.7.31-x86_64.sh --hijack

Then, you reboot the system. If you see something similar to this screen when booting:

Success!

then bedrock is installed successfully. Yeah, that’s it. The main gentoo system now lives under what’s called a stratum. A stratum is a collection of interrelated files and processes. Currently, we have two strata: bedrock and gentoo. The former provides bedrock specific functionality, while the latter is our gentoo installation. Bedrock linux is not a usable distribution by itself; rather, you need to install a proper distribution first, and then you install bedrock on top of it.

Before installing another stratum on the system, i decided to install kde plasma and copy my configuration from tinfoil. Then, issues began. Well, only two, and these happened because of me being a professional dumbass. First issue was i couldn’t upgrade my kernel from 6.12 to 6.18. It would compile and install without problems, and it seemed that it installed without a problem, there were no error messages. Well, that’s because the boot partition was not mounted, and when i installed the kernel, it would install to the root partition, not the boot one. Fucking amazing.

The second one was bizarre, where portage would complain that the locale setting was incorrect. I initially thought that bedrock installation was fucked up somehow, but i couldn’t figure out where. Then i found out that while copying my configuration, the locale settings were copied too, which included locales that weren’t installed in the system.

To explain it better, i decided to use the same kde plasma configuration from tinfoil to ease the migration process. I used a tool called konsave to save the plasma configuration as a separate profile that i could apply to the mercury. That’s what i did, and it worked alright. There were some missing things, but i added them later. The locale configuration is one of the many settings that are copied to the profile i made that got applied to the mercury. Well, the locale configuration used spanish as the time locale and turkish as the paper size locale, both of which were never installed in mercury. They were quite literally missing, that’s fun! I ended up changing them back to the defaults. Other that that, the system runs just fine. Here is the photo of both tinfoil and mercury:

Let’s Sprinkle A Bit of Arch

Now it’s the time to install another stratum alongside our gentoo installation. As far as i know, there are two ways of installing a strata: you can either do it manually, or you can use brl fetch like this:

mercury ~ # brl fetch <distro>

To see available distros that bedrock can fetch, you use the --list option:

ami@mercury ~ $ brl fetch --list
alpine
arch
centos
debian
devuan
fedora
gentoo
opensuse
ubuntu
void
void-musl
ami@mercury ~ $

This only shows compatible distros that have actively maintained fetch code; to see the distros that are not actively maintained, use the --experimental option instead:

ami@mercury ~ $ brl fetch --experimental
alma
artix
artix-s6
chimera
crux
exherbo
exherbo-musl
kiss
manjaro
openwrt
rocky
slackware
solus
ami@mercury ~ $

One important thing to mention is that not all distributions are compatible with bedrock. Here is the compatibility list. Thankfully, both gentoo and arch are supported (but not nixos, (ಡ‸ಡ) ), which means we’re ret’2 go! With running this command, we will have an arch stratum installed alongside our gentoo installation:

ami@mercury ~ $ sudo brl fetch arch
[ 1/19 ( 5%) ] Determining name
* Using arch
[ 2/19 ( 10%) ] Determining CPU architecture
* Using x86_64
[ 3/19 ( 15%) ] Determining release
* Using rolling
[ 4/19 ( 21%) ] Determining mirror
* Checking bedrock.conf [brl-fetch-mirror] items

... one eternity later ...

* Using https://ftp.fau.de/archlinux/
[ 5/19 ( 26%) ] Making bootstrap directory structure
[ 6/19 ( 31%) ] Downloading package information structure

... after decompressing, converting and bootstrapping ...

[ 18/19 ( 94%) ] Showing
[ 19/19 (100%) ] Enabling
* Successfully fetched a new arch stratum with name arch
ami@mercury ~ $

After waiting a while, the system is ready to use; which means we can use pacman to install packages from arch. Except, i haven’t used arch before; and my only experience of pacman was in msys2, back when i used windows. Thankfully, arch wiki has a list of pacman commands that correspond to other package manager commands. To test the arch stratum, i installed fastfetch and hyfetch:

ami@mercury ~ $ sudo pacman -Sv fastfetch hyfetch

Now let’s run hyfetch, aand...

hmm...

It still shows that we’re running bedrock, which is correct; but since fastfetch and hyfetch are also installed on my gentoo stratum, there is a possibility that the gentoo stratum’s hyfetch might be running, but i want to test if my hyfetch executable from arch is running. There is a way to explicitly tell bedrock to use hyfetch from arch strata by using

ami@mercury ~ $ brl strat -r arch hyfetch
... or ...
ami@mercury ~ $ strat -r arch hyfetch

The -r flag is used to restrict the environment that the executable sees — in this case the arch environment — since hyfetch does find the bedrock’s os-release file, before the arch stratum’s own os-release file (my assumption, this may be wrong!). and fastfetch (which is called from hyfetch) checks for an enviroment variable called BEDROCK_RESTRICT. If it is set to 1, then fastfetch doesn’t bother parsing /bedrock/strata/bedrock/etc/os-release [9]. Another use for the -r flag is in situations where some tooling can get confused by having dependencies from different distributions[6, 7].

Another basic — and possibly better — demonstration is printing contents of /etc/os-release. If we just type

ami@mercury ~ $ cat /etc/os-release

then, since we’ve booted from the gentoo stratum, we would get something like this:

NAME=’Gentoo’
ID=’gentoo’
PRETTY_NAME=’Gentoo Linux’
VERSION=’2.18’
VERSION_ID=’2.18’
HOME_URL=’https://www.gentoo.org/’
SUPPORT_URL=’https://www.gentoo.org/support/’
BUG_REPORT_URL=’https://bugs.gentoo.org/’
ANSI_COLOR=’1;32’

But by explicitly mentioning that we want to use the arch environment, we would instead type

ami@mercury ~ $ strat arch cat /etc/os-release

and get this instead:

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

If the same executable is provided by multiple strata, then it is possible to pin that executable to a specific strata [5] to avoid typing strat <distro> every time.

To install packages from the aur easily, i picked yay . To install yay, i needed to install git, then clone the repository and use a tool called makepkg. I had to install git, even if i have it in my gentoo stratum, since bedrock automatically restricts the environment once we run makepkg, and renders the git from gentoo inaccessible. Following are the commands that i ran to install yay:

ami@mercury ~ $ sudo pacman -Sv --needed git base-devel
ami@mercury ~ $ cd Documents/source/
ami@mercury ~ $ git clone https://aur.archlinux.org/yay.git
ami@mercury ~ $ cd yay
ami@mercury ~ $ nano PKGBUILD
ami@mercury ~ $ makepkg -si

The reason that i used the nano PKGBUILD command is because a couple of weeks ago, aur got hit by a large scale malware attack that affected at least 1000 packages, which contained an infostealer[8 ]. I... couldn’t have picked a better time to install arch; why does this shit happen, WHY?! Anyway, i inspected the script to find that it didn’t contain any malicious code, so i went ahead and installed yay. Since yay worked fine, i installed ani-cli with it, and it ran amazingly. ani-cli does support using vlc for playback; and since this is running under bedrock, i passed the --vlc flag to see if it worked without any problems; since ani-cli is only installed in the arch stratum and vlc is only installed on gentoo stratum. I will let the image speak for itself:

m a g i c a l

Now What?

I dunno, just keep using bedrock for now? But seriously, i’ve heard about bedrock linux a year or two ago, thinking whether i should switch to it or keep using gentoo for the foreseeable future. Since i was switching between laptops, i thought this was the perfect moment to test bedrock for daily driving use. In the end, it works well so far; i’ve expected the installation process to be more involved, but it was my dumbness that caused problems more than the installation procedure. I will end here with screenshots of mercury:

Final setup.

Unrelated note: remember the post i made before about my feelings? Well, i feel better ever since then, and i even somehow managed to pass this semester nearly scot free. Probably i felt terrible because i was taking meds for acne treatment, and it managed to amplify my inner stress — i stopped taking them since then. As for the other part, not a bit about my gender expression has changed; in fact, it got even stronger the following weeks. Guess i want to become a tomboy now, you can even call me “gay elettrician” if you want.

References

  1. https://bedrocklinux.org/index.html
  2. https://xenia.efi.pages.gay/
  3. https://itsfoss.com/tux-trivia/
  4. https://foss.wiki/Xenia
  5. https://bedrocklinux.org/0.7/workflows.html#pinning
  6. https://bedrocklinux.org/0.7/commands.html#brl-strat
  7. https://jgkamat.uk/blog/bedrock.html
  8. https://inv.nadeko.net/watch?v=WoxR7fGl4CI
  9. https://github.com/fastfetch-cli/fastfetch/blob/113f7d34d8f3836fe103063f565922cdaf725c79/src/detection/os/os_linux.c#L297-L303