Browse Source

init

stay-on-etc 0.0.1
M. Herdiansyah 8 months ago
commit
c29d3c4c8f
  1. 108
      Makefile
  2. 5
      README
  3. 19
      bin/modules-load
  4. 19
      config/cgroups.conf
  5. 7
      config/hwclock.conf
  6. 10
      config/rc.local
  7. 10
      config/rc.shutdown
  8. 52
      man/modules-load.8
  9. 19
      scripts/binfmt
  10. 19
      scripts/cgroup-release-agent.sh
  11. 120
      scripts/cgroups
  12. 10
      scripts/cleanup
  13. 4
      scripts/hostname
  14. 15
      scripts/hwclock
  15. 4
      scripts/network
  16. 35
      scripts/pseudofs
  17. 14
      scripts/random-seed
  18. 15
      scripts/vconsole
  19. 4
      services/binfmt
  20. 13
      services/boot
  21. 1
      services/boot.d/loginready
  22. 1
      services/boot.d/misc
  23. 1
      services/boot.d/mount
  24. 1
      services/boot.d/setup
  25. 4
      services/cgroups
  26. 4
      services/cleanup
  27. 3
      services/dmesg
  28. 8
      services/fsck
  29. 4
      services/hostname
  30. 6
      services/hwclock
  31. 4
      services/kmod-static-nodes
  32. 3
      services/loginready
  33. 7
      services/misc
  34. 5
      services/modules
  35. 6
      services/mount
  36. 5
      services/mount-all
  37. 3
      services/net-lo
  38. 5
      services/network
  39. 4
      services/pseudofs
  40. 7
      services/random-seed
  41. 4
      services/rclocal
  42. 3
      services/recovery
  43. 9
      services/root-rw
  44. 12
      services/setup
  45. 5
      services/single
  46. 7
      services/swap
  47. 4
      services/sysusers
  48. 4
      services/tmpfiles-dev
  49. 4
      services/tmpfiles-setup
  50. 8
      services/tty1
  51. 8
      services/tty2
  52. 8
      services/tty3
  53. 8
      services/tty4
  54. 8
      services/tty5
  55. 8
      services/tty6
  56. 5
      services/udev-settle
  57. 5
      services/udev-trigger
  58. 9
      services/udevd
  59. 4
      services/vconsole

108
Makefile

@ -0,0 +1,108 @@
PREFIX ?= /usr
SYSCONFDIR ?= /etc
BINDIR ?= $(PREFIX)/bin
DATADIR ?= $(PREFIX)/share
MANDIR ?= $(DATADIR)/man/man8
DINITDIR ?= $(SYSCONFDIR)/dinit.d
BIN_PROGRAMS = modules-load
MANPAGES = modules-load.8
CONF_FILES = \
cgroups.conf \
hwclock.conf \
rc.local \
rc.shutdown
SERVICEDIR = boot.d
SERVICES = \
binfmt \
boot \
cgroups \
cleanup \
dmesg \
fsck \
hostname \
hwclock \
kmod-static-nodes \
loginready \
misc \
modules \
mount \
mount-all \
net-lo \
network \
pseudofs \
random-seed \
rclocal \
recovery \
root-rw \
setup \
single \
swap \
sysusers \
tmpfiles-dev \
tmpfiles-setup \
tty1 \
tty2 \
tty3 \
tty4 \
tty5 \
tty6 \
udevd \
udev-settle \
udev-trigger \
vconsole
SCRIPTS = \
binfmt \
cgroup-release-agent.sh \
cgroups \
cleanup \
hostname \
hwclock \
network \
pseudofs \
random-seed \
vconsole
all:
@echo "Nothing to be done here."
install:
install -d $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(DATADIR)
install -d $(DESTDIR)$(SYSCONFDIR)
install -d $(DESTDIR)$(MANDIR)
install -d $(DESTDIR)$(DINITDIR)
install -d $(DESTDIR)$(DINITDIR)/config
install -d $(DESTDIR)$(DINITDIR)/scripts
install -d $(DESTDIR)$(DINITDIR)/boot.d
# default services
ln -sf ../loginready $(DESTDIR)$(DINITDIR)/boot.d/loginready
ln -sf ../misc $(DESTDIR)$(DINITDIR)/boot.d/misc
ln -sf ../mount $(DESTDIR)$(DINITDIR)/boot.d/mount
ln -sf ../setup $(DESTDIR)$(DINITDIR)/boot.d/setup
# config files
for conf in $(CONF_FILES); do \
install -m 644 config/$$conf $(DESTDIR)$(DINITDIR)/config; \
done
# scripts
for script in $(SCRIPTS); do \
install -m 755 scripts/$$script $(DESTDIR)$(DINITDIR)/scripts; \
done
# programs
for prog in $(BIN_PROGRAMS); do \
install -m 755 bin/$$prog $(DESTDIR)$(BINDIR); \
done
# manpages
for man in $(MANPAGES); do \
install -m 644 man/$$man $(DESTDIR)$(MANDIR); \
done
# services
for srv in $(SERVICES); do \
install -m 644 services/$$srv $(DESTDIR)$(DINITDIR); \
done

