Initial commit

This commit is contained in:
Alex D. 2022-03-21 12:25:55 +00:00
commit 9c644ac828
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
194 changed files with 23030 additions and 0 deletions

View File

@ -0,0 +1,43 @@
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=arm-trusted-firmware
pkgver=2.6
pkgrel=0
pkgdesc="ARM Trusted Firmware-A (TF-A)"
url="https://github.com/ARM-software/arm-trusted-firmware"
arch="aarch64"
license="BSD-3-Clause"
makedepends="dtc openssl1.1-compat-dev gcc-arm-none-eabi"
source="https://github.com/ARM-software/arm-trusted-firmware/archive/v$pkgver/arm-trusted-firmware-v$pkgver.tar.gz
rk3399-baudrate.patch"
options="!check" # No tests
_plats="sun50i_a64 sun50i_h6 rk3399"
build() {
unset LDFLAGS
for plat in $_plats; do
make PLAT=$plat bl31
done
}
package() {
for plat in $_plats; do
case $plat in
rk3399)
install -D "$builddir"/build/$plat/release/bl31/bl31.elf \
"$pkgdir"/usr/share/$pkgname/$plat/bl31.elf
;;
*)
install -D "$builddir"/build/$plat/release/bl31.bin \
"$pkgdir"/usr/share/$pkgname/$plat/bl31.bin
;;
esac
done
}
sha512sums="
8b20964b1b672898268e27424984af0ef9e95b38f426370ed4b802f67fc204db5f467886707dce77e4560548e01777a6c36d4eb801842c7d1f2ff6ca5d9b7dd1 arm-trusted-firmware-v2.6.tar.gz
86d8c60157145ab05e9b870aad11d2acaf2137ba00bf71419f8a54a4fd2b1906c19bc8bfeccc735344d1dcf11ba81bd9396bfd8854cdb972a72503b632d1e900 rk3399-baudrate.patch
"

View File

