X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=buster%2Fsetup_scripts%2Fsetup_eeepc.sh;h=c4c40251b5b040d46e1bec42ed14a4e9692b1233;hb=7da6716e618d2fa8c010ebe50ed846b10123b178;hp=74efe1ccee7ee7cb74264af6e09ea444e215560b;hpb=fee65f404fce9f2bdf00372d7f11071188c6bb7d;p=config
diff --git a/buster/setup_scripts/setup_eeepc.sh b/buster/setup_scripts/setup_eeepc.sh
index 74efe1c..c4c4025 100755
--- a/buster/setup_scripts/setup_eeepc.sh
+++ b/buster/setup_scripts/setup_eeepc.sh
@@ -7,6 +7,7 @@ if [ "$#" -ne 1 ]; then
fi
hostname="$1"
+# Set up system without user environment.
config_tree_prefix="${HOME}/config/buster"
setup_scripts_dir="${config_tree_prefix}/setup_scripts"
cd "${setup_scripts_dir}"
@@ -14,10 +15,59 @@ cd "${setup_scripts_dir}"
./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" eeepc
./install_for_target.sh eeepc
-if [ ! -d "/home/plom" ]; then
- adduser --disabled-password --gecos "" plom
- usermod -a -G sudo plom
- su -c "cd && git clone https://plomlompom.com/repos/clone/config" plom
- su -c "~/config/buster/setup_scripts/copy_dirtree.sh ~/config/buster/home_files ~ eeepc" plom
- su -c "echo 2 > ~/.shell_prompt_color" plom
+# Install Firefox directly from Mozilla.
+url_firefox="https://ftp.mozilla.org/pub/firefox/releases/66.0/linux-x86_64/en-US/firefox-66.0.tar.bz2"
+wget "${url_firefox}"
+mv firefox-66.0.tar.bz2 /opt/
+cd /opt/
+tar xf firefox-66.0.tar.bz2
+rm firefox-66.0.tar.bz2
+ln -s /opt/firefox/firefox /usr/local/bin/
+update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200
+update-alternatives --set x-www-browser /opt/firefox/firefox
+
+# Install Firefox plugins.
+# See
+extensions_dir="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/"
+mkdir -p "${extensions_dir}"
+noscript_xpi="noscript-10.6.xpi"
+url_noscript="https://secure.informaction.com/download/releases/${noscript_xpi}"
+wget "${url_noscript}"
+name=$(unzip -p "${noscript_xpi}" manifest.json | jq -r .applications.gecko.id)
+mv "${noscript_xpi}" "${name}.xpi"
+tridactyl_xpi="tridactyl-1.14.9pre2457-an+fx.xpi"
+url_tridactyl="https://tridactyl.cmcaine.co.uk/betas/${tridactyl_xpi}"
+wget "${url_tridactyl}"
+name=$(unzip -p "${tridactyl_xpi}" manifest.json | jq -r .applications.gecko.id)
+mv "${tridactyl_xpi}" "${name}.xpi"
+mv *.xpi "${extensions_dir}"
+
+# Set up user environments.
+secrets_dev="sdb"
+source_dir_secrets="/media/${secrets_dev}/to_usb"
+target_dir_secrets="/home/plom/tmp_secrets"
+cd "${setup_scripts_dir}"
+./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
+HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
+adduser --disabled-password --gecos "" plom
+usermod -a -G sudo plom
+passwd plom
+if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
+ echo "Put secrets drive into slot for /dev/${secrets_dev}."
+ while [ ! -e /dev/"${secrets_dev}" ]; do
+ sleep 1
+ done
+ stty -echo
+ printf "Secrets passphrase: "
+ read secrets_pass
+ stty echo
+ echo "" # newline so user knows their input return was accepted
+ echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
+ cp -a "${source_dir_secrets}" "${target_dir_secrets}"
+ chown -R plom:plom "${target_dir_secrets}"
+ pumount "${secrets_dev}"
+ echo "You can remove /dev/${secrets_dev} now."
+ cp setup_home_eeepc.sh /home/plom
+ chown plom:plom /home/plom/setup_home_eeepc.sh
+ SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home_eeepc.sh" plom
fi