Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Modern stage1 install?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Wewfus
n00b
n00b


Joined: 23 Mar 2024
Posts: 5

PostPosted: Thu Jan 23, 2025 5:43 pm    Post subject: Modern stage1 install? Reply with quote

Hello, I haven't run Gentoo since 2004 or so. I'm back and want to run through a classic "stage 1" install on my new laptop for fun. I found the Catalyst wiki entry after discovering stage1 files aren't provided anymore. It seems doable but I had some further questions before I get started and blow my entire weekend on this.

1) Kernel config

I found this helpful page for my laptop which includes a kernel config: https://wiki.gentoo.org/wiki/User:Holgersson/Lenovo_Thinkpad_T14s_(AMD)_Gen_1

I noticed a lot of things are being built as modules instead of being built-in. Is there any reason for this or did that user just prefer doing it that way? As far as I know this laptop has open drivers and I should be able to build them all in, right? I went with the AMD laptop to avoid the issue I've been having with Nivida workstation for years now.

2) GCC

I plan on using GCC. I know this will require building it multiple times which I don't care about. I'm just wondering if the steps have changed considerably since the old days when stage 1 installs were more common.

3) -bin packages

I'm seeing a lot of binary packages in the default install now. Kernel-bin, Rust-bin, and even Firefox-bin is in repos. There also seems to be a project now to offer all packages at -bin. How bad is something like Rust going to be to compile? Can I do it in 16-20GB of RAM without having to fall back to disk for extra space at compile time? I want to avoid the binary but I don't want to have swap at all. I'd prefer to avoid zswap/zram and friends if I can help it as well.

Why is rust-bin the default even in the default install path? Is it really that much of a time sink to compile it? How often will I be compiling it in normal use? As far as I can tell I only need it for my web browser.

4) "Modern" linux vs. pre-2010s Linux

I've been in *BSD land for over a decade now. Not really by choice. Is there anything else major that's changed since I was away? Why is OpenRC profile pulling in so much systemd stuff? Can I avoid most of systemd with USE flags or am I stuck with shims to have working desktop and input devices?

For what it's worth I plan to have basic X11 powered desktop running something like Openbox and dwm. No log-in manager (log-in from tty). Full disk encryption with detached headers+kernel on USB thumb drive. I'm guessing there is no way to have that without initramfs?

I do appreciate any replies. I'm trying to work my way through docs and posts but it's a lot of information to grok through and a "stage 1" install doesn't seem to be very common anymore.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1429
Location: Richmond Hill, Canada

PostPosted: Thu Jan 23, 2025 7:49 pm    Post subject: Reply with quote

Wewfus wrote:
plan to have basic X11 powered desktop running something like Openbox and dwm
If that is primary goal I see no reason to do it from stage1.

So for stage1 the real question is do you have to or you just want to. Nothing wrong with wanting to do it, it is fun and I am doing now. but it is unnecessary. I am doing it because I want to have small storage foot print for my catalyst stage4 build and take this chance to learn more about Portage.

if you have something let you to believe you have to, may be you can explain why, so we can see if those reason can be avoid if possible.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54747
Location: 56N 3W

PostPosted: Thu Jan 23, 2025 7:52 pm    Post subject: Re: Modern stage1 install? Reply with quote

Wewfus,

Wewfus wrote:
Hello, I haven't run Gentoo since 2004 or so. I'm back and want to run through a classic "stage 1" install on my new laptop for fun. I found the Catalyst wiki entry after discovering stage1 files aren't provided anymore. It seems doable but I had some further questions before I get started and blow my entire weekend on this.

1) Kernel config

I found this helpful page for my laptop which includes a kernel config: https://wiki.gentoo.org/wiki/User:Holgersson/Lenovo_Thinkpad_T14s_(AMD)_Gen_1

I noticed a lot of things are being built as modules instead of being built-in. Is there any reason for this or did that user just prefer doing it that way? As far as I know this laptop has open drivers and I should be able to build them all in, right? I went with the AMD laptop to avoid the issue I've been having with Nivida workstation for years now.

When a kernel module initalises, be it built as a loadable module or built into the kernel binary, all the things it needs must be available. That includes any firmware it needs to load.
When a module is built in, the firmware must be built it too. When its a loadable module, it loads after root is mounted, so the firmware can be loaded from /lib/firmware. That's the most compelling reason to build things as modules.
A run almost anywhere kernel can be almost fully modular. Its a lot of bloat on disk but unused modules should not be resident. They may load, find nothing to do then exit.