@ -0,0 +1,23 @@
From b3fc3a853b8357afd3a010a765072d27f640f5e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu>
Date: Sat, 14 Sep 2019 11:09:01 +0100
Subject: [PATCH] Increase BAUD_RATE to 1500000, so that it matches U-Boot and
kernel.
---
plat/rockchip/rk3399/rk3399_def.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
index ba83242e..8d6ecfbe 100644
--- a/plat/rockchip/rk3399/rk3399_def.h
+++ b/plat/rockchip/rk3399/rk3399_def.h
@@ -17,7 +17,7 @@
/**************************************************************************
* UART related constants
**************************************************************************/
-#define RK3399_BAUDRATE 115200
+#define RK3399_BAUDRATE 1500000
#define RK3399_UART_CLOCK 24000000
/******************************************************************************

87
main/lfsbase/APKBUILD Normal file
View File

@ -0,0 +1,87 @@
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=lfsbase
pkgver=1.0
pkgrel=0
pkgdesc="Base directory structure for linux"
url="none"
arch="noarch"
license="GPL-2.0-only"
options="!check"
install="
$pkgname.pre-install
$pkgname.post-install
$pkgname.pre-upgrade
$pkgname.post-upgrade
"
source="
group
passwd
profile
"
builddir="$srcdir/build"
prepare() {
default_prepare
mkdir -p "$builddir"
}
_passwd2shadow() {
local name="$(echo "$1" | cut -d: -f1)"
printf '%s:!:::::::\n' "$name"
}
build() {
while read -r LINE; do
_passwd2shadow "$LINE"
done < "$srcdir"/passwd > shadow
}
package() {
mkdir -p "$pkgdir"
cd "$pkgdir"
install -m 0755 -d \
etc \
var \
mnt \
proc \
run \
sys
install -d -m 0700 root
install -d -m 1777 tmp
ln -s /run var/run
ln -s /tmp var/tmp
echo "localhost" > etc/hostname
cat > etc/hosts <<-EOF
127.0.0.1 localhost localhost.localdomain
::1 localhost localhost.localdomain
EOF
cat > etc/shells <<-EOF
# valid login shells
/bin/sh
/bin/ash
EOF
install -m644 \
"$srcdir"/group \
"$srcdir"/passwd \
"$srcdir"/profile \
etc/
install -m640 "$builddir"/shadow \
etc/
# symlinks
ln -s /proc/mounts etc/mtab
}
sha512sums="
e322a393aee9633981cb8669af30429899fed859e9709d4b888d17af43feb65474fe822e7aa8f06e7127ee7b6cf2d66d2f56698fd4314e0f8ab737ce275d1914 group
f6fe247889a9c09a1c6ac6b1f5baae9ecc9f6300594428dc04dd8e7543c06b4774f57cf034e970a913faf7bbf0aff28b170e5c6425ab04b380b34a3b80a3b529 passwd
2e0c19c08bc161278db950ca66c138091724a134ccbaa655cb7efa933f32ce28cfc006a563d0c150646c8ac7b6c84ab03f0958fd1a55c17e7d3f91c9ff0c1e94 profile
"

4
main/lfsbase/group Normal file
View File

@ -0,0 +1,4 @@
root:x:0:root
shadow:x:42:
nogroup:x:65533:
nobody:x:65534:

View File

@ -0,0 +1,4 @@
#!/bin/sh
# force /etc/shadow to be owned by root and not be world readable
chown root:shadow /etc/shadow

View File

@ -0,0 +1 @@
lfsbase.post-install

View File

@ -0,0 +1,5 @@
#!/bin/sh
addgroup -S -g 42 shadow 2>/dev/null
exit 0

View File

@ -0,0 +1 @@
lfsbase.pre-install

2
main/lfsbase/passwd Normal file
View File

@ -0,0 +1,2 @@
root:x:0:0:root:/root:/bin/ash
nobody:x:65534:65534:nobody:/:/sbin/nologin

23
main/lfsbase/profile Normal file
View File

@ -0,0 +1,23 @@
# Append "$1" to $PATH when not already in.
# Copied from Arch Linux, see #12803 for details.
append_path () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
;;
esac
}
append_path "/usr/local/sbin"
append_path "/usr/local/bin"
append_path "/usr/sbin"
append_path "/usr/bin"
append_path "/sbin"
append_path "/bin"
unset -f append_path
export PATH
export PAGER=less
umask 022

View File

@ -0,0 +1,29 @@
From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Mon, 20 Jan 2014 21:31:34 +0100
Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
the declaration of struct sysinfo clashes with userspace.
it's not quite clear why that header was included from kernel.h,
as none of its functionality is needed.
---
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Submitted
include/uapi/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
index fadf2db71fe8..813800ed141f 100644
--- a/include/uapi/linux/kernel.h
+++ b/include/uapi/linux/kernel.h
@@ -2,7 +2,9 @@
#ifndef _UAPI_LINUX_KERNEL_H
#define _UAPI_LINUX_KERNEL_H
+#ifdef __GLIBC__
#include <linux/sysinfo.h>
+#endif
#include <linux/const.h>
#endif /* _UAPI_LINUX_KERNEL_H */

View File

@ -0,0 +1,73 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=linux-headers
_kver=5.16
_kpatch=16
pkgver=$_kver.$_kpatch
pkgrel=0
source="
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz
include-uapi-linux-swab-Fix-potentially-missing-__always_inline.patch
0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
"
_kabi= _klocalver= _kconfig= _kbdmain= _kbddev= _kflavor=
_kdir_src="$srcdir/linux-$pkgver"
arch="noarch"
_depends_dev="
perl
gmp-dev
elfutils-dev
bash
flex
bison
"
makedepends="
$_depends_dev
sed
installkernel
bc
openssl-dev
diffutils
findutils
"
pkgdesc="Linux Kernel - Headers"
url="https://www.kernel.org"
license="GPL-2.0"
options="!strip"
builddir="$_kdir_src"
_carch=${CARCH} # abuild to kernel arch mapping
case "$_carch" in
aarch64*) _carch="arm64" ;;
arm*) _carch="arm" ;;
mips*) _carch="mips" ;;
ppc*) _carch="powerpc" ;;
s390*) _carch="s390" ;;
esac
package() {
local _outdir="$pkgdir/usr"
mkdir -p "$_outdir"
cd "$_kdir_src"
make headers_install \
ARCH="$_carch" \
INSTALL_HDR_PATH="$_outdir"
rm -f **/.install **/install.cmd
rm -rf "$_outdir/include/drm" # provided by libdrm-dev
}
sha512sums="
a922b950fd3803b922be40c826554359f44f9eea8bc44be89c1db1e7173fb7726601373fdf37256eab85a644eccc774fdbcec407c7154c233117e0331f028ef8 linux-5.16.16.tar.xz
7cfa786144009c52d682e307bb512156e4812d7abe03b3fed99651a02d80567d47ee6f347f88d083c1b9805e0c09625fc3df08a8d0ae96b169d24eb5b83917b7 include-uapi-linux-swab-Fix-potentially-missing-__always_inline.patch
607c074d72aca88fea9ecdbd62198d8f7857daca75e5d027966e0a9997338d6ac8ce0a1e9114b19232b390751d05acca09e28b0cfad2a12d5942f5575a9f4684 0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
"

