• Stars
    star
    287
  • Rank 143,385 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

a framework used to create custom debian linux operating systems

🐧🏭 linux-factory

a framework used to create custom linux debian operating systems

Usage

Building

Edit configurations in the os/config.yaml, activate custom overlays and when ready . . .

make build

Once the build has completed, you can find the iso installer located in the .build/lb folder.

Reset Environment

Run the following command to completely reset your environment.

sudo git clean -fxd

Please note that if you stopped the build in the middle of execution (for example CTRL-C), it's possible you will get a permission error. If this happens you may need to restart your computer and try resetting after you have rebooted.

Dependencies

This system can only be built from a Debian based operating system. While any Debian based operating system should work, this is only tested against the official Debian distribution on amd64.

You can install all of the dependencies with the following command.

sudo apt-get install -y imagemagick make git git-lfs grub-emu live-build python3 jq python3-poetry-core python3-venv snapd && sudo snap install yq

Required

Name Install Url
GNU Make sudo apt-get install -y make https://www.gnu.org/software/make
Git sudo apt-get install -y git https://git-scm.com
Git LFS sudo apt-get install -y git-lfs https://git-lfs.com
ImageMagick sudo apt-get install -y imagemagick https://imagemagick.org
Live Build sudo apt-get install -y live-build https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.html
Python 3 sudo apt-get install -y python3 https://www.python.org
jq sudo apt-get install -y jq https://stedolan.github.io/jq
poetry sudo pip3 install poetry --break-system-packages https://python-poetry.org
virtualenv sudo apt-get install -y python3-venv https://virtualenv.pypa.io
yq sudo apt-get install -y snapd && sudo snap install yq https://mikefarah.gitbook.io/yq

Optional

Name Install Url
Grub Emulator sudo apt-get install -y grub-emu https://manpages.debian.org/testing/grub-emu/grub-emu.1.en.html

Overlays

Overlays are configurable, flexible and decoupled customizations that get applied to the operating system build. They can be mixed and matched with other overlays, or be completely disabled if you don't want those changes.

Overlays get "overlayed" on top of the os directory during the build. This means the file structure inside of an overlay and the file structure of the os directory are identical.

Example

The example overlay showcases the capabilities of an overlay. You can use it as a starting point for one of your overlays, or simply use it as a reference.

overlays/example

Debian Installer

The Debian Installer is the official installation system for the Debian operating system. It provides a user-friendly interface for installing Debian on a wide range of hardware, from desktops and laptops to servers and embedded systems. The Debian Installer supports multiple languages, network installations, and a variety of disk partitioning options. With its flexible and customizable design, the Debian Installer is a popular choice for many users who are looking to install Debian on their systems.

overlays/debianInstaller

Grub

GRUB (GRand Unified Bootloader) is a boot loader package from the GNU Project. It is used to boot Linux operating systems, as well as a number of other operating systems. In the context of this system, Grub can be used as an overlay to customize the boot loader.

overlays/debianInstaller

Sway

Sway is a tiling window manager for Wayland. It provides a tiling window manager experience for users who are looking for a modern, keyboard-driven interface. In the context of this system, Sway can be used as an overlay to provide a tiling window manager for the target system.

overlays/sway

Overlay Components

Fonts

Supports zip, tar and tar.gz files that contain .ttf or .otf fonts

Packages

Repos

Filesystem

Prompt

Types

  • string
  • boolean
  • select
  • multiselect
  • error
  • note
  • password

Hooks

To use the hooks in your overlay, you will need to create a file named overlay.py within your overlay directory. This file should contain a class named OverlayHooks that implements methods for each hook.

Each hook has two corresponding methods, one for before the stage is executed and one for after the stage is executed. There are currently three stages in the process: build, config, and prepare. This means the following hooks are available for you to use:

  • before_build()
  • after_build()
  • before_config()
  • after_config()
  • before_prepare()
  • after_prepare()

For example, if you wanted to run some custom code before the build stage is executed, you could implement the following in your overlay.py file:

overlay.py

class OverlayHooks:
    def before_build(self):
        # Your custom code here

It's important to note that the order in which hooks are executed is determined by the order in which the overlays are specified. Make sure to take this into consideration when implementing your hooks.

Script Hooks

Script hooks are a linux-factory concept and should not be confused with the live build hooks available at lb/hooks/.

During the installation process, there are two script hooks that can be utilized, post-install and user-post-install.

Location of Script Hooks

Script hooks should be placed in the hooks/<hook> folder. All scripts within the specified folder will be executed during the corresponding hook.

the name of the script should be the same name as your overlay to prevent collisions with hooks from other overlays

Execution of Script Hooks

  • user-post-install: This script hook will execute after the system has been installed as the newly created user.
  • post-install: This script hook will also execute after the system has been installed, but it runs as the root user.

Example

Here's an example of how you can utilize the user-post-install script hook.

Create a folder named user-post-install in the hooks directory and add a file named script.sh in it. In the script.sh file, you can add the following code.

hooks/user-post-install/<overlay>.sh

#!/bin/sh

echo "Running user-post-install script"

Live Build Cheatsheet

