#asahi · 2022-12-04 05:31
nicolas17found it#asahi · 2022-12-04 05:25
marcanthat sounds like something userspace, yeah#asahi · 2022-12-04 05:24
nicolas17but could be coincidence (10 minutes delay seems odd!)#asahi · 2022-12-04 05:24
nicolas17"systemd-logind[456]: The system will power off now!"#asahi · 2022-12-04 05:24
nicolas17about 10 minutes later:#asahi · 2022-12-04 05:24
nicolas17"kernel: macsmc-rtkit 23e400000.smc: RTKit: syslog message: extPwr.cpp:414: okBootiBoot=1 okBootAP_OS=0 ACSt=0x03 sel=0 AcPwr=0 fullPwr=0 battCap=149"#asahi · 2022-12-04 05:21
nicolas17Plasma powerdevil settings are "critical level: 5%; at critical level: do nothing" so I think that was *not* it#asahi · 2022-12-04 05:20
nicolas17but I can't figure out what triggered the shutdown#asahi · 2022-12-04 05:19
nicolas17hm looking at logs I think my system *did* shut down cleanly#asahi · 2022-12-04 05:19
marcanit would be nice if there's some flag we can enable to actually get an event delivered on battery critical#asahi · 2022-12-04 05:18
marcanwould be nice to know how a lot of this works (and looking at firmware is fairly safe from a cleanroom perspective, since you're just looking at the "other side" of what you have to implement)#asahi · 2022-12-04 05:18
marcanI did look at some iOS SMC firmwares before, but they're missing a lot of stuff that's in the macs#asahi · 2022-12-04 05:18
marcanI should throw SMC into ghidra, now that the t8103 iboot encryption keys leaked for some firmwares#asahi · 2022-12-04 05:17
marcaninstead of waiting for it to kill power itself#asahi · 2022-12-04 05:17
marcanSMC gives us three warnings, we do a software initiated hard shutdown on the third (which flushes NVMe)#asahi · 2022-12-04 05:17
marcanwe already have panic shutdown when you hold the power button, FWIW#asahi · 2022-12-04 05:16
marcan(on desktops I'm not sure there's much we can do, but there's a kernel arg for those who want to disable the defers at the cost of significant flush performance)#asahi · 2022-12-04 05:15
marcanbut on laptops it should be possible to close it entirely#asahi · 2022-12-04 05:15
marcanI find that unacceptable, right now our window is much smaller than macOS though we still have it on desktops#asahi · 2022-12-04 05:14
marcane.g. if you rsync data over then delete the source, pull the plug, data is gone from both sides#asahi · 2022-12-04 05:14
marcanFWIW macOS has this problem, at least on desktops if you pull the plug#asahi · 2022-12-04 05:14
marcanyeah, I know#asahi · 2022-12-04 05:14
tpw_rulesthat's what will really screw your fs#asahi · 2022-12-04 05:14
marcanI don't think it violates ordering guarantees, but I'm not sure anyone really stress-tested that#asahi · 2022-12-04 05:14
tpw_rulesi forget, does it actually violate ordering guarantees?#asahi · 2022-12-04 05:13
marcan(up to one second, but still)#asahi · 2022-12-04 05:13
tpw_rulesahh#asahi · 2022-12-04 05:13
marcanwithout this we still have that corner case where if your laptop runs out of battery you lose ostensibly committed data#asahi · 2022-12-04 05:13
marcanin that case it makes sense for the kernel to flush NVMe, yes, because that completes the safety scorecard for the NVMe deferred flush story#asahi · 2022-12-04 05:12
tpw_rulesjust to make sure the nvme is flushed properly?#asahi · 2022-12-04 05:12
marcanthe property goes high like 10 seconds before hard shutdown or something#asahi · 2022-12-04 05:12
marcanthis is about last-gasp panic shutdown#asahi · 2022-12-04 05:12
tpw_ruleswhy not leave it up to userspace?#asahi · 2022-12-04 05:12
marcanbut obviously that in and of itself wastes some power, so I'm not sure if it's a good idea (and it's not implemented yet anyway)#asahi · 2022-12-04 05:12
marcanso my idea was to just have the battery driver poll that every couple of seconds or something when the battery % is < 3% or something like that, and do a panic shutdown when it sees it#asahi · 2022-12-04 05:11
marcanwhat I did find is an SMC property that flips on#asahi · 2022-12-04 05:11
marcanI looked into the kernel side (at least flushing NVMe) but I didn't find an SMC event for it#asahi · 2022-12-04 05:10
marcanthat's up to userspace#asahi · 2022-12-04 04:12
nicolas17hm does asahi shut down cleanly if it runs low on battery?#asahi · 2022-12-03 21:45
bcrumbhere, i finished the pull, so no need to look at the old shabby repo#asahi · 2022-12-03 21:45
bcrumbhttps://github.com/AsahiLinux/asahi-scripts/pull/21#asahi · 2022-12-03 21:32
j`eyoh, that too!#asahi · 2022-12-03 21:31
nicolas17since the main user-data partition will be encrypted with SEP and that's *also* not supported#asahi · 2022-12-03 21:31
nicolas17even if Linux had APFS support#asahi · 2022-12-03 21:31
nicolas17j`ey: well you'd also need to make a partition dedicated for such sharing, right?#asahi · 2022-12-03 20:58
Core3294awesome. thanks again!#asahi · 2022-12-03 20:55
j`eyyep#asahi · 2022-12-03 20:50
Core3294well, do thumbdrives on the m1 laptops work?#asahi · 2022-12-03 20:45
Core3294ah. yep, im used to mounting other linux filesystems through that method, never tried with apple before. i think Ill just use a thumbdrive for now at least so i dont have to do any more partitioning. thanks!!#asahi · 2022-12-03 20:43
j`eyCore3294: there are some 3rd party things you can use, but depending on what you need, a FAT partition for sharing would be easier