• Stars
    star
    207
  • Rank 189,769 (Top 4 %)
  • Language
    Rust
  • License
    GNU Lesser Genera...
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Installer Backend

distinst

Distinst is a Rust-based software library that handles Linux distribution installer installation details. It has been built specifically to be used in the construction of Linux distribution installers, so that installers can spend more time improving their UI, and less time worrying about some of the more complicated implementation details, such as partition management & encryption.

Frontends

At the moment, elementary's installer is the primary target for distinst. However, distinst also ships with a CLI application (also called distinst) that serves as a fully-functioning test bed for the distinst library. Example scripts exist within the tests directory to demonstrate how the CLI can be used to perform installs using files from the Pop! ISO.

CLI

GTK

Capabilities

Disk Partitioning & Formatting

Distinst provides a Rust, C, and Vala API for probing disk and partition information, as well as the ability to create and manipulate partitions. In addition to partitioning the disk via the libparted bindings, distinst will also handle disk partitioning using mkfs, provided that you have installed the corresponding packages for each file system type that you want to support in your installer. LUKS & LVM configurations are also supported, and may be configured after configuring your physical partitions.

Implementors of the library should note that distinst utilizes in-memory partition management logic to determine whether changes that are being specified will be valid or not. Changes specified will be applied by distinst during the install method, which is where you will pass your disk configurations into. This configuration will be validated by distinst before any changes are made.

Rust Example

See the source code for the distinst CLI application.

Vala Example

if (disk.mklabel (bootloader) != 0) {
    stderr.printf ("unable to write GPT partition table to /dev/sda");
    exit (1);
}

var efi_sector = Sector() {
    flag = SectorKind.MEGABYTE,
    value = 512
};

var start = disk.get_sector (Sector.start());
var end = disk.get_sector (efi_sector);

int result = disk.add_partition(
    new PartitionBuilder (start, end, FileSystem.FAT32)
        .set_partition_type (PartitionType.PRIMARY)
        .add_flag (PartitionFlag.ESP)
        .set_mount ("/boot/efi")
);

if (result != 0) {
    stderr.printf ("unable to add EFI partition to disk");
    exit (1);
}

start = disk.get_sector (efi_sector);
end = disk.get_sector (Sector.end ());

result = disk.add_partition (
    new PartitionBuilder (start, end, FileSystem.EXT4)
        .set_partition_type (PartitionType.PRIMARY)
        .set_mount ("/")
);

if (result != 0) {
    stderr.printf ("unable to add / partition to disk");
    exit (1);
}

Disks disks = Disks.with_capacity (1);
disks.push (disk);
installer.install (disks, config);

Extracting, Chrooting, & Configuring

The implementor of the library should provide a squashfs file that contains a base image that the installer will extract during installation, as well as the accompanying .manifest-remove file. These can be found on the Pop!_OS ISOs, as an example. Once this image has been extracted, the installer will chroot into the new install and then configure the image using the configuration script located at src/configure.sh.

Bootloader

Based on whether the image is running on a system that is EFI or not, the bootloader will be configured using either systemd-boot or GRUB, thereby allowing the user to be capable of booting into install once the system is rebooted.

Build Instructions

In order to build distinst on Pop!, you will need to follow these instructions:

# Install dependencies
sudo apt build-dep distinst

# Build in debug mode
# make all DEBUG=1

# Build in release mode
make

# Install in release mode
sudo make install prefix=/usr

# Install in debug mode
# sudo make install prefix=/usr DEBUG=1

# Uninstall
sudo make uninstall

The following files will be generated:

  • CLI app: target/release/distinst
  • Library: target/release/libdistinst.so
  • Header: target/include/distinst.h
  • pkg-config: target/pkg-config/distinst.pc

These files will be placed in /usr/local when installed, and pkg-config --cflags distinst or pkg-config --libs distinst can then be used to find them.

In order to produce a source package, you must run the following commands:

# Install cargo-vendor
cargo install cargo-vendor

# Download vendored sources
make vendor

More Repositories

1

shell

Pop!_OS Shell
TypeScript
4,276
star
2

cosmic-epoch

Next generation Cosmic desktop environment
Just
2,766
star
3

pop

A project for managing all Pop!_OS sources
Rust
2,128
star
4

