chore(hygiene): final script cleanup and persistence fixes

- Remove remaining obsolete Arch-era scripts (branch-set, debug, upload-log, etc.)
- Add /var/lib/fprint to impermanence persistence for fingerprint survival
- Add /etc/supergfxd.conf to impermanence persistence for GPU mode survival
This commit is contained in:
Bernardo Magri
2026-04-04 19:54:01 +01:00
parent 08e2b4e248
commit 09377e37ea
8 changed files with 2 additions and 285 deletions

View File

@@ -1,17 +0,0 @@
#!/bin/bash
# Set the branch for Nomarchy's git repository.
if (($# == 0)); then
echo "Usage: nomarchy-branch-set [master|rc|dev]"
exit 1
else
branch="$1"
fi
if [[ $branch != "master" && $branch != "rc" && $branch != "dev" ]]; then
echo "Error: Invalid branch '$branch'. Must be one of: master, rc, dev"
exit 1
fi
git -C $OMARCHY_PATH switch $branch

View File

@@ -1,31 +0,0 @@
#!/bin/bash
# Set the Nomarchy channel, which dictates what git branch and package repository is used.
#
# Stable uses the master branch, which only sees updates on official releases, and
# the stable package repository, which typically lags the edge by a month to ensure
# better compatibility.
#
# Edge tracks the latest package repository, but still relies on the master branch,
# so new packages which require config changes may cause conflicts or errors.
#
# Dev tracks the active development dev branch, which may include partial or broken updates,
# as well as the latest package repository. This should only be used by Nomarchy developers
# and people with a lot of experience managing Linux systems.
if (($# == 0)); then
echo "Usage: nomarchy-channel-set [stable|rc|edge|dev]"
exit 1
else
channel="$1"
fi
case "$channel" in
"stable") nomarchy-branch-set "master" && nomarchy-refresh-pacman "stable" ;;
"rc") nomarchy-branch-set "rc" && nomarchy-refresh-pacman "rc" ;;
"edge") nomarchy-branch-set "master" && nomarchy-refresh-pacman "edge" ;;
"dev") nomarchy-branch-set "dev" && nomarchy-refresh-pacman "edge" ;;
*) echo "Unknown channel: $channel"; exit 1; ;;
esac
nomarchy-update -y

View File

@@ -1,95 +0,0 @@
#!/bin/bash
# Return exhaustive debugging information about the system to help diagnose problems.
NO_SUDO=false
PRINT_ONLY=false
while (( $# > 0 )); do
case "$1" in
--no-sudo)
NO_SUDO=true
shift
;;
--print)
PRINT_ONLY=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: nomarchy-debug [--no-sudo] [--print]"
exit 1
;;
esac
done
LOG_FILE="/tmp/nomarchy-debug.log"
if [[ $NO_SUDO = "true" ]]; then
DMESG_OUTPUT="(skipped - --no-sudo flag used)"
else
DMESG_OUTPUT="$(sudo dmesg)"
fi
cat > "$LOG_FILE" <<EOF
Date: $(date)
Hostname: $(hostname)
Nomarchy Branch: $(git -C "$OMARCHY_PATH" branch --show-current 2>/dev/null || echo "unknown")
=========================================
SYSTEM INFORMATION
=========================================
$(inxi -Farz)
=========================================
DMESG
=========================================
$DMESG_OUTPUT
=========================================
JOURNALCTL (CURRENT BOOT, WARNINGS+ERRORS)
=========================================
$(journalctl -b -p 4..1)
=========================================
INSTALLED PACKAGES
=========================================
$({ expac -S '%n %v (%r)' $(pacman -Qqe) 2>/dev/null; comm -13 <(pacman -Sql | sort) <(pacman -Qqe | sort) | xargs -r expac -Q '%n %v (AUR)'; } | sort)
EOF
if [[ $PRINT_ONLY = "true" ]]; then
cat "$LOG_FILE"
exit 0
fi
OPTIONS=("View log" "Save in current directory")
if ping -c 1 8.8.8.8 >/dev/null 2>&1; then
OPTIONS=("Upload log" "${OPTIONS[@]}")
fi
ACTION=$(gum choose "${OPTIONS[@]}")
case "$ACTION" in
"Upload log")
echo "Uploading debug log to 0x0.st..."
URL=$(curl -sF "file=@$LOG_FILE" -Fexpires=24 https://0x0.st)
if (( $? == 0 )) && [[ -n $URL ]]; then
echo "✓ Log uploaded successfully!"
echo "Share this URL:"
echo ""
echo " $URL"
echo ""
echo "This link will expire in 24 hours."
else
echo "Error: Failed to upload log file"
exit 1
fi
;;
"View log")
less "$LOG_FILE"
;;
"Save in current directory")
cp "$LOG_FILE" "./nomarchy-debug.log"
echo "✓ Log saved to $(pwd)/nomarchy-debug.log"
;;
esac

View File

