<mixi>
mps: I created my own esp + kernel partition with and efi bootloader and qemu efi support as a qcow2-file on macos, and passed that and the root partition as separate hard drives to qemu; but I think it would have been a lot easier to just pass the root partition and have qemu load the kernel and maybe initramfs you want to boot directly
<mixi>
the qemu efi support was of course not part of the qcow2-file, I just rewrote that sentence wrongly when trying to add extra information to it
andreas has joined #asahi
<mixi>
the qemu efi support was referring to also passing -bios QEMU_EFI.fd with an appropriate QEMU_EFI.fd stolen from some distribution package
<mps>
mixi: aha, ok. I thought about same. just wanted to know which option you used. thank you
andreas has quit []
<mps>
yes, I sued QEMU_EFI.fd earlier when run daily linux in qemu on m1
<mps>
and I can confirm that passing partition to qemu works on macos
bisko has joined #asahi
bisko has quit []
bisko has joined #asahi
andreas has joined #asahi
andreas has quit []
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi
andreas has joined #asahi
andreas has quit []
Ry_Darcy has joined #asahi
Ry_Darcy has quit [Remote host closed the connection]
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Gaspare has joined #asahi
zzywysm has joined #asahi
zanfix has quit [Quit: Konversation terminated!]
MajorBiscuit has quit [Ping timeout: 480 seconds]
Gaspare has quit [Quit: Gaspare]
zzywysm has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<janrinze>
hi all.. anyone here who has been compiling their own kernels for the mac mini? (probably yes..) I have some issues getting newer kernels to boot properly. it seems they can't find the root disk. UUID is set but the kernel does not see that partition..
Gaspare has joined #asahi
<AdryzzOLEDEdition[m]1>
newer kernels?
<mps>
janrinze: kernel doesn't recognize UUID
<AdryzzOLEDEdition[m]1>
you mean latest linux-asahi?
<mps>
you have to use PARTUUID
<janrinze>
mps: PARTUUID, sorry but what i mean is that the kernel I built a while back works with the same cmdline..
<janrinze>
that's the one that my 'old' current kernel gets from grub.
<janrinze>
mps: if i bake in the modules required the initramfs shouldn't matter much, right?
<mps>
to use UUID for root initramfs must contain proper tools
<janrinze>
unless the DTBs are not found.. that might cause problems.
<mps>
janrinze: DTB is loaded by m1n1
<janrinze>
mps: I boot kernels on many different machines here without initramfs.. so probably not a requirement.
<mps>
janrinze: then use PARTUUID instead of UUID
<mps>
I do that
<janrinze>
DTB in m1n1 is for u-boot, i thought.. will the kernel not use its own DTBs?
<janrinze>
mps: the kernel boots.. but the newer kernel that i compiled just now doesn't..
<mps>
janrinze: DTB is general, whoever loads it it is ok
<janrinze>
mps: DTB in m1n1 does not get updated after a kernel build.. right?
<ElvishJerricco[m]>
janrinze: You're not using any initramfs at all?
<mps>
janrinze: 5.18 kernels have DTB in default m1n1
<janrinze>
ElvishJerricco[m]: generally not.. If the kernel can start and has sufficient modules to mout root fs then all should just work..
<janrinze>
oops .. mount
<ElvishJerricco[m]>
The kernel will use whatever DTB is provided by the previous stage. It doesn't load its own, I'm pretty sure. But u-boot can be configured to load a DTB from disk and provide that to the kernel. Dunno if the asahi installer sets it up that way or if it just passes the one it gets from m1n1 onward
<janrinze>
Okay, I can add the DTBs in the kernel. I'm used to different ARM platforms.
<mps>
ElvishJerricco[m]: DTB must be chained to m1n1, even u-boot doesn't load it
<ElvishJerricco[m]>
Ah so m1n1 does some essential fixups?
<ElvishJerricco[m]>
on the FDT that is?
<mps>
ElvishJerricco[m]: yes
<janrinze>
let me reboot for a second and see if the nwely built kernel can find the root partition now.
<ElvishJerricco[m]>
good to know; means I can't have per-kernel DTBs with NixOS :(
<mps>
ElvishJerricco[m]: for now yes, but maybe in future
<mps>
janrinze: 'BOOT_IMAGE=/boot/vmlinuz-5.18.0-rc5-2-asahi root=PARTUUID=b0a3.........' is my line in grub.cfg
<mps>
I do not use initramfs
<ElvishJerricco[m]>
shouldn't be a big deal as long as the asahi kernel remains backward compatible with older DTBs; though I understand that's only assured for patches that make it to mainline
<janrinze>
ElvishJerricco[m]: during kernel config you should be able to set the flag to add the DTBs to the kernel image..
<janrinze>
brb.
<ElvishJerricco[m]>
oh really? TIL. That could be useful on some other platforms.
janrinze has quit [Quit: Leaving.]
<mps>
ElvishJerricco[m]: you can add newer DTBs to second stage m1n1+u-boot easily
janrinze has joined #asahi
<ElvishJerricco[m]>
yea I know
<janrinze>
back.. now on Linux M1DebianSid 5.18.0-asahi-jrp-git-new-dirty #3 SMP Thu Jul 7 18:44:44 CEST 2022 aarch64 GNU/Linux
<janrinze>
at least rebooting is faaaast
<janrinze>
Why i wanted to get a newer kerenl working is because i did some benchmark test (Geekbench 5) and it showed that it only runs at a little over 56% of the speed of OSX.
<janrinze>
the mac mini on OSX does almost 1.65x this score for single score and around 1.42x on multi core score.. So i was thinking that since i have an older kernel it might not run at the full 3.2 GHz. Unfortunately no nodes in /sys that give me a clue on cpu scaling and such.
<nicolas17>
I assume "running at the full 3.2GHz" and "exposing scaling info in /sys" needs the same kind of work :P
<janrinze>
no info at /sys/devices/system/cpu/cpu4/cpufreq
<janrinze>
nicolas17: at some point the cpu frequency gets set.. either at m1n1, u-boot or kernel..
<janrinze>
mps: cleary my kernel is not using its own DTBs but the ones provided somewhere else indeed. So I probably need to bake them in the kernel..
<mps>
janrinze: what kernel config option enables putting DTBs in kernel
zzywysm has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thevar1able has joined #asahi
thevar1able has quit [Remote host closed the connection]
thevar1able has joined #asahi
thevar1able1 has joined #asahi
thevar1a- has joined #asahi
<janrinze>
mps: looks like it's not supported anymore in the kernel.. apparently maintainers were afraid that people would actually use it..
zzywysm has joined #asahi
thevar1a- has quit []
thevar1able has quit []
thevar1able1 has quit []
thevar1able has joined #asahi
<steev>
you could always use a fit image
<janrinze>
mps: this means when the DTBs are updated we need to update UEFI/m1n1 too.
<mps>
steev: yes, I use fit on some chromebooks
<mps>
janrinze: right
<steev>
if you're doing u-boot->grub, grub also has a "devicetree" option that isn't really exposed, but you can add it in
<janrinze>
would be nice to have a way of integrating the m1n1 build with the linux kernel build. but it probably will make it harder if the kernel fails to boot and we need to fall back on an older kernel..
<mps>
steev: yes, I saw 'devicetree' in grub docs but this doesn't work on current grub
<steev>
it should, i've been using it for a few years now, unless current grub is.... not > 2
<mps>
janrinze: asahi build scripts already have this I think
<steev>
mps: if you don't mind patching your grub, you can always pull in the ubuntu patches that add it automagically
<mps>
steev: I'm not sure but this must be in some patches. At least it doesn't work with grub in alpine linux and I didn't investigated further
<steev>
debian doesn't patch it in, so i'd say its an issue with alpine
<mps>
steev: I guess so. I tried on riscv board to use grub with devicetree but didn't worked and I used plain u-boot with extelinux.conf which could load DTB fine
<steev>
i've been using it on my lenovo yoga c630 (non-chromebook) which has uefi, and it makes flipping between kernels very easy when there had been significant dt changes while working on getting its support in the kernel
<steev>
yeah, extlinux works fine too
<mps>
I even used extlinux.conf for long on M1 but switched to grub a month or two ago
<janrinze>
On the Nvidia AGX the DTBs are at /boot and it uses extlinux.conf as well
<janrinze>
steev: so where do i add the device tree in grub?
<steev>
you can also add (above it) "echo 'loading dtb file ...'" like the other entries do to show it's loading it
<tpw_rules>
FTR you can't use that on m1n1
<steev>
the kernel can't override the dtb passed in from m1n1?
<tpw_rules>
no, m1n1 has to do various massaging. if you try the kernel won't boot
<steev>
well that would explain why it isn't working :D
quarkyalice has joined #asahi
<tpw_rules>
i did write a patch a while ago for u-boot to do this massaging based on m1n1's data but the asahi folks were pretty against it. i agree with them in an ideal world but it would really be a nice capability while things are still in flux
<janrinze>
echo'Loading Linux 5.18.0-asahi-jrp-git-new-dirty ...'
<tpw_rules>
even if you do not care about nixos, that post is very relevant and it sounds like you would like it
<steev>
tpw_rules: i'm the kali arm guy, so it's very interesting to me what other distros are doing as well
<tpw_rules>
get on the tow-boot train
<tpw_rules>
:D
<steev>
once it supports more boards....
<steev>
it supports... 19 boards? i have to support 50+
<tpw_rules>
do you have a large pile of them? it's 99% (mainline) u-boot. the nix stuff is quite gnarly if you are unfamiliar but support is almost entirely about just testing it
<steev>
i have over 200 here :D i've been working with arm devices since the early 2000s and have amassed a bit of a collection
<tpw_rules>
do you guys commonly use vendor u-boots?
<steev>
on some devices i do, on some i don't
<janrinze>
brb, will reboot now. (wish me luck ;-) )
___nick___ has joined #asahi
<steev>
i try to move off the vendor stuff as soon as is feasible
janrinze has quit [Remote host closed the connection]
___nick___ has quit []
janrinze has joined #asahi
___nick___ has joined #asahi
<janrinze>
okay.. that was interesting.. grub says the path is not a regular file.. yes.. duh..
<steev>
ah, if grub is on a separate partition, you'd need to either hardcode the (hdX,gptX) to the beginning of the path, or cp the dtb to the partition that has grub on it
<tpw_rules>
i know bandwidth to contribute is an eternally limited resource but if you have lots of boards which are supported in mainline u-boot and like tow-boot's mission statement it would be great to help out
<janrinze>
steev: i'll copy the dtbs to the /boot partition.. brb after reboot.
<tpw_rules>
would kali be interested in board-agnostic images anyway? that's a pretty application specific distribution right
<steev>
tpw_rules: it would definitely be nice to have board agnostic images to increase maintainer sanity ;) the bigger problem is that every board is a special snowflake and you can't write the bootloader to the same spot and have it work across all of them
janrinze has quit [Quit: Leaving.]
<tpw_rules>
that's what tow-boot aims to solve. make each distro's installation be: 1. follow tow-boot's instructions for your board 2. download our iso and run the installer
<tpw_rules>
i just wasn't sure if kali included lots of board-specific packages and setup or so
pb17[m] has joined #asahi
janrinze has joined #asahi
<janrinze>
ok.. copied the dtbs but grub still says not a regular file.. which i do agree with because it's a directory..
<j`ey>
janrinze: as they said, dont try to use grub for that
<j`ey>
janrinze: its not supported to use anything but the DTS that is passed through 1m1n to uboot to the kernel
<j`ey>
lol 1m1n, I mean m1n1
<janrinze>
j`ey: but u-boot starts grub, not the kernel..
___nick___ has quit [Ping timeout: 480 seconds]
<j`ey>
well to grub, to the kernel, its passed through grub too
<steev>
janrinze: you need to put the full dtb not the directory
<steev>
grub doesn't have the info that u-boot does, so it doesn't know which dtb to use
<janrinze>
steev: that's what i am thinking as well.. so which dtb for the mac mini?
<j`ey>
janrinze: it wont work
<j`ey>
the issue is elsewhere
<steev>
tpw_rules: is there a tow boot irc channel because the convo is a bit OT for here :)
<tpw_rules>
https://matrix.to/#/#Tow-Boot:matrix.org is the official thing. don't think it has irc
<j`ey>
janrinze: which kernel versions are you testing? dont think there was anyway dtb changes recently that would stop it working
guillaume_g has quit []
<janrinze>
/boot/dtbs/linux-image-5.18.0-asahi-jrp-git-new-dirty/apple/t8103-j274.dtb that's the one for mac mini :-)
<janrinze>
j`ey: it works.. but it does not go beyond 2 GHz..
<j`ey>
janrinze: and it previously did?
jole has quit [Remote host closed the connection]
<janrinze>
j`ey: no .. when i installed linux i ran an older kernel..
<j`ey>
well I dont think cpufreq has changed..
<j`ey>
(well i suppose the changes for m2 could have broken it somehow.. but if it didnt work on an older kernel anyway it wasnt that)
<janrinze>
yes.. like i say.. older kernel... Duh..
<j`ey>
janrinze: how old?
<janrinze>
brb.. rebooting.
janrinze has quit [Remote host closed the connection]
<opticron>
have there been any murmurs about the PSCI stuff getting merged in/accepted?
<sven>
I don’t think that stuff is even remotely ready yet
<opticron>
unfortunate :/ it's kind of important for me to be able to sleep the computer for hours at a time and last time I tried with s2idle it ended up very warm in a bag
<opticron>
though I guess I may have done something wrong
<j`ey>
opticron: s2idle.. didnt that crash the wifi driver?
janrinze has joined #asahi
<opticron>
I don't think s2idle powers down the PCIe bus, so no?
<janrinze>
back..
<j`ey>
opticron: it doesnt work yet
<janrinze>
so the good news is: yes grub dtb loading works.. but the bad news is that X doesn't work. can boot into a console though.
<ElvishJerricco[m]>
I don't think that proposal is like... official at all, but it does solve the problem I think, and seems like a good idea in general even outside asahi/m1n1
<ElvishJerricco[m]>
Though I guess u-boot would have to do something else to figure out what fixups were made by m1n1 so that it could offer this protocol to the boot loader, so maybe it's just kicking the can
Zaprit has quit [Ping timeout: 480 seconds]
ptudor_ is now known as ptudor
janrinze has joined #asahi
<janrinze>
ok.. good thing is : i can mount the fat32 partition from OSX and yes i broke m1n1.. copied the backup and now back in linux.
<janrinze>
tpw_rules: how do i 'chainload' m1n1.. the one i built crashed and got me in a boot loop
janrinze has quit [Remote host closed the connection]
janrinze has joined #asahi
jluthra has quit [Remote host closed the connection]
jluthra has joined #asahi
<janrinze>
sven: I want to update the dtbs. so either need to add it in a working m1n1 or use grub for that.. however both methods seem to fail. lots of reboots
<j`ey>
well grub is not the right way
Zaprit has joined #asahi
<janrinze>
j`ey: and m1n1 will crash and get me in a boot loop.. so now what?
<j`ey>
how is m1n1 crashing?
<janrinze>
fast
<janrinze>
quick register list and rebooting again
<janrinze>
so the recipe for creating /boot/efi/m1n1/boot.bin is not quite ok yet
<j`ey>
and prettu sure it adds a bunch of the same file names
<j`ey>
(ah no, spi-hid-core.c vs spi-hid-apple-core.c)
Zaprit has quit [Quit: Zaprit]
deepphilosopher846[m] has joined #asahi
janrinze has quit [Remote host closed the connection]
janrinze has joined #asahi
c10l has joined #asahi
Gaspare has quit [Quit: Gaspare]
nsklaus_ has joined #asahi
nsklaus has quit [Ping timeout: 480 seconds]
derzahl has joined #asahi
derzahl has quit [Remote host closed the connection]
derzahl has joined #asahi
<derzahl>
strange. sound stopped working on my macbook(air). I figured it was just the latest kernel I installed but I went back to a known good kernel and stil no sound
<derzahl>
i reinstalled the known-good kernel so that m1n1 would update its dtb (even though my PKGBUILD automatically adds the modified dts file to enable sound). still no go
<derzahl>
anyone else have issues?
<j`ey>
check dmesg, any errors?
<zzywysm>
have you tried shutting the system down completely? or have you just been rebooting since you discovered the issue?
<nicolas17>
derzahl: I heard some sound errors go away if you switch the sound device to something else and switch back