iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t12 related changes
[automated-distro-installer]
/
mk-basefile-big
diff --git
a/mk-basefile-big
b/mk-basefile-big
index 337d80ad09b601a2f6716bb0e3d8b5a5c252f628..1a6b6a99bc70dc28b12b157a34967c11ab7c0a7d 100755
(executable)
--- a/
mk-basefile-big
+++ b/
mk-basefile-big
@@
-16,11
+16,13
@@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-[[ $EUID == 0 ]] || exec sudo -E "$
BASH_SOURCE
" "$@"
+[[ $EUID == 0 ]] || exec sudo -E "$
{BASH_SOURCE[0]}
" "$@"
+set -e; . /usr/local/lib/bash-bear; set +e
-x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
-x="$(readlink -f -- "$BASH_SOURCE")"; PATH="${x%/*}:$PATH" # directory of this file
+this_file="$(readlink -f -- "${BASH_SOURCE[0]}")"
+readonly this_file this_dir="${this_file%/*}"
+PATH="$this_dir:$PATH" # directory of this file
usage() {
cat <<EOF
usage() {
cat <<EOF
@@
-45,7
+47,7
@@
EOF
exit $1
}
exit $1
}
-read distver <<<"$@"
+read
-r
distver <<<"$@"
if [[ $# != 1 ]]; then
echo "$0: error: expected one argument"
if [[ $# != 1 ]]; then
echo "$0: error: expected one argument"
@@
-73,7
+75,7
@@
distro=trisquel
t=/tmp/dirinstall
t=/tmp/dirinstall
-err
catch
-cleanup() {
+err-cleanup() {
sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf
for d in proc var/lib/dpkg var/cache; do
umount -R $t/$d ||:
sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf
for d in proc var/lib/dpkg var/cache; do
umount -R $t/$d ||:
@@
-87,11
+89,12
@@
sed -i 's/^LOGUSER=/#LOGUSER=/' /etc/fai/fai.conf
# config umount required after a failed run, proc umount always required
umount /var/lib/fai/config ||: ; umount -R $t/proc ||:
# config umount required after a failed run, proc umount always required
umount /var/lib/fai/config ||: ; umount -R $t/proc ||:
-fai-redep faiserver $distro
+fai-redep faiserver
.b8.nz
$distro
echo "echo $classes" > /srv/fai/config/class/51-multi-boot
rm -rf $t; mkdir -p $t
echo "echo $classes" > /srv/fai/config/class/51-multi-boot
rm -rf $t; mkdir -p $t
+# shellcheck disable=SC1007 # intentional
LANG= fai -N -u hostname_does_not_matter dirinstall $t
# Turn a dirinstall into a basefile. taken from mk-basefile
LANG= fai -N -u hostname_does_not_matter dirinstall $t
# Turn a dirinstall into a basefile. taken from mk-basefile
@@
-100,7
+103,7
@@
rm -f $t/etc/hostname $t/etc/resolv.conf \
$t/var/lib/apt/lists/*_* $t/usr/bin/qemu-*-static \
$t/etc/udev/rules.d/70-persistent-net.rules
echo | dd of=$t/etc/machine-id
$t/var/lib/apt/lists/*_* $t/usr/bin/qemu-*-static \
$t/etc/udev/rules.d/70-persistent-net.rules
echo | dd of=$t/etc/machine-id
-tar --one-file-system -C $t -cf - . |
gzip > /a/bin/fai-basefiles/basefiles/${distver^^}64BIG.tar.gz
+tar --one-file-system -C $t -cf - . |
zstd -9 > /a/bin/fai-basefiles/basefiles/${distver^^}64BIG.tar.zst
cleanup
cleanup