View File

@ -0,0 +1,55 @@
From 2b7d2ece0b60b8f450f29119f28668dc74bb692e Mon Sep 17 00:00:00 2001
From: Matt Redfearn <matt.redfearn@mips.com>
Date: Wed, 3 Jan 2018 09:57:30 +0000
Subject: [PATCH] include/uapi/linux/swab: Fix potentially missing
__always_inline
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining
of some byteswap operations") added __always_inline to swab functions
and commit 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to
userspace headers") added a definition of __always_inline for use in
exported headers when the kernel's compiler.h is not available.
However, since swab.h does not include stddef.h, if the header soup does
not indirectly include it, the definition of __always_inline is missing,
resulting in a compilation failure, which was observed compiling the
perf tool using exported headers containing this commit:
In file included from /usr/include/linux/byteorder/little_endian.h:12:0,
from /usr/include/asm/byteorder.h:14,
from tools/include/uapi/linux/perf_event.h:20,
from perf.h:8,
from builtin-bench.c:18:
/usr/include/linux/swab.h:160:8: error: unknown type name __always_inline
static __always_inline __u16 __swab16p(const __u16 *p)
Fix this by replacing the inclusion of linux/compiler.h with
linux/stddef.h to ensure that we pick up that definition if required,
without relying on it's indirect inclusion. compiler.h is then included
indirectly, via stddef.h.
Fixes: 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to userspace headers")
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
---
include/uapi/linux/swab.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
index 7272f85d6d6a..3736f2fe1541 100644
--- a/include/uapi/linux/swab.h
+++ b/include/uapi/linux/swab.h
@@ -3,7 +3,7 @@
#define _UAPI_LINUX_SWAB_H
#include <linux/types.h>
-#include <linux/compiler.h>
+#include <linux/stddef.h>
#include <asm/bitsperlong.h>
#include <asm/swab.h>
--
2.27.0

236
main/linux/APKBUILD Normal file
View File

