description = "This article will go over the installation guide for the distro"
date = 2025-01-30
trigger = "TylkoLinux is still in experimental stage, and you should only install it if you know what you're doing. We do not take responsibility for any bricked machine as a result of not following the guide."
disclaimer = """
Do not follow this article. This page is NOT done yet.
Run the compatibility check by running the script that is inside of the repository:
```bash
chmod +x ./version-check.sh && ./version-check.sh
```
Make sure everything is successful. If not, update your packages.
## S3: Partitioning the target device
Now that we have the installer ready, let's not run it just yet!
First, we need to __partition the drive we want to install it to.__
Now, of course, there are a lot of guides on how to do that online and depending on what setup you might want to achieve.
What IS clear though, is that you need a boot partition and a root partition, those are the bare minimum.
Obviously, I won't be able to write an ENTIRE guide on how to partiton your drive. If you don't know how to do that in the first place, then you shouldn't use TylkoLinux.
## S4: Setting the $LFS variable
Set the $LFS variable to point to /mnt/lfs. Of course, if you desire, you may also make it point to a different destination.
```bash
export LFS=/mnt/lfs
```
{% alert(caution=true) %}
Make sure that the $LFS variable always points to the correct destination.
It is recommended to always mount the target root partition under /mnt/lfs and set your variable to that.
Failure to do so may lead you to absolutely fuck up your system.
{% end %}
{% alert(tip=true) %}
From the LFS handbook:
One way to ensure that the LFS variable is always set is to edit the .bash_profile file in both your personal home directory and in /root/.bash_profile and enter the export command above. In addition, the shell specified in the /etc/passwd file for all users that need the LFS variable must be bash to ensure that the /root/.bash_profile file is incorporated as a part of the login process.
Another consideration is the method that is used to log into the host system. If logging in through a graphical display manager, the user's .bash_profile is not normally used when a virtual terminal is started. In this case, add the export command to the .bashrc file for the user and root. In addition, some distributions use an "if" test, and do not run the remaining .bashrc instructions for a non-interactive bash invocation. Be sure to place the export command ahead of the test for non-interactive use.
{% end %}
## S5: Mounting the partitions
Create the mount point and mount the filesystem using the following commands:
```bash
mkdir -pv $LFS
mount -v -t ext4 /dev/<foo> $LFS
# Replace <foo> with the partition name.
```
If using multiple partitions for TylkoLinux (for example, one for the root and one for the home partition), mount them as followed:
```bash
mkdir -pv $LFS
mount -v -t ext4 /dev/<xxx> $LFS
mkdir -v $LFS/home
mount -v -t ext4 /dev/<yyy> $LFS/home
# Replace <foo> and <bar> with the appropriate partition names.
```
{% alert(caution=true) %}
The instructions above assume that you are not rebooting your computer during the build. (imagine)
To automatically remount the partition on boot, modify /etc/fstab by adding this line:
```bash
/dev/<foo> /mnt/lfs ext4 defaults 1 1
```
If you use additional (optional) partitions, add them as well.
{% end %}
If also using swap, mount with the swapon command:
```bash
/sbin/swapon -v /dev/<owo>
# Replace <owo> with the name of the swap partition.
```
### S5.1: Move bash.bashrc out of the way
Several commercial distributions add an undocumented instantiation of /etc/bash.bashrc to the initialization of bash. This file has the potential to modify the lfs user's environment in ways that can affect the building of critical TylkoLinux (LFS) packages. To make sure the lfs user's environment is clean, check for the presence of /etc/bash.bashrc and, if present, move it out of the way. As the root user, run:
Enter the LFS environment to build the cross toolchain and temporary tools by entering the following:
```bash
einrichter> einrichter.installer.SafeUser
```
### S7.1: Going through pending steps
You are about to build a cross toolchain and temporary tools. You're going to see the following:
```bash
Einrichter is designed to work as an install script where you can resume where you left off. Do NOT skip anything if you have not ran the step yet.
Pending step: Setting up environment. Run, skip or quit?
```
Either type R to run, S to skip or Q to quit.
Do the same for the other remaining quesitons:
```bash
Pending step: Setting up toolchain. Run, skip or quit? R
Pending step: Installing cross toolchain and packages. Run, skip or quit? R
```
And eventually...
```bash
Done!
[i] Completed!
[i] Finished section installer.SafeUser
einrichter>
```
Before you know it, you're done!
Now HERE begins the real work (insert lqtroll emoji)
## S8: Actually building the system itself
{% alert(tip=true) %}
Before proceeding with the build,
One way to ensure that the LFS variable is always set is to edit the .bash_profile file in both your personal home directory and in /root/.bash_profile and enter the export command above. In addition, the shell specified in the /etc/passwd file for all users that need the LFS variable must be bash to ensure that the /root/.bash_profile file is incorporated as a part of the login process.
Another consideration is the method that is used to log into the host system. If logging in through a graphical display manager, the user's .bash_profile is not normally used when a virtual terminal is started. In this case, add the export command to the .bashrc file for the user and root. In addition, some distributions use an "if" test, and do not run the remaining .bashrc instructions for a non-interactive bash invocation. Be sure to place the export command ahead of the test for non-interactive use.
{% end %}
Now that you finished that section, enter the chroot environment like this:
```bash
einrichter> einrichter.installer.chroot
```
This command changes ownership of the commands under $LFS from the user `lfs` to `root`
It also mounts the virtual kernel file systems.
Then, it chroots you into the bash shell. Continue the installer by running the following command inside of the chroot:
If after running eic.essentials.verify, the packages have not been installed, try to troubleshoot the actual package that failed to install and try again.
GCC, due to its nature of taking so long to build, gets its own function:
```bash
einrichter/eic> eic.system.build.gcc
```
Continue building as if nothing happened
```bash
einrichter/eic> eic.system.build.continue
```
### S8.1: Strip system (optional)
Done after so long? If you don't plan on doing any debugging on the system software/aren't that much of a programmer, you can remove debugging symbols and unnecessary symbol table entries from binaries and libraries.
This frees up about 2GB(?) on the system.
To do so, run the following:
```bash
einrichter/eic> eic.strip
```
### S8.2: Cleaning up
Finally, after all of that, clean up extra leftovers and the tester account by running this command:
```bash
einrichter/eic> eic.system.build.clean
```
## S9: Setting up the system
You are now in the stage where you set up your system and actually make an attempt at making your system bootable!
### S9.1: Networking
(This section only applies if a network card is to be configured.)
#### S9.1.1: Network Device Naming
{% alert(tip=true) %}
Modified from the LFS handbook: The interface names depend on the implementation and configuration of the udev daemon running on the system. The udev daemon for TylkoLinux (well, LFS) (systemd-udevd) will not run unless the TylkoLinux/LFS system is booted. So it's unreliable to determine the interface names being used in the TylkoLinux system by running those commands on the host distro, even though you are in the chroot environment.
{% end %}
Udev normally assigns network card interface names based on physical system characteristics such as enp2s1. If you are not sure what your interface name is, you can always run `ip link` after you have booted your system.
For most systems, there is only one network interface for each type of connection. For example, the classic interface name for a wired connection is eth0. A wireless connection will usually have the name wifi0 or wlan0.
If you'd like to use classic/customised network names, run the following function and enter the demanded information:
```bash
einrichter/eic> eic.config.network.devicenaming
[i] Enter MAC address of desired device: SN:UG:N0:0K:FR
[i] Enter the desired name of your interface: nasaethernet1
# Those are examples, not things you should actually enter!! Replace those with the actual info
```
#### S9.1.2: Static IP configuration
This makes a basic config file for a Static IP setup
```bash
einrichter/eic> eic.config.network.staticip
[i] Enter the name of the configured interface: nasaethernet1 # example
[?] Add DNS? If no, type N. If yes, type DNS address.
> Y # example
[?] Add domain? If no, type N. If yes, type domain name.
> N # example
[i] Skipped domain addition. # example
```
#### S9.1.3: DHCP configuration
```bash
einrichter/eic> eic.config.network.dhcp
[i] Enter the name of the configured interface: itsthesamethingagain0 # example
```
#### S9.1.4: /etc/resolv.conf
{% alert(tip=true) %}
From the LFS handbook: If using methods incompatible with systemd-resolved to configure your network interfaces (ex: ppp, etc.), or if using any type of local resolver (ex: bind, dnsmasq, unbound, etc.), or any other software that generates an /etc/resolv.conf (ex: a resolvconf program other than the one provided by systemd), the systemd-resolved service should not be used.
To switch settings about whether this should be allowed or not, run the command below ↓
~~Remind me to work on this section.~~ Call me lazy (please don't), but to get over this guide a tiny tiny bit faster, I recommend you to google (or otherwise look up) "how to set up etc hosts". Usually it's managed by systemd I think? (obv unless you disabled it)
### S9.2: System time
You can tell the system whether your hardware clock is set to local time or UTC.
Either run:
// When in chroot,
```bash
einrichter/eic> eic.config.time.createAdj
```
// When in a booted system,
```bash
einrichter/eic> eic.config.time.clarifyUTC
```
Either can be set back to nothing by either deleting /etc/adjtime
```bash
einrichter/eic> rm /etc/adjtime
```
or by using timedatectl
```bash
timedatectl set-local-rtc 0
```
To interactively change the system time (when in a booted system ofc)
do:
```bash
einrichter/eic> eic.config.time.set
```
then respond to the questions.
To set the timezone on a running system, run the following:
```bash
einrichter/eic> eic.config.time.tz <TZ>
# replace <TZ> with the timezone
```
To get the list of timezones in the first place, do:
```bash
timedatectl list-timezones
```
In systemd 216 and up, the network time synchronisation service is enabled by default. **If you want, disable/enable it like this:**
Replace <foo> and <bar> with the appropriate values, don't add the swap line if you didn't make a swap partition.
Replace <owo> with the filesystem type
For any additional configuration, check this page: https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter10/fstab.html
### S10.2: BOOTING LINUX!!!!
Don't get excited too yet, we need to verify something.
```bash
cd /sources/linux/
ls -a | grep .config
```
If you see the .config file, we can continue. If not, don't run this step, exit out of the Einrichter-in-chroot.sh script to go back to the Einrichter-CLI.sh script. After that, run:
```bash
einrichter> einrichter.add.linuxConfig
```
Alright, we can continue. RUN THE FOLLOWING:
```bash
einrichter/eic> eic.linux.install
```
Later it will ask you this:
```bash
[i] Mount boot partition? <Y/N>:
```
Say yes if you want the kernel to be in the boot partition instead of the root one. Otherwise, **no.**
[This page shows instructions on installing GRUB.](https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter10/grub.html)
Not needed of course, if you want to tweak your current GRUB to also detect other OSes, add this to your /etc/default/grub (on the host machine)
``GRUB_DISABLE_OS_PROBER=false``
Update the GRUB config with the respective command.
### S10.4: Package management
Need a package manager? Install RPM:
```bash
einrichter/eic> eic.rpm.install
```
To install tdnf, vmware's implementation of DNF, do:
```bash
einrichter/eic> eic.tdnf.install
```
If you want to add more packages to your system, including NetworkManager, run:
```bash
einrichter/eic> eic.plus
```
## S11: The End:tm:
Well, you made it! Congrats on installing the basics of TylkoLinux... If you want, you can also mark your installation as a TylkoLinux one by running this: