Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: voice off by default, poweroff from first run, udhcpc path search

- Keystroke TTS disabled by default (voice_off=1)
- Init script handles exit code 0/2 from first run (not just crash loop)
- udhcpc searches /sbin, /bin, /usr/bin + passes default.script path
- Better DHCP log messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+29 -7
+14 -1
fedac/native/initramfs/init
··· 104 104 # Run once, capture crash 105 105 echo "[ac-init] === LAUNCHING ===" 106 106 /ac-native /piece.mjs > /mnt/pre-launch-out.log 2>&1 107 - echo "[ac-init] EXIT=$?" 107 + FIRST_EXIT=$? 108 + echo "[ac-init] EXIT=$FIRST_EXIT" 108 109 sync 110 + 111 + # Handle clean exit from first run 112 + if [ "$FIRST_EXIT" = "0" ]; then 113 + echo "[ac-init] Clean exit (first run) — powering off..." 114 + echo o > /proc/sysrq-trigger 2>/dev/null 115 + sleep 2; poweroff -f 2>/dev/null; sleep 30; exit 0 116 + fi 117 + if [ "$FIRST_EXIT" = "2" ]; then 118 + echo "[ac-init] Reboot (first run)..." 119 + echo b > /proc/sysrq-trigger 2>/dev/null 120 + sleep 2; reboot -f 2>/dev/null; sleep 30; exit 0 121 + fi 109 122 sleep 5 110 123 111 124 CRASH_COUNT=0
+1 -1
fedac/native/src/ac-native.c
··· 41 41 static volatile int running = 1; 42 42 static FILE *logfile = NULL; 43 43 int ac_log_stderr_muted = 0; // When set, ac_log skips stderr (PTY active) 44 - int voice_off = 0; // When set, keystroke TTS is disabled 44 + int voice_off = 1; // Keystroke TTS disabled by default (enable with voice:on in config) 45 45 static int is_removable(const char *blkname); 46 46 static void get_parent_block(const char *part, char *out, int out_sz); 47 47
+14 -5
fedac/native/src/wifi.c
··· 336 336 int fd = open("/tmp/dhcp.log", O_WRONLY|O_CREAT|O_TRUNC, 0644); 337 337 if (fd >= 0) { dup2(fd, 2); dup2(fd, 1); close(fd); } 338 338 // Prefer udhcpc (busybox) — fast, no script needed 339 - if (file_exists("/sbin/udhcpc")) 340 - execl("/sbin/udhcpc", "udhcpc", "-i", wifi->iface, 339 + const char *udhcpc = NULL; 340 + if (file_exists("/sbin/udhcpc")) udhcpc = "/sbin/udhcpc"; 341 + else if (file_exists("/bin/udhcpc")) udhcpc = "/bin/udhcpc"; 342 + else if (file_exists("/usr/bin/udhcpc")) udhcpc = "/usr/bin/udhcpc"; 343 + if (udhcpc) { 344 + fprintf(stderr, "[wifi] using udhcpc: %s\n", udhcpc); 345 + execl(udhcpc, "udhcpc", "-i", wifi->iface, 341 346 "-n", // exit if no lease (don't background) 342 347 "-q", // quit after obtaining lease 348 + "-s", "/usr/share/udhcpc/default.script", 343 349 "-t", "5", // 5 retries 344 350 "-T", "3", // 3 second timeout 345 351 NULL); 352 + // execl failed 353 + fprintf(stderr, "[wifi] udhcpc execl failed: %s\n", strerror(errno)); 354 + } 346 355 // Fallback to dhclient 347 356 const char *dhc_paths[] = { 348 357 "/sbin/dhclient", "/usr/sbin/dhclient", NULL ··· 402 411 pclose(ifp); 403 412 } 404 413 405 - // Check if dhclient died 414 + // Check if DHCP client died 406 415 if (wifi->dhcp_pid > 0) { 407 416 int status; 408 417 pid_t r = waitpid(wifi->dhcp_pid, &status, WNOHANG); 409 418 if (r > 0) { 410 419 if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { 411 - wifi_log(wifi, "dhclient exit %d", WEXITSTATUS(status)); 412 - FILE *dlog = fopen("/tmp/dhclient.log", "r"); 420 + wifi_log(wifi, "DHCP exit %d", WEXITSTATUS(status)); 421 + FILE *dlog = fopen("/tmp/dhcp.log", "r"); 413 422 if (dlog) { 414 423 char dline[256]; 415 424 while (fgets(dline, sizeof(dline), dlog))