Wewfus wrote:
2) GCC

I plan on using GCC. I know this will require building it multiple times which I don't care about. I'm just wondering if the steps have changed considerably since the old days when stage 1 installs were more common.

The GCC build system bootstraps gcc, so every
Code:
emerge gcc
actually builds it three times.

Wewfus wrote:
3) -bin packages

I'm seeing a lot of binary packages in the default install now. Kernel-bin, Rust-bin, and even Firefox-bin is in repos. There also seems to be a project now to offer all packages at -bin. How bad is something like Rust going to be to compile? Can I do it in 16-20GB of RAM without having to fall back to disk for extra space at compile time? I want to avoid the binary but I don't want to have swap at all. I'd prefer to avoid zswap/zram and friends if I can help it as well.


Packages with suffix -bin are generally binaries provided by upstream.
Gentoo used a different mechanism for distributing binary packages. That's the BINHOST. To pull in Gentoo provided packages you need to configure the BINHOST then tell emerge to use it, with either the -g or -G option.

16-20G RAM will struggle to build big packages in tmpfs (all in RAM) most things will fit. You can put /var/tmp/portage onto HDD on a package by package basis.

Don't do 'no swap'. It does not stop swapping, it only deprives the kernel of one of mechanisms that in has for swapping.
The kernel will drop the code you would like to execute if it has to, then reload it later. That's swapping too.

Wewfus wrote:
Why is rust-bin the default even in the default install path? Is it really that much of a time sink to compile it? How often will I be compiling it in normal use? As far as I can tell I only need it for my web browser.

The bootstrap path for rust is very new to gentoo. It used to be that rust was needed to build rust, so you had to start with the -bin.
The rust that you can bootstrap may not be in Gentoo stable yet.
Rust is getting in everywhere now, not just web browsers.

Wewfus wrote:

4) "Modern" linux vs. pre-2010s Linux

I've been in *BSD land for over a decade now. Not really by choice. Is there anything else major that's changed since I was away? Why is OpenRC profile pulling in so much systemd stuff? Can I avoid most of systemd with USE flags or am I stuck with shims to have working desktop and input devices?

OpenRC does not pull in much systemd stuff. I think that there are about three small pieces abstracted from systemd. Then elogind, is a rewrite of logind.
I have none of this new fangled stuff. The old way still works.

Wewfus wrote:
For what it's worth I plan to have basic X11 powered desktop running something like Openbox and dwm. No log-in manager (log-in from tty). Full disk encryption with detached headers+kernel on USB thumb drive. I'm guessing there is no way to have that without initramfs?


I still use startx and I build xorg-server withe the USE=suid option, so it runs as root. That avoids the need to hide the setup things in some other software that must run as root.
You need user space tools to mount the root filesystem, so correct. An initrd is required. However, it can be a kernel module free initrd, so you make it work and leave it alone for the like of the hardware.

Wewfus wrote:
I do appreciate any replies. I'm trying to work my way through docs and posts but it's a lot of information to grok through and a "stage 1" install doesn't seem to be very common anymore.

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 458

PostPosted: Thu Jan 23, 2025 9:07 pm    Post subject: Reply with quote

I had a long post ready, but I guess I did not click "submit"? Anyway...

For the rust bootstrap, you need USE=mrustc-bootstrap, which is not on by default, might fail on clang and might fail on arm. Testing is appreciated. Also, the USE flag and mrustc are stable-masked.
That said, bootstrapping needs to build mrustc->rust 1.74->rust 1.75->...->rust-latest.
It also needs LLVM 17, LLVM 18 and LLVM 19.

I keep my entire /var/tmp on dist and compiling with LTO, with 4 threads needs up to 12GB as far as I know. I have 8GB RAM and as much swap. Though only gcc, LLVM, clang, rust and firefox end up touching swap.
Not even that, if I am not using the machine, so firefox is not taking up useful RAM.

systemd components that you "can't" avoid are systemd-udev and systemd-tmpfile.
Udev can be replaced with mdev, or even static /dev.
without-systemd overlay has additional alernatives.
Both systemd components are installed through systemd-utils, which is a collection of utilities from the systemd project, but buildable without the rest of the project.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum