summaryrefslogtreecommitdiff
path: root/docs/NOTES.org
blob: 854e598e2c62815b3b52e26d2c828850e1f00110 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
#+TITLE: ArchSetup Development Notes
#+DATE: 2025-11-10

* 2025-12-01: Major Feature Session - Pre-flight, State Tracking, Integration Test

** Work Completed

*** Rofi Configuration Standardization
- Created self-contained rofi configuration in dotfiles/system/.config/rofi/
- Designed theme to match dunst notification colors (bg: #383c4af0, fg: #cdd1dc, border: #2d303c)
- Simplified sxhkd keybindings (removed inline flags, moved to config.rasi)
- Removed phantom PATH entry for non-existent ~/.config/rofi/scripts/

*** Nitrogen to Feh Migration
- Replaced nitrogen with feh (nitrogen removed from Arch repos)
- Updated all references: .xinitrc, monitor script, lf/lfrc, ranger/rc.conf
- Added feh to archsetup package list

*** Pre-flight Checks Implementation
- Added preflight_checks() function validating:
  - Disk space (20GB minimum)
  - Network connectivity (ping archlinux.org)
  - pacman availability
  - Arch Linux detection (/etc/arch-release)

*** State Tracking for Resume Capability
- State stored in /var/lib/archsetup/state/ as timestamped marker files
- run_step() wrapper tracks completion of 12 major installation phases
- Added CLI flags: --status (show progress), --fresh (clear state), --help

*** Integration Test Fixes
- Fixed duplicate package entries (multimarkdown, proselint were listed as both AUR and pacman)
- Diagnosed and fixed git server 504 errors (fcgiwrap overload after 2 months)
- Blocked aggressive crawler IP via UFW

** Test Results
- Test 20251201-084055: *PASSED* (60m 34s)
- 3 non-critical errors: mkinitcpio-firmware (intermittent), multimarkdown/proselint (fixed)

** Git Commits (8 total)
- 590aa02: feat(rofi): standardize rofi configuration with dunst-matched theme
- 0601d39: feat(wallpaper): replace nitrogen with feh
- 84a52a8: docs(TODO): mark completed tasks from today's session
- bcacfa0: docs(TODO): mark -debug packages task as verified complete
- 03145a1: docs(TODO): mark root check and git pull fixes as verified complete
- 75b0a17: feat(archsetup): add pre-flight checks before installation
- 50423fd: feat(archsetup): implement state tracking for resume capability
- 777e113: fix(archsetup): remove duplicate multimarkdown and proselint entries

** Context for Next Session
- mkinitcpio-firmware occasionally fails (network/AUR timing issue) - kept as-is
- All [#A] priority TODOs now complete
- Consider testing resume capability (--fresh then interrupt mid-run)

* 2025-11-21: GPG/Emacs Authentication Fix

** Problem Diagnosed
- mu4e in Emacs failing with "gpg: problem with the agent: End of file"
- Root cause: Emacs daemon started via systemd user service (emacs.service)
- systemd-started Emacs had no DISPLAY or GPG_TTY in environment
- pinentry-dmenu couldn't connect to X, causing silent failures
- gpg-agent settings were fine (400-day TTL, pinentry-dmenu, ssh-support)

** Diagnostic Commands Used
#+begin_src bash
gpgconf --list-dirs agent-socket   # Socket present at /run/user/1000/gnupg/S.gpg-agent
gpg-connect-agent 'getinfo pid' /bye  # Agent running (pid 1759, --supervised)
cat /proc/1728/environ | tr '\0' '\n' | grep -E 'GPG|TTY|DISPLAY'  # Empty - no X env
#+end_src

** Previous Fix (Did Not Work)
- Disabled emacs.service: =systemctl --user disable emacs.service=
- Issue persisted after reboot - still got "End of file" error in mu4e

** Understanding "End of File" Error
- Error comes from IPC level between gpg-agent and pinentry
- pinentry-dmenu spawns, tries to connect to X11, fails (no DISPLAY)
- pinentry crashes/exits without sending response
- gpg-agent reads EOF from the pipe and reports the error
- The error message is the literal syscall result, not a helpful description

** Actual Fix Applied
- Added =~/.local/bin/reset-auth= call to .xinitrc after DISPLAY is exported
- This restarts gpg-agent with correct DISPLAY environment
- Runs before any apps (signal-desktop, protonmail-bridge, etc.) start
- Location: .xinitrc lines 29-31

** Key Files Referenced
- ~/.gnupg/gpg-agent.conf - TTL and pinentry settings
- ~/.xinitrc - now includes reset-auth call after DISPLAY export
- ~/.local/bin/reset-auth - restarts gpg-agent with current environment

** Context for Next Session
- Verify GPG auth works correctly after next reboot
- If still failing, investigate pinentry-dmenu X11 connection

* 2025-11-18: Console Font Configuration

** Work Completed
- Improved console font readability for laptop display
- Tested multiple console fonts: solar24x32, latarcyrheb-sun32, terminus variants
- Selected ter-132n (Terminus 32px normal) as optimal for readability
- Updated /etc/vconsole.conf to FONT=ter-132n on current system
- Added terminus-font package to archsetup (archsetup:561)
- Changed console font configuration from lat0-16 to ter-132n (archsetup:965)

** Console Font History
- Original (pre-Nov 16): No FONT setting (kernel default, very small)
- Commit 26a20f3: Added FONT=lat0-16 (moderate size, 16px)
- Uncommitted change: FONT=lat4a-19 (HiDPI, too small for laptop)
- Current configuration: FONT=ter-132n (large, 32px, excellent readability)

* 2025-11-16: Session Workflows Setup

** Work Completed
- Adopted session-start workflow from claude-templates
- Executed session start routine: synced templates, checked inbox (empty), reviewed project context
- Updated session-wrap-up workflow in both archsetup and claude-templates projects
  - Changed archiving from time-based (7 days/2 weeks) to session-count-based (keep last 5 sessions)
  - Updated both docs/templates/docs/workflows/session-wrap-up.org and ~/projects/claude-templates/docs/workflows/session-wrap-up.org
- Verified all ~/.profile.d/ files are properly symlinked to ~/code/archsetup/dotfiles/system/.profile.d/

** Context for Next Session
- Outstanding TODOs from 2025-11-13 session still pending:
  - Run verification test to confirm yay-debug is no longer installed
  - Investigate 56 AUR package retry errors
  - Consider if errors need to be addressed or are acceptable failures

* 2025-11-13: Critical Bug Fixes & Test Infrastructure

** Test Results Summary
- Test 20251113-232631: *PASSED* (exit code 0) in 17m 33s
- Test 20251113-190717: Exit code 1 (ran old version without fixes) in 40m 54s
- All validations passed: user creation, dotfiles stowed, yay installed, DWM built
- 56 non-critical errors (mostly AUR package retry failures)

** Bug Fixes Implemented
*** Root Permission Check (archsetup:21-27)
- Added EUID check at script start
- Fails fast with clear error message if not run as root
- Prevents confusing errors later in execution

*** Disable Debug Packages
- Added --nodebug flag to all yay calls (archsetup:167-171)
- Added --nodebug to makepkg for yay build (archsetup:375)
- Prevents installation of unnecessary -debug packages (saves ~500MB+)
- *Note*: Still need to verify yay-debug is prevented in next test

*** Safe Git Operations
- Replaced dangerous `git pull --force` with safe rm + fresh clone
- Applied to git_install function (archsetup:154-160)
- Applied to yay installer (archsetup:366-372)
- Prevents accidental data loss in local repositories

*** Completion Marker for Tests
- Added unique marker: `=== ARCHSETUP_EXECUTION_COMPLETE ===` (archsetup:1044)
- Test script now detects completion reliably (run-test.sh:239)
- Fixed false negative test failures

*** Test Script Process Detection
- Fixed pgrep infinite loop bug (run-test.sh:216)
- Changed from `pgrep -f 'bash archsetup'` to `ps aux | grep '[b]ash archsetup'`
- Prevents test script from matching its own SSH commands

** Package Changes
*** Removed Packages
- anki: Build hangs 98+ minutes (removed from archsetup:924)
- adwaita-color-schemes: CMake build issues (removed comment from archsetup:704)

*** Added Packages
- geoclue: Geolocation service with correct systemd service (archsetup:456-458)
  - Service name: geoclue.service (not geoclue-agent@user.service)

** Test Infrastructure Added
- Comprehensive VM-based testing framework in scripts/testing/
- Network diagnostics and pre-flight checks
- Snapshot-based testing for reproducible runs
- Support for --skip-slow-packages flag for faster testing

** Git Commits
- 2e10a88: fix(archsetup): implement critical bug fixes and test improvements
- 0148a1d: fix(archsetup): prevent yay-debug package installation during yay build

** Next Session TODO
- [ ] Run verification test to confirm yay-debug is no longer installed
- [ ] Investigate 56 AUR package retry errors
- [ ] Consider if errors need to be addressed or are acceptable failures

* 2025-11-10: Successful Test Run & Package Fixes

** Test Results
- Completed successful full test run in VM
- Total runtime: 58 minutes, 4 seconds
- Errors encountered: 0
- Test results location: test-results/20251110-154908/

** Package Issues Resolved
*** anki (DISABLED - line 924)
- Problem: Hangs for 98+ minutes during cargo build, missing .gitconfig
- Solution: Temporarily disabled with comment
- TODO: Investigate and re-enable or replace

*** tageditor (DISABLED - line 933)
- Problem: Hangs indefinitely building qt5-webengine dependency
- Solution: Temporarily disabled with comment
- TODO: Investigate alternatives or fix dependency issue

*** Other packages removed/fixed:
- gtk-engine-murrine: Removed (no longer needed)
- vagrant: Moved to AUR (was in official repos, now AUR-only)
- Blue light filter: Removed entirely from installation

** Test Infrastructure Improvements
*** Git Clone Simulation
- Test now properly simulates: git clone --depth 1
- Uses git bundle to transfer repository to VM with full git metadata
- Location: scripts/testing/run-test.sh lines 158-180

*** Dotfiles Git Restore
- Confirmed working: stow --adopt followed by git restore
- Reverted conditional git restore back to unconditional (line 320-322)
- This workflow requires proper git repository structure (provided by git clone)

** Known Issues
*** Test Script Timeout Detection
- Bug: Test script doesn't properly detect when archsetup completes
- Symptom: Reports "timeout after 90 minutes" even when archsetup finishes at 58 minutes
- Impact: Test marked as failed despite successful completion
- All validations still pass (user creation, dotfiles, yay, DWM)
- TODO: Fix timeout detection logic in run-test.sh

** Remaining High Priority Tasks (see TODO.org)
- [#A] Replace nitrogen with feh for wallpaper management
- [#A] Fix or permanently disable adwaita-color-schemes

** VM Configuration
- VM Name: archsetup-base
- Clean snapshot: clean-install
- IP: 192.168.122.21 (typically)
- Location: vm-images/archsetup-base.qcow2

** Important Commands
#+begin_src bash
# Run test
./scripts/testing/run-test.sh

# Run test and keep VM up for debugging
./scripts/testing/run-test.sh --keep

# Manual snapshot management
virsh --connect qemu:///system snapshot-list archsetup-base
virsh --connect qemu:///system snapshot-revert archsetup-base clean-install

# Check VM status
virsh --connect qemu:///system list --all
#+end_src

** Git Commits Made
- 18c6bc3: fix(archsetup): disable problematic slow packages