diff --git a/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf b/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf deleted file mode 100644 index 9b08ec3c..00000000 --- a/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf +++ /dev/null @@ -1,64 +0,0 @@ -# LightDM GTK+ Configuration -# Available configuration options listed below. -# -# Appearance: -# theme-name = GTK+ theme to use -# icon-theme-name = Icon theme to use -# background = Background file to use, either an image path or a color (e.g. #772953) -# user-background = false|true ("true" by default) Display user background (if available) -# transition-duration = Length of time (in milliseconds) to transition between background images ("500" by default) -# transition-type = ease-in-out|linear|none ("ease-in-out" by default) -# -# Fonts: -# font-name = Font to use -# xft-antialias = false|true Whether to antialias Xft fonts -# xft-dpi = Resolution for Xft in dots per inch (e.g. 96) -# xft-hintstyle = none|slight|medium|hintfull What degree of hinting to use -# xft-rgba = none|rgb|bgr|vrgb|vbgr Type of subpixel antialiasing -# -# Login window: -# active-monitor = Monitor to display greeter window (name or number). Use #cursor value to display greeter at monitor with cursor. Can be a semicolon separated list -# position = x y ("50% 50%" by default) Login window position -# default-user-image = Image used as default user icon, path or #icon-name -# hide-user-image = false|true ("false" by default) -# -# Panel: -# panel-position = top|bottom ("top" by default) -# clock-format = strftime-format string, e.g. %H:%M -# indicators = semi-colon ";" separated list of allowed indicator modules. Built-in indicators include "~a11y", "~language", "~session", "~power", "~clock", "~host", "~spacer". Unity indicators can be represented by short name (e.g. "sound", "power"), service file name, or absolute path -# -# Accessibility: -# a11y-states = states of accessibility features: "name" - save state on exit, "-name" - disabled at start (default value for unlisted), "+name" - enabled at start. Allowed names: contrast, font, keyboard, reader. -# keyboard = command to launch on-screen keyboard (e.g. "onboard") -# keyboard-position = x y[;width height] ("50%,center -0;50% 25%" by default) Works only for "onboard" -# reader = command to launch screen reader (e.g. "orca") -# -# Security: -# allow-debugging = false|true ("false" by default) -# screensaver-timeout = Timeout (in seconds) until the screen blanks when the greeter is called as lockscreen -# -# Template for per-monitor configuration: -# [monitor: name] -# background = overrides default value -# user-background = overrides default value -# laptop = false|true ("false" by default) Marks monitor as laptop display -# transition-duration = overrides default value -# -[greeter] -background=/usr/share/wallpaper/current.png -#user-background= -theme-name=Numix -icon-theme-name=Numix-Circle-Light -font-name=Noto-Sans -#xft-antialias= -#xft-dpi= -#xft-hintstyle= -#xft-rgba= -hide-user-image=true -#indicators= -clock-format=%H:%M -#keyboard= -#reader= -#position=50%,center 100%,bottom -position=5% 45%,center -#screensaver-timeout= diff --git a/archlive/airootfs/etc/lightdm/lightdm.conf b/archlive/airootfs/etc/lightdm/lightdm.conf deleted file mode 100644 index 2281dff8..00000000 --- a/archlive/airootfs/etc/lightdm/lightdm.conf +++ /dev/null @@ -1,163 +0,0 @@ -# -# General configuration -# -# start-default-seat = True to always start one seat if none are defined in the configuration -# greeter-user = User to run greeter as -# minimum-display-number = Minimum display number to use for X servers -# minimum-vt = First VT to run displays on -# lock-memory = True to prevent memory from being paged to disk -# user-authority-in-system-dir = True if session authority should be in the system location -# guest-account-script = Script to be run to setup guest account -# logind-check-graphical = True to on start seats that are marked as graphical by logind -# log-directory = Directory to log information to -# run-directory = Directory to put running state in -# cache-directory = Directory to cache to -# sessions-directory = Directory to find sessions -# remote-sessions-directory = Directory to find remote sessions -# greeters-directory = Directory to find greeters -# backup-logs = True to move add a .old suffix to old log files when opening new ones -# -[LightDM] -#start-default-seat=true -#greeter-user=lightdm -#minimum-display-number=0 -#minimum-vt=7 # Setting this to a value < 7 implies security issues, see FS#46799 -#lock-memory=true -#user-authority-in-system-dir=false -#guest-account-script=guest-account -#logind-check-graphical=false -#log-directory=/var/log/lightdm -run-directory=/run/lightdm -#cache-directory=/var/cache/lightdm -#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions -#remote-sessions-directory=/usr/share/lightdm/remote-sessions -#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters -#backup-logs=true - -# -# Seat configuration -# -# Seat configuration is matched against the seat name glob in the section, for example: -# [Seat:*] matches all seats and is applied first. -# [Seat:seat0] matches the seat named "seat0". -# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client". -# -# type = Seat type (xlocal, xremote, unity) -# pam-service = PAM service to use for login -# pam-autologin-service = PAM service to use for autologin -# pam-greeter-service = PAM service to use for greeters -# xserver-command = X server command to run (can also contain arguments e.g. X -special-option) -# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option) -# xserver-config = Config file to pass to X server -# xserver-layout = Layout to pass to X server -# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server -# xserver-share = True if the X server is shared for both greeter and session -# xserver-hostname = Hostname of X server (only for type=xremote) -# xserver-display-number = Display number of X server (only for type=xremote) -# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true) -# xdmcp-port = XDMCP UDP/IP port to communicate on -# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf) -# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option) -# unity-compositor-timeout = Number of seconds to wait for compositor to start -# greeter-session = Session to load for greeter -# greeter-hide-users = True to hide the user list -# greeter-allow-guest = True if the greeter should show a guest login option -# greeter-show-manual-login = True if the greeter should offer a manual login option -# greeter-show-remote-login = True if the greeter should offer a remote login option -# user-session = Session to load for users -# allow-user-switching = True if allowed to switch users -# allow-guest = True if guest login is allowed -# guest-session = Session to load for guests (overrides user-session) -# session-wrapper = Wrapper script to run session with -# greeter-wrapper = Wrapper script to run greeter with -# guest-wrapper = Wrapper script to run guest sessions with -# display-setup-script = Script to run when starting a greeter session (runs as root) -# display-stopped-script = Script to run after stopping the display server (runs as root) -# greeter-setup-script = Script to run when starting a greeter (runs as root) -# session-setup-script = Script to run when starting a user session (runs as root) -# session-cleanup-script = Script to run when quitting a user session (runs as root) -# autologin-guest = True to log in as guest by default -# autologin-user = User to log in with by default (overrides autologin-guest) -# autologin-user-timeout = Number of seconds to wait before loading default user -# autologin-session = Session to load for automatic login (overrides user-session) -# autologin-in-background = True if autologin session should not be immediately activated -# exit-on-failure = True if the daemon should exit if this seat fails -# -[Seat:*] -#type=xlocal -pam-service=lightdm -pam-autologin-service=lightdm-autologin -#pam-greeter-service=lightdm-greeter -#xserver-command=X -#xmir-command=Xmir -#xserver-config= -#xserver-layout= -#xserver-allow-tcp=false -#xserver-share=true -#xserver-hostname= -#xserver-display-number= -#xdmcp-manager= -#xdmcp-port=177 -#xdmcp-key= -#unity-compositor-command=unity-system-compositor -#unity-compositor-timeout=60 -#greeter-session=example-gtk-gnome -#greeter-hide-users=false -#greeter-allow-guest=true -#greeter-show-manual-login=false -#greeter-show-remote-login=true -#user-session=default -#allow-user-switching=true -#allow-guest=true -#guest-session= -session-wrapper=/etc/lightdm/Xsession -#greeter-wrapper= -#guest-wrapper= -#display-setup-script= -#display-stopped-script= -#greeter-setup-script= -#session-setup-script= -#session-cleanup-script= -#autologin-guest=false -autologin-user=wktech -autologin-user-timeout=0 -#autologin-in-background=false -#autologin-session= -#exit-on-failure=false - -# -# XDMCP Server configuration -# -# enabled = True if XDMCP connections should be allowed -# port = UDP/IP port to listen for connections on -# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present) -# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf) -# -# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively -# it can be a word and the first 7 characters are used as the key. -# -[XDMCPServer] -#enabled=false -#port=177 -#listen-address= -#key= - -# -# VNC Server configuration -# -# enabled = True if VNC connections should be allowed -# command = Command to run Xvnc server with -# port = TCP/IP port to listen for connections on -# listen-address = Host/address to listen for VNC connections (use all addresses if not present) -# width = Width of display to use -# height = Height of display to use -# depth = Color depth of display to use -# -[VNCServer] -#enabled=false -#command=Xvnc -#port=5900 -#listen-address= -#width=1024 -#height=768 -#depth=8 diff --git a/archlive/airootfs/etc/nodm.conf b/archlive/airootfs/etc/nodm.conf new file mode 100644 index 00000000..dfcb5113 --- /dev/null +++ b/archlive/airootfs/etc/nodm.conf @@ -0,0 +1,22 @@ +# nodm configuration file + +# Controls the user that is used to automatically log in +NODM_USER='wktech' + +# Options to pass to the X server (for example: "vt7 -nolisten tcp") +NODM_X_OPTIONS='vt7 -nolisten tcp' + +# Minimum time (in seconds) that a session should last in order for nodm to +# decide that it has not quit too soon. If an X session will run for less than +# this time, nodm will wait an increasing bit of time before restarting it. +NODM_MIN_SESSION_TIME=60 + +# Restart session after it ending? +NODM_RESTART_SESSION=0 + +# Path to the xinit program +NODM_XINIT='/usr/bin/xinit' + +# Path to the X session script (useful if using xinit instead of startx). +# NOTE: This file needs to be executable! +NODM_XSESSION='/home/wktech/.xinitrc' diff --git a/archlive/airootfs/etc/skel/.Xresources b/archlive/airootfs/etc/skel/.Xresources index ce6e4b9a..b349dcba 100644 --- a/archlive/airootfs/etc/skel/.Xresources +++ b/archlive/airootfs/etc/skel/.Xresources @@ -6,7 +6,7 @@ URxvt*geometry: 96x32+24+24 URxvt*scrollBar_right: True URxvt*scrollstyle: plain -URxvt*shading: 30 +URxvt*shading: 13 URxvt*transparent: true ! Base16 Isotope diff --git a/archlive/airootfs/etc/skel/.config/autostart/NetworkManager.desktop b/archlive/airootfs/etc/skel/.config/autostart/NetworkManager.desktop new file mode 100644 index 00000000..fc74de1b --- /dev/null +++ b/archlive/airootfs/etc/skel/.config/autostart/NetworkManager.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=NetworkManager +Comment=NetworkManager +Exec=/home/wktech/.network_start +OnlyShowIn=XFCE; +StartupNotify=false +Terminal=false +Hidden=false + diff --git a/archlive/airootfs/etc/skel/.config/xfce4/panel/whiskermenu-1.rc b/archlive/airootfs/etc/skel/.config/xfce4/panel/whiskermenu-1.rc index 93ffb654..e0195106 100644 --- a/archlive/airootfs/etc/skel/.config/xfce4/panel/whiskermenu-1.rc +++ b/archlive/airootfs/etc/skel/.config/xfce4/panel/whiskermenu-1.rc @@ -1,4 +1,4 @@ -favorites=Hardware Diagnostics.desktop,exo-file-manager.desktop,gparted.desktop,gsmartcontrol.desktop,SpeedTest.desktop,truecrypt.desktop,exo-web-browser.desktop +favorites=Hardware Diagnostics.desktop,Hardware Information.desktop,exo-file-manager.desktop,gparted.desktop,gsmartcontrol.desktop,SpeedTest.desktop,exo-web-browser.desktop recent=xfce4-settings-editor.desktop,xfce-session-settings.desktop,xfce4-power-manager-settings.desktop,gsmartcontrol.desktop,gparted.desktop button-title=Applications button-icon=distributor-logo-archlinux diff --git a/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml b/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml index 7c785878..f293434e 100644 --- a/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml +++ b/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml @@ -32,6 +32,7 @@ + diff --git a/archlive/airootfs/etc/skel/.conky_start b/archlive/airootfs/etc/skel/.conky_start index ce3fc10d..c7230b17 100644 --- a/archlive/airootfs/etc/skel/.conky_start +++ b/archlive/airootfs/etc/skel/.conky_start @@ -1,5 +1,10 @@ #!/bin/bash -sleep 2s && conky & -sleep 5s && killall conky -conky +CONKY_RC="$HOME/.conkyrc" +if [[ -f "/run/archiso/bootmnt/arch/conky.rc" ]]; then + CONKY_RC="/run/archiso/bootmnt/arch/conky.rc" +fi + +sleep 2s && conky -c "${CONKY_RC}" -dq +sleep 5s && killall conky -c "${CONKY_RC}" -dq + diff --git a/archlive/airootfs/etc/skel/.conkyrc b/archlive/airootfs/etc/skel/.conkyrc index 3e84073e..4782d0d8 100644 --- a/archlive/airootfs/etc/skel/.conkyrc +++ b/archlive/airootfs/etc/skel/.conkyrc @@ -14,9 +14,9 @@ ### Begin Window Settings ##################### own_window yes own_window_type normal -own_window_transparent yes +own_window_transparent no own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky -own_window_colour 000000 +own_window_colour 421114 own_window_class Conky #own_window_title Bunsen Labs Default Conky own_window_title Default Conky @@ -25,13 +25,13 @@ own_window_title Default Conky ### NOTE that a composite manager is required for real transparency. ### This option will not work as desired (in most cases) in conjunction with ### own_window_type normal -# own_window_argb_visual yes # Options: yes or no +own_window_argb_visual yes # Options: yes or no ### When ARGB visuals are enabled, this use this to modify the alpha value ### Use: own_window_type normal ### Use: own_window_transparent no ### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity. -# own_window_argb_value 50 +own_window_argb_value 160 minimum_size 180 0 ### width | height maximum_width 180 @@ -155,6 +155,7 @@ ${hr} [Super] + d${alignr}HW Diagnostics [Super] + f${alignr}File Manager [Super] + h${alignr}Task Manager +[Super] + i${alignr}HW Information [Super] + m${alignr}Mount Volumes [Super] + r${alignr}Run Dialog [Super] + s${alignr}SMART Check diff --git a/archlive/airootfs/etc/skel/.local/share/keyrings/login.keyring b/archlive/airootfs/etc/skel/.local/share/keyrings/login.keyring deleted file mode 100644 index f312a94a..00000000 Binary files a/archlive/airootfs/etc/skel/.local/share/keyrings/login.keyring and /dev/null differ diff --git a/archlive/airootfs/etc/skel/.local/share/keyrings/user.keystore b/archlive/airootfs/etc/skel/.local/share/keyrings/user.keystore deleted file mode 100644 index 2d8eee8d..00000000 Binary files a/archlive/airootfs/etc/skel/.local/share/keyrings/user.keystore and /dev/null differ diff --git a/archlive/airootfs/etc/skel/.network_start b/archlive/airootfs/etc/skel/.network_start new file mode 100644 index 00000000..d6e16c7f --- /dev/null +++ b/archlive/airootfs/etc/skel/.network_start @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo systemctl start NetworkManager +connect-to-network + diff --git a/archlive/airootfs/etc/systemd/system/NetworkManagerFork.service b/archlive/airootfs/etc/systemd/system/NetworkManagerFork.service new file mode 100644 index 00000000..fe1944f7 --- /dev/null +++ b/archlive/airootfs/etc/systemd/system/NetworkManagerFork.service @@ -0,0 +1,23 @@ +[Unit] +Description=Network Manager +Wants=network.target +After=network-pre.target dbus.service +Before=network.target + +[Service] +Type=forking +PIDFile=/var/run/NetworkManager.pid +BusName=org.freedesktop.NetworkManager +ExecReload=/bin/kill -HUP $MAINPID +ExecStart=/usr/bin/NetworkManager --pid-file=/var/run/NetworkManager.pid --no-daemon +REstart=on-failure +# NM doesn't want systemd to kill its children for it +KillMode=process +CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT +ProtectSystem=true +ProtectHome=read-only + +[Install] +WantedBy=multi-user.target +Alias=dbus-org.freedesktop.NetworkManager.service +Also=NetworkManager-dispatcher.service diff --git a/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service b/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service deleted file mode 100644 index e874a9b3..00000000 --- a/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/NetworkManager.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/display-manager.service b/archlive/airootfs/etc/systemd/system/display-manager.service index 5595cea3..0ce57dc6 100644 --- a/archlive/airootfs/etc/systemd/system/display-manager.service +++ b/archlive/airootfs/etc/systemd/system/display-manager.service @@ -1 +1 @@ -/usr/lib/systemd/system/lightdm.service \ No newline at end of file +/usr/lib/systemd/system/nodm.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service b/archlive/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service deleted file mode 100644 index e874a9b3..00000000 --- a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/NetworkManager.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/remote-fs.target b/archlive/airootfs/etc/systemd/system/multi-user.target.wants/remote-fs.target deleted file mode 100644 index 2bc8b1cc..00000000 --- a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/remote-fs.target +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/remote-fs.target \ No newline at end of file diff --git a/archlive/airootfs/root/customize_airootfs.sh b/archlive/airootfs/root/customize_airootfs.sh index 022df645..2f6ec861 100644 --- a/archlive/airootfs/root/customize_airootfs.sh +++ b/archlive/airootfs/root/customize_airootfs.sh @@ -42,7 +42,6 @@ sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' /etc/systemd/logind.conf sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' /etc/systemd/logind.conf sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' /etc/systemd/logind.conf -# Startup settings (from archiso) -systemctl enable pacman-init.service choose-mirror.service +# Startup settings #systemctl set-default multi-user.target systemctl set-default graphical.target diff --git a/archlive/airootfs/usr/local/bin/arch.conf b/archlive/airootfs/usr/local/bin/arch.conf new file mode 100644 index 00000000..1cda4d51 --- /dev/null +++ b/archlive/airootfs/usr/local/bin/arch.conf @@ -0,0 +1,44 @@ +## WK-Arch Settings ## + +# Backup options +declare -a BACKUP_1=( + "ServerOne" # Server name + "10.0.0.10" # IP + "Backups" # Share name + "backup" # User name + "Abracadabra" # Password +) +declare -a BACKUP_2=( + "ServerTwo" # Server name + "10.0.0.11" # IP + "Backups" # Share name + "backup" # User name + "Abracadabra" # Password +) +declare -a BACKUP_3=( + "" # Server name + "" # IP + "" # Share name + "" # User name + "" # Password +) +declare -a BACKUP_4=( + "" # Server name + "" # IP + "" # Share name + "" # User name + "" # Password +) + +# Hardware testing options +TEST_CPU_LENGTH="7" # Time in minutes to run Prime95 + +# Network options +WIFI_SSID="SomeWiFi" # Use the 2.4Ghz network for better compatability +WIFI_PASS="Abracadabra" + +# Results upload options +SKIP_UPLOAD="False" # Set to "True" to disable all uploads +DIAG_SERVER="10.0.0.10" # Use the IP and not the server name +DIAG_USER="wkdiag" # User used to connect to the server via SSH +DIAG_DEST="/srv/Diagnostics" # Full path to dest folder (on server) diff --git a/archlive/airootfs/usr/local/bin/connect-to-network b/archlive/airootfs/usr/local/bin/connect-to-network new file mode 100644 index 00000000..94a6d257 --- /dev/null +++ b/archlive/airootfs/usr/local/bin/connect-to-network @@ -0,0 +1,58 @@ +#!/bin/bash +# +## Get connected to a network + +# 1. Checks if already online; skips if so +# 2. If no wired devices are present then reload kernel modules +# 3. If wireless devices are present, and we're still offline, then connect to WiFi + +die () { + echo "$0:" "$@" >&2 + exit 1 +} + +# Load settings +if [[ -f "/run/archiso/bootmnt/arch/arch.conf" ]]; then + source "/run/archiso/bootmnt/arch/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" +else + source "/usr/local/bin/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" + echo -n "ERROR: Settings file on ARCH_WK media missing. Using build version for now" + sleep 1s + echo -n "." + sleep 1s + echo -n "." + sleep 1s + echo "." +fi + +# Init +WIFI_SSID="${WIFI_SSID}" +WIFI_PASS="${WIFI_PASS}" + +# Connect to network +if ! ip a | grep -Eq '(192.168|10.[0-9]+).[0-9]+.[0-9]+'; then + # LAN + if ! ip l | grep -Eq '[0-9]+: +en'; then + ## Reload the tg3/broadcom driver (known fix for some Dell systems) + echo "No wired network adapters found; reloading drivers..." + sudo modprobe -r tg3 + sudo modprobe broadcom + sudo modprobe tg3 + sleep 5s + fi + + # WiFi + if ip l | grep -Eq '[0-9]+: +wl'; then + ## Skip if we're already connected (i.e. the code above worked) + if ! ip a | grep -Eq '(192.168|10.[0-9]+).[0-9]+.[0-9]+'; then + echo "Attempting to connect to ${WIFI_SSID}..." + nmcli dev wifi con "${WIFI_SSID}" password "${WIFI_PASS}" + sleep 5s + fi + fi +fi + +# Done +exit 0 diff --git a/archlive/airootfs/usr/local/bin/hw-diags-inner b/archlive/airootfs/usr/local/bin/hw-diags-inner index 3b7ba213..c805ce1a 100644 --- a/archlive/airootfs/usr/local/bin/hw-diags-inner +++ b/archlive/airootfs/usr/local/bin/hw-diags-inner @@ -2,8 +2,30 @@ # ## WK HW Diagnostics - Main script +die () { + echo "$0:" "$@" >&2 + exit 1 +} + +# Load settings +if [[ -f "/run/archiso/bootmnt/arch/arch.conf" ]]; then + source "/run/archiso/bootmnt/arch/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" +else + source "/usr/local/bin/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" + echo -n "ERROR: Settings file on ARCH_WK media missing. Using build version for now" + sleep 1s + echo -n "." + sleep 1s + echo -n "." + sleep 1s + echo "." +fi + # Get TICKET -SKIP_UPLOAD="" +## Inital SKIP_UPLOAD value loaded from arch.conf +SKIP_UPLOAD="${SKIP_UPLOAD}" TICKET="" while [[ "$TICKET" == "" ]]; do if [[ "$1" == "foh" ]]; then @@ -22,16 +44,16 @@ while [[ "$TICKET" == "" ]]; do done # Init +## Tautologies left to show which settings are coming from arch.conf DIAG_DATE="$(date "+%F_%H%M")" DIAG_SERVER_AVAIL="False" -DIAG_SERVER="10.0.0.10" -DIAG_DEST="/srv/Diagnostics/${TICKET}/${DIAG_DATE}" -DIAG_USER="wkdiag" +DIAG_SERVER="${DIAG_SERVER}" +DIAG_DEST="${DIAG_DEST}/${TICKET}/${DIAG_DATE}" +DIAG_USER="${DIAG_USER}" TMP_DIR="$(mktemp -d)" ERRORS="False" -ERROR_IMG="$TMP_DIR/error.jpg" -PASSED_IMG="$TMP_DIR/passed.jpg" TEST_CPU="False" +TEST_CPU_LENGTH="${TEST_CPU_LENGTH}" TEST_OVER="False" TEST_SMART="False" TEST_BADBLOCKS="False" @@ -51,30 +73,10 @@ done # Handle testing runs if [[ "$SKIP_UPLOAD" != "True" ]]; then # Connect to network - if ! ip a | grep -q '192.168.1'; then - # LAN - if ! ip l | grep -Eq '[0-9]+: +en'; then - ## Reload the tg3/broadcom driver (known fix for some Dell systems) - echo "No wired network adapters found; reloading drivers..." - sudo modprobe -r tg3 - sudo modprobe broadcom - sudo modprobe tg3 - sleep 5s - fi - - # WiFi - if ip l | grep -Eq '[0-9]+: +wl'; then - ## Skip if we're already connected (e.g. the code above worked) - if ! ip a | grep -q '192.168.1'; then - echo "Attempting to connect to SomeWiFi..." - nmcli dev wifi con "SomeWiFi" password "Abracadabra" - sleep 5s - fi - fi - fi + connect-to-network # Test connection to DIAG_SERVER - if ip a | grep -q '192.168.1' && \ + if ip a | grep -Eq '(192.168|10.[0-9]+).[0-9]+.[0-9]+' && \ ping -c 1 -q $DIAG_SERVER >/dev/null 2>&1; then DIAG_SERVER_AVAIL="True" ssh $DIAG_USER@$DIAG_SERVER mkdir -p "$DIAG_DEST" @@ -250,8 +252,8 @@ if [[ "$TEST_CPU" == "True" ]]; then CPU_ERRORS="False" cpu_result="Working" update_progress - (sleep 10m && killall -s INT "mprime" >>/dev/null 2>&1) & - (sleep 10m && killall "hw-diags-sensors" >>/dev/null 2>&1) & + (sleep ${TEST_CPU_LENGTH}m && killall -s INT "mprime" >>/dev/null 2>&1) & + (sleep ${TEST_CPU_LENGTH}m && killall "hw-diags-sensors" >>/dev/null 2>&1) & tmux split-window -d -v -l 10 "hw-diags-prime95 $TMP_DIR" hw-diags-sensors "$TMP_DIR" 2>/dev/null sleep 1s diff --git a/archlive/airootfs/usr/local/bin/mount-all-volumes b/archlive/airootfs/usr/local/bin/mount-all-volumes index ec634b9a..40ddb671 100644 --- a/archlive/airootfs/usr/local/bin/mount-all-volumes +++ b/archlive/airootfs/usr/local/bin/mount-all-volumes @@ -2,9 +2,28 @@ # ## Mount all volumes read-only +# Fix issue where first device is mounted under /media/wktech/ +TMP_FILE=$(mktemp) +dd bs=1K count=64 if=/dev/zero of="$TMP_FILE" >/dev/null 2>&1 +mkfs.msdos "$TMP_FILE" >/dev/null 2>&1 +udevil mount -o ro "$TMP_FILE" >/dev/null 2>&1 +udevil umount "$TMP_FILE" >/dev/null 2>&1 + +# Mount all volumes echo "Mounting all volumes" regex="/dev/((h|s)d[a-z]|md)[0-9]+" -for v in $(inxi -Do | grep -E "$regex" | sed -r "s#.*($regex).*#\1#" | sort); do - udevil mount -o ro $v +for volume in $(inxi -Dopxx | grep -E "$regex" | sed -r "s#.*($regex).*#\1#" | sort); do + if grep -q "$volume" /proc/mounts; then + if ! mount | grep "/run/archiso/bootmnt" | grep -q "$volume"; then + # Show what's already mounted except the ARCH_WK boot device + echo "$volume: (Already) mounted at $(mount | grep "$volume" | awk '{print $3}') ($(df -h "$volume" | tail -1 | awk '{print $3, $4}' | sed -r 's/(K|M|G|T|) (.*[0-9])(K|M|G|T|)$/ \1b used, \2 \3b free/'))" + fi + else + if udevil mount -o ro $volume >/dev/null 2>&1; then + echo "$volume: Mounted at $(mount | grep "$volume" | awk '{print $3}') ($(df -h "$volume" | tail -1 | awk '{print $3, $4}' | sed -r 's/(K|M|G|T|) (.*[0-9])(K|M|G|T|)$/ \1b used, \2 \3b free/'))" + else + echo "$volume: Failed to mount" + fi + fi done echo "Done." diff --git a/archlive/airootfs/usr/local/bin/mount-backup-shares b/archlive/airootfs/usr/local/bin/mount-backup-shares index 36e44645..3e372bb3 100644 --- a/archlive/airootfs/usr/local/bin/mount-backup-shares +++ b/archlive/airootfs/usr/local/bin/mount-backup-shares @@ -2,9 +2,73 @@ # ## Mount NAS backup shares -echo "Mounting NAS backup shares" -sudo mkdir /Backups/ServerOne -p -sudo mount //10.0.0.10/Backups /Backups/ServerOne -o username=backup,password=Abracadabra -sudo mkdir /Backups/ServerTwo -p -sudo mount //10.0.0.11/Backups /Backups/ServerTwo -o username=backup,password=Abracadabra +die () { + echo "$0:" "$@" >&2 + exit 1 +} + +# Load settings +if [[ -f "/run/archiso/bootmnt/arch/arch.conf" ]]; then + source "/run/archiso/bootmnt/arch/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" +else + source "/usr/local/bin/arch.conf" || \ + die "ERROR: ARCH_WK media may be damaged. Please reboot or try another UFD" + echo -n "ERROR: Settings file on ARCH_WK media missing. Using build version for now" + sleep 1s + echo -n "." + sleep 1s + echo -n "." + sleep 1s + echo "." +fi + +# Connect to a network +connect-to-network + +# Mount loop +echo "Mounting NAS backup shares" +for x in {1..4}; do + _skip="False" + + # Load Backup share info + eval "declare -a _backup=(\${BACKUP_$x[@]})" + _name="${_backup[0]}" + _ip="${_backup[1]}" + _share="${_backup[2]}" + _user="${_backup[3]}" + _pass="${_backup[4]}" + + # Check backup share info + if echo "$_name" | grep -Eq '^\s*$'; then + _skip="True"; + fi + if echo "$_ip" | grep -Eq '^\s*$'; then + _skip="True"; + fi + if echo "$_share" | grep -Eq '^\s*$'; then + _skip="True"; + fi + if echo "$_user" | grep -Eq '^\s*$'; then + _skip="True"; + fi + if echo "$_pass" | grep -Eq '^\s*$'; then + _skip="True"; + fi + + # Mount + if [[ "$_skip" == "False" ]]; then + sudo mkdir "/Backups/$_name" -p + if mountpoint -q "/Backups/$_name"; then + echo "$_name: (Already) mounted at /Backups/$_name ($(df -h "/Backups/$_name" | tail -1 | awk '{print $4}' | sed -r 's/([KMGT])/ \1b/') free)" + else + if sudo mount "//$_ip/$_share" "/Backups/$_name" -o username=$_user,password=$_pass 2>/dev/null; then + echo "$_name: Mounted at /Backups/$_name ($(df -h "/Backups/$_name" | tail -1 | awk '{print $4}' | sed -r 's/([KMGT])/ \1b/') free)" + else + rmdir "/Backups/$_name" -p 2>/dev/null + echo "$_name: Failed to mount" + fi + fi + fi +done diff --git a/archlive/airootfs/usr/share/applications/Hardware Information.desktop b/archlive/airootfs/usr/share/applications/Hardware Information.desktop new file mode 100644 index 00000000..afe334bb --- /dev/null +++ b/archlive/airootfs/usr/share/applications/Hardware Information.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Hardware Information +Comment= +Exec=hardinfo +Icon=hardinfo +Path= +Terminal=false +StartupNotify=false diff --git a/archlive/packages.both b/archlive/packages.both index 114bdf72..979ae849 100644 --- a/archlive/packages.both +++ b/archlive/packages.both @@ -6,7 +6,6 @@ b43-fwcutter btrfs-progs chntpw clonezilla -cmatrix colordiff conky crda @@ -36,6 +35,7 @@ grub gsmartcontrol gtk-engine-murrine gtk-theme-arc-git +hardinfo hdparm hexedit hfsprogs @@ -46,9 +46,8 @@ ipw2200-fw iw ldns lftp +libewf librsvg -lightdm -lightdm-gtk-greeter linux-atm lm_sensors lsscsi @@ -70,13 +69,11 @@ networkmanager nfs-utils nilfs-utils nmap +nodm noto-fonts ntfs-3g ntp numix-circle-icon-theme-git -numix-icon-theme-git -numix-themes -numix-themes-git openconnect openssh openvpn @@ -101,7 +98,6 @@ speedtouch sudo tcpdump terminus-font -testdisk testdisk-wip tk tmux diff --git a/build-wk b/build-wk index 2ffa0d3b..07294750 100644 --- a/build-wk +++ b/build-wk @@ -10,4 +10,4 @@ mkdir $OUT_DIR ./archlive/build.sh -N "arch-wk" -V "$(date +%F)" -L "ARCH_WK" -w "$TMP_DIR" -o "$OUT_DIR" -v # Cleanup -mv -nv "$OUT_DIR"/*iso "$HOME/" && rm "$TMP_DIR" -Rf +mv --backup=t -v "$OUT_DIR"/*iso "$HOME/" && rm "$TMP_DIR" -Rf