5
README

@ -0,0 +1,5 @@
Artix's dinit stage 1.
Adapted from s6-scripts, runit-rc, Chimera Linux, and dinit's own configuration.
TODO: Remove cgroup code, it's messy, and it's on dinit's plan post-1.0.

19
bin/modules-load

@ -0,0 +1,19 @@
#!/bin/sh
# modules-load [-n] [-v] - modules-load.d(5) compatible kernel module loader
export PATH=/bin:/sbin
{
# Parameters passed as modules-load= or rd.modules-load= in kernel command line.
sed -nr 's/,/\n/;s/(.* |^)(rd\.)?modules-load=([^ ]*).*/\3/p' /proc/cmdline
# Find files /{etc,run,usr/lib}/modules-load.d/*.conf in that order.
find -L /etc/modules-load.d /run/modules-load.d /usr/lib/modules-load.d \
-maxdepth 1 -name '*.conf' -printf '%p %P\n' 2>/dev/null |
# Load each basename only once.
sort -k2 -s | uniq -f1 | cut -d' ' -f1 |
# Read the files, output all non-empty, non-comment lines.
tr '\012' '\0' | xargs -0 -r grep -h -v -e '^[#;]' -e '^$'
} |
# Call modprobe on the list of modules
tr '\012' '\0' | xargs -0 -r modprobe -ab "$@"

19
config/cgroups.conf

@ -0,0 +1,19 @@
# cgroups mode
# legacy mounts cgroups version 1 on /sys/fs/cgroup
# unified mounts cgroups version 2 on /sys/fs/cgroup
# hybrid mounts cgroups version 2 on /sys/fs/cgroup/unified and
# cgroups version 1 on /sys/fs/cgroup
CGROUP_MODE=hybrid
# This is a list of controllers which should be enabled for cgroups version 2.
# If hybrid mode is being used, controllers listed here will not be
# available for cgroups version 1. none means no controllers will be used
CGROUP_CONTROLLERS=none
# This switch controls whether or not cgroups version 1 controllers are
# individually mounted under
# /sys/fs/cgroup in hybrid or legacy mode
HAVE_CONTROLLER1_GROUPS=true

7
config/hwclock.conf

@ -0,0 +1,7 @@
# Set HARDWARECLOCK to UTC if your Hardware Clock is set to UTC (also known as
# Greenwich Mean Time). If that clock is set to the local time, then set
# HARDWARECLOCK to localtime Note that if you dual boot with Windows, then you
# should set it to localtime (or edit the Windows registry to make the Hardware
# Clock set to UTC).
HARDWARECLOCK=UTC

10
config/rc.local