cosmic-text

Pure Rust multi-line text handling
Rust
1,571
star
5

cosmic

Computer Operating System Main Interface Components
JavaScript
1,066
star
6

gtk-theme

System76 Pop GTK+ Theme
SCSS
747
star
7

system76-scheduler

Auto-configure CFS and process priorities for improved desktop responsiveness
Rust
540
star
8

popsicle

Multiple USB File Flasher
Rust
520
star
9

system76-power

System76 Power Management
Rust
512
star
10

cosmic-comp

Compositor for the COSMIC desktop environment
Rust
466
star
11

iso

Pop!_OS ISO production
Makefile
439
star
12

libcosmic

WIP library for COSMIC applications
Rust
416
star
13

cosmic-term

WIP COSMIC terminal emulator
Rust
366
star
14

beta

Pop!_OS Beta
353
star
15

keyboard-configurator

Keyboard configuration UI
Rust
231
star
16

cosmic-edit

COSMIC Text Editor
Rust
225
star
17

launcher

Modular IPC-based desktop launcher service
Rust
203
star
18

tensorman

Utility for easy management of Tensorflow containers
Rust
190
star
19

cosmic-applets

WIP applets for cosmic-panel
Rust
174
star
20

icon-theme

System76 Pop icon theme for Linux
Python
169
star
21

firmware-manager

Generic framework and GTK UI for firmware updates from system76-firmware and fwupd, written in Rust.
Rust
163
star
22

cosmic-settings

COSMIC Settings
Rust
151
star
23

wallpapers

Wallpapers for Pop!_OS
Makefile
149
star
24

cosmic-panel

WIP
Rust
110
star
25

nvidia-graphics-drivers

Pop!_OS NVIDIA Graphics Drivers
110
star
26

cosmic-launcher

WIP
Rust
102
star
27

system76-driver

System76 Driver for Pop!_OS
Python
101
star
28

cosmic-files

WIP COSMIC file manager
Rust
93
star
29

upgrade

Utility for upgrading Pop!_OS and its recovery partition to new releases.
Rust
90
star
30

cosmic-time

Animation Library for https://github.com/iced-rs/iced and https://github.com/pop-os/cosmic-epoch
Rust
86
star
31

gnome-shell-extension-system76-power

System76 Power Management Extension
TypeScript
74
star
32

cosmic-store

WIP COSMIC app store
Rust
72
star
33

system76-firmware

System76 Firmware Tool and Daemon
Rust
71
star
34

fonts

Fonts for the System76 Pop look, Fira and Roboto Slab
Makefile
68
star
35

cosmic-dock

Pop!_OS fork of https://github.com/micheleg/dash-to-dock/tree/ubuntu-dock
JavaScript
68
star
36

pop-arm64

Experimental scripts for building an Pop!_OS for ARM64 EFI platforms.
Shell
67
star
37

tiler

Generic tiling window manager library in Rust
Rust
65
star
38

cosmic-session

Session manager for the COSMIC desktop environment
Rust
65
star
39

core

WIP immutable base
Rust
56
star
40

cosmic-applibrary

WIP
Rust
55
star
41

shell-shortcuts

Application for displaying and demoing Pop Shell shortcuts
Rust
53
star
42

debrepbuild

A project for automatically generating and maintaining Debian repositories from a TOML spec.
Rust
53
star
43

cosmic-greeter

libcosmic greeter for greetd, which can be run inside cosmic-comp
Rust
50
star
44

theme

A metapackage including pop-fonts, pop-gtk-theme, and pop-icon-theme
42
star
45

desktop-widget

Pop Desktop Settings Widget
Fluent
41
star
46

touchegg

Pop!_OS fork of https://github.com/JoseExposito/touchegg
C++
36
star
47

async-fetcher

Rust crate for asynchronous file fetching, using optional fetching based on modified times and checksums
Rust
36
star
48

system76-dkms

System76 DKMS driver
C
36
star
49

sys-mount

High level FFI binding around the sys mount & umount2 calls, for Rust
Rust
36
star
50

url-scraper

Rust crate for scraping URLs from HTML pages
Rust
36
star
51

cosmic-wallpapers

Wallpapers for the COSMIC Desktop Environment
Makefile
36
star
52

gnome-shell-theme

