updates, especially for etiona
[distro-setup] / distro-end
index d63d315d3da01c6a275bd2d68dda08ee0fed1e8b..0c6b463623c5f9a352be268363910b0a73a5d5bd 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright (C) 2019 Ian Kelling
 # SPDX-License-Identifier: AGPL-3.0-or-later
-if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
+export BRC=t; if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
 
 ### setup
 source /a/bin/errhandle/err
@@ -12,15 +12,14 @@ if [[ $EUID == 0 ]]; then
   exit 1
 fi
 
-errcatch-cleanup() {
+err-cleanup() {
   echo 1 >~/.local/distro-end
 }
 
 # shellcheck source=./pkgs
 source $src/pkgs
 
-exec &> >(sudo tee -a /var/log/distro-end)
-echo "$0: $(date): starting now)"
+echo "$0: $(date) starting now)"
 # see example of usage to understand.
 end_msg() {
   local y
@@ -32,9 +31,11 @@ end() {
   echo 0 >~/.local/distro-end
   if $pending_reboot; then
     echo "$0: pending reboot and then finished. doing it now."
+    echo "exiting with status 0"
     sudo reboot now
   else
     echo "$0: $(date): ending now)"
+    echo "exiting with status 0"
   fi
   exit 0
 }
@@ -104,10 +105,10 @@ esac
 
 
 ### begin certbot install ###
-if [[ $distro == debian ]]; then
+if [[ $distro == debian || $codename_compat == bionic ]]; then
   # note, need python-certbot-nginx for nginx, but it depends on nginx,
   # and I'm not installing nginx by default right now.
-  pi certbot python-certbot-apache
+  pi certbot python3-certbot-apache
 elif [[ $codename_compat == xenial ]]; then
   # not packaged in xenial or flidas
   pi software-properties-common
@@ -180,6 +181,10 @@ Pin-Priority: -100
 Package: *
 Pin: release a=xenial-security
 Pin-Priority: -100
+
+Package: firefox
+Pin: release n=xenial
+Pin-Priority: 500
 EOF
     sd /etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
 deb http://us.archive.ubuntu.com/ubuntu/ xenial main
@@ -357,7 +362,18 @@ Pin-Priority: 1005
 EOF
 
 
-    ;;
+    ;;&
+  etiona)
+    sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
+Package: *
+Pin: release n=bionic
+Pin-Priority: -100
+
+Package: firefox gnome-screenshot gnome-icon-theme libnautilus-extension1a gnome-settings-daemon nautilus yelp gnome-settings-daemon-schemas nautilus-data ubuntu-wallpapers gnome-control-center gnome-control-center-data gnome-control-center-faces libsnapd-glib1 ubuntu-wallpapers-bionic gir1.2-snapd-1 ubuntu-drivers-common ubuntu-docs libyelp0
+Pin: release n=bionic
+Pin-Priority: 500
+EOF
+    ;;&
   *)
     if isdeb; then
       pi debian-goodies shellcheck
@@ -603,10 +619,28 @@ case $codename_compat in
     # mate doesnt have wayland support yet
     pi task-gnome-desktop
     ;;
+  bionic)
+    pi gnome-core
+    # by default, it sleeps when not logged in to x/wayland and on ac power.
+    # stop that.
+    sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
+    systemctl --user stop gvfs-daemon
+    systemctl --user disable gvfs-daemon
+    ;;
 esac
 
 
+if [[ $codename_compat == flidas ]]; then
+  # doesnt exist in newer
+  pi gnupg-doc
+fi
 
+# abrowser is not in etiona yet, abrowser version is 68,
+# abrowser won't run on a firefox profile that was on firefox
+# version 70. firefox in ubuntu is at version 70.
+# have to rm compabibility.ini to even try downgrade.
+pi firefox
+sudo update-alternatives --set x-www-browser /usr/bin/firefox
 
 # TODO: some of the X programs can be removed from pall when using wayland
 
@@ -617,9 +651,6 @@ esac
 pi ${pall[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}') $(apt-cache depends gcc|grep -i suggests:| awk '{print $2}') $($src/distro-pkgs)
 
 
-sgo fsf-vpn-dns-cleanup
-
-
 # website is dead june 14 2019. back in october, but meh
 sudo rm -fv /etc/apt/sources.list.d/iridium-browser.list
 # case $distro in
@@ -773,16 +804,11 @@ fi
 ######### end irc periodic backup #############
 
 
-case $distro in
-  debian|trisquel|ubuntu)
-    # suggests resolvconf package. installing it here is redundant, but make sure anyways.
-    # todo: check other distros to make sure it\'s installed
-    pi-nostart openvpn resolvconf
-    # pi-nostart does not disable
-    ser disable openvpn
-    ;;
-  *) pi openvpn;;
-esac
+pi-nostart openvpn
+# pi-nostart does not disable
+ser disable openvpn
+
+/p/c/gen-fsf-vpn
 
 m /a/bin/distro-setup/radicale-setup
 
@@ -864,8 +890,8 @@ fi
 
 case $codename in
   flidas)
-
-  ;;
+    :
+    ;;
 esac
 
 
@@ -1025,6 +1051,7 @@ sgo schrootupdate.timer
 # for my roommate
 case $distro in
   trisquel)
+    # cant do buster due to old gpg
     m mkschroot debian stretch firefox-esr pulseaudio chromium
     ;;
   debian)
@@ -1264,8 +1291,6 @@ sudo gpasswd -a $USER lpadmin # based on ubuntu wiki
 # in arch, I had to pick out the 6L driver.
 
 
-# allow user to run vms, from debian handbook
-for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
 # bridge networking as user fails. google lead here, but it doesn\'t work:
 # oh well, I give up.
 # http://wiki.qemu.org/Features-Done/HelperNetworking
@@ -1284,7 +1309,8 @@ m /a/bin/buildscripts/rust
 m /a/bin/buildscripts/misc
 
 pi-nostart virtinst virt-manager
-
+# allow user to run vms, from debian handbook
+for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
 
 
 pi --no-install-recommends kdeconnect
@@ -1358,21 +1384,38 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
-# 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
+case $(debian-codename) in
+  # needed for debootstrap scripts for fai since fai requires debian
+  flidas)
+    pi dnsmasq
+    pi-nostart network-manager
+    # 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
 
 # make my /etc/fonts/conf.d/ get used.
 # I have a new sans-serif font there because the default one
 # displays l and I as the same char, grrrrr.
 sudo fc-cache
 
+pi desktop-file-utils
 m /a/bin/distro-setup/mymimes
 
 
@@ -1444,15 +1487,6 @@ m /a/bin/buildscripts/tor-browser
 # nfs server
 pi-nostart nfs-kernel-server
 
-# 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
 
 
 if [[ $HOSTNAME == frodo ]]; then