#asahi · 2022-05-21 05:04
marcanI don't know about NixOS internals but I imagine it shouldn't be too weird to automate it; there's plenty of approaches for not touching the root filesystem directly (tmpfs+overlayfs, just a tmpfs and a firmware loader looking in an alt path, etc)#asahi · 2022-05-21 05:02
marcanfun thought experiment for the future but... let's not go there right now ;)#asahi · 2022-05-21 05:01
marcanand both getting kmutiled ping-pong etc#asahi · 2022-05-21 05:01
marcanso you'd need two volumes in one stub partition showing up as two OSes#asahi · 2022-05-21 05:01
marcanlet's just say that's not a can of worms you want to open right now, and the platform is kind of designed to forbid that, by design (security)#asahi · 2022-05-21 05:01
marcanon Apple Silicon a "true" rollback would involve rolling back the stub too, but, well#asahi · 2022-05-21 05:00
marcanexactly#asahi · 2022-05-21 04:59
marcanso I don't think what we're doing is particularly strange :)#asahi · 2022-05-21 04:59
marcanbut either way there is clearly a use case for "Linux needs firmware synchronized with platform state" even if that's not usually what happens now on desktop systems#asahi · 2022-05-21 04:58
marcanit's just unfortunate we can't just redistribute those blobs and put them in linux-firmware (and have guarantees compat won't be a problem)#asahi · 2022-05-21 04:58
marcanthe firmware mechanism we have is intended as a generic thing any platform could use; there's just no good standard like that yet (other than what Android does which is their own thing)#asahi · 2022-05-21 04:55
marcanbut then you can still consider the firmware there to be part of system state#asahi · 2022-05-21 04:55
marcansure#asahi · 2022-05-21 04:55
marcanu-boot may want to keep state there down the road too#asahi · 2022-05-21 04:55
marcanI expect people to manage their stuff in there but not to literally take over the entire partition#asahi · 2022-05-21 04:54
marcanso if you plan of owning and wiping everything in the ESP partition you don't control, well, you're going to have a bad time the way our installer is currently architected#asahi · 2022-05-21 04:54
marcanlike seed credential IDs needed to transfer ownership to a new SEP user down the road#asahi · 2022-05-21 04:54
marcanthere is other useful state there too#asahi · 2022-05-21 04:53
marcansure, but the files the installer puts there are just a mirror of what's in the stub partition anyway, and intended to represent such#asahi · 2022-05-21 04:53
marcanif you need to avoid literally writing to the root filesystem, you should have a userspace firmware loader that can read the files off of the ESP directly, or use a ramdisk, or whatever#asahi · 2022-05-21 04:52
marcanyou should consider that state part of world state and always synchronize it on boot#asahi · 2022-05-21 04:52
marcanand the ESP is too#asahi · 2022-05-21 04:52
marcanconsider that the stub partition is stateful anyway#asahi · 2022-05-21 04:51
marcanthat one is system firmware too, and *must* be synchronized or everything explodes, so that's the only sane way to do that#asahi · 2022-05-21 04:51
marcanApple puts that one in memory for us but the kernel still has to load it into the coprocessor#asahi · 2022-05-21 04:50
marcanthere's also SEPOS which will be a funny special case. that one will get passed to the kernel via a memory region from m1n1.#asahi · 2022-05-21 04:48
marcanand then there's potential issues with having to reload firmware after sleep/resume#asahi · 2022-05-21 04:48
marcanit could, but it'd still have to be read off of the ESP since those firmware blobs originate in either the XNU kernel or filesystem, and therefore we have to put them somewhere in the installer either way#asahi · 2022-05-21 04:47
marcanwhen Apple doesn't do it for us#asahi · 2022-05-21 04:46
marcanso I'm guessing mixing and matching won't cause a problem, but I'd rather plan for not doing that#asahi · 2022-05-21 04:45
marcanvideo decoder is fairly small and may be entirely self contained#asahi · 2022-05-21 04:45
marcanother than video decoder those are all non-apple and it's hard to imagine how they could interact with other per-OS firmware (and system firmware should always be backwards compatible)#asahi · 2022-05-21 04:45
marcancurrently we only know of four things that go in /lib/firmware: wifi (only one done so far), bluetooth, video decoder, USB xHCI chip for some machines#asahi · 2022-05-21 04:44
marcanthat's also why the reference distro has a boot-time script to update the copy in /lib/firmware, and there's a manifest file you can check to see if anything changed since last boot#asahi · 2022-05-21 04:43
marcanthe installer puts the currently installed stub's firmware in the ESP, so it is expected that it will always match and a distro should always copy it. whether mismatches will cause a problem in the future, only Apple can say. right now given the kinds of firmware involved in that tree, they *probably* won't.#asahi · 2022-05-21 04:42
marcanwhich is why the Asahi reference distro is set up with a script that updates m1n1 stage 2 with the kernel's device trees when the kernel gets updated#asahi · 2022-05-21 04:41
marcanthe kernel will also support all prior device trees (modulo missing newer hardware of course) *once upstreamed* but we make no guarantees about kernel/devicetree compat until that happens#asahi · 2022-05-21 04:41
marcanElvishJerricco[m]: the kernel will support all prior supported versions of the OS-tied firmware, forever#asahi · 2022-05-19 08:05
marcanif it outright fails entirely you do have to clean up yourself and start over though, it deliberately doesn't keep any cache because it streams the download straight to the target partition#asahi · 2022-05-19 08:04
marcanthe downloads are chunked so it will pick up where it left off#asahi · 2022-05-19 08:04
marcanit used to have trouble with that but I improved it soon after release#asahi · 2022-05-19 08:03
marcanit does retry up to 5 times (or was it 10 now?) if the connection dies or times out#asahi · 2022-05-19 03:15
marcana fridge magnet is 5mT, so >100 times stronger than that 30 µT, for the record.#asahi · 2022-05-16 11:28
marcanSobek[m]: the problem is that's not practical since you'd have to pass around the context to literally every function call#asahi · 2022-05-14 04:29
marcanyou can run xorg headless for VNC, then it doesn't matter what your hardware is#asahi · 2022-05-11 01:58
marcanI actually want to add a debugfs interface to macsmc to be able to do this sanely at some point (macsmc will hopefully replace applesmc)#asahi · 2022-05-11 01:58
marcanthat talks to SMC directly, which will conflict with the kernel driver#asahi · 2022-05-10 05:51
marcansure, but it's obviously not going to work for apps you do not build from source which are x86 apps#asahi · 2022-05-10 03:53
marcanalso I have the M1 Ultra version#asahi · 2022-05-10 03:53
marcanmine was definitely not the fan, might've even just been the MBP speakers