From b43bf951c7471fabd2301641ba3503bacf5b91e7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 1 Feb 2022 21:37:19 +0100 Subject: adapted for buildmaster, ISO, update works, not the torrents --- Attic/build-isos-nlopc43 | 131 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100755 Attic/build-isos-nlopc43 (limited to 'Attic/build-isos-nlopc43') diff --git a/Attic/build-isos-nlopc43 b/Attic/build-isos-nlopc43 new file mode 100755 index 0000000..5541fe6 --- /dev/null +++ b/Attic/build-isos-nlopc43 @@ -0,0 +1,131 @@ +#!/bin/bash + +# to be executed on nlopc43 ... sry for all the hard-coded stuff + +set -e + +archive='/mnt/archlinux32archive' +destination='/mnt/archlinux32/archisos' +base_dir=$( + readlink -e "${0%/*}" +) + +case "$(hostname -s)" in + 'nlopc43') + echo 'build isos on nlopc46 ...' + rsync "$0" nlopc46.ioq.uni-jena.de:/tmp/ + isos=$( + ssh nlopc46.ioq.uni-jena.de "/tmp/${0##*/}" + ) + echo '... done.' + + if [ -z "${isos}" ]; then + echo 'no isos were built!?' + exit 1 + fi + + echo 'sign and upload isos ...' + + tmp_dir=$(mktemp -d) + trap 'cd "${base_dir}"; rm -rf --one-file-system "${tmp_dir}"' EXIT + + rsync -av $(printf 'nlopc46.ioq.uni-jena.de:%s\n' ${isos}) "${tmp_dir}/" + + isos=$( + printf '%s\n' "${isos}" | \ + sed 's,^.*/,,' + ) + + mountpoint -q "${archive}" || sudo mount "${archive}" + mountpoint -q "${destination%/*}" || sudo mount "${destination%/*}" + + cd "${tmp_dir}" + cp "${destination}/sha512sums" . + cp "${destination}/md5sums" . + + date=$( + printf '%s\n' "${isos}" \ + | sed 's/^.*-\([^-]\+\)-[^-]\+$/\1/' \ + | sort -u + ) + + for iso in ${isos}; do + gpg --local-user '33CA3597B0D161AAE4173F65C17F1214114574A4' --batch --no-tty --detach-sign "${iso}" > sha512sums + md5sum ${isos} >> md5sums + sort -k2,2 sha512sums --output sha512sums + sort -k2,2 md5sums --output md5sums + + cp $( + printf '%s\n' ${isos} + printf '%s.sig\n' ${isos} + ) sha512sums md5sums "${destination}/" + + date +%s > "${destination%/*}/lastupdate" + + "${base_dir}/al32-mktorrent.sh" -d "${date}" -t "hefur@archlinux32:" + + mv $( + printf '%s.torrent\n' ${isos} + ) feed_dual.rss feed_i686.rss "${destination}/" + +# --torrent-seed-dual "https://pool.mirror.archlinux32.org/archisos/archlinux32-${date}-dual.iso.torrent" \ +# + git -C "${base_dir}/../archweb32" pull --ff-only + "${base_dir}/update-website" \ + --torrent-seed-i686 "https://pool.mirror.archlinux32.org/archisos/archlinux32-${date}-i686.iso.torrent" \ + --update-iso + git -C "${base_dir}/../archweb32" commit 'download/index.html' -m 'download/index.html: new isos ('"${date}"')' + git -C "${base_dir}/../archweb32" push + + find "${destination}" \( -name 'archlinux32-*' -o -name 'archlinux-*' \) -not -name 'archlinux32-'"${date}"'-*' \ + | while read -r to_delete; do + if diff -q "${to_delete}" "${archive}/iso/${to_delete#${destination}/}" >/dev/null; then + rm "${to_delete}" + printf '%s\n' "${to_delete}" \ + | sed ' + s@^.*/@@ + s/\./\\./g + s@.*@/ \0$/d@ + ' + fi + done \ + >> "${tmp_dir}/delete-regex" + sed -i -f "${tmp_dir}/delete-regex" "${destination}/sha512sums" + sed -i -f "${tmp_dir}/delete-regex" "${destination}/md5sums" + + echo '... done.' + ;; + 'nlopc46') + if [ "$(whoami)" = 'root' ]; then + cd "/usr/share/archiso/configs/$1" + tmp_dir=$(mktemp -d) + trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT + arch=i686 setarch i686 mkarchiso -o "$2" -w "${tmp_dir}" -v /usr/share/archiso/configs/$1 + chown "${SUDO_USER}:users" "$2/"archlinux*.iso + exit + fi + + rm -rf --one-file-system ~/archisos + mkdir ~/archisos + + >&2 echo 'build i686-iso ...' + + >&2 sudo "$0" releng32 ~/archisos/ + + >&2 echo '... done.' + +# >&2 echo 'build dual-iso ...' + +# >&2 sudo "$0" releng-dual ~/archisos/ + +# >&2 echo '... done.' + + find ~/archisos/ -type f + ;; + *) + >&2 echo 'execute on nlopc43 (or nlopc46) - sry' + exit 1 + ;; +esac -- cgit v1.2.3-54-g00ecf