@ -0,0 +1,236 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=linux
_kver=5.16
_kpatch=16
pkgver=$_kver.$_kpatch
pkgrel=0
_configs="
config-full.x86_64
config-slim.x86_64
config-rockpro64.aarch64
"
source="
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz
$_configs
"
_kabi= _klocalver= _kconfig= _kbdmain= _kbddev= _kflavor=
_kdir_src="$srcdir/linux-$pkgver"
arch="noarch"
_depends_dev="
perl
gmp-dev
elfutils-dev
bash
flex
bison
"
makedepends="
$_depends_dev
sed
linux-headers
installkernel
bc
openssl-dev
diffutils
findutils
"
pkgdesc="Linux Kernel - Metapackage"
url="https://www.kernel.org"
license="GPL-2.0"
options="!strip"
builddir="$_kdir_src"
_carch=${CARCH} # abuild to kernel arch mapping
case "$_carch" in
aarch64*) _carch="arm64" ;;
arm*) _carch="arm" ;;
mips*) _carch="mips" ;;
ppc*) _carch="powerpc" ;;
s390*) _carch="s390" ;;
esac
_archflavors() {
for i in $_configs; do
local _nocfg="${i#config-}"
local _arch="${_nocfg#*.}"
local _flavour="${_nocfg%.*}"
[ "$_arch" == "$CARCH" ] && echo "$_flavour"
done
}
_bvars() {
_kconfig="config-$_kflavor.$CARCH"
_kdir_main="$srcdir/build-$_kflavor.$CARCH"
_kdir_dev="$srcdir/build-$_kflavor-dev.$CARCH"
_ksaf="$_kflavor"
_kabi="$pkgver-$pkgrel-$_ksaf"
_klocalver="-$pkgrel-$_ksaf"
}
_spvars() {
_kflavor="$(echo $subpkgname | cut -d- -f2)"
}
for _kflavor in $(_archflavors); do
_bvars
subpackages="
$subpackages
$pkgname-$_ksaf:_pkg_kernel:$CBUILD_ARCH
$pkgname-$_ksaf-dev:_pkg_extmod:$CBUILD_ARCH
"
done
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
prepare() {
default_prepare
for _kflavor in $(_archflavors); do
_bvars
for _kbuilddir in "$_kdir_main" "$_kdir_dev"; do
mkdir -p "$_kbuilddir"
echo "$_klocalver" > "$_kbuilddir"/localversion-alpine \
|| return 1
cp "$srcdir"/"$_kconfig" "$_kbuilddir"/.config
make -C "$_kdir_src" \
O="$_kbuilddir" \
ARCH="$_carch" \
olddefconfig
done
done
}
build() {
unset LDFLAGS
for _kflavor in $(_archflavors); do
_bvars
# Build kernel and modules
msg "Building $_kflavor for $CARCH"
cd "$_kdir_main"
make \
ARCH="$_carch" \
CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine"
# Build out-of-tree builder
msg "Building $_kflavor-dev for $CARCH"
cd "$_kdir_dev"
make syncconfig \
ARCH="$_carch"
make prepare \
ARCH="$_carch"
make modules_prepare \
ARCH="$_carch"
make scripts \
ARCH="$_carch"
done
}
package() {
mkdir -p "$pkgdir"
}
_pkg_kernel() {
_spvars
_bvars
local _install=
case "$CARCH" in
arm*|aarch64) _install="zinstall dtbs_install";;
*) _install=install;;
esac
local _outdir="$subpkgdir"
mkdir -p "$_outdir"/boot "$_outdir"/lib/modules
cd "$_kdir_main"
# Install modules
make modules_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$_outdir"
# Install kernel
make $_install \
ARCH="$_carch" \
INSTALL_PATH="$_outdir"/boot \
INSTALL_DTBS_PATH="$_outdir/boot/dtbs-$_ksaf"
# Remove incorrect build-time symlinks
rm -f "$_outdir"/lib/modules/"$_kabi"/build \
"$_outdir"/lib/modules/"$_kabi"/source
rm -rf "$_outdir"/lib/firmware
# Install release file
install -D -m644 include/config/kernel.release \
"$_outdir"/usr/share/kernel/"$_kflavor"/kernel.release
}
_pkg_extmod() {
_spvars
_bvars
depends="$_depends_dev"
local _outdir="$subpkgdir/usr/src/linux-headers-$_kabi" _builddir="$subpkgdir/lib/modules/$_kabi"
mkdir -p "$_outdir"
cd "$_kdir_dev"
msg "Copying kernel out-of-tree build files"
rm Makefile source
cp -a . "$_outdir"
cd "$_kdir_src"
msg "Copying kernel out-of-tree build tree"
cp -a scripts include "$_outdir"
find . \
-path './include/*' -prune -o \
-path './scripts/*' -prune -o \
-type f \( \
-name 'Makefile*' -o \
-name 'Kconfig*' -o \
-name 'Kbuild*' -o \
-name '*.sh' -o \
-name '*.pl' -o \
-name '*.lds' -o \
-name 'Platform' \
\) -print | \
cpio -pdm "$_outdir"
find ./arch \
-path './arch/*/include/*' \
-type f -print | \
cpio -pdm "$_outdir"
mkdir -p "$_builddir"
ln -sf "/usr/src/linux-headers-$_kabi" "$_builddir"/build
}
sha512sums="
a922b950fd3803b922be40c826554359f44f9eea8bc44be89c1db1e7173fb7726601373fdf37256eab85a644eccc774fdbcec407c7154c233117e0331f028ef8 linux-5.16.16.tar.xz
0db424b64b50a1ffda7a8591526eb3d4d77b97b74aeee49810ef05730f95622573775026073ce57e43b4389c5c2ba075be42c49b5c3fd5e745d8c6b948a77b62 config-full.x86_64
acc7f183a6773d3de0e10c808cbfadb7b54b6f9fcf891234473adef449f87e04a486ed6ec3fae106d0ff10f0c4bc3224971319aeba03fbcaafb1590e89c5ae84 config-slim.x86_64
ad69e8a63a9aae01191e751520dc50ed43397770b90b154e9b4fc5129765f29d93d36f219ee62dda9f3826fdc0e2b312aaaac2edc998c1a073efb1200ada1338 config-rockpro64.aarch64
"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=nnd-s6-linux-init
pkgver=0.1
pkgrel=0
pkgdesc="Skeleton for nnd-s6-services"
url="none"
arch="noarch"
license="CC0-1.0"
builddir="$srcdir/"
prepare() {
default_prepare
cp -R "$startdir"/skel "$builddir"/skel
}
package() {
mkdir -p "$pkgdir"/etc/s6-linux-init
mv "$builddir"/skel "$pkgdir"/etc/s6-linux-init/nnd-skel
}