@@ -1,11 +0,0 @@
#!/bin/bash
update_log="/tmp/nomarchy-update.log"
# Check for initramfs generation failure
if grep -q "Updating linux initcpios" "$update_log"; then
if ! grep -q "Initcpio image generation successful" "$update_log"; then
echo -e '\e[31mError: Initramfs generation may have failed. Review logs before restart.\e[0m'
echo
fi
fi

View File

@@ -1,126 +0,0 @@
#!/bin/bash
# Upload logs to 0x0.st
LOG_TYPE="${1:-install}"
TEMP_LOG="/tmp/upload-log.txt"
SYSTEM_INFO="/tmp/system-info.txt"
# Get system information if fastfetch is available
if command -v fastfetch >/dev/null 2>&1; then
{
echo "========================================="
echo "SYSTEM INFORMATION"
echo "========================================="
# Use fastfetch with no logo to get clean output
fastfetch --logo none --pipe 2>/dev/null || echo "Failed to get system info"
echo ""
echo "========================================="
echo "LOG CONTENT"
echo "========================================="
echo ""
} >"$SYSTEM_INFO"
else
# Fallback to basic info if fastfetch isn't available
{
echo "========================================="
echo "SYSTEM INFORMATION"
echo "========================================="
echo "Hostname: $(hostname)"
echo "Kernel: $(uname -r)"
echo "Date: $(date)"
echo ""
echo "========================================="
echo "LOG CONTENT"
echo "========================================="
echo ""
} >"$SYSTEM_INFO"
fi
case "$LOG_TYPE" in
install)
ARCHINSTALL_LOG="/var/log/archinstall/install.log"
OMARCHY_LOG="/var/log/nomarchy-install.log"
# Combine system info with logs
cat "$SYSTEM_INFO" >"$TEMP_LOG"
cat $ARCHINSTALL_LOG $OMARCHY_LOG >>"$TEMP_LOG" 2>/dev/null
if [[ ! -s $TEMP_LOG ]]; then
echo "Error: No install logs found"
exit 1
fi
echo "Uploading installation log to 0x0.st..."
;;
this-boot)
# Combine system info with boot logs
cat "$SYSTEM_INFO" >"$TEMP_LOG"
journalctl -b 0 >>"$TEMP_LOG" 2>/dev/null
if [[ ! -s $TEMP_LOG ]]; then
echo "Error: No logs found for current boot"
exit 1
fi
echo "Uploading current boot logs to 0x0.st..."
;;
last-boot)
# Combine system info with previous boot logs
cat "$SYSTEM_INFO" >"$TEMP_LOG"
journalctl -b -1 >>"$TEMP_LOG" 2>/dev/null
if [[ ! -s $TEMP_LOG ]]; then
echo "Error: No logs found for previous boot"
exit 1
fi
echo "Uploading previous boot logs to 0x0.st..."
;;
installed|system-info)
# System info plus all installed packages
cat "$SYSTEM_INFO" >"$TEMP_LOG"
{
echo ""
echo "========================================="
echo "INSTALLED PACKAGES (pacman -Q)"
echo "========================================="
pacman -Q 2>/dev/null || echo "Failed to get package list"
} >>"$TEMP_LOG"
if [[ ! -s $TEMP_LOG ]]; then
echo "Error: Failed to gather system information"
exit 1
fi
echo "Uploading system information to 0x0.st..."
;;
*)
echo "Usage: $0 [install|this-boot|last-boot|installed|system-info]"
echo " install - Upload installation logs (default)"
echo " this-boot - Upload logs from current boot"
echo " last-boot - Upload logs from previous boot"
echo " installed - Upload system info and installed packages"
exit 1
;;
esac
echo ""
URL=$(curl -sF "file=@$TEMP_LOG" -Fexpires=24 https://0x0.st)
if (( $? == 0 )) && [[ -n $URL ]]; then
echo "✓ Log uploaded successfully!"
echo "Share this URL:"
echo ""
echo " $URL"
echo ""
echo "This link will expire in 24 hours."
else
echo "Error: Failed to upload log file"
exit 1
fi

View File

@@ -1,2 +0,0 @@
#!/bin/bash
cat $OMARCHY_PATH/version

View File

@@ -1,3 +0,0 @@
#!/bin/bash
echo $(git -C "$OMARCHY_PATH" rev-parse --abbrev-ref HEAD)

View File

@@ -49,12 +49,14 @@ in
"/var/lib/systemd/coredump" "/var/lib/systemd/coredump"
"/var/lib/systemd/timesync" "/var/lib/systemd/timesync"
"/var/lib/bluetooth" "/var/lib/bluetooth"
"/var/lib/fprint"
"/etc/NetworkManager/system-connections" "/etc/NetworkManager/system-connections"
"/etc/nixos" "/etc/nixos"
"/etc/ssh" "/etc/ssh"
]; ];
files = [ files = [
"/etc/machine-id" "/etc/machine-id"
"/etc/supergfxd.conf"
]; ];
}; };
}; };