This repo will contain the necessary files, steps, and dependencies required to make a stage4 that is compatible with Magix Linux. In theory any Gentoo stage3 or stage4 will work, with minimal to no changes, but this will also be a good starting point if you want to make your own (or if I forget how to make them, I can always come back)
A Linux-based distribution, PREFERABLY one with the arch-chroot in its repos, not a problem if there is none. Also do note that you CAN ONLY make stage4s for your computer architecture, or at least from my limited knowledge.
A stage3, that you can download from here : Downloads – Gentoo Linux
And the most important thing is to have fun ^-^
Here in Magix corp, we rarely judge you for your choice of software, and your init is no exception. Instructions for both openrc and systemd will be provided, and the differences will be highlighted. Keep in mind that everything can be tailored to your liking. So go wild!
NoX11 (or NoX) will refer to a stage4 without a DE or WM, just a tty and basic tools. This will logically be the smallest one, and fastest to make, as it will be similar to the base stage3. We will be using the non-desktop stage3 as a base because why not. Sufficient permissions are assumed here !
- Step 1: Extract stage3 to Build directory using
tar xpvf path/to/stage3.tar.xz --xattrs-include='*.*' --numeric-owner Builddir
- Step 2: From now on, we will assume being inside the Builddir, unless otherwise mentioned:
cp --dereference /etc/resolv.conf etc/
- Step 3:
arch-chroot .
or Ignore the warning, we know - Step 3 ALT: if for some reason you cant use arch-chroot, use this
mount --types proc /proc proc
mount --rbind /sys sys
mount --make-rslave sys
mount --rbind /dev dev
mount --make-rslave dev
mount --bind /run run
mount --make-slave run
chroot . /bin/bash
- Step 4:
source /etc/profile
- Step 5: We now execute
emerge-webrsync
and select a profile fromeselect profile list
usingeselect profile set <number>
(in this case,default/linux/amd64/23.0 (stable)
) - Step 6: We add (temporarily)
ACCEPT_LICENSE="*"
MAKEOPTS="-jX -lY"
to /etc/portage/make.conf , according to the Gentoo Handbook : For X :A good choice is the smaller of: the number of threads the CPU has, or the total amount of system RAM divided by 2 GiB. For Y : just X but slightly bigger, generally by 1 - Step 7: We also add some custom use flags, i will use networkmanager as an example here
USE="networkmanager"
, you can also play around with other variables such as L10N, VIDEO_CARDS and others, but we will stick with the basics for now. - Step 8: While we prefer an English stage4 by default, if something else is needed, check Installing the Gentoo base system - Gentoo wiki
- Step 9: Now we do a world update, this way the user wont end up with outdated packages upon installing, even if they refuse to update :
emerge -avuDN @world
- Step 10: We enable dracut and grub support for dist kernels by adding
sys-kernel/installkernel dracut grub
to/etc/portage/package.use/installkernel
- Step 11: This is where editions WILL differ, so we will start with mandatory packages to install, and give examples of optional ones ^-^,
emerge -aq app-portage/cpuid2cpuflags app-portage/gentoolkit app-admin/sudo sys-block/io-scheduler-udev-rules sys-kernel/dracut sys-fs/genfstab sys-kernel/installkernel sys-boot/grub
If for whatever reason you want to use GRUB with an “exotic” target firmware , refer to this page GRUB - Gentoo wiki but for the most part, the defaults are good. - Step 12:OpenRC Now for some optional packages that IMO should be added ^^ but without em, the installer will NOT break
emerge -aq app-admin/sysklogd sys-process/cronie sys-apps/mlocate net-misc/chrony
and we enable the services withrc-update add sysklogd default && rc-update add cronie default && rc-update add chronyd default
- Step 12:SystemD In the case of systemd, most of these features are built in, so we need to only enable
systemctl enable systemd-timesyncd.service
- Step 13: For both systemd and openrc i suggest installing
app-shells/bash-completion dev-vcs/git
and anything else you deem fit, have fun here !! - Step 14: using
visudo
we configure sudo to allow people from the wheel group to execute commands WITH a password. Un-comment this line%wheel ALL=(ALL:ALL) ALL
. - Step 15: Copy ./misc/os-release to
/etc/os-release
to get Magix branding and Logo in fetch programs. - Step 16: We remove temp files using
eclean-pkg && eclean-dist
and deleting/var/cache/distfiles /tmp /var/tmp /root/.bash-history
and whatever you see fit - Step 17: And now, we
exit
from the chroot, go back a step (or even better, go homecd \~
) andumount -R Builddir/
VERY IMPORTANT STUFF overwise the stage4 will contain the content of all your hard drives. not the smartest thing to do IMO. and then dorm -rfv Builddir/dev/*
AFTER THE FIRST COMMAND. OTHERWISE DATA WILL BE LOST - Step 18: Go back to the Builddir
cd Builddir
and dotar -c -v -I 'xz -9 -T0' -f path/where/you/want/to/save/the/stage4.tar.xz .
as a general rule of thumb, your naming of the file should bestage4-%init%-%desktop%-%quirk%-%creator%-%DDMMYYYY%.tar.xz
and by quirk I mean what will make it different from another stage4 of the same nature both this, and the creator are optional. EX: ~stage4-openrc-xfce-freesoftware-bobelkassa-29082024.tar.xz~ if the stage4 doesn’t include a desktop, use nox11 or nox for short.
To have a KDE Plasma stage4, pick a different profile in Step 5 and do the same steps as NoX11 up until Step 13 where you make these modifications:
- Step A: Install the base Plasma desktop package
kde-plasma/plasma-meta gui-libs/display-manager-init
and I also recommend installing at least a browser, dolphin, and konsolewww-client/firefox:esr kde-apps/dolphin kde-apps/konsole
- Step A.1: Optionally, and if you have the patience and hardware, also install
kde-apps/kde-apps-meta
according to KDE - Gentoo wiki. And other packages however you see fit! - Step B: Edit
/etc/conf.d/display-manager
and replacexdm
withsddm
- Step C: Run
rc-update add display-manager default
for OpenRC andsystemctl enable sddm.service
for SystemD - Step D: Enable udev
rc-update add udev sysinit
and elogindrc-update add elogind boot
for OpenRC. As for Systemd you do not need to do anything of the sort.
And the rest is done the exact same way!
- Step A: Install
gnome-base/gnome
for the full GNOME experience orgnome-base/gnome-light
to have a minimal install. It’s also suggested to edit/etc/portage/package.use/nautilus
and addgnome-base/nautilus -previewer
and add-gnome-online-accounts
to your Useflags to avoid pullingnet-libs/webkit-gtk
as it takes a lot of time to compile.
- Step B: Install
gui-libs/display-manager-init
, edit/etc/conf.d/display-manager
and replacexdm
withgdm
. - Step C: Run
rc-update add display-manager default
for OpenRC andsystemctl enable sddm.service
for SystemD - Step D: Enable udev
rc-update add udev sysinit
and elogindrc-update add elogind boot
for OpenRC. As for Systemd you do not need to do anything of the sort.