View File

@ -0,0 +1,25 @@
#!/bin/sh -e
rl="$1"
shift
### argv now contains the arguments of the kernel command line that are
### not of the form key=value. (The key=value arguments were stored by
### s6-linux-init into an envdir, if instructed so via the -s option.)
### Normally this argv remains unused because programs that need the
### kernel command line usually read it later on from /proc/cmdline -
### but just in case, it's available here.
### 1. Early preparation
### This is done only once at boot time.
### Ideally, this phase should just initialize the service manager.
s6-rc-init -d -c /etc/s6/sv/current /run/service
### 2. Starting the wanted set of services
### This is also called every time you change runlevels with telinit.
### (edit the location to suit your installation)
### By default, $rl is the string "default", unless you changed it
### via the -D option to s6-linux-init-maker.
### Numeric arguments from 1 to 5 on the kernel command line will
### override the default.
exec /etc/s6-linux-init/current/scripts/runlevel "$rl"

View File

@ -0,0 +1,17 @@
#!/bin/sh -e
### Things to do before hardware halt/reboot/poweroff.
### Ideally, it should be a single call to the service manager,
### telling it to bring all the services down.
### If your s6-linux-init-maker invocation was made with the -1
### option, messages from rc.shutdown will appear on /dev/console
### as well as be logged by the catch-all logger.
### If your s6-linux-init-maker invocation did NOT include the -1
### option, messages from rc.shutdown will only be logged by the
### catch-all logger and will NOT appear on /dev/console. In order
### to print them to /dev/console instead, you may want to
### uncomment the following line:
# exec >/dev/console 2>&1
exec s6-rc -v2 -bDa change

View File

@ -0,0 +1,18 @@
#!/bin/sh -e
### Things to do *right before* the machine gets rebooted or
### powered off, at the very end of the shutdown sequence,
### when all the filesystems are unmounted.
### This is a last resort hook; normally nothing should be
### done here (your rc.shutdown script should have taken care
### of everything) and you should leave this script empty.
### Some distributions, however, may need to perform some
### actions after unmounting the filesystems: typically if
### an additional teardown action is required on a filesystem
### after unmounting it, or if the system needs to be
### pivot_rooted before it can be shut down, etc.
### Those are all exceptional cases. If you don't know for
### certain that you need to do something here, you don't.

View File

@ -0,0 +1,11 @@
#!/bin/sh -e
### This script is called once at boot time by rc.init, and is
### also called by the runleveld service every time the user
### requests a machine state change via telinit.
### Ideally, it should just be a call to the service manager.
test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; }
### If your services are managed by s6-rc:
exec s6-rc -v2 -up change "$1"

View File

