minor improvements
authorIan Kelling <ian@iankelling.org>
Tue, 3 Dec 2024 13:13:17 +0000 (08:13 -0500)
committerIan Kelling <ian@iankelling.org>
Tue, 3 Dec 2024 13:13:17 +0000 (08:13 -0500)
brc
brc3
distro-begin
filesystem/usr/local/bin/mount-latest-subvol

diff --git a/brc b/brc
index ed4b689e0f01c095d7f896cf52926a947b76ef86..77a79d1ccbac218ff5a44df23298c8923082613b 100644 (file)
--- 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 a0d864fded02a2978edf4d1f2d901ffdf527e0f9..3b75081b4fc4ba5a0547df4db4a55388934032ff 100644 (file)
--- 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 <<EOF
index a7813299e1c4218e941026323e4beb6895cdf164..54e2e9c9d67cc1673bc59f89e913bf7b4f7d9400 100755 (executable)
@@ -567,8 +567,17 @@ if has_btrfs; then
     fi
 
     first_root_crypt=$(awk '$2 == "/" {print $1}' /etc/mtab)
+
+    mopts=
+    if (( $(nproc) > 2)); then
+      mopts+=,compress=zstd
+    fi
+    if grep -qF ,nodiscard,flushoncommit /etc/fstab; then
+      mopts+=,nodiscard,flushoncommit
+    fi
+
     sudo /a/exe/teeu /etc/fstab <<EOF
-$first_root_crypt  /nocow  btrfs  noatime,subvol=nocow$( (( $(nproc) > 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
index 2cf48d4c5d4d39a9b1ee0dd7e5bb9d669086a8da..1a55c886c00e83ec41d4fea6554d8f9eac0673fc 100755 (executable)
@@ -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 <<EOF
 $crypt_dev  /a  btrfs  noatime,subvol=a$mopts  0 0