distri

package module
v0.0.0-...-ef90cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

distri — a Linux distribution to research fast package management

CI

This repository contains distri, a linux distribution research project.

The contents form a proof-of-concept implementation of the simplest¹ linux distribution I can think of that is still useful². Interestingly enough, in some cases the simple solution has inherent advantages, which I explore and contrast in the articles released at https://michael.stapelberg.ch/posts/tags/distri/

  1. simple: while all the typical building blocks for a Linux distribution are present (a package builder, installer, tooling for creating patches, preparing package download mirrors, etc.), they all leave out many features. For example, the package format intentionally leaves out triggers and hooks, but can parallelize installation as a result.

  2. useful: I have successfully booted and used distri images on qemu, Google Cloud, a Dell XPS 13 notebook. This includes booting from an encrypted root file system and running Google Chrome on Xorg to watch Netflix, which I consider a proxy for having a useful system.

Note that due to its research project status, it is NOT RECOMMENDED to use distri in ANY CAPACITY except for research. Specifically, do not expect any support.

distri is published in the hope that other, more established distributions, will find some parts of it interesting and decide to integrate those.

For more details, please see my blog article “introducing distri”. You can subscribe to all distri-related posts by subscribing to https://michael.stapelberg.ch/posts/tags/distri/feed.xml.

Giving feedback

Please send feedback to the distri mailing list so that everyone can participate!

You can also talk to us by connecting to https://robustirc.net/ and joining the #distri channel. Please stick around for a while, not everyone is at their keyboard all the time :)

More information

Please see the distr1.org website for more information!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Architectures = map[string]bool{
	"amd64": true,
	"i686":  true,
	"arm64": true,
}

Architectures contains one entry for each known architecture identifier.

Functions

func HasArchSuffix

func HasArchSuffix(pkg string) (archIdentifier string, ok bool)

HasArchSuffix reports whether pkg ends in an architecture identifier (e.g. emacs-amd64) and returns the identifier.

func InterruptibleContext

func InterruptibleContext() (context.Context, context.CancelFunc)

InterruptibleContext returns a context which is canceled when the program is interrupted (i.e. receiving SIGINT or SIGTERM).

func LikelyFullySpecified

func LikelyFullySpecified(pkg string) bool

LikelyFullySpecified returns true if the provided pkg contains an architecture suffix in the middle, e.g. systemd-amd64-239.

func PackageRevisionLess

func PackageRevisionLess(filenameA, filenameB string) bool

PackageRevisionLess returns true if the distri package revision extracted from filenameA is less than those extracted from filenameB. This can be used with sort.Sort.

func RegisterAtExit

func RegisterAtExit(fn func() error)

func RunAtExit

func RunAtExit() error

Types

type PackageVersion

type PackageVersion struct {
	Pkg  string
	Arch string

	// Upstream is the upstream version number. It is never parsed or compared,
	// and is meant for human consumption only.
	Upstream string

	// DistriRevision is an incrementing integer starting at 1. Every time the
	// package is changed, it must be increased by 1 so that e.g. distri update
	// will see the package. Even if upstream versions change, the revision does
	// not reset. E.g., 8.2.0-3 could be followed by 8.3.0-4.
	//
	// If the version could not be parsed, DistriRevision is 0.
	DistriRevision int64
}

PackageVersion describes one released version of a package. It is assumed that files never change in the archive, but may become unavailable.

func ParseVersion

func ParseVersion(filename string) PackageVersion

ParseVersion constructs a PackageVersion from filename, e.g. glibc-amd64-2.31-4, which parses into PackageVersion{Upstream: "2.31", DistriRevision: 4}.

func (PackageVersion) String

func (pv PackageVersion) String() string

type Repo

type Repo struct {
	// Path is a file system path (e.g. /home/michael/distri/build/distri) or
	// HTTP URL (e.g. http://repo.distr1.org/).
	Path string

	// PkgPath is Path/pkg (e.g. /home/michael/distri/build/distri/pkg).
	PkgPath string
}

Directories

Path Synopsis
cmd
distri-installer
Program distri-installer installs distri on a block device, i.e.
Program distri-installer installs distri on a block device, i.e.
minitrd
Program minitrd is a minimal init program to be used in a Linux initramfs.
Program minitrd is a minimal init program to be used in a Linux initramfs.
internal
cp
env
Package env captures details about the distri environment.
Package env captures details about the distri environment.
squashfs
Package squashfs implements writing SquashFS file system images using zlib compression for data blocks (inodes and directory entries are written uncompressed for simplicity).
Package squashfs implements writing SquashFS file system images using zlib compression for data blocks (inodes and directory entries are written uncompressed for simplicity).
pb
builder
Package builder defines a gRPC protocol to leverage remote compute resources in a distri build.
Package builder defines a gRPC protocol to leverage remote compute resources in a distri build.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL