Numerous changes to toolchain optional packages and world default packages

bin/head - accept -[num] style arguments
usr.bin/uname - alias -o to -s
This commit is contained in:
Nathan Fisher 2021-02-26 12:46:11 -05:00
parent 7fa225e680
commit 61db92519f
180 changed files with 1239 additions and 45 deletions

View File

@ -33,13 +33,13 @@ rootfs-tbz: rootfs-hhl-${os_version}-${arch}.tbz
rootfs-txz: rootfs-hhl-${os_version}-${arch}.txz rootfs-txz: rootfs-hhl-${os_version}-${arch}.txz
toolchain-hhl-${os_version}-${arch}.tgz: /toolchain/.built smalltools toolchain-hhl-${os_version}-${arch}.tgz: /toolchain/.built smalltools
cd build && tar -czf ../$@ toolchain cd build && paxtar -M uidgid -czf ../$@ toolchain
toolchain-hhl-${os_version}-${arch}.tbz: /toolchain/.built smalltools toolchain-hhl-${os_version}-${arch}.tbz: /toolchain/.built smalltools
cd build && tar -cjf ../$@ toolchain cd build && paxtar -M uidgid -cjf ../$@ toolchain
toolchain-hhl-${os_version}-${arch}.txz: /toolchain/.built smalltools toolchain-hhl-${os_version}-${arch}.txz: /toolchain/.built smalltools
cd build && tar -cJf ../$@ toolchain cd build && paxtar -M uidgid -cJf ../$@ toolchain
smalltools: /toolchain/.built smalltools: /toolchain/.built
$(MAKE) -C toolchain reduce-size $(MAKE) -C toolchain reduce-size
@ -47,7 +47,7 @@ smalltools: /toolchain/.built
buildtools: /toolchain/.built buildtools: /toolchain/.built
$(info $(grn)=== Temporary toolchain build ===$(reset)) $(info $(grn)=== Temporary toolchain build ===$(reset))
/toolchain/.built: | $(dirs) /toolchain/.built: config.mk | $(dirs)
$(info $(grn)=== Building temporary toolchain ===$(reset)) $(info $(grn)=== Building temporary toolchain ===$(reset))
$(MAKE) -C toolchain $(MAKE) -C toolchain
touch $@ touch $@
@ -67,12 +67,12 @@ buildworld: $(build)/.built $(plists)
strip: $(build)/.stripped strip: $(build)/.stripped
$(build)/.stripped: $(build)/.stripped:
for dir in ${stripdirs} ; \ for dir in $(stripdirs) ; \
do /toolchain/bin/strip --strip-debug $${dir}/* > \ do $(arch)-strip --strip-debug $${dir}/* > \
/dev/null 2>&1 || true ; done /dev/null 2>&1 || true ; done
touch $@ touch $@
$(build)/.built: $(build)/.skeleton.built $(build)/.built: /toolchain/.built $(build)/.skeleton.built
$(MAKE) -C world $(MAKE) -C world
touch $@ touch $@
@ -96,13 +96,13 @@ remove-toolchain:
$(MAKE) -C toolchain remove $(MAKE) -C toolchain remove
rootfs-hhl-$(os_version)-$(arch).tgz: $(plists) $(build)/.stripped rootfs-hhl-$(os_version)-$(arch).tgz: $(plists) $(build)/.stripped
cd build && tar -czf ../$@ $(alldirs) cd build && paxtar -M uidgid -czf ../$@ $(alldirs)
rootfs-hhl-$(os_version)-$(arch).tbz: $(plists) $(build)/.stripped rootfs-hhl-$(os_version)-$(arch).tbz: $(plists) $(build)/.stripped
cd build && tar -cjf ../$@ $(alldirs) cd build && paxtar -M uidgid -cjf ../$@ $(alldirs)
rootfs-hhl-$(os_version)-$(arch).txz: $(plists) $(build)/.stripped rootfs-hhl-$(os_version)-$(arch).txz: $(plists) $(build)/.stripped
cd build && tar -cJf ../$@ $(alldirs) cd build && paxtar -M uidgid -cJf ../$@ $(alldirs)
clean: clean:
$(MAKE) -C world clean $(MAKE) -C world clean

View File

@ -9,6 +9,10 @@
# riscv64 (SiFive Unmatched, BeagleV) # riscv64 (SiFive Unmatched, BeagleV)
arch = x86_64 arch = x86_64
# If building for rpi3/4 we can automatically configure and build u-boot
# by setting rpi to 1
# rpi = 1
# Maximum make threads to run concurrently. For some packages on some # Maximum make threads to run concurrently. For some packages on some
# architectures this will be automatically overridden. # architectures this will be automatically overridden.
makeflags = -j8 makeflags = -j8
@ -16,9 +20,22 @@ makeflags = -j8
# Optional bootstrap packages. HitchHiker ships with BSD paxtar, and it's syntax # Optional bootstrap packages. HitchHiker ships with BSD paxtar, and it's syntax
# is used rather than GNU tar in certain places. To bootstrap on systems other # is used rather than GNU tar in certain places. To bootstrap on systems other
# than HitchHiker it is a good idea to set build_pax to 1. # than HitchHiker it is a good idea to set build_pax to 1.
# build_pax = 1
# Similarly, GNU awk (gawk) is a build time dependency of Glibc, but HitchHiker # Similarly, GNU awk (gawk) is a build time dependency of Glibc, but HitchHiker
# ships with The One True Awk. By setting build_gawk to 1, we build a temporary # ships with The One True Awk. By setting build_gawk to 1, we build a temporary
# gawk which will only exist in /toolchain # gawk which will only exist in /toolchain
build_pax = 1
build_gawk = 1 build_gawk = 1
# If building on HitchHiker, Perl will need to be built as it is used repeatedly
# during the build of other packages. If perl is installed via pkgsrc this can
# be skipped.
build_perl = 1
# If building on HitchHiker, intltool is not part of the base system as it
# depends on the XML::Parser perl module.
build_intltool = 1
# Again, if building on HitchHiker, Python must be built either here or via
# pkgsrc.
build_python = 1

View File

@ -516,6 +516,8 @@ tzdata${tzdata_version}.tar.gz:
wget -c https://www.iana.org/time-zones/repository/releases/$@ wget -c https://www.iana.org/time-zones/repository/releases/$@
u-boot: u-boot-$(u-boot_version).tar.bz2 u-boot: u-boot-$(u-boot_version).tar.bz2
u-boot-$(u-boot_version).tar.bz2:
wget -c ftp://ftp.denx.de/pub/u-boot/$@ wget -c ftp://ftp.denx.de/pub/u-boot/$@
udev-lfs: udev-lfs-${udev-lfs_version}.tar.xz udev-lfs: udev-lfs-${udev-lfs_version}.tar.xz

View File

@ -4,15 +4,22 @@
include toolchain.mk include toolchain.mk
subdirs += binutils
subdirs += gcc-pass1
subdirs += linux-headers
ifeq ($(build_gawk), 1) ifeq ($(build_gawk), 1)
subdirs += gawk subdirs += gawk
endif endif
ifeq ($(build_pax), 1) ifeq ($(build_pax), 1)
subdirs += pax subdirs += pax
endif endif
ifeq ($(build_perl), 1)
subdirs += perl
subdirs += xml-parser
endif
ifeq ($(build_python), 1)
subdirs += python
endif
subdirs += binutils
subdirs += gcc-pass1
subdirs += linux-headers
subdirs += glibc subdirs += glibc
subdirs += gcc-pass2 subdirs += gcc-pass2

View File

@ -2,6 +2,6 @@
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com> # Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
# #
distname = gawk distname = gawk
include world.mk include toolchain.mk
config_opts += --disable-nls config_opts += --disable-nls
include targets.mk include targets.mk

View File

@ -0,0 +1,9 @@
# Makefile - hhl - /usr/src/world/intltool
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = intltool
distext = gz
patches = intltool-perl-warning.patch
include toolchain.mk
include targets.mk

View File

@ -0,0 +1,51 @@
diff -Naur intltool-0.51.0.orig/intltool-update.in intltool-0.51.0/intltool-update.in
--- intltool-0.51.0.orig/intltool-update.in 2015-03-08 21:39:54.000000000 -0400
+++ intltool-0.51.0/intltool-update.in 2020-05-31 18:49:45.382651247 -0400
@@ -1062,13 +1062,13 @@
}
}
- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
+ if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
{
my $rest = $3;
my $untouched = $1;
my $sub = "";
# Ignore recursive definitions of variables
- $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
+ $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\$\{?$2}?/;
return SubstituteVariable ("$untouched$sub$rest");
}
@@ -1190,10 +1190,10 @@
$name =~ s/\(+$//g;
$version =~ s/\(+$//g;
- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
}
if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
@@ -1219,11 +1219,11 @@
$version =~ s/\(+$//g;
$bugurl =~ s/\(+$//g if (defined $bugurl);
- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
- $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
+ $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
}
# \s makes this not work, why?

21
toolchain/perl/Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile - hhl - /usr/src/world/perl
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = perl
export BUILD_ZLIB = False
export BUILD_BZIP2 = 0
config_opts = -des
config_opts += -Dmksymlinks
config_opts += -Dprefix=/toolchain
config_opts += -Dvendorprefix=/usr
config_opts += -Dman1dir=/toolchain/share/man/man1
config_opts += -Dman3dir=/toolchain/share/man/man3
config_opts += -Duseshrplib
config_opts += -Dusethreads
include toolchain.mk
config_cmd = cd $(objdir) && $(srcdir)/Configure $(config_opts)
include targets.mk

15
toolchain/python/Makefile Normal file
View File

@ -0,0 +1,15 @@
# Makefile - hhl - /usr/src/world/python
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = python
include versions.mk
distfullname = Python-$(python_version)
include toolchain.mk
config_opts += --enable-ipv6
config_opts += --enable-shared
config_opts += --with-system-expat
config_opts += --with-system-ffi
config_opts += --with-ensurepip=yes
include targets.mk

View File

@ -0,0 +1,9 @@
# Makefile - hhl - /usr/src/world/xml-parser
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = XML-Parser
distext = gz
no_objdir = 1
include toolchain.mk
config_cmd = cd $(srcdir) && perl Makefile.PL
include targets.mk

View File

@ -40,20 +40,20 @@ subdirs += gdbm
subdirs += pcre subdirs += pcre
subdirs += zsh subdirs += zsh
subdirs += inetutils subdirs += inetutils
subdirs += perl #subdirs += perl
subdirs += autoconf subdirs += autoconf
subdirs += automake subdirs += automake
subdirs += gperf subdirs += gperf
subdirs += expat subdirs += expat
#subdirs += xml-parser #subdirs += xml-parser
subdirs += intltool #subdirs += intltool
subdirs += kmod subdirs += kmod
subdirs += gettext subdirs += gettext
subdirs += elfutils subdirs += elfutils
subdirs += libffi subdirs += libffi
subdirs += libressl subdirs += libressl
subdirs += wget subdirs += wget
subdirs += python #subdirs += python
#subdirs += ninja #subdirs += ninja
#subdirs += meson #subdirs += meson
subdirs += findutils subdirs += findutils
@ -75,16 +75,22 @@ subdirs += execline
subdirs += s6 subdirs += s6
subdirs += s6-rc subdirs += s6-rc
subdirs += s6-linux-init subdirs += s6-linux-init
#subdirs += udev-lfs subdirs += s6-scripts
subdirs += udev-lfs
subdirs += bin subdirs += bin
subdirs += sbin subdirs += sbin
subdirs += usr.bin subdirs += usr.bin
subdirs += usr.sbin subdirs += usr.sbin
subdirs += $(kernel) subdirs += $(kernel)
ifeq ($(arch),x86,64) ifeq ($(arch),x86_64)
#subdirs += grub subdirs += grub
else ifeq ($(arch),aarch64)
ifeq ($(rpi),1)
subdirs += u-boot-rpi64
endif endif
endif
ifeq ($(_dhcpcd),1) ifeq ($(_dhcpcd),1)
subdirs += dhcpcd subdirs += dhcpcd
endif endif

View File

@ -4,3 +4,8 @@
progname = env progname = env
onestage = true onestage = true
include hhl.cprog.openbsd.mk include hhl.cprog.openbsd.mk
install: | $(DESTDIR)/usr/bin/env
$(DESTDIR)/usr/bin/env:
ln -s ../../bin/env $@

View File

@ -26,9 +26,10 @@
* *
*/ */
#define _GNU_SOURCE // getline, getopt #define _GNU_SOURCE // getline, getopt
#include <ctype.h> // isprint #include <ctype.h> // isprint
#include <err.h> // err
#include <inttypes.h> // uint*_t #include <inttypes.h> // uint*_t
#include <libgen.h> // basename #include <libgen.h> // basename
#include <stdio.h> // fclose, fopen, getline, nread, perror, printf #include <stdio.h> // fclose, fopen, getline, nread, perror, printf
@ -36,16 +37,15 @@
#include <string.h> // strcmp #include <string.h> // strcmp
#include <unistd.h> // getopt #include <unistd.h> // getopt
uint8_t cflag = 0, qflag = 0, vflag = 0; uint8_t cflag = 0, nflag = 0, qflag = 0, vflag = 0;
int lines = 10, j = 0; int lines = 10, j = 0, chars = 0;
static const char *__progname; static const char *__progname;
static void usage() { static void usage() {
fprintf(stderr, fprintf(stderr, "Usage: %s [-hqv] [-c count] [-n lines] [FILE]...\n", __progname);
"Usage: %s [-hcqv] [-n number] [FILE]...\n", __progname);
} }
void _head(char * file) { void _head(char *file) {
FILE *fp; FILE *fp;
char *line = NULL; char *line = NULL;
size_t len = 0; size_t len = 0;
@ -65,11 +65,11 @@ void _head(char * file) {
else else
printf("==> %s <==\n", file); printf("==> %s <==\n", file);
} }
if (cflag) { if (cflag && !nflag) {
while (!feof(fp)) { while (!feof(fp)) {
putchar(fgetc(fp)); putchar(fgetc(fp));
i++; i++;
if (i>= lines) if (i >= chars)
break; break;
} }
} else { } else {
@ -83,7 +83,7 @@ void _head(char * file) {
} }
if (strcmp(file, "-") != 0) { if (strcmp(file, "-") != 0) {
fclose(fp); fclose(fp);
j = 1; j = 1;
} }
} }
@ -91,10 +91,25 @@ int main(int argc, char *argv[]) {
int c, index; int c, index;
__progname = basename(argv[0]); __progname = basename(argv[0]);
while ((c = getopt(argc, argv, "chqvn:")) != -1) /* Handle the old school -[0-9] style options */
if ((argv[1])[0] == '-' && isdigit((argv[1])[1])) {
char *x;
x = argv[1] + 1;
int i;
for (i = 0; i < sizeof(argv[1]); i++) {
if (!isdigit(x[i])) {
x[i] = '\0';
break;
}
}
lines = (int)strtol(x, NULL, 10);
}
while ((c = getopt(argc, argv, "c:hqvn:0123456789")) != -1)
switch (c) { switch (c) {
case 'c': case 'c':
cflag = 1; cflag = 1;
chars = (int)strtol(optarg, NULL, 10);
break; break;
case 'q': case 'q':
qflag = 1; qflag = 1;
@ -108,7 +123,19 @@ int main(int argc, char *argv[]) {
usage(); usage();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'n': case 'n':
lines = strtol(optarg, NULL, 10); nflag = 1;
lines = (int)strtol(optarg, NULL, 10);
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break; break;
default: default:
usage(); usage();

View File

@ -4,6 +4,8 @@
distname = binutils distname = binutils
include world.mk include world.mk
install_cmd = $(MAKE) DESTDIR=$(DESTDIR) -C $(objdir) install || true
config_opts += --host=$(tgt) config_opts += --host=$(tgt)
config_opts += --target=$(tgt) config_opts += --target=$(tgt)
config_opts += --with-build-sysroot=$(DESTDIR) config_opts += --with-build-sysroot=$(DESTDIR)

View File

@ -18,6 +18,5 @@ fi
if [ -x /usr/pkg/share/info ] if [ -x /usr/pkg/share/info ]
then INFOPATH=/usr/pkg/share/info:${INFOPATH} then INFOPATH=/usr/pkg/share/info:${INFOPATH}
fi fi
PKG_PATH=https://hitchhiker-linux.org/pub/${OS_VERSION}/${arch}/packages export PATH PKG_CONFIG_PATH MANPATH INFOPATH
export PATH PKG_CONFIG_PATH MANPATH INFOPATH PKG_PATH

View File

@ -9,6 +9,6 @@ config_opts += --sysconfdir=/etc
config_opts += --disable-efiemu config_opts += --disable-efiemu
config_opts += --disable-werror config_opts += --disable-werror
post_install = mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions post_install = mv -v $(DESTDIR)/etc/bash_completion.d/grub $(DESTDIR)/usr/share/bash-completion/completions
include targets.mk include targets.mk

Binary file not shown.

View File

@ -0,0 +1,5 @@
# Makefile - hhl - /src/world/bin/s6-scripts
# Copyright 2021 Nathan Fisher <nfisher.sr@gmail.com>
#
progname = modules-load
include hhl.script.mk

View File

@ -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.

View File

@ -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 "$@"

View File

@ -7,6 +7,6 @@ no_objdir = 1
include world.mk include world.mk
export CFLAGS = --sysroot=$(DESTDIR) export CFLAGS = --sysroot=$(DESTDIR)
config_opts += --host=$(tgt) config_opts += --host=$(tgt)
config_opts += --skeldir=/etc/s6-linux-init/skel config_opts += --skeldir=/etc/s6/skel
config_opts += --with-sysdeps=$(libdir)/skalibs/sysdeps config_opts += --with-sysdeps=$(libdir)/skalibs/sysdeps
include targets.mk include targets.mk

20
world/s6-scripts/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Makefile - hhl - /src/world/bin/s6-scripts
# Copyright 2021 Nathan Fisher <nfisher.sr@gmail.com>
#
progname = init
include hhl.script.mk
sysctl_libdir = $(DESTDIR)/usr/lib/sysctl.d
install: $(sysctl_libdir)/50-default.conf install_conf
$(sysctl_libdir)/50-default.conf: data/50-default.conf | $(sysctl_libdir)
install -m644 $< $@
install_conf:
cp -R etc $(DESTDIR)
$(sysctl_libdir):
install -d $@
.PHONY: install_conf

View File

@ -0,0 +1,42 @@
# See sysctl.d(5) and core(5) for documentation.
# System Request functionality of the kernel (SYNC)
#
# Use kernel.sysrq = 1 to allow all keys.
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html for a list
# of values and keys.
kernel.sysrq = 16
# Append the PID to the core filename
kernel.core_uses_pid = 1
# Source route verification
net.ipv4.conf.default.rp_filter = 2
-net.ipv4.conf.all.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
-net.ipv4.conf.all.accept_source_route = 0
# Promote secondary addresses when the primary address is removed
net.ipv4.conf.default.promote_secondaries = 1
-net.ipv4.conf.all.promote_secondaries = 1
# ping(8) without CAP_NET_ADMIN and CAP_NET_RAW
# The upper limit is set to 2^31-1. Values greater than that get rejected by
# the kernel because of this definition in linux/include/net/ping.h:
# #define GID_T_MAX (((gid_t)~0U) >> 1)
# That's not so bad because values between 2^31 and 2^32-1 are reserved on
# systemd-based systems anyway: https://systemd.io/UIDS-GIDS.html#summary
-net.ipv4.ping_group_range = 0 2147483647
# Fair Queue CoDel packet scheduler to fight bufferbloat
net.core.default_qdisc = fq_codel
# Enable hard and soft link protection
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
# Enable regular file and FIFO protection
fs.protected_regular = 1
fs.protected_fifos = 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,6 @@
#!/sbin/execlineb -P
redirfd -w 2 /dev/console
fdmove -c 1 2
foreground { s6-linux-init-echo -- "s6-svscan crashed. Rebooting." }
s6-linux-init-hpr -fr

View File

@ -0,0 +1,6 @@
#!/sbin/execlineb -P
redirfd -w 2 /dev/console
fdmove -c 1 2
foreground { s6-linux-init-echo -- "s6-svscan exited. Rebooting." }
s6-linux-init-hpr -fr

View File

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

View File

@ -0,0 +1,7 @@
#!/sbin/execlineb -P
fdmove -c 2 1
fdmove 1 3
s6-ipcserver -1 -a 0700 -c 1 -- s
s6-sudod -dt30000 --
"/etc/s6/current"/scripts/runlevel

View File

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

View File

@ -0,0 +1,5 @@
#!/sbin/execlineb -P
fdmove -c 1 2
redirfd -rnb 0 fifo
s6-log -bpd3 -- 1 t /run/uncaught-logs

View File

@ -0,0 +1,49 @@
#!/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.
### If your services are managed by sysv-rc:
# /etc/init.d/rcS
### If your services are managed by OpenRC:
# /sbin/openrc sysinit
# /sbin/openrc boot
### If your services are managed by s6-rc:
### (replace /run/service with your scandir)
s6-rc-init -c /etc/s6/rc/compiled /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/current/scripts/runlevel "$rl"
### If this script is run in a container, then 1. and 2. above do not
### apply and you should just call your CMD, if any, or let your
### services run.
### Something like this:
# if test -z "$*" ; then return 0 ; fi
# $@
# echo $? > /run/s6-linux-init-container-results/exitcode
# halt

View File

@ -0,0 +1,30 @@
#!/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
### If your services are managed by sysv-rc:
### also remove the K11reboot link from /etc/rc6.d to prevent
### sysv-rc from rebooting prematurely - because sysvinit does
### not properly separate state changes from system init/shutdown.
# exec /etc/init.d/rc 6
### If your services are managed by OpenRC:
### also remove the "killprocs" and "mount-ro" symlinks from
### /etc/runlevels/shutdown - because OpenRC does not properly
### separate the service manager from the shutdown manager either.
# exec /sbin/openrc shutdown
### If your services are managed by s6-rc:
exec s6-rc -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,18 @@
#!/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 sysv-rc:
# exec /etc/init.d/rc "$1"
### If your services are managed by OpenRC:
# exec /sbin/openrc "$1"
### If your services are managed by s6-rc:
exec s6-rc -up change "$1"

View File

@ -0,0 +1,6 @@
#!/bin/sh
#
# Enter custom commands here. By default, they will be executed on startup with the
# "boot" bundle before running services. If you need these commands to wait on certain
# services being up, you can edit the /etc/s6/sv/rc-local/dependencies file and then
# recompile the database.

View File

@ -0,0 +1,28 @@
# /etc/s6/s6.conf - system configuration
# 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.
HARDWARECLOCK=UTC
# 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

View File

@ -0,0 +1,49 @@
#!/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.
### If your services are managed by sysv-rc:
# /etc/init.d/rcS
### If your services are managed by OpenRC:
# /sbin/openrc sysinit
# /sbin/openrc boot
### If your services are managed by s6-rc:
### (replace /run/service with your scandir)
s6-rc-init -c /etc/s6/rc/compiled /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/current/scripts/runlevel "$rl"
### If this script is run in a container, then 1. and 2. above do not
### apply and you should just call your CMD, if any, or let your
### services run.
### Something like this:
# if test -z "$*" ; then return 0 ; fi
# $@
# echo $? > /run/s6-linux-init-container-results/exitcode
# halt

View File

@ -0,0 +1,30 @@
#!/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
### If your services are managed by sysv-rc:
### also remove the K11reboot link from /etc/rc6.d to prevent
### sysv-rc from rebooting prematurely - because sysvinit does
### not properly separate state changes from system init/shutdown.
# exec /etc/init.d/rc 6
### If your services are managed by OpenRC:
### also remove the "killprocs" and "mount-ro" symlinks from
### /etc/runlevels/shutdown - because OpenRC does not properly
### separate the service manager from the shutdown manager either.
# exec /sbin/openrc shutdown
### If your services are managed by s6-rc:
exec s6-rc -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,18 @@
#!/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 sysv-rc:
# exec /etc/init.d/rc "$1"
### If your services are managed by OpenRC:
# exec /sbin/openrc "$1"
### If your services are managed by s6-rc:
exec s6-rc -up change "$1"

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty1/conf
importas -iu SPAWN SPAWN
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty1 115200 } exec agetty -L -8 tty1 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty2/conf
importas -iu SPAWN SPAWN
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty2 115200 } exec agetty -L -8 tty2 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty3/conf
importas -iu SPAWN SPAWN
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty3 115200 } exec agetty -L -8 tty3 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/execlineb -P
if { pipeline { redirfd -w 2 /dev/null s6-rc -a list } grep -qFx mount-filesystems }
envfile /etc/s6/sv/agetty-tty4/conf
importas -iu SPAWN SPAWN
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty4 115200 } exec agetty -L -8 tty4 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/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
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty5 115200 } exec agetty -L -8 tty5 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1,5 @@
# Option to actually spawn the getty when the service starts. Set to "yes" to enable.
SPAWN="yes"
# User to autologin as. Leave blank to disable.
USER=""

