-
-
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 <<EOF
Explanation: Debian* includes Debian + Debian Backports
Package: *
Pin: release o=Debian*
Pin-Priority: 1000
EOF
- ;;&
-
- aramo|nabia|etiona)
- # for ziva
- #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
- doupdate=false
- # shellcheck disable=SC2043 # in case we want more than 1 in the loop later.
- for n in bookworm; do
- f=/etc/apt/sources.list.d/$n.list
- t=$(mktemp)
- case $n in
- bookworm)
- cat >$t <<EOF
-deb http://deb.debian.org/debian bookworm main
-deb-src http://deb.debian.org/debian bookworm main
-
-deb http://deb.debian.org/debian-security/ bookworm-security main
-deb-src http://deb.debian.org/debian-security/ bookworm-security main
-
-deb http://deb.debian.org/debian bookworm-updates main
-deb-src http://deb.debian.org/debian bookworm-updates main
-
-deb http://http.debian.net/debian bookworm-backports main
-deb-src http://http.debian.net/debian bookworm-backports main
-EOF
- ;;
- esac
-
- if ! diff -q $t $f; then
- doupdate=true
- s cp $t $f
- s chmod 644 $f
- fi
- done
- if $doupdate; then
- tmpdir=$(mktemp -d)
- (
- cd $tmpdir
- # cant apt get the keyring without doing an update, can't update
- # without the keyring, this is a stupid chicken and egg problem
- # that apt should have some feature to solve, but doesn't as far
- # as I know.
- f=debian-archive-keyring_2023.3+deb12u1_all.deb
- wget http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/$f
- sudo dpkg -i $f
- )
- p update
- rm -rf $tmpdir
- fi
-
- if [[ ! -e /usr/share/debootstrap/scripts/noble ]]; then
- # dir from within /a/opt/debootstrap_1.0.134ubuntu1_all.deb noble debootstrap as of 2024-07-05. not going to bother
- # adding a whole repo for one package which doesn't seem to generally change within a single distro version.
- rsync -ra /a/opt/debootstrap_1.0.134ubuntu1_all-scripts/ /usr/share/debootstrap/scripts
- fi
-
- ;;&
- etiona)
- sd /etc/apt/preferences.d/focal <<'EOF'
-Package: *
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: -100
-EOF
-
- sd /etc/apt/preferences.d/spamassassin <<'EOF'
-Package: spamassassin sa-compile spamc
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
- sd /etc/apt/preferences.d/spamassassin <<'EOF'
-Package: spamassassin sa-compile spamc
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
- sd /etc/apt/preferences.d/psd <<'EOF'
-Package: profile-sync-daemon
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
-
- f=/etc/apt/sources.list.d/focal.list
- t=$(mktemp)
- cat >$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)
# 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
# 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
# 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
fi
-
if [[ $HOSTNAME == "$MAIL_HOST" || $HOSTNAME == kd ]]; then
m systemctl --now enable btrbk.timer
else
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*)
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
# 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