From 077401ef85b99c67a266a1c097a958731c0e0242 Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Wed, 6 Dec 2017 17:58:25 -0800 Subject: [PATCH] 2017-06: Retroactive Updates * Include extras/* in ISO * build-wk modifies build.sh before it is called * NetworkManager is back * Switched to Numix-Square icons * Added remount-rw script * Accessible in Thunar as custom action * Readded mesa-demos to fix inxi message * Removed xorg-video-ati (conflicts with AMDGPU) * Swapping nvidia in for nouveau (attempt to fix X for newer macs) * Added mbpfan-git * Added Mac fans script (set all fans to auto/max) * Fixed issue where udevil would use /media/$USER/Name for the first call --- archlive/airootfs/etc/motd | 2 +- .../etc/skel/.config/Thunar/accels.scm | 2 + .../airootfs/etc/skel/.config/Thunar/uca.xml | 11 ++ .../etc/skel/.config/gtk-3.0/settings.ini | 2 +- .../airootfs/etc/skel/.config/midori/config | 21 --- .../xfce4-keyboard-shortcuts.xml | 2 +- .../xfconf/xfce-perchannel-xml/xsettings.xml | 2 +- .../etc/systemd/network/wired.network | 8 - .../etc/systemd/network/wireless.network | 8 - ...bus-org.freedesktop.NetworkManager.service | 1 + ...dbus-org.freedesktop.nm-dispatcher.service | 1 + .../systemd/system/etc-pacman.d-gnupg.mount | 8 - .../NetworkManager.service | 1 + .../systemd-networkd.service | 1 - .../systemd-resolved.service | 1 - .../etc/systemd/system/pacman-init.service | 15 -- .../systemd-networkd.socket | 1 - .../etc/udev/rules.d/99-udisks2.rules | 5 + archlive/airootfs/etc/udevil/udevil.conf | 2 +- archlive/airootfs/root/customize_airootfs.sh | 22 ++- archlive/airootfs/usr/local/bin/applefans | 37 ++++ .../airootfs/usr/local/bin/connect-to-network | 2 +- .../airootfs/usr/local/bin/hw-diags-inner | 50 +++--- .../airootfs/usr/local/bin/mount-all-volumes | 14 +- .../usr/local/bin/mount-all-volumes-foh | 1 + archlive/airootfs/usr/local/bin/remount-rw | 22 +++ archlive/airootfs/usr/local/bin/start-wifi | 55 ------ .../applications/Hardware Diagnostics.desktop | 2 +- archlive/extra/arch/arch.conf | 44 +++++ archlive/extra/arch/conky.rc | 165 ++++++++++++++++++ archlive/extra/arch/wifi.conf | 9 + archlive/packages.both | 17 +- archlive/packages.x86_64 | 1 - archlive/pacman.conf | 2 +- build-wk | 13 +- custom-repo/update | 17 ++ 36 files changed, 388 insertions(+), 179 deletions(-) delete mode 100644 archlive/airootfs/etc/skel/.config/midori/config delete mode 100644 archlive/airootfs/etc/systemd/network/wired.network delete mode 100644 archlive/airootfs/etc/systemd/network/wireless.network create mode 100644 archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service create mode 100644 archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service delete mode 100644 archlive/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount create mode 100644 archlive/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service delete mode 100644 archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service delete mode 100644 archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-resolved.service delete mode 100644 archlive/airootfs/etc/systemd/system/pacman-init.service delete mode 100644 archlive/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket create mode 100644 archlive/airootfs/etc/udev/rules.d/99-udisks2.rules create mode 100644 archlive/airootfs/usr/local/bin/applefans create mode 100644 archlive/airootfs/usr/local/bin/mount-all-volumes-foh create mode 100644 archlive/airootfs/usr/local/bin/remount-rw delete mode 100644 archlive/airootfs/usr/local/bin/start-wifi create mode 100644 archlive/extra/arch/arch.conf create mode 100644 archlive/extra/arch/conky.rc create mode 100644 archlive/extra/arch/wifi.conf create mode 100644 custom-repo/update diff --git a/archlive/airootfs/etc/motd b/archlive/airootfs/etc/motd index 649aa912..dfba12f7 100644 --- a/archlive/airootfs/etc/motd +++ b/archlive/airootfs/etc/motd @@ -5,5 +5,5 @@ Some common commands: % hw-info % mount-all-volumes % mount-backup-shares -% start-wifi +% connect-to-network diff --git a/archlive/airootfs/etc/skel/.config/Thunar/accels.scm b/archlive/airootfs/etc/skel/.config/Thunar/accels.scm index 7876f2fe..45408e2a 100644 --- a/archlive/airootfs/etc/skel/.config/Thunar/accels.scm +++ b/archlive/airootfs/etc/skel/.config/Thunar/accels.scm @@ -69,3 +69,5 @@ ; (gtk_accel_path "/ThunarWindow/view-statusbar" "") ; (gtk_accel_path "/ThunarWindow/show-hidden" "h") ; (gtk_accel_path "/ThunarWindow/view-as-detailed-list" "2") +; (gtk_accel_path "/ThunarActions/uca-action-1497008558378216-3" "") + diff --git a/archlive/airootfs/etc/skel/.config/Thunar/uca.xml b/archlive/airootfs/etc/skel/.config/Thunar/uca.xml index 74185535..d5eafe20 100644 --- a/archlive/airootfs/etc/skel/.config/Thunar/uca.xml +++ b/archlive/airootfs/etc/skel/.config/Thunar/uca.xml @@ -10,4 +10,15 @@ + + edit-redo-symbolic + Remount Read-Write + 1497008558378216-3 + urxvt -T "Mount Tool" -e remount-rw %f + Remount Read-Write + * + + + + diff --git a/archlive/airootfs/etc/skel/.config/gtk-3.0/settings.ini b/archlive/airootfs/etc/skel/.config/gtk-3.0/settings.ini index 3a73097e..2dba9975 100644 --- a/archlive/airootfs/etc/skel/.config/gtk-3.0/settings.ini +++ b/archlive/airootfs/etc/skel/.config/gtk-3.0/settings.ini @@ -1,5 +1,5 @@ [Settings] gtk-theme-name=Arc -gtk-icon-theme-name=Numic Circle +gtk-icon-theme-name=Numic Square gtk-font-name=Noto Sans 10 diff --git a/archlive/airootfs/etc/skel/.config/midori/config b/archlive/airootfs/etc/skel/.config/midori/config deleted file mode 100644 index 30a10bcf..00000000 --- a/archlive/airootfs/etc/skel/.config/midori/config +++ /dev/null @@ -1,21 +0,0 @@ -[settings] -default-encoding=ISO-8859-1 -default-font-family=Noto Sans -monospace-font-family=Noto Mono -enable-developer-extras=true -enable-site-specific-quirks=true -enable-javascript=true -default-charset=ISO-8859-1 -last-panel-position=249 -last-panel-page=3 -last-window-state=MIDORI_WINDOW_MAXIMIZED -location-entry-search=https://duckduckgo.com/?q=%s -toolbar-items=TabNew,Back,NextForward,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu -homepage=https://www.google.com/ -tabhome=about:dial -download-folder=/home/wktech -load-on-startup=MIDORI_STARTUP_HOMEPAGE -user-agent=Mozilla/5.0 (X11; Linux) AppleWebKit/538.15 (KHTML, like Gecko) Chrome/18.0.1025.133 Safari/538.15 Midori/0.5 - -[extensions] -libadblock.so=true 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 f293434e..e63b0f5f 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 @@ -38,7 +38,7 @@ - + diff --git a/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml index 2284a963..81ab1f1c 100644 --- a/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml +++ b/archlive/airootfs/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -3,7 +3,7 @@ - + diff --git a/archlive/airootfs/etc/systemd/network/wired.network b/archlive/airootfs/etc/systemd/network/wired.network deleted file mode 100644 index 8a23b1c5..00000000 --- a/archlive/airootfs/etc/systemd/network/wired.network +++ /dev/null @@ -1,8 +0,0 @@ -[Match] -Name=en* - -[Network] -DHCP=yes - -[DHCP] -RouteMetric=10 diff --git a/archlive/airootfs/etc/systemd/network/wireless.network b/archlive/airootfs/etc/systemd/network/wireless.network deleted file mode 100644 index 94a986b0..00000000 --- a/archlive/airootfs/etc/systemd/network/wireless.network +++ /dev/null @@ -1,8 +0,0 @@ -[Match] -Name=wl* - -[Network] -DHCP=yes - -[DHCP] -RouteMetric=20 diff --git a/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service b/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service new file mode 100644 index 00000000..e874a9b3 --- /dev/null +++ b/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/NetworkManager.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service b/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service new file mode 100644 index 00000000..a7e5cd4e --- /dev/null +++ b/archlive/airootfs/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/NetworkManager-dispatcher.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount b/archlive/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount deleted file mode 100644 index 4eab5513..00000000 --- a/archlive/airootfs/etc/systemd/system/etc-pacman.d-gnupg.mount +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Temporary /etc/pacman.d/gnupg directory - -[Mount] -What=tmpfs -Where=/etc/pacman.d/gnupg -Type=tmpfs -Options=mode=0755 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 new file mode 100644 index 00000000..e874a9b3 --- /dev/null +++ b/archlive/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/NetworkManager.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service b/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service deleted file mode 100644 index 4c158e62..00000000 --- a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-networkd.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/systemd-networkd.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-resolved.service b/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-resolved.service deleted file mode 100644 index 4f6ae342..00000000 --- a/archlive/airootfs/etc/systemd/system/multi-user.target.wants/systemd-resolved.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/systemd-resolved.service \ No newline at end of file diff --git a/archlive/airootfs/etc/systemd/system/pacman-init.service b/archlive/airootfs/etc/systemd/system/pacman-init.service deleted file mode 100644 index 23b81445..00000000 --- a/archlive/airootfs/etc/systemd/system/pacman-init.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Initializes Pacman keyring -Wants=haveged.service -After=haveged.service -Requires=etc-pacman.d-gnupg.mount -After=etc-pacman.d-gnupg.mount - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/pacman-key --init -ExecStart=/usr/bin/pacman-key --populate archlinux - -[Install] -WantedBy=multi-user.target diff --git a/archlive/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket b/archlive/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket deleted file mode 100644 index 51942c8e..00000000 --- a/archlive/airootfs/etc/systemd/system/sockets.target.wants/systemd-networkd.socket +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/systemd-networkd.socket \ No newline at end of file diff --git a/archlive/airootfs/etc/udev/rules.d/99-udisks2.rules b/archlive/airootfs/etc/udev/rules.d/99-udisks2.rules new file mode 100644 index 00000000..996e4343 --- /dev/null +++ b/archlive/airootfs/etc/udev/rules.d/99-udisks2.rules @@ -0,0 +1,5 @@ +# UDISKS_FILESYSTEM_SHARED +# ==1: mount filesystem to a shared directory (/media/VolumeName) +# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName) +# See udisks(8) +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1" diff --git a/archlive/airootfs/etc/udevil/udevil.conf b/archlive/airootfs/etc/udevil/udevil.conf index be24a342..b61d2c30 100644 --- a/archlive/airootfs/etc/udevil/udevil.conf +++ b/archlive/airootfs/etc/udevil/udevil.conf @@ -101,7 +101,7 @@ allowed_groups = * # be permitted to unmount its associated loop device even though internal. # INCLUDING /MNT HERE IS NOT RECOMMENDED. ALL ALLOWED MEDIA DIRECTORIES # SHOULD BE OWNED AND WRITABLE ONLY BY ROOT. -allowed_media_dirs = /media, /media/$USER, /run/media/$USER +allowed_media_dirs = /media # allowed_devices is the first criteria for what block devices users may mount diff --git a/archlive/airootfs/root/customize_airootfs.sh b/archlive/airootfs/root/customize_airootfs.sh index 520208c7..57e8b9b9 100644 --- a/archlive/airootfs/root/customize_airootfs.sh +++ b/archlive/airootfs/root/customize_airootfs.sh @@ -36,6 +36,10 @@ echo "wktech:Abracadabra" | chpasswd echo "[customize_airootfs] INFO: Enable sudo" echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers +# Misc +echo "[customize_airootfs] INFO: Misc Settings" +sed -i -r 's/extensions.autoDisableScopes", [0-9]+/extensions.autoDisableScopes", 0/' /usr/lib/firefox/browser/defaults/preferences/vendor.js + # Set mirrorlist echo "[customize_airootfs] INFO: Setup pacman mirrorlist" ## Process: @@ -49,17 +53,17 @@ echo "[customize_airootfs] INFO: Setup pacman mirrorlist" #tr '\n' '~' < /etc/pacman.d/mirrorlist.bak | sed -r 's/([0-1]\.[0-9], United States)~#/\1~/g' | tr '~' '\n' > "$tmp_file" #rankmirrors -n 10 "$tmp_file" | egrep '^S' > /etc/pacman.d/mirrorlist #rm -v "$tmp_file" -### List ranked on 2017-02-25 ### +### List ranked on 2017-06-08 ### echo 'Server = http://mirror.htnshost.com/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist -echo 'Server = http://mirrors.abscission.net/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://mirror.lty.me/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://ca.us.mirror.archlinux-br.org/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://mirror.kaminski.io/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://mirrors.rit.edu/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://archlinux.surlyjake.com/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist -echo 'Server = http://mirrors.acm.wpi.edu/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = http://ftp.osuosl.org/pub/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist echo 'Server = http://mirrors.cat.pdx.edu/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = http://mirror.lty.me/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = https://mirror.lty.me/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = http://mirrors.xmission.com/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = https://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +echo 'Server = http://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist # journald settings (from archiso) echo "[customize_airootfs] INFO: Setup journald" diff --git a/archlive/airootfs/usr/local/bin/applefans b/archlive/airootfs/usr/local/bin/applefans new file mode 100644 index 00000000..3bf21b42 --- /dev/null +++ b/archlive/airootfs/usr/local/bin/applefans @@ -0,0 +1,37 @@ +#!/bin/bash +# +## HW diagnostics - Prime95 + +SMCPATH="/sys/devices/platform/applesmc.768" +SET_MAX="True" + +function usage { + echo "Usage: $0 auto|max" + echo " e.g. $0 max" +} + +# Set mode +case $1 in + auto) + SET_MAX="False";; + max) + SET_MAX="True";; + *) + usage + exit 1;; +esac + +if [[ -e "$SMCPATH" ]]; then + if [[ "$SET_MAX" == "True" ]]; then + # Set fans to max RPM + for fan in $SMCPATH/fan*max; do + echo '1' | sudo tee ${fan:0:-4}_manual > /dev/null + cat $fan | sudo tee ${fan:0:-4}_output > /dev/null + done + else + # Set fans to auto + for fan in $SMCPATH/fan*manual; do + echo '0' | sudo tee $fan > /dev/null + done + fi +fi diff --git a/archlive/airootfs/usr/local/bin/connect-to-network b/archlive/airootfs/usr/local/bin/connect-to-network index e335fbf5..f18aeb52 100644 --- a/archlive/airootfs/usr/local/bin/connect-to-network +++ b/archlive/airootfs/usr/local/bin/connect-to-network @@ -49,7 +49,7 @@ if ! test_connection; then ## Skip if we're already connected (i.e. the code above worked) if ! test_connection; then echo "Attempting to connect to ${WIFI_SSID}..." - sudo start-wifi + nmcli dev wifi connect "${WIFI_SSID}" password "${WIFI_PASS}" sleep 5s fi fi diff --git a/archlive/airootfs/usr/local/bin/hw-diags-inner b/archlive/airootfs/usr/local/bin/hw-diags-inner index f72d734f..a007fa68 100644 --- a/archlive/airootfs/usr/local/bin/hw-diags-inner +++ b/archlive/airootfs/usr/local/bin/hw-diags-inner @@ -97,7 +97,7 @@ function update_progress { echo "${BLUE}HW Diagnostics${CLEAR}" > "$OUT" echo "───────────────" >> "$LOG" echo "───────────────" >> "$OUT" - + if [[ "$TEST_CPU" == "True" ]]; then echo "" >> "$LOG" echo "" >> "$OUT" @@ -115,7 +115,7 @@ function update_progress { echo "${BLUE}Prime95${CLEAR} ${RED}NS${CLEAR}" >> "$OUT" fi fi - + if [[ "$TEST_SMART" == "True" ]]; then echo "" >> "$LOG" echo "" >> "$OUT" @@ -147,7 +147,7 @@ function update_progress { fi done fi - + if [[ "$TEST_BADBLOCKS" == "True" ]]; then echo "" >> "$LOG" echo "" >> "$OUT" @@ -174,13 +174,13 @@ function update_progress { fi done fi - + if [[ "$TEST_OVER" == "True" ]]; then echo "" >> "$LOG" echo "" >> "$OUT" echo "───────────────" >> "$LOG" echo "───────────────" >> "$OUT" - + if [[ "$ERRORS" == "True" ]]; then echo "HW: Error(s)" >> "$LOG" echo "${RED}HW: Error(s)${CLEAR}" >> "$OUT" @@ -189,7 +189,7 @@ function update_progress { echo "${GREEN}HW: Passed${CLEAR}" >> "$OUT" fi fi - + # Update Server if [[ "$DIAG_SERVER_AVAIL" == "True" ]]; then rsync -aqz --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r "$TMP_DIR/" $DIAG_USER@$DIAG_SERVER:"$DIAG_DEST/${DIAG_UPLOAD_NAME}/" --exclude '*.out' @@ -248,8 +248,10 @@ if [[ "$TEST_CPU" == "True" ]]; then CPU_ERRORS="False" cpu_result="Working" update_progress + apple_fans max (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) & + (sleep ${TEST_CPU_LENGTH}m && apple_fans auto >>/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 @@ -273,9 +275,9 @@ if [[ "$TEST_CPU" == "True" ]]; then CPU_ERRORS="True" cpu_result="Unknown" fi - + update_progress - + if [[ "$CPU_ERRORS" == "True" ]]; then ERRORS="True" fi @@ -292,7 +294,7 @@ if [[ "$TEST_SMART" == "True" ]]; then inxi -Dxx | grep "/dev/${tmp_device}" | sed -r "s#.*/dev/${tmp_device} (.*)# \1#" > "${tmp_device}_report.out" inxi -Dxxc 0 | grep "/dev/${tmp_device}" | sed -r "s#.*/dev/${tmp_device} (.*)# \1#" > "${tmp_device}_report.log" update_progress - + # Attempt to enable SMART reporting if sudo smartctl -s on "/dev/${tmp_device}" | grep -q 'device lacks SMART capability'; then SMART_ERRORS="True" @@ -301,14 +303,14 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ERROR: device lacks SMART capability" >> "${tmp_device}_report.log" sleep 1s fi - + # Save current SMART values sudo smartctl --all "/dev/${tmp_device}" >> "${tmp_device}-smart.log" sudo smartctl -l error "/dev/${tmp_device}" >> "${tmp_device}-smart-err.log" - + # Check specific SMART results sudo smartctl -A "/dev/${tmp_device}" | grep -E '^\s*(5|9|184|197|198)\s' >> "${tmp_device}-smart-attributes.log" - + # 5 - Reallocated Sectors if grep -qE '^\s*5\s' "${tmp_device}-smart-attributes.log"; then line="$(grep -E '^\s*5\s' "${tmp_device}-smart-attributes.log")" @@ -321,7 +323,7 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ${GREEN}Reallocated Sectors: $value${CLEAR}" >> "${tmp_device}_report.out" fi fi - + # 9 - Power-on Hours (Warn, but don't prevent badblock scan) if grep -qE '^\s*9\s' "${tmp_device}-smart-attributes.log"; then line="$(grep -E '^\s*9\s' "${tmp_device}-smart-attributes.log")" @@ -336,7 +338,7 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ${GREEN}Power-on Hours: $value${CLEAR}" >> "${tmp_device}_report.out" fi fi - + # 184 - End-to-End Errors if grep -qE '^\s*184\s' "${tmp_device}-smart-attributes.log"; then line="$(grep -E '^\s*184\s' "${tmp_device}-smart-attributes.log")" @@ -349,7 +351,7 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ${GREEN}End-to-End Errors: $value${CLEAR}" >> "${tmp_device}_report.out" fi fi - + # 197 - Current Pending Sectors if grep -qE '^\s*197\s' "${tmp_device}-smart-attributes.log"; then line="$(grep -E '^\s*197\s' "${tmp_device}-smart-attributes.log")" @@ -362,7 +364,7 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ${GREEN}Current Pending Sectors: $value${CLEAR}" >> "${tmp_device}_report.out" fi fi - + # 198 - Offline Uncorrectable if grep -qE '^\s*198\s' "${tmp_device}-smart-attributes.log"; then line="$(grep -E '^\s*198\s' "${tmp_device}-smart-attributes.log")" @@ -375,13 +377,13 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ${GREEN}Offline Uncorrectable: $value${CLEAR}" >> "${tmp_device}_report.out" fi fi - + if [[ "$SMART_ERRORS" == "False" ]] && [[ "$SKIP_SHORT_TEST" == "False" ]]; then if sudo smartctl -c "/dev/${tmp_device}" >>/dev/null 2>&1; then # Determine short-test polling time wait_time=$(sudo smartctl -c "/dev/${tmp_device}" | grep -i 'polling time' | head -1 | sed -r 's/.*\( *([0-9]+)\).*/\1/') wait_time=$(( wait_time + 5)) - + # Run short self-test echo " Running SMART short self-test ($wait_time minutes)..." sudo smartctl -t short "/dev/${tmp_device}" >/dev/null @@ -400,7 +402,7 @@ if [[ "$TEST_SMART" == "True" ]]; then echo " ERROR: Unable to run SMART self-test." >> "${tmp_device}_report.log" fi fi - + if [[ "$SMART_ERRORS" == "False" ]]; then eval "${tmp_device}_smart_result=CS" else @@ -411,7 +413,7 @@ if [[ "$TEST_SMART" == "True" ]]; then eval "${tmp_device}_smart_result=NS" fi fi - + update_progress done fi @@ -424,7 +426,7 @@ if [[ "$TEST_BADBLOCKS" == "True" ]]; then tmp_device="${d##*/}" d_smart="${tmp_device}_smart_result" eval "d_smart=\$$d_smart" - + # Check SMART results if [[ "$d_smart" == "NS" ]]; then echo -e "${RED}Skipping drive: $tmp_device${CLEAR}" @@ -433,17 +435,17 @@ if [[ "$TEST_BADBLOCKS" == "True" ]]; then eval "${tmp_device}_badblocks_result=Working" update_progress echo "Testing drive: ${tmp_device}" - + # Split and run tmux split-window -v -l 7 "hw-diags-badblocks $TMP_DIR /dev/${tmp_device}" - + # Wait until done sleep 2s while pgrep -G 0 -U 0 -f "badblocks.*${tmp_device}" >/dev/null 2>&1; do sleep 1s; done sleep 2s - + # Check log if grep -Eiq 'Pass completed.*0/0/0 errors' "${tmp_device}_badblocks.log"; then eval "${tmp_device}_badblocks_result=CS" diff --git a/archlive/airootfs/usr/local/bin/mount-all-volumes b/archlive/airootfs/usr/local/bin/mount-all-volumes index 994ecd23..b0eed90e 100644 --- a/archlive/airootfs/usr/local/bin/mount-all-volumes +++ b/archlive/airootfs/usr/local/bin/mount-all-volumes @@ -2,14 +2,6 @@ # ## Mount all volumes read-only -# Fix issue where first device is mounted under /media/wktech/ -udevil mount tmpfs >/dev/null 2>&1 -udevil umount /media/wktech/tmpfs >/dev/null 2>&1 -udevil umount /media/tmpfs >/dev/null 2>&1 -sleep 1s -sudo rmdir /media/wktech/* -p >/dev/null 2>&1 -sudo rmdir /media/* -p >/dev/null 2>&1 - # Mount all volumes echo "Mounting all volumes" regex="/dev/((h|s)d[a-z]|md)[0-9]+" @@ -27,4 +19,10 @@ for volume in $(inxi -Dopxx | grep -E "$regex" | sed -r "s#.*($regex).*#\1#" | s fi fi done + +# Open folder? +if echo "$0" | grep -iq foh; then + thunar /media +fi + echo "Done." diff --git a/archlive/airootfs/usr/local/bin/mount-all-volumes-foh b/archlive/airootfs/usr/local/bin/mount-all-volumes-foh new file mode 100644 index 00000000..8ac53b0c --- /dev/null +++ b/archlive/airootfs/usr/local/bin/mount-all-volumes-foh @@ -0,0 +1 @@ +mount-all-volumes \ No newline at end of file diff --git a/archlive/airootfs/usr/local/bin/remount-rw b/archlive/airootfs/usr/local/bin/remount-rw new file mode 100644 index 00000000..270f2287 --- /dev/null +++ b/archlive/airootfs/usr/local/bin/remount-rw @@ -0,0 +1,22 @@ +#!/bin/bash +# +## Remount volume read-write + +if ! mount | grep -q "$1"; then + echo "ERROR: Can't remount $1" + sleep 2s + exit 1 +fi + +DEVICE=$(mount | grep "$1" | cut -d' ' -f1) + +echo "Remounting: $DEVICE" +udevil umount $DEVICE +if udevil mount $DEVICE; then + echo "Done" +else + echo "Failed" +fi + +sleep 2s +exit 0 diff --git a/archlive/airootfs/usr/local/bin/start-wifi b/archlive/airootfs/usr/local/bin/start-wifi deleted file mode 100644 index e9f15dc9..00000000 --- a/archlive/airootfs/usr/local/bin/start-wifi +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -## Creates network configs for all WLAN adapters - - -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: WK_ARCH media may be damaged. Please reboot or try another UFD" -else - source "/usr/local/bin/arch.conf" || \ - die "ERROR: WK_ARCH media may be damaged. Please reboot or try another UFD" -fi - -# Init -WIFI_SSID="${WIFI_SSID}" -WIFI_PASS="${WIFI_PASS}" -metric_value=20 - -# Add WLAN cards to config -for d in /sys/class/net/wl*; do - device="$(basename $d)" - # Create networkd entry - echo "[Match]" > /etc/systemd/network/$device.network - echo "Name=$device" >> /etc/systemd/network/$device.network - echo "" >> /etc/systemd/network/$device.network - echo "[Network]" >> /etc/systemd/network/$device.network - echo "DHCP=yes" >> /etc/systemd/network/$device.network - echo "" >> /etc/systemd/network/$device.network - echo "[DHCP]" >> /etc/systemd/network/$device.network - echo "RouteMetric=$metric_value" >> /etc/systemd/network/$device.network - metric_value=$((metric_value+1)) - - # Create wpa_supplicant entry - if [[ -f "/run/archiso/bootmnt/arch/wifi.conf" ]]; then - cp -f "/run/archiso/bootmnt/arch/wifi.conf" "/etc/wpa_supplicant/wpa_supplicant-$device.conf" - elif [[ -f "/usr/local/bin/arch.conf" ]]; then - cp -f "/usr/local/bin/arch.conf" "/etc/wpa_supplicant/wpa_supplicant-$device.conf" - else - die "ERROR: WK_ARCH media may be damaged. Please reboot or try another UFD" - fi -done - -# Enable WLAN devices -systemctl restart systemd-networkd.service -for d in /sys/class/net/wl*; do - device="$(basename $d)" - systemctl start wpa_supplicant@$device.service -done - diff --git a/archlive/airootfs/usr/share/applications/Hardware Diagnostics.desktop b/archlive/airootfs/usr/share/applications/Hardware Diagnostics.desktop index f502d1a2..77e8821a 100644 --- a/archlive/airootfs/usr/share/applications/Hardware Diagnostics.desktop +++ b/archlive/airootfs/usr/share/applications/Hardware Diagnostics.desktop @@ -4,7 +4,7 @@ Type=Application Name=Hardware Diagnostics Comment=Hardware Diagnostics Exec=urxvt -title "Hardware Diagnostics" -e hw-diags -Icon=xcos +Icon=utilities-system-monitor Path= Terminal=false StartupNotify=false diff --git a/archlive/extra/arch/arch.conf b/archlive/extra/arch/arch.conf new file mode 100644 index 00000000..06d8c761 --- /dev/null +++ b/archlive/extra/arch/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_SHARE="/srv/ClientInfo" # Full path to shared folder (relative to the server's root) +DIAG_USER="wkdiag" # User used to connect to the server via SSH diff --git a/archlive/extra/arch/conky.rc b/archlive/extra/arch/conky.rc new file mode 100644 index 00000000..bd492c9b --- /dev/null +++ b/archlive/extra/arch/conky.rc @@ -0,0 +1,165 @@ +# For commands above TEXT check: +# http://conky.sourceforge.net/config_settings.html +# +# For commands available below TEXT check: +# http://conky.sourceforge.net/variables.html + +# Bunsen Labs Conky help threads +# http://crunchbang.org/forums/viewtopic.php?pid=371424#p371424 + +# beta tested by: smacz +# Enjoy! :) + +# pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc" & +### Begin Window Settings ##################### +own_window yes +own_window_type normal +own_window_transparent no +own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky +own_window_colour 000000 +own_window_class Conky +#own_window_title Bunsen Labs Default Conky +own_window_title Default Conky + +### ARGB can be used for real transparency +### 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 + +### 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 160 + +minimum_size 180 0 ### width | height +maximum_width 180 + +gap_x 20 ### left | right +gap_y 45 ### up | down + +alignment tr +####################### End Window Settings ### +### Font Settings ############################# +# Use Xft (anti-aliased font and stuff) +use_xft yes +xftfont Inconsolata:bold:size=9 +#xftfont Liberation Sans:size=9 + +# Alpha of Xft font. Must be a value at or between 1 and 0 ### +xftalpha 1 +# Force UTF8? requires XFT ### +override_utf8_locale yes + +uppercase no +######################### End Font Settings ### +### Colour Settings ########################### +draw_shades no #yes +default_shade_color 000000 + +draw_outline no # amplifies text if yes +default_outline_color 000000 + +#default_color 656667 # Waldorf original colour +#default_color 7a7a7a # Flame & Bunsen Grey +#default_color 929292 # Labs Grey +default_color C0C0C0 # Silver +color0 B0E0E6 # PowderBlue +color1 778899 # LightSlateGray +color2 D8BFD8 # Thistle +color3 9ACD32 # YellowGreen +color4 FFA07A # LightSalmon +color5 FFDEAD # NavajoWhite +color6 00BFFF # DeepSkyBlue +color7 5F9EA0 # CadetBlue +color8 BDB76B # DarkKhaki +color9 CD5C5C # IndianRed +####################### End Colour Settings ### +### Borders Section ########################### +draw_borders no +# Stippled borders? +stippled_borders 5 +# border margins +border_inner_margin 5 +border_outer_margin 0 +# border width +border_width 2 +# graph borders +draw_graph_borders yes #no +#default_graph_size 15 40 +####################### End Borders Section ### +### Miscellaneous Section ##################### +# Boolean value, if true, Conky will be forked to background when started. +background yes + +# Adds spaces around certain objects to stop them from moving other things +# around, this only helps if you are using a mono font +# Options: right, left or none +use_spacer none + +# Default and Minimum size is 256 - needs more for single commands that +# "call" a lot of text IE: bash scripts +text_buffer_size 6144 + +# Subtract (file system) buffers from used memory? +no_buffers yes + +# change GiB to G and MiB to M +short_units yes + +# Like it says, ot pads the decimals on % values +# doesn't seem to work since v1.7.1 +pad_percents 2 + +# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use +# $image lots. Set to 0 to disable the image cache. +imlib_cache_size 0 + +# Use the Xdbe extension? (eliminates flicker) +# It is highly recommended to use own window with this one +# so double buffer won't be so big. +double_buffer yes + +# Maximum size of user text buffer, i.e. layout below TEXT line in config file +# (default is 16384 bytes) +# max_user_text 16384 + +# Desired output unit of all objects displaying a temperature. Parameters are +# either "fahrenheit" or "celsius". The default unit is degree Celsius. +# temperature_unit Fahrenheit + +################# End Miscellaneous Section ### +#### ${font Monospace:bold:size=10}${alignc}${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh} +update_interval 1 + +TEXT +${color}${alignc}S Y S T E M I N F O +${hr} +Date:${alignr}${time %F} +Time:${alignr}${time %H:%M} +Uptime:${alignr}${uptime_short} + +CPU: ${if_match ${cpu cpu0}<10} ${cpu cpu0}\ +${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\ +${else}${cpu cpu0}${endif}${endif}% Used${alignr}${freq_g} GHz +${cpugraph cpu0 20,180 ${color} ${color}} +RAM: ${mem} Used${alignr}${memmax} +${memgraph 20,180 ${color} ${color}} +Disk I/O: +${diskiograph 20,180 ${color} ${color}} +Down: ${downspeed}${goto 115}Up:${alignr}${upspeed} + +${alignc}S H O R T C U T K E Y S +${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 +[Super] + t${alignr}Terminal +[Super] + v${alignr}View Temps +[Super] + w${alignr}Web Browser +[Super] + x${alignr}Logout diff --git a/archlive/extra/arch/wifi.conf b/archlive/extra/arch/wifi.conf new file mode 100644 index 00000000..0b0d5850 --- /dev/null +++ b/archlive/extra/arch/wifi.conf @@ -0,0 +1,9 @@ +ctrl_interface=/var/run/wpa_supplicant +eapol_version=1 +ap_scan=1 +fast_reauth=1 +network={ + ssid="SomeWiFi" + psk="Abracadabra" + priority=5 +} diff --git a/archlive/packages.both b/archlive/packages.both index 75016011..8c567f02 100644 --- a/archlive/packages.both +++ b/archlive/packages.both @@ -1,11 +1,11 @@ aic94xx-firmware alsa-utils antiword -arc-icon-theme-git arch-install-scripts -b43-fwcutter bash-pipes bc +bluez +bluez-utils btrfs-progs chntpw cmatrix @@ -28,8 +28,8 @@ elinks ethtool exfat-utils f2fs-tools -firefox ffmpeg +firefox fsarchiver gnome-keyring gnu-netcat @@ -57,6 +57,7 @@ linux-atm linux-firmware lm_sensors lsscsi +mbpfan-git mc mdadm mediainfo @@ -68,13 +69,17 @@ mtools mupdf ncdu ndisc6 +network-manager-applet +networkmanager nfs-utils nilfs-utils nmap noto-fonts ntfs-3g ntp -numix-circle-icon-theme-git +numix-square-icon-theme-git +nvidia +nvidia-utils openconnect openssh openvpn @@ -123,16 +128,14 @@ wpa_actiond wvdial xf86-input-libinput xf86-video-amdgpu -xf86-video-ati xf86-video-fbdev xf86-video-intel -xf86-video-nouveau xf86-video-vesa xfce4 xfce4-goodies +xfce4-notifyd xl2tpd xorg-server -xorg-server-utils xorg-xdpyinfo xorg-xev xorg-xinput diff --git a/archlive/packages.x86_64 b/archlive/packages.x86_64 index 93647f14..e69de29b 100644 --- a/archlive/packages.x86_64 +++ b/archlive/packages.x86_64 @@ -1 +0,0 @@ -broadcom-wl diff --git a/archlive/pacman.conf b/archlive/pacman.conf index feb74a44..aea88d93 100644 --- a/archlive/pacman.conf +++ b/archlive/pacman.conf @@ -71,7 +71,7 @@ LocalFileSigLevel = Optional [customrepo] SigLevel = Optional TrustAll -Server = file:///home/wkadmin/wk-arch/custom-repo/$arch +Server = file:///home/builduser/Projects/wk-arch/custom-repo/$arch #[testing] #Include = /etc/pacman.d/mirrorlist diff --git a/build-wk b/build-wk index 03ae31da..cf688fcd 100644 --- a/build-wk +++ b/build-wk @@ -1,9 +1,9 @@ #!/bin/bash - +#/srv/ArchBuilds # Set Vars -LOG_DIR="/ArchBuilds/BuildLogs" -OUT_DIR="/ArchBuilds" -TMP_DIR="/ScratchDir" +LOG_DIR="/srv/ArchBuilds/BuildLogs" +OUT_DIR="/srv/ArchBuilds/isos" +TMP_DIR="/srv/ScratchDir" DATE="$(date +%F)" DATETIME="$(date +%F_%H%M)" @@ -17,6 +17,11 @@ fi echo "Setting permissions..." chown root.root archlive -R +# Modify build.sh +if ! grep -iq 'customize_iso' archlive/build.sh; then + sed -ir 's!run_once make_iso!# customize_iso\ncp -a ${script_path}/extra/* ${work_dir}/iso/\n\nrun_once make_iso!' archlive/build.sh +fi + # Build ISO mkdir $LOG_DIR mkdir $OUT_DIR diff --git a/custom-repo/update b/custom-repo/update new file mode 100644 index 00000000..6016005b --- /dev/null +++ b/custom-repo/update @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Symlink all packages from ~/.cache/pacaur and rebuild repo database + +pushd i686 +rm *pkg.tar.xz +cp -ans $HOME/.cache/pacaur/*/*pkg.tar.xz ./ +rm *x86_64* +for p in *pkg.tar.xz; do repo-add customrepo.db.tar.gz $p; done +popd + +pushd x86_64 +rm *pkg.tar.xz +cp -ans $HOME/.cache/pacaur/*/*pkg.tar.xz ./ +rm *i686* +for p in *pkg.tar.xz; do repo-add customrepo.db.tar.gz $p; done +popd