From 212f01489449f7dae9e0932de80fc53fa0e9ef4b Mon Sep 17 00:00:00 2001 From: lagertonne Date: Sun, 28 Jun 2020 14:25:53 +0200 Subject: [PATCH] Initial commit --- auto/build | 5 +++++ auto/clean | 8 ++++++++ auto/config | 9 +++++++++ build-live-cd.sh | 28 +++++++++++++++++++++++++++ config/build | 10 ++++++++++ config/package-lists/live.list.chroot | 3 +++ 6 files changed, 63 insertions(+) create mode 100755 auto/build create mode 100755 auto/clean create mode 100755 auto/config create mode 100755 build-live-cd.sh create mode 100644 config/build create mode 100644 config/package-lists/live.list.chroot diff --git a/auto/build b/auto/build new file mode 100755 index 0000000..f8d8346 --- /dev/null +++ b/auto/build @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +lb build noauto "${@}" 2>&1 | tee build.log diff --git a/auto/clean b/auto/clean new file mode 100755 index 0000000..69874ee --- /dev/null +++ b/auto/clean @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +lb clean noauto "${@}" + +rm -f config/binary config/bootstrap config/chroot config/common config/source +rm -f build.log diff --git a/auto/config b/auto/config new file mode 100755 index 0000000..46c27ac --- /dev/null +++ b/auto/config @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +lb config noauto \ + -d buster \ + --debian-installer false \ + --bootappend-live "boot=live components locales=de_DE.UTF-8" \ + "${@}" diff --git a/build-live-cd.sh b/build-live-cd.sh new file mode 100755 index 0000000..8fae8ec --- /dev/null +++ b/build-live-cd.sh @@ -0,0 +1,28 @@ +BASEDIR=/var/lib/machines +ID=$(uuidgen | tr -d -) +NAME=debian-live-cd-$ID +DIR=$BASEDIR/$NAME + +echo "Generating container under $DIR" +zfs snapshot ztstor/ROOT/archie/var/lib/machines/buster-template@${ID} +zfs clone \ + -o mountpoint=$DIR \ + ztstor/ROOT/archie/var/lib/machines/buster-template@${ID} \ + ztstor/ROOT/archie/var/lib/machines/$NAME + +mkdir $DIR/var/live-build/ +rsync -av . $DIR/var/live-build/ + +# Execute stuff inside container +systemd-nspawn -q --pipe -D $DIR /bin/bash << EOF +apt update +apt install -y live-build binutils +cd /var/live-build/ +lb clean --purge +lb config +lb build +EOF + + +echo "Removing container..." +zfs destroy ztstor/ROOT/archie/var/lib/machines/$NAME diff --git a/config/build b/config/build new file mode 100644 index 0000000..ad71056 --- /dev/null +++ b/config/build @@ -0,0 +1,10 @@ +[Image] +Architecture: amd64 +Archive-Areas: main +Distribution: buster +Mirror-Bootstrap: http://deb.debian.org/debian/ + +[FIXME] +Configuration-Version: 1:20190311 +Name: live-image +Type: iso-hybrid diff --git a/config/package-lists/live.list.chroot b/config/package-lists/live.list.chroot new file mode 100644 index 0000000..1e6ef96 --- /dev/null +++ b/config/package-lists/live.list.chroot @@ -0,0 +1,3 @@ +live-boot +live-config +live-config-systemd