distro specific fixes
[distro-setup] / distro-end
index dcf919893dab0ae2946d9c52c60433a9ca21addc..d8a6cc57d3ea62d071558fe10577d42879cd46eb 100755 (executable)
@@ -333,7 +333,7 @@ EOF
 esac
 
 case $codename_compat in
-  jammy)
+  jammy|noble)
     s systemctl enable --now ssh-agent-iank
     ;;
 esac
@@ -752,13 +752,28 @@ EOF
       # s fwupdmgr get-updates
       # says I have 3 "devices with no available firmware updates"
       # if there were updates, install with: s fwupdmgr update
+
+      check_downgrade=false
+      if [[ ! -e /etc/apt/preferences.d/system76-apt-preferences ]]; then
+        check_downgrade=true
+      fi
       pi system76-firmware system76-driver fwupd
+      if $check_downgrade && [[ -e /etc/apt/preferences.d/system76-apt-preferences ]]; then
+        # driver installs a preferences file to give s76 packages
+        # priority so we may need to downgrade here.
+        pup --allow-downgrades
+      fi
       # system76-driver: on a modern kernel, it seems to mainly just do
-      # some power settings, I haven't looked entirely through it. it
-      # might also change fan speed. Of its recommended packages,
-      # system76-power is the only one I haven't looked at, the others
-      # do nothing for laptops i have. they have models hardcoded in
-      # source, so you can just grep for it. pkx package; caf | less.
+      # some power settings, I haven't looked entirely through it. Of
+      # its recommended packages, system76-power is the only one I
+      # haven't looked at, the others do nothing for laptops i
+      # have. they have models hardcoded in source, so you can just grep
+      # for it. pkx package; caf | less. I'm rather annoyed that
+      # com.system76.PowerDaemon.service is regularly taking up the
+      # most power. I wonder what it is actually doing, it really
+      # doesn't say, just has cryptic messages when I turn on
+      # debug logs, and has no documentation. Similar deal with
+      # system76-driver.service.
       #
       # if you get a notice about a firmware update, the notifier on i3
       # is too dumb to do anything when you click it.
@@ -934,13 +949,16 @@ case $distro in
   ubuntu)
     case $codename in
       noble)
-        # mint firefox has a dependency which is totally not really
-        # needed, just some mint branding and maybe a random firefox
-        # setting.
-        tmpdir="$(mktemp -d)"
-        cd "$tmpdir"
-        # edited from output of equivs-control ubuntu-system-adjustments
-        cat >ubuntu-system-adjustments <<'EOF'
+        if pcheck ubuntu-system-adjustments; then
+          # mint firefox has a dependency which is totally not really
+          # needed, just some mint branding and maybe a random firefox
+          # setting.
+          tmpdir="$(mktemp -d)"
+          # it puts the deb in .., so use a subdir to stay contained
+          mkdir $tmpdir/sub
+          cd "$tmpdir/sub"
+          # edited from output of equivs-control ubuntu-system-adjustments
+          cat >ubuntu-system-adjustments <<'EOF'
 Section: misc
 Priority: optional
 Version: 2030
@@ -948,11 +966,11 @@ Standards-Version: 3.9.2
 Package: ubuntu-system-adjustments
 Description: ubuntu-system-adjustments-dummy
 EOF
-        equivs-build ubuntu-system-adjustments
-        sudo dpkg -i ubuntu-system-adjustments_2030_all.deb
-        rm -rf ./ubuntu-system-adjustments*
-        cd
-        rm -r "$tmpdir"
+          equivs-build ubuntu-system-adjustments
+          sudo dpkg -i ../ubuntu-system-adjustments_2030_all.deb
+          cd
+          rm -r "$tmpdir"
+        fi
         ;;
     esac
     pi firefox
@@ -1365,7 +1383,11 @@ s DEBIAN_FRONTEND=noninteractive pi wireshark
 # listed in the default config as suggested.
 # /run/usr/1000 i noticed was missing for pulseaudio
 # /run/user/0 just seemed like a not bad idea, given the above
+#
+# /root gives us our bashrc, making various things a lot more
+# convenient
 tu /etc/schroot/desktop/fstab <<'EOF'
+/root          /root           none    rw,bind         0       0
 /p             /p              none    rw,bind         0       0
 /a             /a              none    rw,bind         0       0
 /run           /run            none    rw,bind         0       0
@@ -1402,11 +1424,11 @@ sgo schrootupdate.timer
 
 
 
-# for my roommate
+# for testing firefox specific issues
 case $distro in
-  trisquel)
+  trisquel|ubuntu)
     m mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/bookworm.list/BOOKWORM_FREE \
-      debian bookworm firefox-esr pulseaudio chromium
+      debian bookworm chromium
     ;;
   debian)
     pi chromium
@@ -1658,19 +1680,6 @@ for x in iank user2; do s usermod -a -G libvirt,kvm,libvirt-qemu $x; done
 
 
 pi --no-install-recommends kdeconnect
-### kdeconnect for gnome. started in /a/bin/distro-setup/desktop-20-autostart.sh
-### but gnome + xmonad not working in flidas, so i disabled it
-# pi libgtk-3-dev python3-requests-oauthlib valac cmake python-nautilus libappindicator3-dev
-# cd /a/opt/indicator-kdeconnect
-# mkdir -p build
-# cd build
-# cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-# make
-# sudo make install
-# # we can start it manually with /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
-# # it seems, according to
-# # /etc/xdg/autostart/kdeconnectd.desktop
-# # I'm not seeing the icon, but the clipboard replication is working
 
 
 ### begin model 01 arduino support ###
@@ -1799,22 +1808,24 @@ rm -rf /home/iank/.mpv
 
 case $(debian-codename) in
   aramo)
-    tmpdir="$(mktemp -d)"
-    cd "$tmpdir"
-    # edited from output of equivs-control tox
-    cat >tox <<'EOF'
+    if pcheck tox; then
+      tmpdir="$(mktemp -d)"
+      cd "$tmpdir"
+      # edited from output of equivs-control tox
+      cat >tox <<'EOF'
 Section: python
 Priority: optional
 Standards-Version: 3.9.2
 Package: tox
 Description: tox-dummy
 EOF
-    equivs-build tox
-    sudo dpkg -i tox_1.0_all.deb
-    rm -rf ./tox*
-    pi beets python3-discogs-client
-    cd
-    rm -r "$tmpdir"
+      equivs-build tox
+      sudo dpkg -i tox_1.0_all.deb
+      rm -rf ./tox*
+      pi beets
+      cd
+      rm -r "$tmpdir"
+    fi
     ;;
 esac