Skip to content
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

Add the os repository documentation #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
73 changes: 73 additions & 0 deletions pages/dev/ISO_Builder.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Image Builder
description: How Rhino Linux builds its images
---

## Building Workflow

Inside the `rhino-linux/os` repository is where the production-ready images are made. While it is possible for manual building of each different architecture (e.g. `arm64`) and type (e.g. `pinetab`),
this is time consuming, so the team can schedule a GitHub Workflow that builds all images in a efficiently and repeatable manner.
Images are built from scratch thanks to the Debian's [`live-build`](https://salsa.debian.org/live-team/live-build) tool in a automated fashion thanks to shell scripts.

## How to get started building Rhino Linux images

> [!IMPORTANT]
> This can only be done with the latest release of Ubuntu and derivatives such as Rhino Linux


First, make sure the proper dependencies are installed:
```sudo apt-get update && sudo apt-get install --reinstall debootstrap mtools dosfstools qemu-user-static binfmt-support dpkg-dev git
```

The repository can be cloned into by Git:
```git clone https://github.com/rhino-linux/os.git && cd ./os
```

Next to install the live build dependency:
```sudo dpkg -i debs/live-build_*_all.deb
```

Unfortunately, live-build has to be patched to support Ubuntu `devel` archives so multiple commands have to be run:

```sudo mv /usr/share/debootstrap/functions functions && sudo patch -i 0002-remove-WRONGSUITE-error.patch && sudo mv functions /usr/share/debootstrap/functions && sudo cp binary_grub-efi /usr/lib/live/build/binary_grub-efi
```

The last step to get the repository running is making the scripts executable:
```chmod -R +x build.sh etc/auto/config etc/terraform.conf etc/
```

Finally, images can be made:
```sudo ./build.sh etc/terraform.conf
```

The resulting binary is found under `builds/[architecture]` where `[architecture]` is most commonly `amd64`

## [Repository Structure](https://github.com/rhino-linux/os)

```.
├── 0002-remove-WRONGSUITE-error.patch -> for devel apt archives
├── binary_grub-efi -> Modified grub script for RL
├── build.sh -> Main build script
├── debs
│   └── live-build_20220505_all.deb -> Modified for RL
├── etc
│   ├── auto
│   │   └── config -> Is used to setup live-build
│   ├── config
│   │   ├── bootloaders -> Stores Bootloader configurations
│   │   │   ├── grub-pc -> Is used in UEFI boot
│   │   │   └── isolinux -> Is used in BIOS instead of Grub
│   │   ├── hooks
│   │   │   └── live -> Each step (script) that live-build runs incrementally from 000 to 999
│   │   ├── includes.binary -> Media information
│   │   ├── includes.chroot -> Files that are directly included in media
│   │   └── package-lists.calamares -> Calamares installer packages
│   │   ├── desktop.list.chroot_install -> Apt packages to install onto disk
│   │   ├── desktop.list.chroot_live -> Packages only necessary while booting off a disk image (live boot)
│   │   └── pool.list.binary -> Packages on media (mostly firmware)
│   └── terraform.conf -> RL specific distribution information (shouldn't needed to be changed)
├── LICENSE
├── README.md
├── rebuild-list -> Don't worry about this file
└── ub2r.sh -> Script that converts Ubuntu into Rhino Linux
```
1 change: 1 addition & 0 deletions pages/dev/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"pacstall-101": "Pacscript 101",
"hotfix-101": "Creating Hotfixes",
"ubxi": "UBXI",
"ISO_Builder": "Image Builder",
"wiki": "Wiki Page Tips"
}