The GNOME Shell theme for Pop!_OS
CSS
35
star
53

xdg-desktop-portal-cosmic

Rust
35
star
54

default-settings

Distribution Default Settings
Shell
35
star
55

cosmic-workspaces

Pop!_OS fork of https://github.com/RensAlthuis/vertical-overview
JavaScript
35
star
56

cosmic-app-template

Project template for creating applications for the COSMICâ„¢ desktop
Rust
34
star
57

linux-firmware

Pop!_OS fork of https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-firmware
C
29
star
58

cosmic-reader

WIP COSMIC PDF reader
Rust
28
star
59

gnome-control-center

Pop!_OS fork of https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/gnome-control-center
C
27
star
60

bus-writer

Single-reader, multi-writer & single-reader, multi-verifier; broadcasts reads to multiple writeable destinations in parallel
Rust
27
star
61

website

The Pop!_OS website
Vue
27
star
62

system-updater

Systemd services for checking for and applying system updates.
Rust
27
star
63

pidfd

Rust crate providing Linux (>= 5.3) PID file descriptor support
Rust
27
star
64

cosmic-randr

Library and utility for displaying and configuring Wayland outputs
Rust
27
star
65

buildchain

Software for creating and managing a distributed and reproducible chain of builds
Rust
27
star
66

desktop

Desktop metapackage
25
star
67

cosmic-protocols

Addtional wayland-protocols used by the COSMIC desktop environment
Rust
25
star
68

cosmic-osd

Rust
25
star
69

cosmic-theme-editor

WIP
Rust
24
star
70

system76-oled

Control brightness on OLED displays
Rust
24
star
71

cosmic-player

WIP COSMIC media player
Rust
22
star
72

libparted

Rust wrappers for libparted
Rust
22
star
73

gnome-shell-extension-do-not-disturb

Enable or disable do not disturb mode.
JavaScript
21
star
74

gnome-shell

Pop!_OS fork of https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/gnome-shell
C
21
star
75

cosmic-workspaces-epoch

Rust
21
star
76

cosmic-screenshot

Utility for capturing screenshots via XDG Desktop Portal
Rust
21
star
77

theme-switcher

Pop!_OS GTK widget library / app for switching themes
Rust
20
star
78

cosmic-settings-daemon

Rust
20
star
79

progress-streams

Rust crate to extend io::Read & io::Write types with progress callbacks
Rust
19
star
80

freedesktop-desktop-entry

Rust crate for navigating Freedesktop desktop entries
Rust
19
star
81

cosmic-notifications

Rust
19
star
82

sysfs-class

Rust library for viewing /sys/class in an object-oriented format
Rust
18
star
83

system76-wallpapers

System76 Wallpapers
17
star
84

plymouth-theme

Plymouth splash screen themes
Shell
17
star
85

systemd-boot-conf

Rust crate for managing the systemd-boot loader configuration.
Rust
17
star
86

cosmic-bg

Rust
17
star
87

repo-release

Produces Pop release package repositories
Shell
16
star
88

dbus-udisks2

Rust library for interacting with the UDisks2 DBus API
Rust
16
star
89

cosmic-theme

WIP
Rust
16
star
90

libcosmic-book

Guide for starting development with libcosmic: https://pop-os.github.io/libcosmic-book/
16
star
91

system76-acpi-dkms

System76 ACPI Driver (DKMS)
C
15
star
92

gtk-extras

Rust crate containing an assortment of extra, unofficial GTK patterns, widgets, and traits.
Rust
13
star
93

as-result

Rust crate which provides the `AsResult<T, E>` and `IntoResult<T, E>` traits.
Rust
13
star
94

debarchive

Rust crate which provides direct access to files within a Debian archive
Rust
13
star
95

mutter-rs

Rust wrappers for Mutter and related projects
Rust
13
star
96

proc-mounts

Rust crate for fetching active mounts and swaps on a Linux system
Rust
13
star
97

os-release

Rust crate for parsing the /etc/os-release file, common with Linux distributions
Rust
13
star
98

iced-sctk

WIP
Rust
12
star
99

grub-theme

Grub bootloader theme
12
star
100

cog-stable-diffusion

Packaging for convenience of installation and setup of stable diffusion on Pop
Python
12
star