X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=distro-begin;h=16d3359d5d8f8579250d9541e14f37479601089d;hp=0744a1b07861d56739d972b77e38181da957b8a6;hb=77917a8fbf2032a8b2634a1b3de0879ec45cf213;hpb=6061d88c7d5beda3e974943eb8676f7c39d4ae9f diff --git a/distro-begin b/distro-begin index 0744a1b..16d3359 100755 --- a/distro-begin +++ b/distro-begin @@ -46,7 +46,6 @@ ### make ssh interactive shell run better. for when running line interactively line by line sudo bash -c '/a/exe/ssh-emacs-setup' -if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi ##### setup error handling interactive=true # set this to false to force set -x [[ $- == *i* ]] || interactive=false @@ -55,14 +54,13 @@ if ! $interactive; then fi source /a/bin/errhandle/err -errcatch-cleanup() { +err-cleanup() { echo 1 >~/.local/distro-begin } source /a/bin/distro-functions/src/package-manager-abstractions ### setup logging -exec &> >(sudo tee -a /var/log/distro-begin) echo "$0: $(date): starting now)" @@ -128,7 +126,7 @@ if encrypted; then # but it happened too late in the shutdown process. sudo dd of=/etc/systemd/system/keyscripton.service <<'EOF' [Unit] -Description=Turn on automatic decryption of drives on boot +Description=keyscripton # This is triggered by reboot and when keyscriptoff stops. # tried using graphical.target, but it made my display manager restart before rebooting. @@ -154,7 +152,7 @@ EOF sudo dd of=/etc/systemd/system/keyscriptoff.service <<'EOF' [Unit] -Description=Turn off automatic decryption of drives on boot +Description=keyscriptoff [Service] Type=oneshot @@ -169,15 +167,26 @@ EOF pi rsync - # from /usr/share/doc/dropbear-initramfs/README.initramfs.gz - tmp=$(mktemp) - while read -r m _; do /sbin/modinfo -F filename "$m"; done /dev/null; then - sudo dd if=$tmp of=/etc/initramfs-tools/modules + ## /usr/share/doc/dropbear-initramfs/README.initramfs.gz + ## claims we need to do this. but it works fine without it. + # tmp=$(mktemp) + # while read -r m _; do /sbin/modinfo -F filename "$m"; done /dev/null; then + # sudo dd if=$tmp of=/etc/initramfs-tools/modules + # sudo /usr/sbin/update-initramfs -u -k all + # fi + # + ## if we were creating an intall for a different machine needing different modules, we could include them all like this: + ## find /lib/modules/*/kernel/drivers/net /lib/modules/*/kernel/net -type f -name '*.ko' -printf "%f\n" | sed 's/.ko$//' | sort -u >/etc/initramfs-tools/modules + + # this is here to cleanup the leftover from the comments above. remove it eventually. + if [[ -s /etc/initramfs-tools/modules ]]; then + sudo truncate -s0 /etc/initramfs-tools/modules sudo /usr/sbin/update-initramfs -u -k all fi + # initram auth keys get setup with rootsshsync $script_dir/rootsshsync # then for remote unlock, ssh and do this once per crypt disk: @@ -213,8 +222,13 @@ if [[ $HOSTNAME != $(cat /etc/hostname) ]]; then echo $HOSTNAME > /etc/hostname hostname -F /etc/hostname fi +# office vpn dhcp adds to /etc/resolv.conf search office.fsf.org which +# makes that be #1 priority, which makes dnsmasq resolve that for +# unqualified hosts first, which means we skip the hosts file. Ya, its +# kinda dumb, but it is what it is. There is a dnsmasq config option to +# override it too, but this seems simpler. sudo sed -i --follow-symlinks -f - /etc/hosts < *{/,/}/s/KP_Multiply/underscore/g' /usr/share/X11/xkb/symbols/keypad -fi -##### basic graphical packages -if has_monitor; then + ##### basic graphical packages pi konsole suckless-tools fi + ##### install emacs if $emacs; then if isarch; then @@ -611,4 +598,5 @@ fi echo 0 >~/.local/distro-begin echo "$0: $(date): ending now" +echo "exiting with status 0" exit 0