@ -0,0 +1,10 @@
#!/bin/sh
# /etc/rc.local -- rc.local for Artix Linux
#
for file in /etc/local.d/*.start; do
sh "$file"
done
# Enter your custom commands here.

10
config/rc.shutdown

@ -0,0 +1,10 @@
#!/bin/sh
# /etc/rc.shutdown -- rc.shutdown for Artix Linux
#
for file in /etc/local.d/*.shutdown; do
sh "$file"
done
# Enter your custom commands here.

52
man/modules-load.8

@ -0,0 +1,52 @@
.Dd June 1, 2016
.Dt MODULES-LOAD 8
.Os Linux
.Sh NAME
.Nm modules-load
.Nd Configure kernel modules to load at boot
.Sh SYNOPSIS
.Nm modules-load
.Op Fl nv
.Sh DESCRIPTION
.Nm
reads files which contain kernel modules to load during boot from the list of
locations below.
.Bl -tag -width indent
.It Fl n
dry-run mode.
This option does everything but actually insert or delete the modules.
.It Fl v
verbose mode.
Print messages about what the program is doing.
.El
.Sh FILES
Configuration files are read from the following locations:
.Bl -tag -width indent
.It /etc/modules-load.d/*.conf
.It /run/modules-load.d/*.conf
.It /usr/lib/modules-load.d/*.conf
.El
.Pp
The configuration files should simply contain a list of kernel module names
to load, separated by newlines.
Empty lines and lines whose first non-whitespace character is # or ; are
ignored.
.Sh EXAMPLES
.Pa /etc/modules-load.d/virtio-net.conf :
.Bd -literal -offset indent
# Load virtio-net.ko at boot
virtio-net
.Ed
.Sh SEE ALSO
.Xr modprobe 8
.Sh HISTORY
This program is a replacement for the
.Nm modules-load
utility provided by
.Nm systemd .
.Sh AUTHOR
.An Leah Neukirchen ,
.Mt leah@vuxu.org .
.Sh LICENSE
.Nm
is in the public domain.

19
scripts/binfmt

@ -0,0 +1,19 @@
#!/bin/sh
mountpoint -q /proc/sys/fs/binfmt_misc || \
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc || return 1
for files in /proc/sys/fs/binfmt_misc/*; do
[ "$files" = /proc/sys/fs/binfmt_misc/register ] && continue
[ "$files" = /proc/sys/fs/binfmt_misc/status ] && continue
echo -1 > "$files"
done
for path in /usr/lib/binfmt.d /etc/binfmt.d /run/binfmt.d; do
[ ! -d $path ] && continue
[ -z "$(ls $path)" ] && continue
grep -h "^:" $path/* | \
while read -r line; do
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register || return 1
done
done
return 0

19
scripts/cgroup-release-agent.sh

@ -0,0 +1,19 @@
#!/bin/sh
# This is run by the kernel after the last task is removed from a
# control group in the openrc hierarchy.
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
cgroup=/sys/fs/cgroup/openrc
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ -d ${cgroup}/"$1" ]; then
rmdir ${cgroup}/"$1"
fi

120
scripts/cgroups

@ -0,0 +1,120 @@
#!/bin/sh
[ -r /etc/dinit.d/cgroups.conf ] && . /etc/dinit.d/cgroups.conf
CGROUP_OPTS=nodev,noexec,nosuid
if [ $CGROUP_CONTROLLERS = "none" ]; then
CGROUP_CONTROLLERS=""
fi
cgroup2_find_path() {
if grep -qw cgroup2 /proc/filesystems; then
case "${CGROUP_MODE}" in
hybrid) printf "/sys/fs/cgroup/unified" ;;
unified) printf "/sys/fs/cgroup" ;;
esac
fi
return 0
}
cgroup1_base() {
grep -qw cgroup /proc/filesystems || return 0
if ! mountpoint -q /sys/fs/cgroup; then
local opts="${CGROUP_OPTS},mode=755,size=${rc_cgroupsize:-10m}"
mount -n -t tmpfs -o "${opts}" cgroup_root /sys/fs/cgroup
fi
if ! mountpoint -q /sys/fs/cgroup/openrc; then
local agent
agent="/etc/dinit.d/scripts/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup -o none,${CGROUP_OPTS},name=openrc,release_agent="$agent" openrc /sys/fs/cgroup/openrc
printf 1 > /sys/fs/cgroup/openrc/notify_on_release
fi
return 0
}
cgroup1_controllers() {
${HAVE_CONTROLLER1_GROUPS} && [ -e /proc/cgroups ] && grep -qw cgroup /proc/filesystems || return 0
while read -r name _ _ enabled _; do
case "${enabled}" in
1) if mountpoint -q "/sys/fs/cgroup/${name}";then continue;fi
local x
for x in $CGROUP_CONTROLLERS; do
[ "${name}" = "blkio" ] && [ "${x}" = "io" ] &&
continue 2
[ "${name}" = "${x}" ] &&
continue 2
done
mkdir "/sys/fs/cgroup/${name}"
mount -n -t cgroup -o "${CGROUP_OPTS},${name}" "${name}" "/sys/fs/cgroup/${name}"
;;
esac
done < /proc/cgroups
return 0
}
cgroup2_base() {
grep -qw cgroup2 /proc/filesystems || return 0
local base
base="$(cgroup2_find_path)"
mkdir -p "${base}"
mount -t cgroup2 none -o "${CGROUP_OPTS},nsdelegate" "${base}" 2> /dev/null ||
mount -t cgroup2 none -o "${CGROUP_OPTS}" "${base}"
return 0
}
cgroup2_controllers() {
grep -qw cgroup2 /proc/filesystems || return 0
local active cgroup_path x y
cgroup_path="$(cgroup2_find_path)"
[ -z "${cgroup_path}" ] && return 0
[ -e "${cgroup_path}/cgroup.controllers" ] && read -r active < "${cgroup_path}/cgroup.controllers"
for x in ${CGROUP_CONTROLLERS}; do
for y in ${active}; do
[ "$x" = "$y" ] && [ -e "${cgroup_path}/cgroup.subtree_control" ] &&
echo "+${x}" > "${cgroup_path}/cgroup.subtree_control"
done
done
return 0
}
cgroups_hybrid() {
cgroup1_base
cgroup2_base
cgroup2_controllers
cgroup1_controllers
return 0
}
cgroups_legacy() {
cgroup1_base
cgroup1_controllers
return 0
}
cgroups_unified() {
cgroup2_base
cgroup2_controllers
return 0
}
mount_cgroups() {
case "${CGROUP_MODE}" in
hybrid) cgroups_hybrid ;;
legacy) cgroups_legacy ;;
unified) cgroups_unified ;;
esac
return 0
}
mount_cgs() {
if [ -d /sys/fs/cgroup ];then
mount_cgroups
return 0
fi
return 1
}
mount_cgs

10
scripts/cleanup

@ -0,0 +1,10 @@
#!/bin/sh
install -m0664 -o root -g utmp /dev/null /run/utmp
if [ ! -e /var/log/wtmp ]; then
install -m0664 -o root -g utmp /dev/null /var/log/wtmp
fi
if [ ! -e /var/log/btmp ]; then
install -m0600 -o root -g utmp /dev/null /var/log/btmp
fi
rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot

4
scripts/hostname

@ -0,0 +1,4 @@
#!/bin/sh
[ -s /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
[ "$HOSTNAME" ] && echo "$HOSTNAME" >| /proc/sys/kernel/hostname

15
scripts/hwclock

@ -0,0 +1,15 @@
#!/bin/sh
. /etc/rc/hwclock.conf
HARDWARECLOCK=${HARDWARECLOCK:-UTC}
case $HARDWARECLOCK in
UTC) HWCLOCK_PARAMS=" --utc" ;;
localtime) HWCLOCK_PARAMS=" --localtime" ;;
*) HWCLOCK_PARAMS="" ;;
esac
case "$1" in
start) hwclock --systz "$HWCLOCK_PARAMS" --noadjfile ;;
stop) hwclock --systohc "$HWCLOCK_PARAMS" ;;
esac

4
scripts/network

@ -0,0 +1,4 @@
#!/bin/sh
default="$(ip route | awk '/^default/{print ($3!="")+($5!="")}')"
[ "$default" = 2 ] && exit 0
exit 1

35
scripts/pseudofs

@ -0,0 +1,35 @@
#!/bin/sh
mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security
[ -d /sys/firmware/efi ] && (mountpoint -q /sys/firmware/efi/efivars || mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars)
mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid
# seed /dev with some things that might be needed (for example,
# xudev doesn't do this compared to eudev), code from OpenRC
# creating /dev/console, /dev/tty and /dev/tty1 to be able to write
# to $CONSOLE with/without bootsplash before udevd creates it
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
# udevd will dup its stdin/stdout/stderr to /dev/null
# and we do not want a file which gets buffered in ram
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# extra symbolic links not provided by default
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
mkdir -p /dev/pts /dev/shm
mountpoint -q /dev/pts || mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
mountpoint -q /dev/shm || mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev

14
scripts/random-seed

@ -0,0 +1,14 @@
#!/bin/sh
umask 077
bytes="$(cat /proc/sys/kernel/random/poolsize)" || bytes=512
case "$1" in
load)
cp /var/lib/random-seed /dev/urandom >/dev/null 2>&1 || true
dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes >/dev/null 2>&1
;;
save)
bytes=512; dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes >/dev/null 2>&1
;;
esac

15
scripts/vconsole

@ -0,0 +1,15 @@
#!/bin/sh
[ -r /etc/vconsole.conf ] && . /etc/vconsole.conf
TTYS=${TTYS:-6}
_index=0
while [ ${_index} -le "$TTYS" ]; do
if [ -n "$FONT" ]; then
setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} \
"$FONT" -C "/dev/tty${_index}"
fi
printf "\033%s" "%G" >/dev/tty${_index}
_index=$((_index + 1))
done
if [ -n "$KEYMAP" ]; then
loadkeys -q -u "${KEYMAP}"
fi

4
services/binfmt

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/scripts/binfmt
depends-on = pseudofs
restart = false

13
services/boot

@ -0,0 +1,13 @@
# The primary service
type = internal
depends-ms = tty1
depends-ms = tty2
depends-ms = tty3
depends-ms = tty4
depends-ms = tty5
depends-ms = tty6
waits-for.d = boot.d
waits-for = rclocal

1
services/boot.d/loginready

@ -0,0 +1 @@
../loginready

1
services/boot.d/misc

@ -0,0 +1 @@
../misc

1
services/boot.d/mount

@ -0,0 +1 @@
../mount

1
services/boot.d/setup

@ -0,0 +1 @@
../setup

4
services/cgroups

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/scripts/cgroups
restart = false
depends-on = pseudofs

4
services/cleanup

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/scripts/cleanup
restart = false
waits-for = fsck

3
services/dmesg

@ -0,0 +1,3 @@
type = scripted
command = /etc/dinit.d/scripts/dmesg
restart = false

8
services/fsck

@ -0,0 +1,8 @@
type = scripted
command = /sbin/fsck -A -R -C -a
restart = false
options = starts-on-console start-interruptible skippable
start-timeout = 0
depends-on = udevd
waits-for = udev-settle
waits-for = lvm

4
services/hostname

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/scripts/hostname
restart = false
waits-for = pseudofs

6
services/hwclock

@ -0,0 +1,6 @@
type = scripted
command = /etc/dinit.d/scripts/hwclock
logfile = /run/hwclock.log
restart = false
depends-on = udevd
depends-on = pseudofs

4
services/kmod-static-nodes

@ -0,0 +1,4 @@
type = scripted
command = /usr/bin/kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
restart = false
waits-for = pseudofs

3
services/loginready

@ -0,0 +1,3 @@
type = internal
restart = false
waits-for = setup

7
services/misc

@ -0,0 +1,7 @@
type = internal
restart = false
waits-for = hostname
waits-for = hwclock
waits-for = tmpfiles-dev
waits-for = modules
waits-for = network

5
services/modules

@ -0,0 +1,5 @@
type = scripted
command = /usr/bin/modules-load
restart = false
waits-for = pseudofs
waits-for = udev-settle

6
services/mount

@ -0,0 +1,6 @@
type = scripted
restart = false
waits-for = root-rw
waits-for = cgroups
waits-for = pseudofs
waits-for = tmpfs

5
services/mount-all

@ -0,0 +1,5 @@
type = scripted
command = /usr/bin/mount -a -t nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs,nofuse.glusterfs -O no_netdev
restart = false
waits-for = cryptsetup
waits-for = fsck

3
services/net-lo

@ -0,0 +1,3 @@
type = scripted
command = /usr/bin/ip link set up dev lo
restart = false

5
services/network

@ -0,0 +1,5 @@
type = scripted
command = /etc/dinit.d/scripts/network
restart = false
waits-for = pseudofs
waits-for = net-lo

4
services/pseudofs

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/scripts/pseudofs
restart = false
options = starts-rwfs

7
services/random-seed

@ -0,0 +1,7 @@
type = scripted
command = /etc/dinit.d/scripts/random-seed load
stop-command = /etc/dinit.d/scripts/random-seed save
restart = false
waits-for = pseudofs
waits-for = udev-settle
waits-for = root-rw

4
services/rclocal

@ -0,0 +1,4 @@
type = scripted
command = sh /etc/dinit.d/config/rc.local
stop-command = sh /etc/dinit.d/config/rc.shutdown
restart = false

3
services/recovery

@ -0,0 +1,3 @@
type = process
command = /sbin/sulogin
options = runs-on-console

9
services/root-rw

@ -0,0 +1,9 @@
type = scripted
command = /bin/mount -o remount,rw /
restart = false
options = starts-rwfs
logfile = /run/rootrw.log
depends-on = mount-all
waits-for = hwclock
waits-for = fsck

12
services/setup

@ -0,0 +1,12 @@
type = internal
restart = false
waits-for = cleanup
waits-for = dmesg
waits-for = binfmt
waits-for = locale
waits-for = net-lo
waits-for = random-seed
waits-for = swap
waits-for = sysusers
waits-for = tmpfiles-setup
waits-for = vconsole

5
services/single

@ -0,0 +1,5 @@
type = process
command = /bin/sh
restart = false
options = shares-console
chain-to = boot

7
services/swap

@ -0,0 +1,7 @@
type = scripted
command = /sbin/swapon -a
stop-command = /sbin/swapoff -a
depends-on = root-rw
depends-on = udevd
depends-on = mount-all
waits-for = udev-settle

4
services/sysusers

@ -0,0 +1,4 @@
type = scripted
command = /usr/bin/sysusers
restart = false
waits-for = root-rw

4
services/tmpfiles-dev

@ -0,0 +1,4 @@
type = scripted
command = /usr/bin/tmpfiles --prefix=/dev --create --boot
restart = false
waits-for = kmod-static-nodes

4
services/tmpfiles-setup

@ -0,0 +1,4 @@
type = scripted
command = /usr/bin/tmpfiles --exclude-prefix=/dev --create --remove --boot
restart = false
waits-for = udev-settle

8
services/tty1

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty1 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 1
inittab-line = tty1

8
services/tty2

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty2 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 2
inittab-line = tty2

8
services/tty3

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty3 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 3
inittab-line = tty3

8
services/tty4

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty4 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 4
inittab-line = tty4

8
services/tty5

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty5 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 5
inittab-line = tty5

8
services/tty6

@ -0,0 +1,8 @@
type = process
command = /sbin/agetty tty6 38400 linux
restart = true
depends-on = loginready
termsignal = HUP
smooth-recovery = true
inittab-id = 6
inittab-line = tty6

5
services/udev-settle

@ -0,0 +1,5 @@
type = scripted
command = /usr/bin/udevadm settle
restart = false
waits-for = udevd
waits-for = udev-trigger

5
services/udev-trigger

@ -0,0 +1,5 @@
type = scripted
command = /usr/bin/udevadm trigger --action=add
logfile = /run/dinit-udev-trigger.log
restart = false
depends-on = udevd

9
services/udevd

@ -0,0 +1,9 @@
# Note that this udevd is experimental. We might use the dinit original
# version.
type = process
command = /usr/bin/udevd
logfile = /run/udevd.log
smooth-recovery = yes
socket-listen = /var/run/udev/control
waits-for = pseudofs

4
services/vconsole

@ -0,0 +1,4 @@
type = scripted
command = /etc/dinit.d/script/vconsole
restart = false
waits-for = hostname
Loading…
Cancel
Save