From: Ian Kelling Date: Tue, 3 Dec 2024 13:13:17 +0000 (-0500) Subject: minor improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=0b2d419e30f18a98919abc5ce46e33b87a5d254f;p=distro-setup minor improvements --- diff --git a/brc b/brc index ed4b689..77a79d1 100644 --- a/brc +++ b/brc @@ -718,8 +718,8 @@ jdo() { # -q = quiet journalctl --since=now -qn2 -f -u "$unit_name" & jr_pid=$! - # sleep 1 is too fast for x200 - sleep 3 + # sleep 1 is too fast for x200. sleep 3 was too fast for a fast computer. + sleep 4 $sdrun_prefix systemd-run $sdrun_args --unit "$unit_name" --wait --collect "$cmd" "$@" || ret=$? # The sleep lets the journal output its last line # before the prompt comes up. diff --git a/brc3 b/brc3 index a0d864f..3b75081 100644 --- a/brc3 +++ b/brc3 @@ -22,7 +22,7 @@ test-ecne-noble-package-lists-exist() { done } -mmdebstrap-ecne-noble-missing() { +ecne-noble-get-missing() { local prefix ecne noble prefix=/var/lib/apt/lists/archive. noble=$(echo ${prefix}ubuntu.com_ubuntu_dists_noble{,-security,-updates}_{main,universe}_binary-amd64_Packages) @@ -58,7 +58,7 @@ EOF update-ecne-missing() { mkc /t/mmchroot - mmdebstrap-ecne-noble-missing + ecne-noble-get-missing cp prefs /b/fai/fai/config/files/etc/apt/preferences.d/ecne-missing/ECNE s cp prefs /etc/apt/preferences.d/ecne-missing } @@ -72,7 +72,7 @@ mmdebstrap-ecne-noble() { deb http://archive.trisquel.org/trisquel/ ecne main deb http://archive.ubuntu.com/ubuntu/ noble main universe EOF - mmdebstrap-ecne-noble-missing + ecne-noble-get-missing # normal sudo can't handle newlines in args cat >mmdebstrap-cm < 2)); then + mopts+=,compress=zstd + fi + if grep -qF ,nodiscard,flushoncommit /etc/fstab; then + mopts+=,nodiscard,flushoncommit + fi + sudo /a/exe/teeu /etc/fstab < 2)) && echo ,compress=zstd ) 0 0 +$first_root_crypt /nocow btrfs noatime,subvol=nocow$mopts 0 0 EOF sudo mkdir -p $dir sudo chown $USER:$USER $dir @@ -583,7 +592,7 @@ mnt-fstab() { # strangely, mount will return success if the device in fstab does not # exist. Here, we catch that. mountpoint -q $1 - } +} case $HOSTNAME in $d_host) sudo /a/exe/teeu /etc/fstab <<'EOF' @@ -713,7 +722,25 @@ EOFOUTER fi +cat <<'EOF' + +if we are at home and this is a fresh install, consider running: + +/a/bin/fai/fai/config/distro-install-common/ethusb-static + +Or, automatically with: + +if [[ $(timeout 1 dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \ + && ip n show 10.2.0.1 | grep . &>/dev/null; then + # we are at_home + $FAI/distro-install-common/ethusb-static +else + $FAI/distro-install-common/ethusb-static off +fi +EOF + echo 0 >~/.local/distro-begin echo "$0: $(date): ending now" echo "exiting with status 0" + exit 0 diff --git a/filesystem/usr/local/bin/mount-latest-subvol b/filesystem/usr/local/bin/mount-latest-subvol index 2cf48d4..1a55c88 100755 --- a/filesystem/usr/local/bin/mount-latest-subvol +++ b/filesystem/usr/local/bin/mount-latest-subvol @@ -334,6 +334,10 @@ setup-fstab() { if (( $(nproc) > 2)); then mopts+=,compress=zstd fi + if grep -qF ,nodiscard,flushoncommit /etc/fstab; then + mopts+=,nodiscard,flushoncommit + fi + fstab <