diff options
| author | Arslaan Pathan <[email protected]> | 2026-06-10 20:06:29 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-06-10 20:06:29 +1200 |
| commit | 58b1499d3431700d999a5164f7e5a22706adc35d (patch) | |
| tree | ee7b285208767f1427ad217727b760553dd69ba2 | |
| parent | 5e2fe0cdbe0da7e1082d273a0295fdad44614a48 (diff) | |
| download | yerbalinux-58b1499d3431700d999a5164f7e5a22706adc35d.tar.xz yerbalinux-58b1499d3431700d999a5164f7e5a22706adc35d.zip | |
Add runit
| -rw-r--r-- | flake.nix | 3 | ||||
| -rw-r--r-- | nix/rootfs.nix | 30 | ||||
| -rwxr-xr-x | runit/1 | 3 | ||||
| -rwxr-xr-x | runit/2 | 2 | ||||
| -rwxr-xr-x | runit/3 | 2 | ||||
| -rwxr-xr-x | runit/sv/getty-tty0/run | 2 | ||||
| -rwxr-xr-x | runit/sv/getty-ttyS0/run | 2 |
7 files changed, 36 insertions, 8 deletions
@@ -18,12 +18,13 @@ busybox = pkgs.callPackage ./nix/busybox.nix { inherit (pkgs) pkgsStatic; }; + runit = pkgsMusl.runit; limine = pkgs.callPackage ./nix/limine.nix {}; initramfs = pkgs.callPackage ./nix/initramfs.nix { inherit (self.packages.${system}) kernel busybox; }; rootfs = pkgs.callPackage ./nix/rootfs.nix { - inherit (self.packages.${system}) busybox; + inherit (self.packages.${system}) busybox runit; inherit (pkgsMusl) musl; }; iso = pkgs.callPackage ./nix/iso.nix { diff --git a/nix/rootfs.nix b/nix/rootfs.nix index 34f1b4e..44532cc 100644 --- a/nix/rootfs.nix +++ b/nix/rootfs.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, busybox, squashfsTools, linuxHeaders, musl }: +{ stdenv, fetchgit, busybox, squashfsTools, linuxHeaders, musl, runit }: stdenv.mkDerivation { name = "rootfs-yerba"; @@ -10,6 +10,8 @@ stdenv.mkDerivation { mkdir -p rootfs mkdir -p rootfs/{bin,sbin,etc,proc,sys,dev,home,var,usr,root,mnt,tmp,lib} mkdir -p rootfs/usr/{lib,bin} + mkdir -p rootfs/etc/runit + mkdir -p rootfs/etc/service chmod -R u+w rootfs # Basic setup end @@ -23,21 +25,35 @@ stdenv.mkDerivation { # Busybox start cp -a ${busybox}/_install/. rootfs/ - chmod -R u+w rootfs - ln -sf /bin/busybox rootfs/init + # chmod -R u+w rootfs + # ln -sf /bin/busybox rootfs/init # Busybox end + # runit start + cp -a ${runit}/bin/* rootfs/usr/bin + chmod -R u+w rootfs + ln -sf /usr/bin/runit-init rootfs/init + chmod -R u+w rootfs + rm rootfs/sbin/init + chmod -R u+w rootfs + ln -sf /usr/bin/runit-init rootfs/sbin/init + cp -a ${../runit}/* rootfs/etc/runit/ + chmod -R u+w rootfs + ln -sf /etc/runit/sv/getty-tty0 rootfs/etc/service/ + chmod -R u+w rootfs + ln -sf /etc/runit/sv/getty-ttyS0 rootfs/etc/service/ + # runit end + # Programs start + # nothing here yet! # Programs end # Basic files setup start echo "proc /proc proc defaults 0 0" > rootfs/etc/fstab echo "sysfs /sys sysfs defaults 0 0" >> rootfs/etc/fstab echo "devtmpfs /dev devtmpfs defaults 0 0" >> rootfs/etc/fstab - echo "::sysinit:/bin/mount -a" > rootfs/etc/inittab - echo "tty0::askfirst:/bin/sh" >> rootfs/etc/inittab - echo "ttyS0::askfirst:/bin/sh" >> rootfs/etc/inittab - echo "::ctrlaltdel:/sbin/reboot" >> rootfs/etc/inittab + echo "root:x:0:0:root:/root:/bin/sh" > rootfs/etc/passwd + echo "root:x:0:" > rootfs/etc/group echo "yerba-live" > rootfs/etc/hostname # Basic files setup end @@ -0,0 +1,3 @@ +#!/bin/sh +mount -a +hostname -F /etc/hostname 2>/dev/null || hostname yerba-live @@ -0,0 +1,2 @@ +#!/bin/bash +exec runsvdir /etc/service @@ -0,0 +1,2 @@ +#!/bin/sh +# this is the shutdown thing i think? nothing here yet diff --git a/runit/sv/getty-tty0/run b/runit/sv/getty-tty0/run new file mode 100755 index 0000000..df22125 --- /dev/null +++ b/runit/sv/getty-tty0/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /sbin/getty -L tty0 115200 vt100 diff --git a/runit/sv/getty-ttyS0/run b/runit/sv/getty-ttyS0/run new file mode 100755 index 0000000..d02722e --- /dev/null +++ b/runit/sv/getty-ttyS0/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /sbin/getty -L ttyS0 115200 vt100 |
