From a1efadbe96f2c5e138588f5ed1738eb8b608a652 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 15 Feb 2026 22:57:48 -0500 Subject: [PATCH] fixes and cleanup --- brc2 | 4 ++++ dall | 2 +- distro-begin | 2 +- distro-end | 13 ++++++------- filesystem/usr/local/bin/mount-latest-subvol | 9 ++++++--- mail-setup | 4 +++- pkgs | 1 - 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/brc2 b/brc2 index 293b50f..c37bcd9 100644 --- a/brc2 +++ b/brc2 @@ -309,6 +309,10 @@ mkschroot() { bookworm|bullseye) repo=http://deb.debian.org/debian/ ;; + *) + err "i dont know how to run with codename='$codename'" + return 1 + ;; esac apps=($@) diff --git a/dall b/dall index da47ce5..0e3844e 100755 --- a/dall +++ b/dall @@ -26,7 +26,7 @@ shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR -readonly this_file; this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" +readonly this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" readonly this_dir="${this_file%/*}" cd "$this_dir" ./distro-begin diff --git a/distro-begin b/distro-begin index 0bc240c..37ee196 100755 --- a/distro-begin +++ b/distro-begin @@ -567,7 +567,7 @@ if has_btrfs; then sudo chattr +C $subvol fi - first_root_crypt=$(awk '$2 == "/" {print $1}' /etc/mtab) + first_root_crypt=$(awk '$2 == "/mnt/root" {print $1}' /etc/mtab) mopts= if (( $(nproc) > 2)); then diff --git a/distro-end b/distro-end index 183f1b9..3390e0f 100755 --- a/distro-end +++ b/distro-end @@ -1119,7 +1119,7 @@ fi ####### begin misc packages ########### -# some $d_host switching commands. edit partition script. edit this. edit distro-begin. +## Notes for changing $d_host. edit partition script. edit this. edit distro-begin. # cd /a/c # mkmv machine_specific/kd/filesystem/etc/btrbk/* machine_specific/frodo/filesystem/etc/btrbk # mv machine_specific/kd/filesystem/etc/systemd/system/btrbkrust* machine_specific/frodo/filesystem/etc/systemd/system @@ -1311,9 +1311,9 @@ sgo schrootupdate.timer # for testing firefox specific issues case $distro in trisquel|ubuntu) - schroot_name=bookworm + bookworm m mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/bookworm.list/BOOKWORM_FREE \ - $schroot_name debian chromium fonts-noto-color-emoji fonts-recommended locales + bookworm bookworm chromium fonts-noto-color-emoji fonts-recommended locales sd /nocow/schroot/$schroot_name/etc/locale.gen <<'EOF' en_US.UTF-8 UTF-8 EOF @@ -1646,7 +1646,6 @@ sudo update-alternatives --set mailx /usr/bin/mail.mailutils # packages I once used before and liked, but don\'t want installed now for # various reasons: -# python-sqlite is used for offlineimap # lxappearance python-sqlite dolphin paman dconf-editor @@ -1886,8 +1885,8 @@ if mountpoint /p &>/dev/null; then fi ### end timetrap setup -# leftover cleanup for t9 -pu resolvconf +# leftover cleanup, t12 timeframe +pu offlineimap # I have no use for avahi, @@ -2160,7 +2159,7 @@ case $HOSTNAME in if [[ ! -e /etc/apt/sources.list.d/pgdg.sources ]]; then pi postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y noble - pi postgresql-17 + pi postgresql-18 sudo -u postgres createuser -d iank sudo usermod -a -G postgres iank fi diff --git a/filesystem/usr/local/bin/mount-latest-subvol b/filesystem/usr/local/bin/mount-latest-subvol index 349049b..aa3798b 100755 --- a/filesystem/usr/local/bin/mount-latest-subvol +++ b/filesystem/usr/local/bin/mount-latest-subvol @@ -56,7 +56,10 @@ tu() { local file line while read -r line; do file="$1" - grep -xFq "$line" "$file" || tee -a "$file"<<<"$line" + if ! grep -xFq "$line" "$file"; then + echo "+ tee -a '$file'" + tee -a "$file"<<<"$line" + fi done } # debug: echo when $verbose @@ -139,7 +142,7 @@ get-btrfs-root-mountpoint() { ### this is duplicated in check-subvol-stale dev=$(sed -rn "s,^\s*([^#]\S*)\s+/$vol\s.*,\1,p" /etc/fstab /etc/mtab|head -n1) # example dev: /dev/mapper/crypt-vgDISK_BY_ID_NAME-root - d dev=$dev + d vol=$vol dev=$dev # $devx are the devices of the btrfs filesystem. they include $dev. # # Note, we can't just use $d in this sed because it might not be mounted. We do this loop @@ -297,7 +300,7 @@ setup-root2() { # Input vars: none setup-fstab() { local root_dev o_dev crypt_dev mopts dev f fa - root_dev=$(awk '$2 == "/" {print $1}' /etc/mtab) + root_dev=$(awk '$2 == "/mnt/root" {print $1}' /etc/mtab) mapper-dev root_dev o_dev=$(awk '$2 == "/mnt/o" {print $1}' /etc/mtab) mapper-dev o_dev diff --git a/mail-setup b/mail-setup index c9482ad..fb1548d 100755 --- a/mail-setup +++ b/mail-setup @@ -694,6 +694,8 @@ EOF # old file. remove when all hosts updated, 2023-09-11 rm -fv /etc/exim4/conf.d/clamav_data_acl +pi-nostart clamav + m usermod -a -G Debian-exim clamav u /etc/systemd/system/clamav-daemon.service.d/fix.conf <