[[ $- == *i* ]] || interactive=false
if ! $interactive; then
set -x
- set -e -o pipefail
fi
-set -E
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
-for x in /a/bin/errhandle/*-function; do
- source $x
-done
-set +e
-$interactive || errcatch
+source /a/bin/errhandle/err
### setup logging
exec &> >(sudo tee -a /var/log/distro-begin)
### arg parsing
recompile=false
-# for copying to a new data fs
-bootstrapfs=false # old flag, needs new look before using.
while [[ $1 == -* ]]; do
case $1 in
-r) recompile=true; shift ;;
##### variables/env setup
-script_dir="$(readlink -f "$BASH_SOURCE")"
+script_dir="$(readlink -f "$BASH_SOURCE")"; script_dir=${script_dir%/*}
source $script_dir/pkgs
set +x
source /a/bin/distro-functions/src/identify-distros
$interactive || set -x
-for f in iank-dev htpc treetowl x2 frodo tp li lj demohost kw fz; do
+for f in iank-dev htpc kd x2 x3 frodo tp li lj demohost kw fz; do
eval "$f() { [[ $HOSTNAME == $f ]]; }"
done
has_p() { ! linode; } # when tp is tracis, then not tp either
sudo systemctl daemon-reload # needed if the file was already there
sudo systemctl enable keyscriptoff.service
sudo systemctl start keyscriptoff.service
+
+ # from /usr/share/doc/dropbear-initramfs/README.initramfs.gz
+ while read m _; do /sbin/modinfo -F filename "$m"; done </proc/modules | \
+ sed -nr "s@^/lib/modules/`uname -r`/kernel/drivers/net(/.*)?/([^/]+)\.ko\$@\2@p" \
+ | sudo dd of=/etc/initramfs-tools/modules
+ sudo apt-get -y install initramfs-tools-core
+ # initram auth keys get setup with rootsshsync
+ # then for remote unlock, ssh and do this once per crypt disk:
+ # echo -n PASS >/lib/cryptsetup/passfifo
fi
##### end setup encryption scripts ######
###### bash environment setup
set +x
-errallow
+err-allow
source /etc/profile.d/environment.sh
source ~/.bashrc
-$interactive || errcatch
+err-catch
$interactive || set -x
fi
s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
/a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
+pi rsync # needed for rootsshsync
+/a/bin/ds/install-my-scripts # needed for rootsshsync
rootsshsync
s lnf /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
if has_p; then
fi
##### install laptop hardware packages
-if tp || x2; then
+if tp || x2 || x3; then
case $distro in
debian)
pi task-laptop