View File

@ -0,0 +1 @@
hostname

View File

@ -0,0 +1,8 @@
#!/sbin/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
importas -iu USER USER
if -t { test ${SPAWN} = "yes" }
ifelse -X { test ${USER} = "" }
{ exec agetty -L -8 tty6 115200 } exec agetty -L -8 tty6 115200 -a ${USER}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
mount-procfs

View File

@ -0,0 +1,15 @@
#!/bin/sh
mountpoint -q /proc/sys/fs/binfmt_misc || \
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
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
reg=${line#*:}
[ -e /proc/sys/fs/binfmt_misc/${reg%%:*} ] && echo -1 > /proc/sys/fs/binfmt_misc/${reg%%:*}
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register
done
done

View File

@ -0,0 +1 @@
oneshot

View File

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

View File

@ -0,0 +1,4 @@
udev
mount
misc
setup

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,5 @@
#!/sbin/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 }
foreground { rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot }

View File

@ -0,0 +1 @@
early-getty-down

View File

@ -0,0 +1,16 @@
#!/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

View File

@ -0,0 +1 @@
oneshot

View File

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

View File

@ -0,0 +1 @@
boot

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1,2 @@
# This configures the directives used for s6-log in the log service.
DIRECTIVES="n3 s2000000 T"

View File

@ -0,0 +1 @@
remount-root

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,5 @@
#!/sbin/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
pipeline { dmesg } s6-setuidgid s6log exec -c s6-log -b -- ${DIRECTIVES} /var/log/dmesg

View File

@ -0,0 +1 @@
agetty-tty1

View File

@ -0,0 +1 @@
oneshot

View File

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

View File

@ -0,0 +1,6 @@
agetty-tty1
agetty-tty2
agetty-tty3
agetty-tty4
agetty-tty5
agetty-tty6

View File

@ -0,0 +1 @@
bundle

View File

@ -0,0 +1 @@
mount-procfs

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,3 @@
#!/sbin/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

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

View File

@ -0,0 +1 @@
oneshot

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