From 99b570cfbcb87b1d0884a90ac86146aae294d4ab Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 20 Jun 2019 11:00:22 +0300 Subject: [PATCH] baseinit: Started work on rc.boot. --- core/baseinit/checksums | 2 +- core/baseinit/files/rc.boot | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/core/baseinit/checksums b/core/baseinit/checksums index 8fed1f0d..474b2dcf 100644 --- a/core/baseinit/checksums +++ b/core/baseinit/checksums @@ -1,2 +1,2 @@ c65d69ade8d0bf6d92d01545323acff68c43cb1296bae8efcbf03faa5b0c653c inittab -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 rc.boot +8e243f895741287fecd52a73b354c1bba846dd0312648be7656ea6d84c955e73 rc.boot diff --git a/core/baseinit/files/rc.boot b/core/baseinit/files/rc.boot index e69de29b..292443a5 100644 --- a/core/baseinit/files/rc.boot +++ b/core/baseinit/files/rc.boot @@ -0,0 +1,36 @@ +#!/bin/sh + +PATH=/usr/bin:/usr/sbin + +log() { + printf '\e[31;1m=>\e[m %s\n' "$@" +} + +mnt() { + mountpoint -q "$1" || { + dir=$1 + shift + mount "$@" "$dir" + } +} + +log "Welcome to KISS!" +log "Mounting pseudo filesystems..." + +mnt /proc -o nosuid,noexec,nodev -t proc proc +mnt /sys -o nosuid,noexec,nodev -t sysfs sys +mnt /run -o mode=0755,nosuid,nodev -t tmpfs run +mnt /dev -o mode=0755,nosuid -t devtmpfs dev + +# shellcheck disable=2174 +mkdir -pm 0755 /run/runit \ + /run/lvm \ + /run/user \ + /run/lock \ + /run/log \ + /dev/pts \ + /dev/shm + +mnt /dev/pts -o mode=0620,gid=5,nosuid,noexec -nt devpts devpts +mnt /dev/shm -o mode=1777,nosuid,nodev -nt tmpfs shm +mnt /sys/kernel/security -nt securityfs securityfs