+++ /dev/null
-fasm-arm/
-lsp/
+++ /dev/null
-reaper.fas
-reaper.map
-reaper
+++ /dev/null
-reaper: reaper.asm
- fasm $^ -s $@.fas $@
- chmod a+x $@
- ./fas2txt.lsp $@.fas > $@.map
-
-clean:
- rm -f reaper
+++ /dev/null
-#!/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)
+++ /dev/null
-;;; 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:
+++ /dev/null
-.debhelper/
-debhelper-build-stamp
-files
-overlay-boot.substvars
-overlay-boot/
+++ /dev/null
-overlay-boot (0.1.14) experimental; urgency=medium
-
- * Bug fixes to handle bind mounted LIVE
-
- -- Ralph Ronnquist <rrq@rrq.au> 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 <rrq@rrq.au> Fri, 25 Aug 2023 23:34:49 +1000
-
-overlay-boot (0.1.12) experimental; urgency=medium
-
- * Change of email and signing key
-
- -- Ralph Ronnquist <rrq@rrq.au> Mon, 26 Jun 2023 21:24:41 +1000
-
-overlay-boot (0.1.11) experimental; urgency=medium
-
- * added vlan setup support
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sat, 27 May 2023 17:27:46 +1000
-
-overlay-boot (0.1.10) experimental; urgency=medium
-
- * include the overlay-share utility
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Fri, 02 Dec 2022 19:21:58 +1100
-
-overlay-boot (0.1.9) experimental; urgency=medium
-
- * discard most mounts before unshare
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sat, 12 Nov 2022 18:33:38 +1100
-
-overlay-boot (0.1.8) unstable; urgency=medium
-
- * added configuration for shared subdirectories
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Thu, 29 Sep 2022 20:33:13 +1000
-overlay-boot (0.1.7) unstable; urgency=medium
-
- * distribute /etc/subhosts.conf as well
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Tue, 10 May 2022 14:34:36 +1000
-overlay-boot (0.1.6) unstable; urgency=medium
-
- * added sysvinit service support
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Tue, 10 May 2022 12:38:32 +1000
-overlay-boot (0.1.5) unstable; urgency=medium
-
- * with optional cpuset accounting
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sat, 09 Apr 2022 10:12:58 +1000
-overlay-boot (0.1.4) unstable; urgency=medium
-
- * added diskfile support
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sun, 03 Apr 2022 22:02:56 +1000
-overlay-boot (0.1.2) unstable; urgency=medium
-
- * bbonev squeeze of reaper.asm
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Tue, 29 Mar 2022 10:41:51 +1100
-overlay-boot (0.1.1) unstable; urgency=medium
-
- * refactoring for more flexible config
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sun, 27 Mar 2022 18:55:49 +1100
-overlay-boot (0.1) unstable; urgency=medium
-
- * initial packaging
-
- -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Fri, 25 Mar 2022 18:05:01 +1100
+++ /dev/null
-Source: overlay-boot
-Section: misc
-Priority: optional
-Origin: Devuan
-Maintainer: Ralph Ronnquist <rrq@grrq.au>
-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".
+++ /dev/null
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: overlay-boot
-Upstream-Contact: Ralph Ronnquist <ralph.ronnquist@gmail.com>
-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.
+++ /dev/null
-/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
+++ /dev/null
-overlay-boot: statically-linked-binary [var/lib/overlay-boot/reaper]
+++ /dev/null
-#!/bin/sh
-set -e
-
-case "$1" in
- configure)
- update-rc.d subhosts defaults || true
- ;;
- *)
- :
- ;;
-esac
+++ /dev/null
-#!/bin/sh
-set -e
-
-case "$1" in
- remove)
- update-rc.d subhosts disable || true
- ;;
- *)
- :
- ;;
-esac
+++ /dev/null
-#!/usr/bin/make -f
-
-%:
- dh $@
-
-override_dh_clean:
- dh_clean $@
- dh_prep -Xtrial
+++ /dev/null
-3.0 (native)
+++ /dev/null
-tar-ignore = trial