From 0c79787872f08e75af35c3564b3e59544f2c176d Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Mon, 4 Sep 2023 12:36:59 +1000 Subject: [PATCH] Cleanup. Split out upstream from packaging and experiments. --- .gitignore | 2 - asm/.gitignore | 3 - asm/Makefile | 7 -- asm/fas2txt.lsp | 118 -------------------------- asm/reaper.asm | 75 ---------------- debian/.gitignore | 5 -- debian/changelog | 76 ----------------- debian/control | 21 ----- debian/copyright | 10 --- debian/overlay-boot.links | 5 -- debian/overlay-boot.lintian-overrides | 1 - debian/postinst | 11 --- debian/postrm | 11 --- debian/rules | 8 -- debian/source/format | 1 - debian/source/options | 1 - 16 files changed, 355 deletions(-) delete mode 100644 .gitignore delete mode 100644 asm/.gitignore delete mode 100644 asm/Makefile delete mode 100755 asm/fas2txt.lsp delete mode 100644 asm/reaper.asm delete mode 100644 debian/.gitignore delete mode 100644 debian/changelog delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/overlay-boot.links delete mode 100644 debian/overlay-boot.lintian-overrides delete mode 100755 debian/postinst delete mode 100755 debian/postrm delete mode 100755 debian/rules delete mode 100644 debian/source/format delete mode 100644 debian/source/options diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 214dad6..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -fasm-arm/ -lsp/ diff --git a/asm/.gitignore b/asm/.gitignore deleted file mode 100644 index f4ba793..0000000 --- a/asm/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -reaper.fas -reaper.map -reaper diff --git a/asm/Makefile b/asm/Makefile deleted file mode 100644 index 87a63e2..0000000 --- a/asm/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -reaper: reaper.asm - fasm $^ -s $@.fas $@ - chmod a+x $@ - ./fas2txt.lsp $@.fas > $@.map - -clean: - rm -f reaper diff --git a/asm/fas2txt.lsp b/asm/fas2txt.lsp deleted file mode 100755 index 98f4c41..0000000 --- a/asm/fas2txt.lsp +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/newlisp -# -# Print an assembly listing for ELF targets associating binary address -# with source lines. - -(signal 2 exit) ; exit on Ctrl-C - -; Format a byte or list of bytes into a hex string -(define (hex L) - (if (list? L) (string "0x" (join (map (curry format "%02x") L))) - ; else - (hex (list L)))) - -; Helper function to "copy out" a NUL terminated string from the -; beginning of a memblock. (only an issue with utf8-enabled newlisp) -(define (asciiz X) (get-string (address X))) - -; Helper function to set and print a variable -(define (print-assign X Y) (set X (println X " = " Y))) - -; Helper "macro" to set variables and print their assignments -(define-macro (setf-print) - (map (fn (P) (print-assign (P 0) (eval (P 1)))) (explode (args) 2))) - -; Load the .fas file here; named last on the command line -(setf FAS (read-file (main-args -1))) - -(setf-print - SIGNATURE (hex (reverse (unpack (dup "b" 4) FAS))) - VERSION (unpack "bb" (4 FAS)) - HEADER-LENGTH ((unpack "u" (6 FAS)) 0) - INFILEP ((unpack "lu" (8 FAS)) 0) - OUTFILEP ((unpack "lu" (12 FAS)) 0) - STRINGS-TABLE-OFFSET ((unpack "lu" (16 FAS)) 0) - STRINGS-TABLE-LENGTH ((unpack "lu" (20 FAS)) 0) - SYMBOLS-TABLE-OFFSET ((unpack "lu" (24 FAS)) 0) - SYMBOLS-TABLE-LENGTH ((unpack "lu" (28 FAS)) 0) - PREPROCESSED-OFFSET ((unpack "lu" (32 FAS)) 0) - PREPROCESSED-LENGTH ((unpack "lu" (36 FAS)) 0) - ASSEMBLY-DUMP-OFFSET ((unpack "lu" (40 FAS)) 0) - ASSEMBLY-DUMP-LENGTH ((unpack "lu" (44 FAS)) 0) - SECTION-TABLE-OFFSET ((unpack "lu" (48 FAS)) 0) - SECTION-TABLE-LENGTH ((unpack "lu" (52 FAS)) 0) - SYMBOL-REFERENCES-DUMP-OFFSET ((unpack "lu" (56 FAS)) 0) - SYMBOL-REFERENCES-DUMP-LENGTH ((unpack "lu" (60 FAS)) 0) - ) - -(setf - STRINGS (STRINGS-TABLE-OFFSET STRINGS-TABLE-LENGTH FAS) - _ (println STRINGS) - PREP (PREPROCESSED-OFFSET PREPROCESSED-LENGTH FAS) - ) - -(setf-print - MAIN-FILE (asciiz (INFILEP STRINGS)) - ) - -; Hash tables for filename->content and macroid->firstline -(define FILES:FILES nil) ; for captured file content -(define MACROS:MACROS nil) ; for captured first-appearance-line of macros - -; Get/cache content of file -(define (get-file NAME) - (or (FILES NAME) (FILES NAME (read-file NAME)))) - -; Check if N is the first-appearence-line in macro ID -; (capture N for the very first appearance of ID) -(define (macro-start ID N) - (if (MACROS ID) (= (MACROS ID) N) (MACROS ID N))) - -; The file name for prep entry index i (with 0 = main file) -(define (source-file i) - (if (= i) MAIN-FILE (asciiz (i PREP)))) - -; Extract and format the file line with line number LN that is at at -; position i of file FILE. -(define (get-line i FILE LN) - (letn ((DATA (get-file FILE)) - (END (find "\n" DATA nil i)) - (R (i (- END i) DATA)) ) - (format "%s:%-5d %s" FILE LN R))) - -; Format a "macro" prep entry by prepending an informative line for -; the first-appearance-line. -(define (resolve-macro AT PL) - (if (macro-start (PL 2) (PL 1)) - (string (PREP-SOURCE-LINE "--------" (PL 2)) "\n" - (PREP-SOURCE-LINE AT (PL 3))) - ; else - (PREP-SOURCE-LINE AT (PL 3)))) - -; Format output for "address" AT and prep line PL (unpacked) -(define (prep-source AT PL) - (if (!= (& 0x80000000 (PL 1))) (resolve-macro AT PL) - ; else - (string AT " " (get-line (PL 2) (source-file (PL 0)) (PL 1))))) - -; Format output for "address" AT and prep line at P (index) -(define (PREP-SOURCE-LINE AT P) - (prep-source AT (unpack "lu lu lu lu" (P PREP)))) - -; Format output for assembly line L (memblock) -(define (ASSEMBLY-LINE L) - (let ((AL (unpack "lu lu lu lu lu b b b b" (or L "")))) - (PREP-SOURCE-LINE (hex (AL 2)) (AL 1)) - )) - -; divide memblock D into memblocks of size N -(define (frag N D) - (unpack (dup (string "s" N " ") (/ (length D) N)) D)) - -#### Main action(s) start here - -(map println - (map ASSEMBLY-LINE - (frag 28 (ASSEMBLY-DUMP-OFFSET ASSEMBLY-DUMP-LENGTH FAS)))) - -(exit 0) diff --git a/asm/reaper.asm b/asm/reaper.asm deleted file mode 100644 index c5dee49..0000000 --- a/asm/reaper.asm +++ /dev/null @@ -1,75 +0,0 @@ -;;; This is a "repear" program that merely waits for child processes -;;; to appear and "reap" them, i.e. read their exit status to let them -;;; exit. The program allows an arbitrary first argument that is -;;; indended for identifying the reaper process. - - format elf64 executable - entry main - -;;; Using mixed Data and Code segment for size squeeze - - segment readable writable executable - -;;; Main entry point -main: - ;; if (getpid() != 1) exit 1; - xor rax, rax - mov al, 39 - ; rax=39 - syscall - - dec rax - jnz exit ; exit(1) - - ;; Continue here for pid 1 only -pid_1: - ;; Block all signals - ;; sigprocmask(SIG_BLOCK, &set, 0); - ; rax is already 0 - mov rdi, rax ; SIG_BLOCK = 0 - lea rsi, [set] ; *set - mov rdx, rax ; 0 - mov r10, rax ; 0 - mov al, 14 ; sys_rt_sigprocmask - ; rax=14, rdi=0, rsi=[set], rdx=0, r10=0 - syscall - - ;; loop waiting for children, and reading their exit status -reaper: - ;; first clear status area again - cld - xor rax, rax - lea rdi, [status] - mov rdx, rdi - mov rcx, rax - mov cl, status$end-status - rep stosq - - ;; waitid( idtype, id, *status, options ) - mov rdi, rax ; idtype_t idtype = P_ALL = 0 - mov rsi, rax ; int id = 0 - ;rdx = [status] ; siginfo_t* = &status - mov al, 4 ; int options = WEXITED = 4 - mov r10, rax - mov al, 247 ; waitid - ; rax=247, rdi=0, rsi=0, rdx=[status], r10=4 - syscall - - add rax, 10 ; -10 = ECHILD (no child processes) - jnz reaper - -exit: ; exit(1) - xor rax, rax - mov rdi, rax - inc rdi - mov al, 60 - syscall ; exit(1) program - - ;; sigset_t set -- bit mask for sigprocmask -set: - dq -1 ; all bits set - -;;; siginfo_t status -- all ignored -status: - rept 16 { dq ? } -status$end: diff --git a/debian/.gitignore b/debian/.gitignore deleted file mode 100644 index abaf77a..0000000 --- a/debian/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.debhelper/ -debhelper-build-stamp -files -overlay-boot.substvars -overlay-boot/ diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index e59fbdb..0000000 --- a/debian/changelog +++ /dev/null @@ -1,76 +0,0 @@ -overlay-boot (0.1.14) experimental; urgency=medium - - * Bug fixes to handle bind mounted LIVE - - -- Ralph Ronnquist Mon, 04 Sep 2023 12:26:05 +1000 - -overlay-boot (0.1.13) experimental; urgency=medium - - * Revise network startup to handle the ifup case better. - - -- Ralph Ronnquist Fri, 25 Aug 2023 23:34:49 +1000 - -overlay-boot (0.1.12) experimental; urgency=medium - - * Change of email and signing key - - -- Ralph Ronnquist Mon, 26 Jun 2023 21:24:41 +1000 - -overlay-boot (0.1.11) experimental; urgency=medium - - * added vlan setup support - - -- Ralph Ronnquist Sat, 27 May 2023 17:27:46 +1000 - -overlay-boot (0.1.10) experimental; urgency=medium - - * include the overlay-share utility - - -- Ralph Ronnquist Fri, 02 Dec 2022 19:21:58 +1100 - -overlay-boot (0.1.9) experimental; urgency=medium - - * discard most mounts before unshare - - -- Ralph Ronnquist Sat, 12 Nov 2022 18:33:38 +1100 - -overlay-boot (0.1.8) unstable; urgency=medium - - * added configuration for shared subdirectories - - -- Ralph Ronnquist Thu, 29 Sep 2022 20:33:13 +1000 -overlay-boot (0.1.7) unstable; urgency=medium - - * distribute /etc/subhosts.conf as well - - -- Ralph Ronnquist Tue, 10 May 2022 14:34:36 +1000 -overlay-boot (0.1.6) unstable; urgency=medium - - * added sysvinit service support - - -- Ralph Ronnquist Tue, 10 May 2022 12:38:32 +1000 -overlay-boot (0.1.5) unstable; urgency=medium - - * with optional cpuset accounting - - -- Ralph Ronnquist Sat, 09 Apr 2022 10:12:58 +1000 -overlay-boot (0.1.4) unstable; urgency=medium - - * added diskfile support - - -- Ralph Ronnquist Sun, 03 Apr 2022 22:02:56 +1000 -overlay-boot (0.1.2) unstable; urgency=medium - - * bbonev squeeze of reaper.asm - - -- Ralph Ronnquist Tue, 29 Mar 2022 10:41:51 +1100 -overlay-boot (0.1.1) unstable; urgency=medium - - * refactoring for more flexible config - - -- Ralph Ronnquist Sun, 27 Mar 2022 18:55:49 +1100 -overlay-boot (0.1) unstable; urgency=medium - - * initial packaging - - -- Ralph Ronnquist Fri, 25 Mar 2022 18:05:01 +1100 diff --git a/debian/control b/debian/control deleted file mode 100644 index f38bc08..0000000 --- a/debian/control +++ /dev/null @@ -1,21 +0,0 @@ -Source: overlay-boot -Section: misc -Priority: optional -Origin: Devuan -Maintainer: Ralph Ronnquist -Build-Depends: debhelper-compat (= 13), - asciidoctor, docbook-xml, libxslt1-dev, xsltproc, docbook-xsl, - musl-tools -Standards-Version: 4.6.0 -Homepage: https://borta.rrq.id.au/git?p=ralph/overlay-boot.git -Vcs-Git: https://borta.rrq.id.au/git?p=ralph/overlay-boot.git - -Package: overlay-boot -Architecture: any -Depends: coreutils (>= 8.32-4+b1), util-linux (>= 2.36.1-8+devuan2), - mount, iproute2, ifupdown, dash, procps -Description: Admin scripts for running overlay subhosts - Overlay subhosting uses unshare and chroot for running services - within independent overlay filesystems, with a common kernel but - independent namespaces. Aka "containerization with a modicum of bells - and whistles". diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 080dc7d..0000000 --- a/debian/copyright +++ /dev/null @@ -1,10 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: overlay-boot -Upstream-Contact: Ralph Ronnquist -Source: https://borta.rrq.id.au/git?p=ralph/overlay-boot.git - -Files: * -Copyright: 2022 Ralph Ronnquist -License: GPL-2+ - The full text of the GPL is distributed as in - /usr/share/common-licenses/GPL-2 on Debian systems. diff --git a/debian/overlay-boot.links b/debian/overlay-boot.links deleted file mode 100644 index 71565ab..0000000 --- a/debian/overlay-boot.links +++ /dev/null @@ -1,5 +0,0 @@ -/var/lib/overlay-boot/overlay-boot /usr/sbin/overlay-boot -/var/lib/overlay-boot/overlay-stop /usr/sbin/overlay-stop -/var/lib/overlay-boot/overlay-go /usr/sbin/overlay-go -/var/lib/overlay-boot/overlay-diskfile /usr/sbin/overlay-diskfile -/var/lib/overlay-boot/overlay-shar /usr/sbin/overlay-share diff --git a/debian/overlay-boot.lintian-overrides b/debian/overlay-boot.lintian-overrides deleted file mode 100644 index 58f7c33..0000000 --- a/debian/overlay-boot.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -overlay-boot: statically-linked-binary [var/lib/overlay-boot/reaper] diff --git a/debian/postinst b/debian/postinst deleted file mode 100755 index 46c5f8f..0000000 --- a/debian/postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - configure) - update-rc.d subhosts defaults || true - ;; - *) - : - ;; -esac diff --git a/debian/postrm b/debian/postrm deleted file mode 100755 index 9760d62..0000000 --- a/debian/postrm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -case "$1" in - remove) - update-rc.d subhosts disable || true - ;; - *) - : - ;; -esac diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 583057e..0000000 --- a/debian/rules +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ - -override_dh_clean: - dh_clean $@ - dh_prep -Xtrial diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/debian/source/options b/debian/source/options deleted file mode 100644 index d7be186..0000000 --- a/debian/source/options +++ /dev/null @@ -1 +0,0 @@ -tar-ignore = trial -- 2.39.2