Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

init: wait for DRM device + fix zram/cpufreq errors

- Wait up to 3s for /dev/dri/card0 before starting ac-native
(GPU driver may not be ready immediately after boot)
- Guard zram setup with existence check
- Guard cpufreq governor with directory check
- Suppresses "non-existent directory" errors on console

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

+22 -6
+22 -6
fedac/native/initramfs/init
··· 38 38 ilog() { echo "ac-init: $*" >> /tmp/ac-init.log 2>/dev/null; } 39 39 ilog "start" 40 40 41 - # zram swap 42 - modprobe zram 2>/dev/null 43 - echo 1G > /sys/block/zram0/disksize 2>/dev/null && mkswap /dev/zram0 >/dev/null 2>&1 && swapon /dev/zram0 2>/dev/null 41 + # zram swap (module may not be available) 42 + if modprobe zram 2>/dev/null && [ -e /sys/block/zram0/disksize ]; then 43 + echo 1G > /sys/block/zram0/disksize && mkswap /dev/zram0 >/dev/null 2>&1 && swapon /dev/zram0 2>/dev/null 44 + ilog "zram: 1G swap enabled" 45 + fi 44 46 45 47 # Loopback 46 48 ip link set lo up 2>/dev/null ··· 54 56 echo "root:x:0:" > /etc/group 55 57 echo "root:x:0:root" > /etc/passwd 56 58 57 - # Performance governor 58 - for g in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do 59 - echo performance > "$g" 2>/dev/null 59 + # Performance governor (cpufreq may not be available) 60 + if [ -d /sys/devices/system/cpu/cpu0/cpufreq ]; then 61 + for g in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do 62 + echo performance > "$g" 2>/dev/null 63 + done 64 + fi 65 + 66 + # Wait for DRM device (GPU driver may not be ready yet) 67 + WAIT=0 68 + while [ ! -e /dev/dri/card0 ] && [ $WAIT -lt 30 ]; do 69 + sleep 0.1 70 + WAIT=$((WAIT + 1)) 60 71 done 72 + if [ -e /dev/dri/card0 ]; then 73 + ilog "drm ready after ${WAIT}00ms" 74 + else 75 + ilog "WARNING: /dev/dri/card0 not found after 3s" 76 + fi 61 77 62 78 ilog "starting ac-native" 63 79