Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

native: eMMC drivers, SOF audio, Chromebook ESP install, sysrq reboot

Fixes G7 Chromebook (Jasper Lake) install + audio + reboot issues
diagnosed from USB pre-launch.log:

- kernel/config-minimal: CONFIG_MMC + SDHCI_PCI/ACPI (eMMC was invisible
— no /dev/mmcblk* nodes); CONFIG_MAGIC_SYSRQ=y so echo b > sysrq-trigger
can rescue a hung reboot on kernels where busybox reboot(2) is blocked
- CONFIG_CMDLINE: drop snd_intel_dspcfg.dsp_driver=0 — forcing legacy HDA
breaks SOF on Jasper Lake; let the driver autoprobe (SOF on Chromebook,
legacy HDA on ThinkPad X13)
- ac-native.c: install loop scans p1..p16 over two passes; pass 0 is
non-destructive so Chromebook ESP at p12 is found before the p1 rescue
mkfs would clobber the stateful (ext4) partition
- initramfs/init: log mmcblk/pci/rfkill/asound state; pipe /dev/kmsg
instead of dmesg (busybox applet absent); after reboot -f, fall back
to sysrq-b then sysrq-c so the machine never silently freezes

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

+72 -10
+43 -4
fedac/native/initramfs/init
··· 133 133 ls -la /dev/dri/ >> $LOG 2>&1 134 134 ls -la /dev/fb* >> $LOG 2>&1 135 135 echo "block devs:" >> $LOG 136 - ls /dev/sd* /dev/nvme* >> $LOG 2>&1 137 - echo "=== DMESG ===" >> $LOG 138 - dmesg >> $LOG 2>&1 136 + ls /dev/sd* /dev/nvme* /dev/mmcblk* 2>/dev/null >> $LOG 137 + echo "net ifaces:" >> $LOG 138 + ls /sys/class/net/ 2>/dev/null >> $LOG 139 + echo "rfkill:" >> $LOG 140 + for rf in /sys/class/rfkill/rfkill*; do 141 + [ -d "$rf" ] || continue 142 + echo " $(basename $rf): type=$(cat $rf/type 2>/dev/null) soft=$(cat $rf/soft 2>/dev/null) hard=$(cat $rf/hard 2>/dev/null)" >> $LOG 143 + done 144 + echo "sound cards:" >> $LOG 145 + cat /proc/asound/cards 2>/dev/null >> $LOG 146 + echo "pci devices (storage/audio/net):" >> $LOG 147 + if [ -d /sys/bus/pci/devices ]; then 148 + for d in /sys/bus/pci/devices/*; do 149 + [ -d "$d" ] || continue 150 + class=$(cat $d/class 2>/dev/null) 151 + # 0x0c* = serial bus (eMMC), 0x0104* = RAID, 0x0106* = SATA, 0x0108* = NVMe 152 + # 0x0280* = network wireless, 0x0403* = audio 153 + case "$class" in 154 + 0x010*|0x028*|0x040*|0x080501|0x0805*) 155 + ven=$(cat $d/vendor 2>/dev/null) 156 + dev=$(cat $d/device 2>/dev/null) 157 + drv=$(basename $(readlink $d/driver 2>/dev/null) 2>/dev/null) 158 + echo " $(basename $d) class=$class ven=$ven dev=$dev drv=${drv:-NONE}" >> $LOG 159 + ;; 160 + esac 161 + done 162 + fi 163 + echo "=== DMESG (kernel ring) ===" >> $LOG 164 + # Capture 2s of /dev/kmsg output (busybox dmesg applet may be absent) 165 + ( cat /dev/kmsg >> $LOG 2>&1 ) & 166 + KMSG_PID=$! 167 + sleep 2 168 + kill $KMSG_PID 2>/dev/null 139 169 echo "=== CPUINFO ===" >> $LOG 140 170 head -30 /proc/cpuinfo >> $LOG 2>&1 141 171 echo "=== CMDLINE ===" >> $LOG ··· 193 223 sync 194 224 echo 0 > /proc/sys/kernel/printk 2>/dev/null 195 225 printf '\033[?25l\033[2J' > /dev/tty0 2>/dev/null 226 + # Enable all sysrq if kernel supports it (belt-and-suspenders) 227 + echo 1 > /proc/sys/kernel/sysrq 2>/dev/null 228 + # Try every reboot path in order — different kernels accept different ones 196 229 reboot -f 2>/dev/null 197 230 echo b > /proc/sysrq-trigger 2>/dev/null 198 - sleep 30 231 + # Last resort: direct reboot(2) syscall via busybox `reboot` 232 + busybox reboot -f 2>/dev/null 233 + halt -f 2>/dev/null 234 + sleep 5 235 + # If we're still here, kernel panic is preferable to a silent freeze 236 + echo c > /proc/sysrq-trigger 2>/dev/null 237 + sleep 5 199 238 break 200 239 fi 201 240
+17 -3
fedac/native/kernel/config-minimal
··· 424 424 CONFIG_LEGACY_VSYSCALL_XONLY=y 425 425 # CONFIG_LEGACY_VSYSCALL_NONE is not set 426 426 CONFIG_CMDLINE_BOOL=y 427 - CONFIG_CMDLINE="console=tty0 quiet loglevel=3 vt.global_cursor_default=0 init=/init mitigations=off snd_intel_dspcfg.dsp_driver=0 snd_hda_intel.power_save=0 nmi_watchdog=0 tsc=reliable no_timer_check acpi_backlight=native thinkpad_acpi.brightness_enable=1 i8042.reset i8042.nomux" 427 + CONFIG_CMDLINE="console=tty0 quiet loglevel=3 vt.global_cursor_default=0 init=/init mitigations=off snd_hda_intel.power_save=0 nmi_watchdog=0 tsc=reliable no_timer_check acpi_backlight=native thinkpad_acpi.brightness_enable=1 i8042.reset i8042.nomux" 428 428 # CONFIG_CMDLINE_OVERRIDE is not set 429 429 CONFIG_MODIFY_LDT_SYSCALL=y 430 430 # CONFIG_STRICT_SIGALTSTACK_SIZE is not set ··· 3336 3336 CONFIG_UCSI_ACPI=y 3337 3337 CONFIG_USB_ROLE_SWITCH=y 3338 3338 CONFIG_USB_ROLES_INTEL_XHCI=y 3339 - # CONFIG_MMC is not set 3339 + CONFIG_MMC=y 3340 + CONFIG_PWRSEQ_EMMC=y 3341 + CONFIG_PWRSEQ_SIMPLE=y 3342 + CONFIG_MMC_BLOCK=y 3343 + CONFIG_MMC_BLOCK_MINORS=32 3344 + CONFIG_MMC_SDHCI=y 3345 + CONFIG_MMC_SDHCI_IO_ACCESSORS=y 3346 + CONFIG_MMC_SDHCI_PCI=y 3347 + CONFIG_MMC_RICOH_MMC=y 3348 + CONFIG_MMC_SDHCI_ACPI=y 3349 + CONFIG_MMC_SDHCI_PLTFM=y 3350 + CONFIG_MMC_CQHCI=y 3340 3351 # CONFIG_SCSI_UFSHCD is not set 3341 3352 # CONFIG_MEMSTICK is not set 3342 3353 CONFIG_NEW_LEDS=y ··· 4355 4366 # 4356 4367 # Generic Kernel Debugging Instruments 4357 4368 # 4358 - # CONFIG_MAGIC_SYSRQ is not set 4369 + CONFIG_MAGIC_SYSRQ=y 4370 + CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1ff 4371 + CONFIG_MAGIC_SYSRQ_SERIAL=y 4372 + CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" 4359 4373 # CONFIG_DEBUG_FS is not set 4360 4374 CONFIG_HAVE_ARCH_KGDB=y 4361 4375 # CONFIG_KGDB is not set
+12 -3
fedac/native/src/ac-native.c
··· 1176 1176 if (rem == 1) continue; // removable = USB 1177 1177 } 1178 1178 1179 - // Try partitions 1-8 1180 - for (int p = 1; p <= 8 && !installed; p++) { 1179 + // Two-pass partition scan. Pass 0: probe p1..p16 for an existing 1180 + // vfat partition (non-destructive) — finds the Chromebook ESP at 1181 + // p12 before we would otherwise reformat p1 (stateful/ext4) on 1182 + // Chromebooks and clobber user data. Pass 1: fall back to the 1183 + // p=1 rescue reformat for stock Linux layouts where no ESP exists. 1184 + for (int pass = 0; pass < 2 && !installed; pass++) { 1185 + int allow_rescue_mkfs = (pass == 1); 1186 + for (int p = 1; p <= 16 && !installed; p++) { 1181 1187 char devpath[32]; 1182 1188 // NVMe + eMMC use "p<N>" suffix (name ends in a digit); SATA 1183 1189 // just appends the number to the base name. ··· 1197 1203 // sfdisk created it but mkfs never succeeded), try to format 1198 1204 // it now. Only attempt this on the first partition (which is 1199 1205 // the ESP slot) and only if the partition is large enough. 1200 - if (p == 1) { 1206 + // Gated to pass==1 so we never clobber Chromebook p1 STATE 1207 + // when an existing vfat ESP is available elsewhere (e.g. p12). 1208 + if (p == 1 && allow_rescue_mkfs) { 1201 1209 long long part_bytes = 0; 1202 1210 int pfd = open(devpath, O_RDONLY | O_CLOEXEC); 1203 1211 if (pfd >= 0) { ··· 1732 1740 } 1733 1741 1734 1742 umount("/tmp/hd"); 1743 + } 1735 1744 } 1736 1745 } 1737 1746