From 8e36a24f3750b892f02c44314c91542b4d6b1139 Mon Sep 17 00:00:00 2001
From: Alan Mason <1923621+2Shirt@users.noreply.github.com>
Date: Wed, 6 Dec 2017 17:49:18 -0800
Subject: [PATCH] 2016-06: Retroactive Updates
* Added HW-Sensors alias and keyboard shortcut
* Added new packages to packages.both (from 2016.06 archiso update)
* Disabled gputests for i686 builds
* Errors would cause an incomplete line to be left in the log causing a false-positive
* HW-Diags will no longer upload results if the Ticket# starts with '0'
* Added chmod flags to the rsync upload
* Initial work to add custom-repos
* Open GUI progs without entering a password (e.g. GParted)
* The wallpaper should now be loaded from the UFD.
* Still need to move scripts or add a "settings" file
* mount-all-volumes now shows the mount-points while mounting (like running manually)
* photorec-sort 7z archive testing is currently stalling, disabled for now
---
.../etc/lightdm/lightdm-gtk-greeter.conf | 2 +-
.../polkit-1/rules.d/49-nopasswd_global.rules | 5 ++
.../xfce4-keyboard-shortcuts.xml | 5 +-
archlive/airootfs/etc/skel/.conky_start | 4 +-
archlive/airootfs/etc/skel/.conkyrc | 1 +
archlive/airootfs/etc/skel/.zsh_aliases | 6 +-
archlive/airootfs/usr/local/bin/hw-diags | 8 +--
.../airootfs/usr/local/bin/hw-diags-inner | 72 +++++++++++--------
.../airootfs/usr/local/bin/hw-diags-prime95 | 7 +-
.../airootfs/usr/local/bin/hw-diags-sensors | 5 +-
.../airootfs/usr/local/bin/mount-all-volumes | 14 +---
archlive/packages.both | 12 ++++
archlive/packages.x86_64 | 1 +
archlive/pacman.conf | 10 ++-
14 files changed, 83 insertions(+), 69 deletions(-)
create mode 100644 archlive/airootfs/etc/polkit-1/rules.d/49-nopasswd_global.rules
diff --git a/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf b/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf
index ac30a13a..9b08ec3c 100644
--- a/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf
+++ b/archlive/airootfs/etc/lightdm/lightdm-gtk-greeter.conf
@@ -45,7 +45,7 @@
# transition-duration = overrides default value
#
[greeter]
-background=/usr/share/wallpaper/wallhaven-105688.png
+background=/usr/share/wallpaper/current.png
#user-background=
theme-name=Numix
icon-theme-name=Numix-Circle-Light
diff --git a/archlive/airootfs/etc/polkit-1/rules.d/49-nopasswd_global.rules b/archlive/airootfs/etc/polkit-1/rules.d/49-nopasswd_global.rules
new file mode 100644
index 00000000..ce304018
--- /dev/null
+++ b/archlive/airootfs/etc/polkit-1/rules.d/49-nopasswd_global.rules
@@ -0,0 +1,5 @@
+polkit.addRule(function(action, subject) {
+ if (subject.isInGroup("wheel")) {
+ return polkit.Result.YES;
+ }
+});
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 cf01628b..7c785878 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
@@ -37,9 +37,8 @@
-
-
-
+
+
diff --git a/archlive/airootfs/etc/skel/.conky_start b/archlive/airootfs/etc/skel/.conky_start
index 8ebe5067..ce3fc10d 100644
--- a/archlive/airootfs/etc/skel/.conky_start
+++ b/archlive/airootfs/etc/skel/.conky_start
@@ -1,3 +1,5 @@
#!/bin/bash
-sleep 5s && conky
+sleep 2s && conky &
+sleep 5s && killall conky
+conky
diff --git a/archlive/airootfs/etc/skel/.conkyrc b/archlive/airootfs/etc/skel/.conkyrc
index 9dafc71e..3e84073e 100644
--- a/archlive/airootfs/etc/skel/.conkyrc
+++ b/archlive/airootfs/etc/skel/.conkyrc
@@ -159,5 +159,6 @@ ${hr}
[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/airootfs/etc/skel/.zsh_aliases b/archlive/airootfs/etc/skel/.zsh_aliases
index b6c91916..7450b0c2 100644
--- a/archlive/airootfs/etc/skel/.zsh_aliases
+++ b/archlive/airootfs/etc/skel/.zsh_aliases
@@ -7,13 +7,13 @@ alias 7z7='7z a -t7z -mx=7'
alias 7z9='7z a -t7z -mx=9'
alias diff='colordiff' -ur
alias du='du -sch --apparent-size'
-alias fidentify="/usr/bin/fidentify-wip$(getconf LONG_BIT)"
alias fix-perms='find -type d -exec chmod 755 "{}" \; && find -type f -exec chmod 644 "{}" \;'
alias less='less -S'
alias mkdir='mkdir -p'
alias mount='sudo mount'
alias mv='mv -nv'
-alias photorec="sudo /usr/bin/photorec-wip$(getconf LONG_BIT)"
+alias photorec="sudo photorec"
+alias photorec-sort="sudo photorec-sort"
alias q1='clear && sudo ls -1'
alias q1a='clear && sudo ls -1A'
alias q='clear && sudo ls -lh'
@@ -28,6 +28,6 @@ alias sdu='sudo du -sch --apparent-size'
alias srmdirs='find -depth -mindepth 1 -type d -exec sudo rmdir "{}" --ignore-fail-on-non-empty \;'
alias srs='sudo rsync -avhPS --stats --exclude-from="$HOME/.rsync_exclusions"'
alias srsz='sudo rsync -avhzPS --stats --exclude-from="$HOME/.rsync_exclusions"'
-alias testdisk="sudo /usr/bin/testdisk-wip$(getconf LONG_BIT)"
+alias testdisk="sudo testdisk"
alias umount='sudo umount'
alias unmount='sudo umount'
diff --git a/archlive/airootfs/usr/local/bin/hw-diags b/archlive/airootfs/usr/local/bin/hw-diags
index af422a7d..311e8f8e 100644
--- a/archlive/airootfs/usr/local/bin/hw-diags
+++ b/archlive/airootfs/usr/local/bin/hw-diags
@@ -19,7 +19,7 @@ while :; do
echo "4: SMART"
echo "5: badblocks"
echo "────────────────────"
- if [[ -n $DISPLAY ]]; then
+ if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then
echo "6: Graphics Test - FurMark"
echo "7: Graphics Test - Piano"
echo "8: Graphics Test - Volplosion"
@@ -55,17 +55,17 @@ while :; do
MODE=badblocks
break;;
6)
- if [[ -n $DISPLAY ]]; then
+ if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then
gputest /fullscreen /test=fur
fi
;;
7)
- if [[ -n $DISPLAY ]]; then
+ if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then
gputest /fullscreen /test=pixmark_piano
fi
;;
8)
- if [[ -n $DISPLAY ]]; then
+ if [[ -n $DISPLAY ]] && [[ $(getconf LONG_BIT) -eq "64" ]]; then
gputest /fullscreen /test=pixmark_volplosion
fi
;;
diff --git a/archlive/airootfs/usr/local/bin/hw-diags-inner b/archlive/airootfs/usr/local/bin/hw-diags-inner
index 1bc5bde3..3b7ba213 100644
--- a/archlive/airootfs/usr/local/bin/hw-diags-inner
+++ b/archlive/airootfs/usr/local/bin/hw-diags-inner
@@ -2,15 +2,20 @@
#
## WK HW Diagnostics - Main script
-# Get TICKET#
+# Get TICKET
+SKIP_UPLOAD=""
TICKET=""
while [[ "$TICKET" == "" ]]; do
if [[ "$1" == "foh" ]]; then
TICKET="foh-consult"
+ SKIP_UPLOAD="True"
else
echo -n "Please enter the Service Order #: "
read -r _ticket
- if echo "$_ticket" | grep -Eq '^[0-9]+\S*$'; then
+ if echo "$_ticket" | grep -Eq '^[1-9]+\S*$'; then
+ TICKET="$_ticket"
+ elif echo "$_ticket" | grep -Eq '^0'; then
+ SKIP_UPLOAD="True"
TICKET="$_ticket"
fi
fi
@@ -35,6 +40,7 @@ LOG="$TMP_DIR/hw-diags.log"
OUT="$TMP_DIR/hw-diags.out"
# Get list of drives to test (excluding any ARCH drives)
+
## Some code borrowed from stackoverflow.com/a/10020397
ARCH_DRIVES=($(ls -l /dev/disk/by-label | grep -iE 'ARCH.*[hs]d[a-z]' | sed -r 's#.*/([hs]d[a-z])[0-9]+#\1#' | sort | uniq))
DRIVES=($(inxi -Dxx -c 0 | grep -E "ID-[0-9]+" | sed -r 's#.*/dev/([hs]d[a-z]).*#\1#' | sort))
@@ -42,34 +48,38 @@ for d in "${ARCH_DRIVES[@]}"; do
DRIVES=(${DRIVES[@]//*$d*})
done
-# 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"
+# 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
-fi
-# Test connection to DIAG_SERVER
-if ip a | grep -q '192.168.1' && \
- ping -c 1 -q $DIAG_SERVER >/dev/null 2>&1; then
- DIAG_SERVER_AVAIL="True"
- ssh $DIAG_USER@$DIAG_SERVER mkdir -p "$DIAG_DEST"
+ # Test connection to DIAG_SERVER
+ if ip a | grep -q '192.168.1' && \
+ ping -c 1 -q $DIAG_SERVER >/dev/null 2>&1; then
+ DIAG_SERVER_AVAIL="True"
+ ssh $DIAG_USER@$DIAG_SERVER mkdir -p "$DIAG_DEST"
+ ssh $DIAG_USER@$DIAG_SERVER chmod 755 "$DIAG_DEST"
+ fi
fi
# Setup Env
@@ -184,7 +194,7 @@ function update_progress {
# Update Server
if [[ "$DIAG_SERVER_AVAIL" == "True" ]]; then
- rsync -aqz "$TMP_DIR/" $DIAG_USER@$DIAG_SERVER:"$DIAG_DEST/" --exclude '*.out'
+ rsync -aqz --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r "$TMP_DIR/" $DIAG_USER@$DIAG_SERVER:"$DIAG_DEST/" --exclude '*.out'
fi
}
@@ -240,7 +250,7 @@ if [[ "$TEST_CPU" == "True" ]]; then
CPU_ERRORS="False"
cpu_result="Working"
update_progress
- (sleep 10m && killall -s INT "mprime$(getconf LONG_BIT)" >>/dev/null 2>&1) &
+ (sleep 10m && killall -s INT "mprime" >>/dev/null 2>&1) &
(sleep 10m && 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
@@ -437,7 +447,7 @@ if [[ "$TEST_BADBLOCKS" == "True" ]]; then
sleep 2s
# Check log
- if grep -q '0/0/0 errors' "${tmp_device}_badblocks.log"; then
+ if grep -Eiq 'Pass completed.*0/0/0 errors' "${tmp_device}_badblocks.log"; then
eval "${tmp_device}_badblocks_result=CS"
else
eval "${tmp_device}_badblocks_result=NS"
@@ -491,13 +501,13 @@ sudo inxi -CDdGlMmNopRsc 0 | grep -Ev '(/dev/ram|No RAID devices|Display Server|
# Cleanup
mkdir "$HOME/Tickets/$TICKET" -p 2>/dev/null
-rsync -aS "$TMP_DIR/" "$HOME/Tickets/$TICKET/"
+rsync -aS --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r "$TMP_DIR/" "$HOME/Tickets/$TICKET/"
popd >/dev/null
cd "$HOME/Tickets" && tar czf "${TICKET}.tgz" "$TICKET"
# Update Server
if [[ "$DIAG_SERVER_AVAIL" == "True" ]]; then
- rsync -aqz "$TMP_DIR/" "${TICKET}.tgz" $DIAG_USER@$DIAG_SERVER:"$DIAG_DEST/" --exclude '*.out'
+ rsync -aqz --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r "$TMP_DIR/" "${TICKET}.tgz" $DIAG_USER@$DIAG_SERVER:"$DIAG_DEST/" --exclude '*.out'
fi
# End
diff --git a/archlive/airootfs/usr/local/bin/hw-diags-prime95 b/archlive/airootfs/usr/local/bin/hw-diags-prime95
index 6e29b670..4152a6a2 100644
--- a/archlive/airootfs/usr/local/bin/hw-diags-prime95
+++ b/archlive/airootfs/usr/local/bin/hw-diags-prime95
@@ -1,9 +1,6 @@
#!/bin/bash
#
-## WK HW diagnostics - Prime95
-
-# Find executable
-MPRIME="/usr/bin/mprime$(getconf LONG_BIT)"
+## HW diagnostics - Prime95
function usage {
echo "Usage: $0 log-dir"
@@ -17,4 +14,4 @@ if [ ! -d "$1" ]; then
fi
# Run Prime95
-$MPRIME -t | grep -iv --line-buffered 'stress.txt' | tee -a "$1/prime.log"
+mprime -t | grep -iv --line-buffered 'stress.txt' | tee -a "$1/prime.log"
diff --git a/archlive/airootfs/usr/local/bin/hw-diags-sensors b/archlive/airootfs/usr/local/bin/hw-diags-sensors
index 32fa7dc4..649601a8 100644
--- a/archlive/airootfs/usr/local/bin/hw-diags-sensors
+++ b/archlive/airootfs/usr/local/bin/hw-diags-sensors
@@ -9,10 +9,9 @@ function usage {
echo " e.g. $0 /tmp/tmp.7Mh5f1RhSL9001"
}
-# Bail early
+# Create directory if necessary
if [ ! -d "$LOG_DIR" ]; then
- usage
- exit 1
+ LOG_DIR="$(mktemp -d)"
fi
# Run Sensor loop
diff --git a/archlive/airootfs/usr/local/bin/mount-all-volumes b/archlive/airootfs/usr/local/bin/mount-all-volumes
index edf3094a..ec634b9a 100644
--- a/archlive/airootfs/usr/local/bin/mount-all-volumes
+++ b/archlive/airootfs/usr/local/bin/mount-all-volumes
@@ -4,17 +4,7 @@
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#"); do
- echo -n " $v: "
- if udevil mount -o ro $v >>/dev/null 2>&1; then
- echo "Mounted."
- else
- echo "Failed to mount."
- fi
+for v in $(inxi -Do | grep -E "$regex" | sed -r "s#.*($regex).*#\1#" | sort); do
+ udevil mount -o ro $v
done
-
-if [[ "$1" == "foh" && -n $DISPLAY ]]; then
- sleep 1s
- exo-open --launch FileManager "$HOME"
-fi
echo "Done."
diff --git a/archlive/packages.both b/archlive/packages.both
index b87730d9..114bdf72 100644
--- a/archlive/packages.both
+++ b/archlive/packages.both
@@ -1,6 +1,7 @@
arch-install-scripts
alsa-utils
antiword
+arc-icon-theme-git
b43-fwcutter
btrfs-progs
chntpw
@@ -34,6 +35,7 @@ gptfdisk
grub
gsmartcontrol
gtk-engine-murrine
+gtk-theme-arc-git
hdparm
hexedit
hfsprogs
@@ -42,12 +44,14 @@ inxi
ipw2100-fw
ipw2200-fw
iw
+ldns
lftp
librsvg
lightdm
lightdm-gtk-greeter
linux-atm
lm_sensors
+lsscsi
mc
mdadm
mediainfo
@@ -55,10 +59,12 @@ mesa
mesa-demos
midori-gtk2
mkvtoolnix-cli
+mprime-bin
mpv
mtools
mupdf
ncdu
+ndisc6
network-manager-applet
networkmanager
nfs-utils
@@ -67,7 +73,10 @@ nmap
noto-fonts
ntfs-3g
ntp
+numix-circle-icon-theme-git
+numix-icon-theme-git
numix-themes
+numix-themes-git
openconnect
openssh
openvpn
@@ -84,6 +93,8 @@ rfkill
rp-pppoe
rsync
rxvt-unicode
+sdparm
+sg3_utils
smartmontools
speedtest-cli
speedtouch
@@ -91,6 +102,7 @@ sudo
tcpdump
terminus-font
testdisk
+testdisk-wip
tk
tmux
truecrypt
diff --git a/archlive/packages.x86_64 b/archlive/packages.x86_64
index e69de29b..36c41284 100644
--- a/archlive/packages.x86_64
+++ b/archlive/packages.x86_64
@@ -0,0 +1 @@
+gputest
diff --git a/archlive/pacman.conf b/archlive/pacman.conf
index 45fe03dc..858b7c1b 100644
--- a/archlive/pacman.conf
+++ b/archlive/pacman.conf
@@ -69,6 +69,10 @@ LocalFileSigLevel = Optional
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
+[customrepo]
+SigLevel = Optional TrustAll
+Server = file:///root/WK-Arch/custom-repo/$arch
+
#[testing]
#Include = /etc/pacman.d/mirrorlist
@@ -84,9 +88,3 @@ Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
-# An example of a custom package repository. See the pacman manpage for
-# tips on creating your own repositories.
-#[custom]
-#SigLevel = Optional TrustAll
-#Server = file:///home/custompkgs
-