@ -0,0 +1,43 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=nnd-s6-services
pkgver=0.7
pkgrel=3
pkgdesc="Base services for s6"
url="none"
arch="noarch"
license="MIT"
depends="s6-rc s6-portable-utils s6-linux-utils"
subpackages="$pkgname-core $pkgname-net $pkgname-desktop"
builddir="$srcdir/"
prepare() {
default_prepare
cp -R "$startdir"/rc "$builddir"/rc
cp -R "$startdir"/env "$builddir"/env
cp "$startdir"/manage.sh "$builddir"/manage.sh
}
package() {
mkdir -p "$pkgdir"/etc/s6/sv
mv "$builddir"/rc "$pkgdir"/etc/s6/rc
mv "$builddir"/env "$pkgdir"/etc/s6/env
install -Dm755 "$builddir"/manage.sh "$pkgdir"/usr/bin/nnd-s6
}
core() {
amove etc/s6/rc/core
amove etc/s6/env/core
}
net() {
amove etc/s6/rc/net
}
desktop() {
amove etc/s6/rc/desktop
}
check() {
s6-rc-compile "$builddir"/compiled "$builddir"/rc/*
}

View File

@ -0,0 +1 @@
/var/log

View File

@ -0,0 +1 @@
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

57
main/nnd-s6-services/manage.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/sh
export PATH="/usr/bin:/bin"
error() {
: ${ERR:=1}
echo "$@" >&2
return "$ERR"
}
alt_ab() {
if [ "$1" == "a" ]; then echo "b"; else echo "a"; fi
}
: ${S6_PATH:='/etc/s6'}
: ${S6_RC_PATH:="$S6_PATH/rc"}
: ${S6_SV_PATH:="$S6_PATH/sv"}
# A/B mode, always keep last copy
DB_FRESH_ACT=""
DB_FRESH_NAC=""
cstate() {
DB_FRESH_ACT="$(readlink "$S6_SV_PATH/current" | cut -d. -f2)" # if it fails (missing), it will be empty and 'a' will be used as inactive by default
DB_FRESH_NAC="$(alt_ab "$DB_FRESH_ACT")"
}
generate() {
mkdir -p "$S6_SV_PATH" || ERR="$?" error "Failed to create sv directory"
# A/B current
if [ -d "$S6_SV_PATH/current.$DB_FRESH_NAC" ]; then
rm -rf "$S6_SV_PATH/current.$DB_FRESH_NAC" || ERR="$?" error "Failed to remove inactive database path"
fi
s6-rc-compile "$S6_SV_PATH/current.$DB_FRESH_NAC" "$S6_RC_PATH"/* || ERR="$?" error "Failed to compile current s6 database"
}
update() {
s6-rc-update "$S6_SV_PATH/current.$DB_FRESH_ACT" || ERR="$?" "Failed to update live state of the database"
}
swap() {
ln -sfn "current.$DB_FRESH_NAC" "$S6_SV_PATH/current" || ERR="$?" "Failed to update A/B current symlink"
}
for act in $@; do
cstate
if [ "$act" == "generate" ]; then
generate
elif [ "$act" == "update" ]; then
update
elif [ "$act" == "swap" ]; then
swap
else
error "Action must be generate, update or swap"
fi
done

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
exec hwclock -u --systz

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define DIR /var/log
fdclose 1
fdclose 2
exec mkdir -p $DIR

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define BAUD 38400
define TTY tty1
fdclose 1
fdclose 2
exec getty ${BAUD} ${TTY}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
define HOSTNAME localhost
export PATH $PATH
fdclose 1
fdclose 2
redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME

View File

@ -0,0 +1 @@
logger.klogd

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define READFROM /proc/kmsg
fdmove -c 2 1
foreground { redirfd -r 0 ${READFROM} } ucspilogd

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,17 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
if -t {
pipeline {
pipeline {
exec find /sys -name modalias -type f -print0
} exec xargs -0 exec sort -u
} exec xargs exec modprobe -b -a -s
}

View File

@ -0,0 +1 @@
klogd

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
export PATH $PATH
define LOGGERNAME klogd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
syslogd

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
export PATH $PATH
define LOGGERNAME syslogd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define MODULE apparmor
fdclose 1
fdclose 2
exec rmmod ${MODULE}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define MODULE apparmor
fdclose 1
fdclose 2
exec modprobe ${MODULE}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t devtmpfs none /dev
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t proc none /proc
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
exec mount -t tmpfs none /run

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define ROOTFSTYPE ext4
fdclose 1
fdclose 2
exec mount -t $ROOTFSTYPE -o remount,rw /

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,16 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define SECURITYFSPATH /sys/kernel/security
fdclose 1
fdclose 2
foreground {
exec mount -t securityfs securityfs $SECURITYFSPATH
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t sysfs none /sys
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
exec mount -t tmpfs none /tmp

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1 @@
logger.syslogd

View File

@ -0,0 +1,10 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define RUNAS nobody
s6-envuidgid ${RUNAS}
s6-socklog -d3 -U -t3000

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,20 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define SOCKET /run/utmps/.utmpd-socket
fdclose 1
fdclose 2
foreground { mkdir -p /var/log }
foreground { touch /var/log/wtmp }
foreground { chmod 644 /var/log/wtmp }
foreground { mkdir -p /run/utmps }
foreground { touch /run/utmps/utmp }
foreground { chmod 755 /run/utmps }
foreground { chmod 644 /run/utmps/utmp }
s6-ipcserver /run/utmps/.utmpd-socket utmps-utmpd

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1 @@
logger.dwm

Some files were not shown because too many files have changed in this diff Show More