From: Ian Kelling Date: Wed, 4 Dec 2024 04:47:45 +0000 (-0500) Subject: mostly new system fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=765f5ba124ee0dafab3177cd993800063e047e4d;p=distro-setup mostly new system fixes --- diff --git a/distro-begin b/distro-begin index 54e2e9c..08abcd0 100755 --- a/distro-begin +++ b/distro-begin @@ -278,9 +278,6 @@ sudo /a/exe/lnf -T /a/bin /b sudo /a/exe/lnf -T /a/f /f sudo /a/exe/lnf -T /var/log/exim4 /el sudo /a/exe/lnf -T /a/f/ans /c -sudo chown iank:iank /nocow/t -sudo chmod 700 /nocow/t -sudo /a/exe/lnf -T /nocow/t /t if has_p; then lnf -T /p/News ~/News fi @@ -477,9 +474,13 @@ done if (( ${#dirs[@]} )); then # mkdir -p on a mounted directory will fail. so will chown if its an ro mount sudo mkdir -p "${dirs[@]}" - sudo chown $USER:$USER "${dirs[@]}" fi +sudo chown iank:iank /nocow/t +sudo chmod 700 /nocow/t +sudo /a/exe/lnf -T /nocow/t /t + + # disabled temporarily ###### setup /i @@ -681,7 +682,14 @@ EOF sudo sed -i.orig '/key * *{/,/}/s/KP_Multiply/underscore/g' /usr/share/X11/xkb/symbols/keypad ##### basic graphical packages - pi konsole suckless-tools ssh-askpass + pi suckless-tools ssh-askpass + + # currently, t12 lacks a konsole recommended package, but I probably + # don't use them anyways so no recommends. + # + # The following packages have unmet dependencies: + # libkf5iconthemes5 : Depends: libqt5svg5 (>= 5.15.2~) but it is not installable + pi --no-install-recommends konsole fi diff --git a/distro-end b/distro-end index 7d16f81..6b60fd4 100755 --- a/distro-end +++ b/distro-end @@ -168,13 +168,20 @@ esac - - pi debootstrap -######### begin universal pinned packages ###### -case $(debian-codename) in - etiona|flidas|nabia|aramo) - sudo rm -fv /etc/apt/preferences.d/etiona-buster +# get the latest version from ubuntu. note: this could backfire if we +# use a new version which targets a new release which our system is too +# old for. +if [[ ! -e /usr/share/debootstrap/scripts/noble ]]; then + mkct + wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap + pkg=$(grep -Eo '\bdebootstrap_[^" >]*_all.deb' debootstrap |sort -Vur | head -n1) + wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/$pkg + ex $pkg + sudo rsync -ra ./usr/share/debootstrap/scripts/ /usr/share/debootstrap/scripts +fi + +# example prefs file for if we were going japanese. sd /etc/apt/preferences.d/trisquel-debian <$t <$t <<'EOF' -deb http://us.archive.ubuntu.com/ubuntu/ focal main universe -deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main universe -deb http://us.archive.ubuntu.com/ubuntu/ focal-security main universe -EOF - if ! diff -q $t $f; then - sudo dd if=$t of=$f status=none - p update - fi - - - - sd /etc/apt/preferences.d/nabia-etiona <<'EOF' -Package: * -Pin: release n=nabia*,o=Trisquel -Pin-Priority: -100 -EOF - - f=/etc/apt/sources.list.d/nabia.list - t=$(mktemp) - cat >$t <<'EOF' -deb http://mirror.fsf.org/trisquel/ nabia main -deb-src http://mirror.fsf.org/trisquel/ nabia main - -deb http://mirror.fsf.org/trisquel/ nabia-updates main -deb-src http://mirror.fsf.org/trisquel/ nabia-updates main - -deb http://archive.trisquel.info/trisquel/ nabia-security main -deb-src http://archive.trisquel.info/trisquel/ nabia-security main -# Uncomment this lines to enable the backports optional repository -deb http://mirror.fsf.org/trisquel/ nabia-backports main -deb-src http://mirror.fsf.org/trisquel/ nabia-backports main -EOF - if ! diff -q $t $f; then - sudo dd if=$t of=$f status=none - p update - fi - - # duplicated in fai. Pin for bionic + ubuntu so that ppas dont get - # matched. - sd /etc/apt/preferences.d/etiona-bionic <<'EOF' -Package: * -Pin: release n=bionic,o=Ubuntu -Pin-Priority: -100 -Package: firefox -Pin: release n=bionic,o=Ubuntu -Pin-Priority: 500 -EOF - - sd /etc/apt/preferences.d/etiona-sa <<'EOF' -Package: * -Pin: release n=bionic,o=Ubuntu -Pin-Priority: -100 -EOF - - ;;& - nabia) - sd /etc/apt/preferences.d/aramo-nabia <<'EOF' -Package: * -Pin: release n=aramo*,o=Trisquel -Pin-Priority: -100 -EOF - f=/etc/apt/sources.list.d/aramo.list - t=$(mktemp) - cat >$t <<'EOF' -deb http://mirror.fsf.org/trisquel/ aramo main -deb-src http://mirror.fsf.org/trisquel/ aramo main - -deb http://mirror.fsf.org/trisquel/ aramo-updates main -deb-src http://mirror.fsf.org/trisquel/ aramo-updates main - -deb http://archive.trisquel.info/trisquel/ aramo-security main -deb-src http://archive.trisquel.info/trisquel/ aramo-security main - -# Uncomment this lines to enable the backports optional repository -deb http://mirror.fsf.org/trisquel/ aramo-backports main -deb-src http://mirror.fsf.org/trisquel/ aramo-backports main -EOF - if ! diff -q $t $f; then - sudo dd if=$t of=$f status=none - p update - fi - - ;;& - *) - if isdeb; then - pi debian-goodies shellcheck - fi - ;; -esac +if isdeb; then + pi debian-goodies shellcheck + s systemctl enable --now ssh-agent-iank +fi -case $codename_compat in - jammy|noble) - s systemctl enable --now ssh-agent-iank - ;; -esac case $codename_compat in focal) @@ -1309,7 +1143,8 @@ sudo update-alternatives --set pinentry /usr/bin/pinentry-gtk-2 # sakura config is owned by ian m reset-sakura m reset-konsole -m sudo -u user2 -i reset-konsole +## not bothering with user2 atm. +#m sudo -u user2 -i reset-konsole # user2 xscreensaver we don't want to reset m reset-xscreensaver @@ -1925,38 +1760,6 @@ fi # leftover cleanup for t9 pu resolvconf -case $codename in - # needed for debootstrap scripts for fai since fai requires debian - flidas) - pi dnsmasq - pi-nostart network-manager - # i hate networkmanager. noo, of course disabling it doesnt work - # unless you add a hack. found this by doing - # systemd-analyze dot > x.dot - # less x.dot - # /networkman - soff NetworkManager - soff NetworkManager-wait-online.service - # make networkmanager use resolvconf instead of its own dnsmasq which - # conflicts with the normal dnsmasq package. - f=/etc/NetworkManager/NetworkManager.conf - m=$(md5sum $f) - sudo sed -ri '/ *\[main\]/,/^ *\[[^]]+\]/{/^\s*dns[[:space:]=]/d}' $f - sudo sed -ri '/ *\[main\]/a dns=default' $f - if [[ $m != $(md5sum $f) ]]; then - srestart NetworkManager - fi - # networkmanager has this nasty behavior on flidas: if the machine - # crashes with dnsmasq running, on subsequent boot, it adds an entry to - # resolvconf for 127.0.0.1 in some stupid attempt to restore - # nameservers. - # This can be manually fixed by stoping dnsmasq, - # then based on whats in /run/dnsmasq/, i see we can run - # s resolvconf -d NetworkManager - # oh ya, and stoping NetworkManager leaves this crap behind without cleaning it up. - ser disable NetworkManager - ;; -esac # I have no use for avahi, # had to run this twice when doing manually, i dunno why diff --git a/fsfsys-recent b/fsfsys-recent index f2b1ad4..9d63090 100755 --- a/fsfsys-recent +++ b/fsfsys-recent @@ -52,6 +52,6 @@ date0=$(date +%Y-%m-%d) date1=$(date +%Y-%m-%d -d yesterday) f0="$d/$date0.log" f1="$d/$date1.log" -url=$( { sed "s/^/$date1 /" $f1; sed "s/^/$date0 /" $f0; } | /a/opt/fpaste/fpaste -x 60 |& grep -i '^http' | sed -r 's,/view/,/view/raw/,' ) +url=$( { if [[ -e $f1 ]]; then sed "s/^/$date1 /" $f1; fi; sed "s/^/$date0 /" $f0; } | /a/opt/fpaste/fpaste -x 60 |& grep -i '^http' | sed -r 's,/view/,/view/raw/,' ) notice='This url is not public and this message does not not imply permission to share it publicly. It expires in 60 minutes. Related: the "Public logging" section at https://libera.chat/policies/.' printf "%s %s\n" "$url" "$notice" | tee /tmp/fsfsys-recent diff --git a/primary-setup b/primary-setup index 5f415c9..5155722 100755 --- a/primary-setup +++ b/primary-setup @@ -55,7 +55,7 @@ source /a/bin/bash_unpublished/source-state # fixing up a bad state that servers got in. if [[ -e /dev/shm/iank-status ]]; then - chown iank.iank /dev/shm/iank-status + chown iank:iank /dev/shm/iank-status fi @@ -73,7 +73,6 @@ EOF fi - if [[ $HOSTNAME == "$MAIL_HOST" || $HOSTNAME == kd ]]; then m systemctl --now enable btrbk.timer else @@ -83,8 +82,6 @@ fi if dpkg -s rss2email &>/dev/null; then if [[ $HOSTNAME == "$MAIL_HOST" ]]; then - # arbtt disabled for now - #DISPLAY=:0 arbtt-capture --sample-rate=10 & m systemctl --now enable rss2email.timer else files=(/sysd-mail-once/btrbk*) @@ -94,17 +91,16 @@ if dpkg -s rss2email &>/dev/null; then serm systemctl stop rss2email.service serm systemctl --now disable rss2email.timer - # arbtt disabled for now - # for ((i=0; i<10; i++)); do - # killall arbtt-capture || break - # sleep 1 - # if [[ $i == 9 ]]; then - # exit 1 - # fi - # done fi fi +if [[ $HOSTNAME == "$HOST2" ]]; then + /a/opt/activity-watch/aw-qt & +else + pkill -f '^/a/opt/activity-watch/aw-qt$' +fi + + # todo: whats going on here? figure out if this should be removed. # if dpkg -s radicale &>/dev/null; then @@ -125,18 +121,6 @@ fi # fi -# todo: this needs to be disabled earlier than primary-setup in switch-mail-host - -# if dpkg -s profile-sync-daemon &>/dev/null; then -# if [[ $HOSTNAME == "$MAIL_HOST" ]]; then -# m systemctl --user start psd -# m systemctl --user enable psd -# else -# m systemctl --user stop psd -# m systemctl --user disable psd -# fi -# fi - m /a/exe/mail-setup exit 0