Skip to content

feat(rdms): document readymade stack #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
"type": "page",
"display": "hidden"
},

"submarine": {
"title": "Submarine",
"type": "page",
"display": "hidden"
},
"rdms": {
"title": "Readymade Stack",
"type": "page",
"display": "hidden"
}
}
7 changes: 6 additions & 1 deletion pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Cards, Card } from "nextra/components";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAtom, faBox, faBowlFood, faAnchor, faHammer } from "@fortawesome/free-solid-svg-icons";
import { faAtom, faBox, faBowlFood, faAnchor, faHammer, faDownload } from "@fortawesome/free-solid-svg-icons";

# Welcome

Expand Down Expand Up @@ -36,6 +36,11 @@ If you'd like to contribute, check out the [GitHub repository](https://github.co
title="Katsu"
href="/katsu"
/>
<Card
icon={<FontAwesomeIcon icon={faDownload} />}
title="Readymade Stack"
href="/rdms"
/>
</Cards>
## Community

Expand Down
5 changes: 5 additions & 0 deletions pages/rdms/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"index": "Introduction",
"rdm": "Readymade",
"tdn": "Taidan"
}
24 changes: 24 additions & 0 deletions pages/rdms/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Readymade Stack Developer Documentations

This wiki contains **developer** documentations for the
Readymade Stack (e.g. [Readymade], [Taidan], etc.). For user
documentations, consult the Ultramarine wiki instead.

## Keyword Glossary

- [Readymade]: Installer for UM41+
- [Taidan]: OOBE app for UM41+
- [Anaconda]: Fedora installer (the rhinstaller stack)
- [initial-setup]: Fedora OOBE app (rhinstaller)
- [umstellar]: Formerly planned catalogue app for up to UM40
- [systemd-repart]: systemd-repart creates partition tables, and adds or grows partitions (see [repart.d(5)]).
It is the main backend used by Readymade.


[Readymade]: https://github.com/FyraLabs/readymade
[Taidan]: https://github.com/Ultramarine-Linux/taidan
[Anaconda]: https://github.com/rhinstaller/anaconda
[initial-setup]: https://github.com/rhinstaller/initial-setup
[umstellar]: https://github.com/Ultramarine-Linux/stellar
[systemd-repart]: https://man.archlinux.org/man/systemd-repart.8
[repart.d(5)]: https://man.archlinux.org/man/repart.d.5.en
115 changes: 115 additions & 0 deletions pages/rdms/rdm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Readymade

[Readymade] is the new installer for Ultramarine Linux 41 and above. It is written in Rust and
[libhelium] and comes with a custom backend based on systemd-repart.

It is created due to frustrations (again!) with Red Hat's Anaconda installer, after we have
received many complaints about the poor UX design of Anaconda, and the lack of working
alternative installers for RPM-based distributions. It also adds support for other kinds of
hardware, including Chromebooks, in response to the [Ultramarine Anywhere Initiative].

## Building

You may view the most updated building instructions in the [CI spec file](https://github.com/FyraLabs/readymade/blob/main/ci/readymade.spec).

Build dependencies:

```
cargo
clang-devel
cmake
gcc
gettext-devel
pkgconfig(libhelium-1)
pkgconfig(libgnome-desktop4)
```

Dependencies: (according to `dnf rq --providers-of=requires readymade`)
```
cairo
cairo-gobject
efibootmgr
gdk-pixbuf2
glib2
glibc
glibc
gnome-desktop4
graphene
gtk4
harfbuzz
libgcc
libhelium
pango
pkexec
vulkan-loader
xz-libs
```

And optionally, `submarine` (for Chromebook installations).

## Configurations

Configurations are read from `/etc/readymade.toml`, or a path specified by the `READYMADE_CONFIG` envvar.

Some example configuration files for Ultramarine are in `templates/`.

## Running

There are also extra PolicyKit rules to skip password prompts for `pkexec` to escalate the process as root.
Copy the `com.fyralabs.pkexec.readymade.policy` file to `/usr/share/polkit-1/actions/` and restart the PolicyKit service.

In development, it may be useful to specify options to the binary, such as the configuration file path, or the log level. You can do this by setting supported environment variables.

For example, to run with tracing and the ultramarine-chromebook template, run the following command:

```sh
READYMADE_LOG=trace READYMADE_CONFIG=templates/ultramarine-chromebook.toml cargo run
```

You can also set `READYMADE_DRY_RUN` to configure if whether the install is a dry-run, this will cause an installation failure.
Please note that this variable is set to `1` by default, within development builds.

Additionally, you may want to create a virtual disk to install to during development:

```sh
fallocate -l 8G test.img # Create a blank 8GB file
sudo losetup --partscan --show -f test.img # Attach the file to a free loop device, take note of the outputted device.
```

Note how loop devices become valid install targets within debug builds, select the one corresponding to the device noted in the prior commands.

## Debugging

Readymade currently defaults to the `error` log level. To set a custom log level, set `READYMADE_LOG`. For example `READYMADE_LOG=trace` will set the log level to trace, which is the most verbose level.
Readymade logs to stderr and to a temporary folder `/tmp/readymade-logsXXXXXX`, which contains the file `readymade.log`.
The logger is powered by `tracing-appender`.

It also logs to the systemd journal, so you can view the logs by running

```sh
journalctl _COMM=readymade # add -f to follow the logs
```

Readymade checks for Dracut's default `live-base` (in `/dev/mapper/live-base`) logical volume for the base filesystem to mount and copy from. This is usually generated with Dracut's live module. It then tries to mount the base filesystem from the logical volume and use the files from there as the source for the installer, **_as it assumes the running environment is a live CD environment generated by Dracut, thus it contains the original overlay filesystem in this exact location_**.

While you may expect it to mount a SquashFS, the default behaviour is to mount an overlay disk image generated _from_ the SquashFS. This is to prevent the SquashFS to be extracted twice, as the live module already mounts the SquashFS and turns it into a Device Mapper device.

If that somehow fails, it may try again and check for `/run/rootfsbase` as the source path, this is a fallback for Dracut live environments that have the SquashFS containing the live environment directly inside the SquashFS and not as a disk image inside the SquashFS.

Readymade will mount this location if possible, and if not, it will attempt to copy files from `/mnt/live-base` as the source path anyway.

You can however override this by setting the environment variable `REPART_COPY_SOURCE` to the path of the base filesystem to copy from. This makes use of systemd 255's new relative repart source feature.

In case you have an alternate root mounted at `/mnt/squash` from an external source (i.e a real filesystem or a mounted SquashFS image, or even an OCI image), add the environment variable `REPART_COPY_SOURCE=/mnt/squash` to the command line when running Readymade.

```sh
sudo REPART_COPY_SOURCE=/mnt/rootfs readymade
```

## Translations

You may translate Readymade to your language by visiting the [Fyra Labs Weblate](https://weblate.fyralabs.com/projects/tauOS/readymade/) instance.


[Readymade]: https://github.com/FyraLabs/readymade
[libhelium]: https://github.com/tau-OS/libhelium
Loading