docs: add homelab topology and infrastructure improvement documentation with hardening script

This commit is contained in:
2026-10-31 22:16:38 -04:00
parent 502b00922b
commit 08c6c76d89
3 changed files with 140 additions and 35 deletions

View File

@@ -58,11 +58,7 @@ if [[ "$ROOT_DEV" == /dev/* ]]; then
echo " [EXT4] $ROOT_DEV -> Errors behavior: $ERR_BEHAV"
fi
# 2. Ensure fsck.repair=yes (and usb-storage.quirks=152d:0583:u if JMicron bridge present) in active cmdline.txt files
HAS_JMICRON=0
if lsusb 2>/dev/null | grep -qi "152d:0583"; then
HAS_JMICRON=1
fi
# 2. Ensure fsck.repair=yes in active cmdline.txt files
for cmdfile in /boot/firmware/cmdline.txt /boot/cmdline.txt; do
if [ -f "$cmdfile" ] && ! grep -q "DO NOT EDIT" "$cmdfile"; then
if ! grep -q "fsck.repair=yes" "$cmdfile"; then
@@ -72,11 +68,6 @@ for cmdfile in /boot/firmware/cmdline.txt /boot/cmdline.txt; do
else
echo " [CMDLINE] Verified fsck.repair=yes already in $cmdfile"
fi
if [ "$HAS_JMICRON" -eq 1 ] && ! grep -q "usb-storage.quirks=152d:0583:u" "$cmdfile"; then
cp "$cmdfile" "${cmdfile}.bak"
sed -i 's/^/usb-storage.quirks=152d:0583:u /' "$cmdfile"
echo " [CMDLINE] Added usb-storage.quirks=152d:0583:u to $cmdfile"
fi
fi
done