commit c61898ccc40d7fee6d337b68cf9af82652f2aa7d
parent 488a33afda42bcc8448253e0d54814dd454786f0
Author: torter <koubbamohamedrayan@gmail.com>
Date: Sat, 14 Nov 2026 16:00:18 +0000
init is a shell script in the base system, dinit is out
Diffstat:
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/files/sbin/init b/files/sbin/init
@@ -0,0 +1,20 @@
+#!/usr/bin/mksh
+# pid 1 of the live system: mounts what a shell needs, starts udev, and keeps a login on tty1
+export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t devtmpfs devtmpfs /dev
+mkdir -p /dev/pts /dev/shm
+mount -t devpts devpts /dev/pts
+mount -t tmpfs tmpfs /run
+mount -t tmpfs tmpfs /tmp
+chmod 1777 /tmp
+read -r host < /etc/hostname && echo "$host" > /proc/sys/kernel/hostname
+if command -v udevd >/dev/null; then
+ udevd --daemon
+ udevadm trigger
+ udevadm settle
+fi
+while :; do
+ agetty --noclear tty1 linux
+done
diff --git a/handbook/handbook.md b/handbook/handbook.md
@@ -12,7 +12,7 @@ and the package manager is `mag`.
| musl | the C library |
| rifle | the coreutils, one C file |
| mag | the package manager, reads pkgsrc packages as they are |
-| dinit | init and service manager |
+| init | a shell script, `/sbin/init` (files/sbin/init), runs under mksh |
| mksh | the shell: login shell and `/bin/sh` (the MirBSD Korn shell) |
| vim | the editor, installed on the ISO |
| limine | the boot loader |
@@ -143,7 +143,6 @@ start to finish on real hardware yet.)
/etc/profile PATH, EDITOR=vim
/etc/ksh.kshrc prompt and aliases of every ksh
- /etc/dinit.d/ services
/etc/fstab, hostname, passwd, group, shells
/var/lib/mag what is installed, per package
/var/cache/mag downloaded sources
diff --git a/iso/profile/packages b/iso/profile/packages
@@ -4,7 +4,6 @@ devel/gmake
archivers/libarchive
archivers/pigz
shells/mksh
-sysutils/dinit
sys-apps/util-linux
sys-apps/kmod
sys-apps/eudev
diff --git a/tools/chamesle-bootstrap b/tools/chamesle-bootstrap
@@ -4,6 +4,7 @@
# chamesle-bootstrap /mnt/root
# chamesle-bootstrap -r ~/repos/ports -s "shells/mksh editors/vim" /srv/chroot
set -e
+here=$(cd "$(dirname "$0")" && pwd)
usage() {
echo "usage: chamesle-bootstrap [-r REPOS] [-s PACKAGES] [-n HOSTNAME] TARGET" >&2
echo " -r repos split by colons, what mag takes in MAG_REPO (default: \$MAG_REPO)" >&2
@@ -11,7 +12,7 @@ usage() {
echo " -n host name of the new system (default chamesle)" >&2
exit 2
}
-base="sys-libs/musl devel/gmake archivers/libarchive archivers/pigz shells/mksh sysutils/dinit sys-apps/util-linux sys-apps/kmod sys-apps/eudev net/dhcpcd www/curl sysutils/e2fsprogs sysutils/dosfstools sys-boot/limine sys-kernel/linux sys-kernel/linux-firmware sys-firmware/sof-firmware sys-firmware/wireless-regdb editors/vim"
+base="sys-libs/musl devel/gmake archivers/libarchive archivers/pigz shells/mksh sys-apps/util-linux sys-apps/kmod sys-apps/eudev net/dhcpcd www/curl sysutils/e2fsprogs sysutils/dosfstools sys-boot/limine sys-kernel/linux sys-kernel/linux-firmware sys-firmware/sof-firmware sys-firmware/wireless-regdb editors/vim"
name=chamesle
while getopts r:s:n: o; do
case $o in
@@ -29,11 +30,12 @@ command -v mag >/dev/null || { echo "chamesle-bootstrap: mag is not in PATH" >&2
[ "$(id -u)" = 0 ] || echo "chamesle-bootstrap: not root, so files will belong to you and the device nodes are skipped" >&2
mkdir -p "$target"
cd "$target"
-for d in bin boot dev etc/dinit.d etc/skel home lib lib/firmware mnt proc root run sbin srv sys tmp usr/bin usr/lib usr/sbin usr/share usr/local/bin var/cache var/lib var/log var/tmp; do
+for d in bin boot dev etc/skel home lib lib/firmware mnt proc root run sbin srv sys tmp usr/bin usr/lib usr/sbin usr/share usr/local/bin var/cache var/lib var/log var/tmp; do
mkdir -p "$d"
done
chmod 1777 tmp var/tmp
chmod 700 root
+install -Dm755 "$here/../files/sbin/init" sbin/init
[ -e etc/passwd ] || cat > etc/passwd <<P
root:x:0:0:root:/root:/usr/bin/mksh
P