From 3636f57f0ccfe1b690321b21b4d337d6e57664ac Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Wed, 20 May 2026 15:00:04 -0400 Subject: [PATCH] Migrate: clean up legacy /etc paths from prior installs Existing users upgrading from script-installed Omarchy still have files the install scripts wrote at the OLD paths. The new package can't own those old paths (they were either renamed or replaced by drop-ins), so this migration tidies them up: - /etc/sysctl.d/99-sysctl.conf: strip the appended net.ipv4.tcp_mtu_probing line (new file is /etc/sysctl.d/99-omarchy-sysctl.conf) - /etc/modprobe.d/disable-usb-autosuspend.conf: removed (new file is /etc/modprobe.d/omarchy-usb-autosuspend.conf) - /etc/sudoers.d/{passwd-tries,asdcontrol}: removed (new files are /etc/sudoers.d/omarchy-{passwd-tries,asdcontrol}) - /etc/systemd/system/user@.service.d/faster-shutdown.conf: removed (new file is 10-faster-shutdown.conf) - /etc/systemd/logind.conf HandlePowerKey=ignore line: reset to its commented default so the logind.conf.d/ drop-in is the only source After cleanup, systemctl daemon-reload + sysctl --system to pick up the new state immediately. --- migrations/1779303581.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 migrations/1779303581.sh diff --git a/migrations/1779303581.sh b/migrations/1779303581.sh new file mode 100644 index 00000000..4ec35337 --- /dev/null +++ b/migrations/1779303581.sh @@ -0,0 +1,35 @@ +echo "Clean up the old per-script /etc files now owned by omarchy-settings package" + +# ssh-flakiness.sh used to append `net.ipv4.tcp_mtu_probing=1` to the +# conventionally-user-owned /etc/sysctl.d/99-sysctl.conf. The setting now ships +# at /etc/sysctl.d/99-omarchy-sysctl.conf via the package. Strip the line from +# the old path if it's there (leave the rest of 99-sysctl.conf alone). +if [[ -f /etc/sysctl.d/99-sysctl.conf ]] && grep -q '^net\.ipv4\.tcp_mtu_probing=1' /etc/sysctl.d/99-sysctl.conf; then + sudo sed -i '/^net\.ipv4\.tcp_mtu_probing=1$/d' /etc/sysctl.d/99-sysctl.conf +fi + +# usb-autosuspend.sh used /etc/modprobe.d/disable-usb-autosuspend.conf; package +# now owns /etc/modprobe.d/omarchy-usb-autosuspend.conf. Remove the old file. +sudo rm -f /etc/modprobe.d/disable-usb-autosuspend.conf + +# Sudoers renames: passwd-tries -> omarchy-passwd-tries; asdcontrol -> omarchy-asdcontrol. +sudo rm -f /etc/sudoers.d/passwd-tries +sudo rm -f /etc/sudoers.d/asdcontrol + +# fast-shutdown.sh used to ship user@.service.d/faster-shutdown.conf; the +# package owns user@.service.d/10-faster-shutdown.conf. Both would apply +# simultaneously, so remove the old. +sudo rm -f /etc/systemd/system/user@.service.d/faster-shutdown.conf + +# ignore-power-button.sh used to `sed` HandlePowerKey=ignore directly into +# /etc/systemd/logind.conf. The package now ships a drop-in at +# /etc/systemd/logind.conf.d/10-ignore-power-button.conf, which wins regardless, +# but reset the main file's line back to its commented default so future +# changes to the drop-in aren't shadowed. +if [[ -f /etc/systemd/logind.conf ]] && grep -q '^HandlePowerKey=ignore' /etc/systemd/logind.conf; then + sudo sed -i 's/^HandlePowerKey=ignore$/#HandlePowerKey=poweroff/' /etc/systemd/logind.conf +fi + +# Reload anything that watches these files so the changes take effect now. +sudo systemctl daemon-reload || true +sudo sysctl --system >/dev/null 2>&1 || true