Fixed numerous path issues in s6-scripts;

Fix sbin handling in hhl.script.mk
This commit is contained in:
Nathan Fisher 2022-08-25 13:13:16 -04:00
parent cd021883f5
commit 828f465435
55 changed files with 3152 additions and 2729 deletions

View file

@ -1,6 +1,6 @@
# Makefile - hhl - /usr/src/world/bc
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
#
distname = bc
include world.mk
export PREFIX = /usr
@ -8,5 +8,5 @@ export CC = $(tgt)-gcc
export HOSTCC = gcc
export HOSTCFLAGS = -std=c99
export CFLAGS = -std=c99 --sysroot=$(DESTDIR)
config_cmd = cd $(objdir) && $(srcdir)/configure.sh -G -O3
config_cmd = cd $(objdir) && $(srcdir)/configure -G -O3
include targets.mk

View file

@ -1,10 +1,12 @@
# Makefile - hhl - /src/world/bin/s6-scripts
# Copyright 2021 Nathan Fisher <nfisher.sr@gmail.com>
#
progname = init
progname = init
export exec_prefix = $(DESTDIR)
export sbin = 1
include hhl.script.mk
sysctl_libdir = $(DESTDIR)/usr/lib/sysctl.d
sysctl_libdir = $(DESTDIR)/usr/lib/sysctl.d
install: $(sysctl_libdir)/50-default.conf install_conf

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
s6-linux-init-shutdown -a -r -- now

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
s6-linux-init-shutdown -a -p -- now

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
s6-linux-init-shutdown -a -p -- now

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
s6-linux-init-shutdown -a -h -- now

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
redirfd -w 2 /dev/console
fdmove -c 1 2

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
redirfd -w 2 /dev/console
fdmove -c 1 2

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
/sbin/agetty -L -8 tty1 115200
/sbin/getty tty1

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
fdmove -c 2 1
fdmove 1 3

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
s6-linux-init-shutdownd -c "/etc/s6/current" -g 3000

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { sh /etc/s6/sv/binfmt/shell_up }

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { install -m0664 -o root -g utmp /dev/null /run/utmp }
foreground { if -t -n { test -e /var/log/wtmp } install -m0664 -o root -g utmp /dev/null /var/log/wtmp }
foreground { if -t -n { test -e /var/log/btmp } install -m0600 -o root -g utmp /dev/null /var/log/btmp }

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec sh /etc/s6/sv/console-setup/shell_up

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { if -n -t { test -d /var/log/dmesg } install -d -m 0755 -o s6log -g s6log /var/log/dmesg }
envfile /etc/s6/sv/dmesg/conf
importas -sCiu DIRECTIVES DIRECTIVES

View file

@ -1 +1 @@
agetty-tty1
getty-tty1

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec s6-svc -d /run/service/s6-linux-init-early-getty

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/getty-tty1/conf
importas -iu SPAWN SPAWN

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/getty-tty2/conf
importas -iu SPAWN SPAWN

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/getty-tty3/conf
importas -iu SPAWN SPAWN

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/getty-tty4/conf
importas -iu SPAWN SPAWN

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty5/conf
importas -iu SPAWN SPAWN

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty6/conf
importas -iu SPAWN SPAWN

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
if -t { test -s /etc/hostname } backtick -n -E HOSTNAME { head -1 /etc/hostname }
if -t { test -n $HOSTNAME } redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
envfile /etc/s6/s6.conf
importas -iu HARDWARECLOCK HARDWARECLOCK
foreground { if { test $HARDWARECLOCK = UTC } hwclock --systohc --utc --noadjfile }

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
envfile /etc/s6/s6.conf
importas -iu HARDWARECLOCK HARDWARECLOCK
foreground { if { test $HARDWARECLOCK = UTC } hwclock --systz --utc --noadjfile }

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground {
if -n { test -d /run/tmpfiles.d } mkdir /run/tmpfiles.d
}

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec modules-load

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
envfile /etc/s6/s6.conf
importas -iu CGROUP_MODE CGROUP_MODE
importas -iu CGROUP_CONTROLLERS CGROUP_CONTROLLERS

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { ln -snf /proc/self/fd /dev/fd }
foreground { ln -snf /proc/self/fd/0 /dev/stdin }
foreground { ln -snf /proc/self/fd/1 /dev/stdout }
@ -6,11 +6,11 @@ foreground { ln -snf /proc/self/fd/2 /dev/stderr }
foreground { ln -snf /proc/kcore /dev/core }
foreground { mkdir -p /dev/pts }
foreground { mkdir -p /dev/shm }
foreground {
foreground {
if -n { mountpoint -q /dev/pts }
mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
}
foreground {
foreground {
if -n { mountpoint -q /dev/shm }
mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
}

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
foreground { mount -a -O no_netdev }
#!/bin/execlineb -P
foreground { mount -a -t nonfs,nocifs }
foreground { if { test -x /usr/bin/zfs } zfs mount -a }

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
exec mount -a -O _netdev
#!/bin/execlineb -P
exec mount -a -t nfs,cifs

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground {
if -n { test -e /proc/mounts }
if -n { mountpoint -q /proc } mount -t proc proc /proc -o nosuid,noexec,nodev

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground {
if -n { mountpoint -q /sys }
mount -t sysfs sys /sys -o nosuid,noexec,nodev

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec ip link set up dev lo

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { umask 077; cp /var/lib/random-seed /dev/urandom }
backtick -n bytes { cat /proc/sys/kernel/random/poolsize }
importas -iu bytes bytes

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { umask 077; cp /var/lib/random-seed /dev/urandom }
backtick -n bytes { cat /proc/sys/kernel/random/poolsize }
importas -iu bytes bytes

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
elglob -0 scripts /etc/local.d/*.stop
forx -E script { ${scripts} }
sh -c "${script}"

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { sh /etc/s6/rc.local }
elglob -0 scripts /etc/local.d/*.start
forx -E script { ${scripts} }

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec mount -o remount,rw /

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec swapoff -a

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec swapon -a

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
redirfd -w 1 /dev/null sysctl --system

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec sysusers

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec tmpfiles --prefix=/dev --create --boot

View file

@ -1,2 +1,2 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
exec tmpfiles --exclude-prefix=/dev --create --remove --boot

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { udevd --daemon }
foreground { redirfd -w 1 /dev/null udevadm trigger --action=add --type=subsystems }
foreground { redirfd -w 1 /dev/null udevadm trigger --action=add --type=devices }

View file

@ -1,4 +1,4 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
foreground { if -n -t { test -d /var/log/udevd } install -d -m 0755 -o s6log -g s6log /var/log/udevd }
envfile /etc/s6/sv/udevd-log/conf
importas -sCiu DIRECTIVES DIRECTIVES

View file

@ -1,3 +1,3 @@
#!/sbin/execlineb -P
#!/bin/execlineb -P
fdmove -c 2 1
exec udevd -D