4 if [ "$#" -ne 1 ]; then
5 echo 'Need exactly one argument (hostname).'
10 # Set up system without user environment.
11 config_tree_prefix="${HOME}/config/buster"
12 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
13 cd "${setup_scripts_dir}"
14 ./setup.sh "${hostname}" ""
15 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" eeepc
16 ./install_for_target.sh eeepc
18 # Install Firefox directly from Mozilla.
19 url_firefox="https://ftp.mozilla.org/pub/firefox/releases/66.0/linux-x86_64/en-US/firefox-66.0.tar.bz2"
21 mv firefox-66.0.tar.bz2 /opt/
23 tar xf firefox-66.0.tar.bz2
24 rm firefox-66.0.tar.bz2
25 ln -s /opt/firefox/firefox /usr/local/bin/
26 update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200
27 update-alternatives --set x-www-browser /opt/firefox/firefox
29 # Install Firefox plugins.
30 # See <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Distribution_options/Sideloading_add-ons>
31 extensions_dir="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/"
32 mkdir -p "${extensions_dir}"
33 noscript_xpi="noscript-10.6.xpi"
34 url_noscript="https://secure.informaction.com/download/releases/${noscript_xpi}"
35 wget "${url_noscript}"
36 name=$(unzip -p "${noscript_xpi}" manifest.json | jq -r .applications.gecko.id)
37 mv "${noscript_xpi}" "${name}.xpi"
38 tridactyl_xpi="tridactyl-1.14.9pre2457-an+fx.xpi"
39 url_tridactyl="https://tridactyl.cmcaine.co.uk/betas/${tridactyl_xpi}"
40 wget "${url_tridactyl}"
41 name=$(unzip -p "${tridactyl_xpi}" manifest.json | jq -r .applications.gecko.id)
42 mv "${tridactyl_xpi}" "${name}.xpi"
43 mv *.xpi "${extensions_dir}"
45 # Set up user environments.
47 source_dir_secrets="/media/${secrets_dev}/to_usb"
48 target_dir_secrets="/home/plom/tmp_secrets"
49 cd "${setup_scripts_dir}"
50 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
51 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
52 adduser --disabled-password --gecos "" plom
53 usermod -a -G sudo plom
55 if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
56 echo "Put secrets drive into slot for /dev/${secrets_dev}."
57 while [ ! -e /dev/"${secrets_dev}" ]; do
61 printf "Secrets passphrase: "
64 echo "" # newline so user knows their input return was accepted
65 echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
66 cp -a "${source_dir_secrets}" "${target_dir_secrets}"
67 chown -R plom:plom "${target_dir_secrets}"
68 pumount "${secrets_dev}"
69 echo "You can remove /dev/${secrets_dev} now."
70 cp setup_home_eeepc.sh /home/plom
71 chown plom:plom /home/plom/setup_home_eeepc.sh
72 SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home_eeepc.sh" plom