Definitions

  • live medium - the ISO image and filesystem
  • live system - the operating system booted from the live medium
  • installed system - the operating system installed from debian installer
  • chroot stage - stage when building the image
  • binary stage - stage when building the live medium (binary can also refer to the debian installer)

File Structure

  • config/archives/*.{list,key}.binary - repositories added to live system /etc/apt/sources.list.d/
  • config/archives/*.{list,key}.chroot - repositories loaded during the chroot stage
  • config/includes.binary/* - files to include in the live medium's filesystem
  • config/includes.chroot/* - files to include in the live system's filesystem
  • config/includes.installer/* - configuration for debian installer
  • config/package-lists/*.list.binary - packages to place in the APT pool/ repository on the live medium (for offline packages)
  • config/package-lists/*.list.chroot_install - packages to install in the live system and installed system
  • config/package-lists/*.list.chroot_live - packages to install in the live system only (works by uninstalling them from installed system)
  • config/package-lists/*.list.chroot - packages to install in the live system (which will most likely be added to the installed system)
  • config/packages.binary - udeb packages to install for the debian installer
  • config/packages.chroot - deb packages to install for the live system

I'm not sure exactly what the differences between config/package-lists/*.list.chroot and config/package-lists/*.list.chroot_install are.

WARNING: binary unfortunately has many different meanings in the documentation depending on the context. The following table helps clarify the context of binary.

binary refers to
config/archives/*.{list,key}.binary live system
config/includes.binary/* live medium
config/package-lists/*.list.binary live medium /pool
config/packages.binary debian installer

WARNING: config/archives/*.{list,key}.chroot does not make the repositories available to the live system. Instead you must use config/archives/*.{list,key}.binary for the repositories to be available to the live system.

Mounts

  • live medium - /cdrom if debian installer or /run/live/medium from live system
  • installed system - /target if debian installer or /tmp/calamares-root-* if calamares

Resources

More Repositories

1

react-ast

render abstract syntax trees with react
TypeScript
314
star
2

sphinx-markdown-builder

sphinx builder that outputs markdown files.
Python
159
star
3

react-gantt

A gantt chart for react
JavaScript
149
star
4

dotstow

Mirror of https://gitlab.com/risserlabs/community/dotstow
Shell
95
star
5

idempotent-babel-polyfill

import babel-polyfill multiple times
JavaScript
69
star
6

breeze-hacked-cursor-theme

Official cursor theme for Jam OS
Shell
62
star
7

nestjs-crud-prisma

crud for restful apis built with nestjs and prisma
TypeScript
53
star
8

create-react-renderer

learn to build a custom react renderer
TypeScript
25
star
9

reactant

write once . . . render everywhere
TypeScript
25
star
10

easyappointments-docker

A docker image for Easy!Appointments
PHP
25
star
11

keycloak-sso-configs

common keycloak single sign on configurations
22
star
12

blogdown

A back-end agnostic, zero compilation, markdown blogging platform
HTML
22
star
13

wp-plugin-devkit

A modern approach to wordpress plugin development
PHP
21
star
14

nestjs-keycloak

nestjs module for authenticating keycloak
TypeScript
21
star
15

sphinx-jekyll-builder

sphinx builder that outputs jekyll compatible markdown files with frontmatter
Python
20
star
16

sphinx-markdown-parser

write markdown inside of docutils & sphinx projects
Python
19
star
17

gtk-node

Node bindings for Gtk3
C
19
star
18

generator-helm-chart

yeoman generator rancher 2 helm charts
JavaScript
18
star
19

deskterm

Turn your Linux desktop into a terminal
Shell
15
star
20

i3lock-color-ubuntu

i3lock-color build for ubuntu deb
Makefile
13
star
21

charts

rock8s community helm charts
Go
13
star
22

open-terminal

cross platform open terminal and run command
TypeScript
11
star
23

generator-jekyll-plugin

💎 Yeoman generator for jekyll plugins
JavaScript
11
star
24

docker-gtk

Run GTK GUI apps with docker
C
11
star
25

react-native-ignore-warnings

⚛️🤷⚠️ Ignore react native warnings and logs
Makefile
11
star
26

make4docker

Use GNU Make to simplify your Docker builds
Makefile
11
star
27

green-docker

Make the most efficient docker images using best practices
Makefile
11
star
28

docker-prisma-studio

prisma studio
Makefile
9
star
29

react-native-exposure-notification

access the covid-19 ios and android exposure notification api from react native
Java
9
star
30

ts-gir

generate typescript from gir
TypeScript
8
star
31

gnome-gtk

typescript bindings for gnome gtk
JavaScript
7
star
32

generator-trailblazer

A pragmatic implementation of TrailsJS for rapid development
JavaScript
7
star
33

craco

high level api for interacting with webpack config
TypeScript
7
star
34

react-noscript

Nest html tags under the <noscript> tag in react
JavaScript
7
star
35

gjs-gtk-typescript

gtk typescript app proof of concept
TypeScript
7
star
36

cross-domain-cookies

Set cookies on other domains
Go
6
star
37

forkbuntu

Easily create your own ubuntu distribution and install cd
Python
6
star
38

lb4-middleware

run express middleware in loopback 4
TypeScript
6
star
39

babel-plugin-gjs

babel plugin for gjs
JavaScript
6
star
40

mklink

Make symbolic links, hard links, and directory junctions from the context menu
C#
6
star
41

lb4-authorization

authorization adapter for loopback 4
TypeScript
5
star
42

ory-stack

Ory hydra oathkeeper and keto
5
star
43

xmpp-react-hooks

react hooks for xmpp
JavaScript
5
star
44

ory-keto-client

Ory Keto access control client for JavaScript and TypeScript
TypeScript
5
star
45

dotfiles

My dotfiles - enjoy!
Emacs Lisp
5
star
46

beegfs-installer

Easy installer for BeeGFS
Python
5
star
47

identity-api

An identity api built with loopback 4
TypeScript
5
star
48

generator-node-module-typescript

yeoman generator for typescript node modules
Makefile
4
star
49

eternal-utils

Eternally persist exported environment variables, aliases and sources
C
4
star
50

kube-api-proxy

proxy kubernetes api
Smarty
4
star
51

readme

An opinionated README file
4
star
52

trailduck

a topological cyclic sorting algorithm based on depth-first search (dfs)
JavaScript
4
star
53

binary-fetch

Fetch binary data with incremental progress from a browser
JavaScript
4
star
54

hmr-client

A client for communicating with hot module replacement (HMR)
JavaScript
4
star
55

ts-ignore

ignore typescript errors
TypeScript
4
star
56

redux-context-provider

💉 Inject redux into react context
JavaScript
4
star
57

python-env

Cross platform isolated embedded python environment
JavaScript
4
star
58

google-chart-react

Implement Google Charts in react
JavaScript
4
star
59

generator-github-project

🎩 :octocat: Yeoman generator for GitHub projects
JavaScript
4
star
60

js-info

Get system information about your JavaScript runtime engine
JavaScript
4
star
61

nestjs-example

example nestjs project integrated with keycloak
TypeScript
4
star
62

oh-my-zsh-docker

run oh-my-zsh from a docker container
Dockerfile
3
star
63

use-constructor

react hook that behaves like a class constructor for functional components
Makefile
3
star
64

awesome-ideas

a curated list of awesome ideas
3
star
65

terraform-rancher-2

Initialize rancher 2 with terraform
HCL
3
star
66

node-sphinxdoc

document node project with sphinx
TypeScript
3
star
67

instant-wordpress

Skip the installation process of WordPress by using environment variables
Python
3
star
68

drone-postman

Test postman collection with Drone
Makefile
3
star
69

oooc

Pretty print structured data found in stdout
Perl
3
star
70

terraform

personal terraform scripts
HCL
3
star
71

rc-config

Load runtime configuration
JavaScript
3
star
72

windows-wifi-cracker

Show the passwords of all wifi accounts saved on a Windows machine
C#
3
star
73

spotawesome

Open source spot instance orchestrator
JavaScript
3
star
74

volback

backup and restore docker volumes
Go
3
star
75

drone-init

Batch initialize drone projects
Python
3
star
76

role-based-access-control

unopinionated role based access control
TypeScript
3
star
77

keycloak-theme

boilerplate keycloak theme
FreeMarker
3
star
78

generator-nestjs-prisma

yeoman generator for nestjs prisma
TypeScript
3
star
79

generator-yo-es6

A generator for ES6 yeoman generators
JavaScript
3
star
80

gnome-cairo

typescript bindings for gnome cairo
TypeScript
3
star
81

loopback4-hydra

loopback 4 integration with ory hydra
TypeScript
3
star
82

google-closure-library

google closure library for node and typescript
JavaScript
3
star
83

php-nginx-alpine-docker

Lightweight php nginx server on an alpine image
Nginx
3
star
84

crypto-review

cryptos from a developers point of view
3
star
85

node-gnumake

cross platform gnu make for nodejs
TypeScript
3
star
86

login-ui

front-end for ory hydra loopback 4 identity api
JavaScript
3
star
87

ghost-proxy

A rest API proxy for the Ghost blogging platform.
JavaScript
2
star
88

link-type-definitions

typescript definition package manager
TypeScript
2
star
89

kiss-date

keep it simple stupid date library
Makefile
2
star
90

velero-schedule-replicator

operator to replicate velero schedules across namespaces
Makefile
2
star
91

xmpp-ts

cross platform typescript library for xmpp built on xmpp.js
Makefile
2
star
92

dns-register

Register and unregister server with DNS providers
Go
2
star
93

generator-sphinx

Yeoman generator for sphinx
JavaScript
2
star
94

keycloak-gatekeeper-demo

secure an application with keycloak gatekeeper demo
2
star
95

event-ears

manage even listeners
Makefile
2
star
96

dockerinfo

Gives detailed information about a docker container's host.
JavaScript
2
star
97

docker-do-spaces

proxy digital ocean spaces
HTML
2
star
98

node-sigar

node bindings to sigar
C++
2
star
99

stripe-exporter

Stripe exporter for Prometheus
Go
2
star
100

bullean

boolean expression interpreter
Makefile
2
star