diff --git a/etc/crontabs/root b/etc/crontabs/root new file mode 100644 index 0000000..903675c --- /dev/null +++ b/etc/crontabs/root @@ -0,0 +1,8 @@ +# do daily/weekly/monthly maintenance +# min hour day month weekday command +*/15 * * * * run-parts /etc/periodic/15min +0 * * * * run-parts /etc/periodic/hourly +0 2 * * * run-parts /etc/periodic/daily +0 3 * * 6 run-parts /etc/periodic/weekly +0 5 1 * * run-parts /etc/periodic/monthly +0 0 3 4 * run-parts /etc/periodic/yearly diff --git a/etc/group b/etc/group index 1270985..9407a14 100644 --- a/etc/group +++ b/etc/group @@ -1,5 +1,17 @@ root:x:0:root +tty:x:5: +disk:x:6:root +kmem:x:9: +floppy:x:11:root +audio:x:18: +cdrom:x:19: +dialout:x:20:root +input:x:23: +tape:x:26:root +video:x:27:root +netdev:x:28: dnsmasq:x:963:dnsmasq sshd:x:33:sshd +kvm:x:34:kvm nobody:x:65534: -gitea:x:1000: \ No newline at end of file +gitea:x:1000: diff --git a/etc/init.d/mdev b/etc/init.d/mdev new file mode 120000 index 0000000..80af9a7 --- /dev/null +++ b/etc/init.d/mdev @@ -0,0 +1 @@ +../../usr/lib/init/services/mdev.service \ No newline at end of file diff --git a/etc/init.d/ntpd b/etc/init.d/ntpd new file mode 120000 index 0000000..585a03d --- /dev/null +++ b/etc/init.d/ntpd @@ -0,0 +1 @@ +../../usr/lib/init/services/ntpd.service \ No newline at end of file diff --git a/etc/init.d/swap b/etc/init.d/swap new file mode 120000 index 0000000..b96882c --- /dev/null +++ b/etc/init.d/swap @@ -0,0 +1 @@ +../../usr/lib/init/services/swap.service \ No newline at end of file diff --git a/etc/mdev.conf b/etc/mdev.conf new file mode 100644 index 0000000..6ba94ae --- /dev/null +++ b/etc/mdev.conf @@ -0,0 +1,157 @@ +# +# This is a sample mdev.conf. +# + +# Devices: +# Syntax: %s %d:%d %s +# devices user:group mode + +$MODALIAS=.* root:root 0660 @modprobe -q -b "$MODALIAS" + +# null does already exist; therefore ownership has to be changed with command +null root:root 0666 @chmod 666 $MDEV +zero root:root 0666 +full root:root 0666 + +random root:root 0666 +urandom root:root 0444 +hwrandom root:root 0660 + +console root:tty 0600 + +# load frambuffer console when first frambuffer is found +fb0 root:video 0660 @modprobe -q -b fbcon + +fd0 root:floppy 0660 +kmem root:kmem 0640 +mem root:kmem 0640 +port root:kmem 0640 +ptmx root:tty 0666 + +# Kernel-based Virtual Machine. +kvm root:kvm 660 + +# ram.* +ram([0-9]*) root:disk 0660 >rd/%1 +loop([0-9]+) root:disk 0660 >loop/%1 + +# persistent storage +dasd.* root:disk 0660 */lib/mdev/persistent-storage +mmcblk.* root:disk 0660 */lib/mdev/persistent-storage +nbd.* root:disk 0660 */lib/mdev/persistent-storage +nvme.* root:disk 0660 */lib/mdev/persistent-storage +sd[a-z].* root:disk 0660 */lib/mdev/persistent-storage +sr[0-9]+ root:cdrom 0660 */lib/mdev/persistent-storage +vd[a-z].* root:disk 0660 */lib/mdev/persistent-storage +xvd[a-z].* root:disk 0660 */lib/mdev/persistent-storage + +md[0-9] root:disk 0660 + +tty root:tty 0666 +tty[0-9] root:root 0600 +tty[0-9][0-9] root:tty 0660 +ttyS[0-9]* root:dialout 0660 +ttyGS[0-9] root:root 0660 +pty.* root:tty 0660 +vcs[0-9]* root:tty 0660 +vcsa[0-9]* root:tty 0660 + +# rpi bluetooth +#ttyAMA0 root:tty 660 @btattach -B /dev/$MDEV -P bcm -S 115200 -N & + +ttyACM[0-9] root:dialout 0660 @ln -sf $MDEV modem +ttyUSB[0-9] root:dialout 0660 @ln -sf $MDEV modem +ttyLTM[0-9] root:dialout 0660 @ln -sf $MDEV modem +ttySHSF[0-9] root:dialout 0660 @ln -sf $MDEV modem +slamr root:dialout 0660 @ln -sf $MDEV slamr0 +slusb root:dialout 0660 @ln -sf $MDEV slusb0 +fuse root:root 0666 + +# mobile broadband modems +cdc-wdm[0-9]+ root:dialout 0660 + +# dri device +dri/.* root:video 0660 +card[0-9] root:video 0660 =dri/ + +# alsa sound devices and audio stuff +pcm.* root:audio 0660 =snd/ +control.* root:audio 0660 =snd/ +midi.* root:audio 0660 =snd/ +seq root:audio 0660 =snd/ +timer root:audio 0660 =snd/ + +adsp root:audio 0660 >sound/ +audio root:audio 0660 >sound/ +dsp root:audio 0660 >sound/ +mixer root:audio 0660 >sound/ +sequencer.* root:audio 0660 >sound/ + +SUBSYSTEM=sound;.* root:audio 0660 + +# PTP devices +ptp[0-9] root:root 0660 */lib/mdev/ptpdev + +# virtio-ports +SUBSYSTEM=virtio-ports;vport.* root:root 0600 @mkdir -p virtio-ports; ln -sf ../$MDEV virtio-ports/$(cat /sys/class/virtio-ports/$MDEV/name) + +# misc stuff +agpgart root:root 0660 >misc/ +psaux root:root 0660 >misc/ +rtc root:root 0664 >misc/ + +# input stuff +SUBSYSTEM=input;.* root:input 0660 + +# v4l stuff +-vbi[0-9] root:video 0660 +vbi[0-9] root:video 0660 >v4l/ +-video[0-9]+ root:video 0660 +video[0-9]+ root:video 0660 >v4l/ +-media[0-9]+ root:video 0660 +media[0-9]+ root:video 0660 >v4l/ + +# dvb stuff +dvb.* root:video 0660 */lib/mdev/dvbdev + +# VideoCore VC4 BCM GPU specific (as in Pi devices) +vchiq root:video 0660 +vcio root:video 0660 +vcsm-cma root:video 0660 +vc-mem root:video 0660 + +# load drivers for usb devices +usb[0-9]+ root:root 0660 */lib/mdev/usbdev + +# net devices +# 666 is fine: https://www.kernel.org/doc/Documentation/networking/tuntap.txt +net/tun[0-9]* root:netdev 0666 +net/tap[0-9]* root:netdev 0666 +SUBSYSTEM=net;INTERFACE=.*;.* root:root 600 @test -r /etc/mactab && nameif -s + +# zaptel devices +zap(.*) root:dialout 0660 =zap/%1 +dahdi!(.*) root:dialout 0660 =dahdi/%1 +dahdi/(.*) root:dialout 0660 =dahdi/%1 + +# raid controllers +cciss!(.*) root:disk 0660 =cciss/%1 +cciss/(.*) root:disk 0660 =cciss/%1 +ida!(.*) root:disk 0660 =ida/%1 +ida/(.*) root:disk 0660 =ida/%1 +rd!(.*) root:disk 0660 =rd/%1 +rd/(.*) root:disk 0660 =rd/%1 + +# tape devices +nst[0-9]+.* root:tape 0660 +st[0-9]+.* root:tape 0660 + +# VirtualBox devices +vboxguest root:root 0600 +vboxuser root:root 0666 +vboxdrv root:root 0600 +vboxdrvu root:root 0666 +vboxnetctl root:root 0600 + +# fallback for any!device -> any/device +(.*)!(.*) root:root 0660 =%1/%2 diff --git a/etc/modprobe.d/.gitkeep b/etc/modprobe.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/modules-load.d/.gitkeep b/etc/modules-load.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/motd b/etc/motd new file mode 100644 index 0000000..2131d63 --- /dev/null +++ b/etc/motd @@ -0,0 +1,3 @@ +Welcome to Simple Linux! + +You may change this message by editing /etc/motd. diff --git a/etc/ntp.conf b/etc/ntp.conf new file mode 100644 index 0000000..00369ba --- /dev/null +++ b/etc/ntp.conf @@ -0,0 +1,5 @@ +config timeserver 'ntp' + option enabled '1' + option enable_server '0' # Set to '1' to enable NTP server functionality + list server 'pool.ntp.org' + list server 'time.nist.gov' diff --git a/etc/periodic/15min/.gitkeep b/etc/periodic/15min/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/periodic/daily/.gitkeep b/etc/periodic/daily/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/periodic/monthly/.gitkeep b/etc/periodic/monthly/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/periodic/weekly/.gitkeep b/etc/periodic/weekly/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/usr/lib/init/services/mdev.service b/usr/lib/init/services/mdev.service new file mode 100644 index 0000000..0f17432 --- /dev/null +++ b/usr/lib/init/services/mdev.service @@ -0,0 +1,35 @@ +#!/bin/sh + +#--- import colors and init-funcs --- +. /usr/lib/init/colors.sh +. /usr/lib/init/init-funcs.sh +#------------------------------------ + +start() { + notify "Starting mdev" + mkdir -p /dev + echo "/sbin/mdev" > /proc/sys/kernel/hotplug + for i in $(find /sys/devices -name 'usb[0-9]*'); do + [ -e $i/uevent ] && echo add > $i/uevent + done + /usr/bin/mdev -s -S + check $? "start mdev" + return $? +} + +stop() { + notify "Stopping mdev" + echo > /proc/sys/kernel/hotplug + check $? "stop mdev" + return $? +} + +case "$1" in + start|stop|restart|reload|help) + "$1" + ;; + *) + help + return 1 +esac +return $? diff --git a/usr/lib/init/services/ntpd.service b/usr/lib/init/services/ntpd.service new file mode 100644 index 0000000..75278b0 --- /dev/null +++ b/usr/lib/init/services/ntpd.service @@ -0,0 +1,37 @@ +#!/bin/sh + +#--- import colors and init-funcs --- +. /usr/lib/init/colors.sh +. /usr/lib/init/init-funcs.sh +#------------------------------------ + +NTPD_OPTS="-N -p pool.ntp.org -n" +if [ -f /etc/ntp.conf ]; then + NTPD_OPTS="-N -n" +fi + +start() { + notify "Starting ntpd" + /usr/bin/ntpd $NTPD_OPTS & + check $? "start ntpd" + echo $(pgrep ntpd) > /var/run/ntpd.pid + return $? +} + +stop() { + notify "Stopping ntpd" + kill $(cat /var/run/ntpd.pid) + check $? "stop ntpd" + rm /var/run/ntpd.pid &> /dev/null + return $? +} + +case "$1" in + start|stop|restart|reload|help) + "$1" + ;; + *) + help + return 1 +esac +return $? diff --git a/usr/lib/init/services/swap.service b/usr/lib/init/services/swap.service new file mode 100644 index 0000000..c5c606a --- /dev/null +++ b/usr/lib/init/services/swap.service @@ -0,0 +1,33 @@ +#!/bin/sh + +#--- import colors and init-funcs --- +. /usr/lib/init/colors.sh +. /usr/lib/init/init-funcs.sh +#------------------------------------ + +SWAPON_OPTS="-a" +SWAPOFF_OPTS="-a" + +start() { + notify "Starting swap" + /usr/bin/swapon $SWAPON_OPTS + check $? "start swap" + return $? +} + +stop() { + notify "Stopping swap" + /usr/bin/swapoff $SWAPOFF_OPTS + check $? "stop swap" + return $? +} + +case "$1" in + start|stop|restart|reload|help) + "$1" + ;; + *) + help + return 1 +esac +return $? diff --git a/usr/lib/init/services/syslogd.service b/usr/lib/init/services/syslogd.service index c6c1ddc..3add002 100755 --- a/usr/lib/init/services/syslogd.service +++ b/usr/lib/init/services/syslogd.service @@ -7,7 +7,7 @@ start() { notify "Starting syslogd" - /usr/bin/syslogd + /usr/bin/syslogd -t -n & check $? "start syslogd" return $? } diff --git a/usr/share/rc/orders b/usr/share/rc/orders index 1abaeeb..c9c23e8 100644 --- a/usr/share/rc/orders +++ b/usr/share/rc/orders @@ -1,19 +1,22 @@ 01hostname 02klogd 03syslogd -04swap -05networking -06sysctl -07crond -08dnsmasq -09dnsd -10telnetd -11sshd -12iptables -13ftpd -14hostapd -15httpd -16nginx -17openrouterinit -18dropbear -19gitea +04mdev +05swap +06networking +07ntpd +08netplugd +09sysctl +10crond +11dnsmasq +12dnsd +13telnetd +14sshd +15iptables +16ftpd +17hostapd +18httpd +19nginx +20openrouterinit +21dropbear +22gitea diff --git a/var/spool/cron/crontabs/.gitkeep b/var/spool/cron/crontabs/.gitkeep new file mode 100644 index 0000000..e69de29