diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-04-17 11:54:07 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-04-17 12:02:25 +0300 |
commit | 066f71735be552cd323fd9dbd82355c699b241af (patch) | |
tree | fbbfffc6cc88e25c890383da4637e785bf297024 | |
parent | a31d1fd000dd9e70cbb1ce9fff491a10ec0980da (diff) | |
download | eug-vs-xyz-066f71735be552cd323fd9dbd82355c699b241af.tar.gz |
blog: running Gentoo on multiple workstations
-rw-r--r-- | blog/2022-04-17.md | 51 | ||||
-rw-r--r-- | blog/index.md | 1 | ||||
-rw-r--r-- | public/emoji/gentoo.png | bin | 0 -> 175104 bytes |
3 files changed, 52 insertions, 0 deletions
diff --git a/blog/2022-04-17.md b/blog/2022-04-17.md new file mode 100644 index 0000000..b7c1150 --- /dev/null +++ b/blog/2022-04-17.md @@ -0,0 +1,51 @@ +# Running Gentoo :gentoo: on multiple workstations +Last week I've migrated my daily-driver laptop :computer: from [Artix Linux](https://artixlinux.org/) to [Gentoo](https://www.gentoo.org/). I also have Gentoo-powered PC for a ~half a year already, so some experience has accumulated. +I always wanted to do that, but there was a fear of unknown: + - Is my CPU performance sufficient for compiling packages? + - What if I don't have time to compile a package (e.g at work)? + - How am I gonna manage the USE flags? + +Of course, none of that shit can stop me! + +## My CPU is weak :cry: +My laptop has a pretty weak CPU (**Intel i3**) compared to flagship models. My PC has **Intel i5**, so obviously compiling packages on laptop will be even slower. That is definitely gonna be a problem... + +But wait, why don't we use **both CPU's** for compilation? :thinking: + + +## Introducing `distcc` +From [Gentoo wiki](https://wiki.gentoo.org/wiki/Distcc): +> Distcc is a program designed to distribute compiling tasks across a network to participating hosts. It comprises a server, distccd, and a client program, distcc. Distcc can work transparently with ccache, Portage, and Automake with a small amount of setup. + +Installation and usage is of course covered in the wiki along with instructions on bootstrapping new machine. Thanks to `distcc` installing Gentoo on my laptop was even faster than on more performant PC. + +Basically my PC runs a `distccd` server in my **LAN** and my laptop connects to it, sending compilation requests. Now every time I want to compile some heavy packages I just wait to come home and do it at almost twice the speed. There are more optional benefits: + - I can bring my RaspberryPI :raspberry-pi: to the compilation network (not without some cross-architecture magic) + - I can pull up some more old rusty metal, connect it to my **LAN** and have my packages compiled *even faster* :fire: + - I can setup [ccache](https://wiki.gentoo.org/wiki/Ccache) and share compilation cache within my network, making heavy package updates finish in seconds + + +## What if I'm outside and don't have time for compilation? :scream: +Actually turns out it's a very hypothetical situation. Most of the time you already have your toolkit installed anyway. It's only annoying if you want to try something new - for that I recommend remote or virtual machines (yes, `docker` still exists). + +In any case, if such an urgent situation occurs, **you can just get a binary!** There are also ways to setup your own [binary package server](https://wiki.gentoo.org/wiki/Binary_package_guide). + +## Managing portage configuration across workstations :hammer_and_wrench: +[Portage](https://wiki.gentoo.org/wiki/Portage) is **the best** package manager I ever used. The obvious benefit is an ability to split your packages into [sets](https://wiki.gentoo.org/wiki/Package_sets). I can define as many sets as I want, for example here's my `/etc/portage/sets/base`: +```bash +app-admin/doas +app-admin/stow +app-editors/neovim +app-shells/dash +app-shells/zsh +dev-vcs/git +app-misc/vifm +net-misc/ntp +``` + +I can install everything from this set with `emerge --ask --verbose @base`. Or if I want to install everything development-related, I can just install `@development` set. As easy as it gets! + +This way I can categorize my packages by purpose, compilation time, shared libraries, *etc*. Each package can belong to many sets. And most importantly, package set is **just a plaintext file**! You can manually edit it, you can store it under `git`, and you can share it across your workstations. + +Since portage is fully configurable via plaintext files, the same works for USE flags, keywords, accepted keywords and licenses. + diff --git a/blog/index.md b/blog/index.md index a2951b9..e3c2d1f 100644 --- a/blog/index.md +++ b/blog/index.md @@ -4,6 +4,7 @@ ### April +- [Running Gentoo :gentoo: on multiple workstations](2022-04-17.md) - [DWM - useless gaps are useless!](2022-04-02.md) ### March diff --git a/public/emoji/gentoo.png b/public/emoji/gentoo.png Binary files differnew file mode 100644 index 0000000..d5e5ad1 --- /dev/null +++ b/public/emoji/gentoo.png |