From f44e84ee528b07fb61ddc5a791968ac1c5589554 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Wed, 29 Dec 2021 23:46:58 -0500 Subject: [PATCH] Initial commit --- lsd/dist/documentation/trinitx.7 | 49 ++++++++++++++++++++++++++++++++ lsd/dist/install | 20 +++++++++++++ lsd/dist/macro.sh | 31 ++++++++++++++++++++ lsd/dist/sync_musl | 14 +++++++++ lsd/dist/trinitx | 11 +++++++ 5 files changed, 125 insertions(+) create mode 100644 lsd/dist/documentation/trinitx.7 create mode 100755 lsd/dist/install create mode 100644 lsd/dist/macro.sh create mode 100644 lsd/dist/sync_musl create mode 100755 lsd/dist/trinitx diff --git a/lsd/dist/documentation/trinitx.7 b/lsd/dist/documentation/trinitx.7 new file mode 100644 index 0000000..8038026 --- /dev/null +++ b/lsd/dist/documentation/trinitx.7 @@ -0,0 +1,49 @@ +.TH TRINITX 7 + +.SH PRONUNCIATION + +Trinity, but replace the final syllable with tech. + +.SH SYNOPSIS + +.I Trinitx +is a UNIX-like software distribution built upon the Linux kernel and the +musl C standard library, with nearly all configuration options left to the +user's own device. + +.SH BASE SYSTEM + +.I Trinitx +explicitly relies on the existence of the following programs and +packages: +dash(1), +ftp(1), +the GNU compiler collection, +GNU make, +musl, +linux, +bsdtar(1), +and util-linux. +.PP +In addition, +.I Trinitx +needs a core utilities package. +The GNU coreutils are a popular choice but Busybox or your own may be used. +.PP +.I Trinitx +also needs an initialization system. +OpenRC is the suggested choice but others may be used. +SystemD is discouraged; it's mentioned for its popularity and frowned upon for +its generally lax security. + +.SH HISTORY + +The +.I Trinitx +project was started 2021-12-28. + +.SH COPYRIGHT + +.I Trinitx +documentation and all in-house tools are part of the public domain. +Components of the distribution are of course subject to their own licenses. diff --git a/lsd/dist/install b/lsd/dist/install new file mode 100755 index 0000000..7517d25 --- /dev/null +++ b/lsd/dist/install @@ -0,0 +1,20 @@ +#!/bin/true +set -e + +depend_on cd +depend_on mkdir +depend_on nonzero +depend_on test + +if ! nonzero "$PREFIX"; then + printf 'Please select a $PREFIX for installation. +For example, "PREFIX=/ %s".\n' "$0" 1>&2 + exit 1 +fi + +# constant definitions +MUSL_UPSTREAM="git://git.musl-libc.org/musl" + +argv0="$0" + +trinitx sync_musl diff --git a/lsd/dist/macro.sh b/lsd/dist/macro.sh new file mode 100644 index 0000000..0a82a0d --- /dev/null +++ b/lsd/dist/macro.sh @@ -0,0 +1,31 @@ +#!/bin/true + +# constant definitions +MUSL_UPSTREAM="git://git.musl-libc.org/musl" + +depend_on(){ + ! command -v "$1" >/dev/null \ + && printf "Missing %s.\n" "$1" 1>&2 \ + && exit 1 \ + || true +} + +fetch_upstream(){ + url="$1" + scheme="$(scheme_from_uri "$url")" + case "$scheme" in + git) + git clone "$url" + ;; + *) + printf "%s: Invalid upstream URL %s (scheme is %s)\n" \ + "$argv0" "$1" "$scheme" + exit 1 + esac +} + +scheme_from_uri(){ + # There are no colons in scheme names and no ways to separate schemes + # from scheme-specific content without colons (RFC 3986). + printf "%s\n" "$1" | cut -d ':' -f 1 +} diff --git a/lsd/dist/sync_musl b/lsd/dist/sync_musl new file mode 100644 index 0000000..ccd4b33 --- /dev/null +++ b/lsd/dist/sync_musl @@ -0,0 +1,14 @@ +#!/bin/true +set -e + +depend_on cd +depend_on make +depend_on mkdir + +mkdir -p "$PREFIX/src" +cd "$PREFIX/src" + +fetch_upstream "$MUSL_UPSTREAM" +cd "$PREFIX/src/musl" +./configure --prefix="$PREFIX" +make install diff --git a/lsd/dist/trinitx b/lsd/dist/trinitx new file mode 100755 index 0000000..0a03993 --- /dev/null +++ b/lsd/dist/trinitx @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ -z "$PREFIX" ]; then + printf 'Please select a $PREFIX for installation. +For example, "PREFIX=/ %s".\n' "$0" 1>&2 + exit 1 +fi + +cd "$PREFIX"/dist +. ./macro.sh +. ./"$1"