marcan changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | Not ready for end users / self contained install yet. Soon. | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-stream #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
eroux has quit [Ping timeout: 480 seconds]
yrlf has joined #asahi
espressocookie[m] has joined #asahi
<Glanzmann> landscape15[m]: In the old days also 'chvt 0' worked. Not sure, if it still works.
Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eroux has joined #asahi
eroux has quit [Ping timeout: 480 seconds]
riker77_ has joined #asahi
riker77 has quit [Ping timeout: 480 seconds]
riker77_ is now known as riker77
<yrlf> landscape15[m], Glanzmann: usually tty1 or tty7 are where the graphical desktop runs (depending on distro and/or display manager)
<yrlf> as you said, Ctrl+Alt+F? will switch to tty? (where ? is a number)
<yrlf> 'chvt ?' also works, though I think you need to run chvt as root on some systems
eroux has joined #asahi
eroux has quit [Ping timeout: 480 seconds]
darkapex4 has joined #asahi
darkapex3 has quit [Ping timeout: 480 seconds]
<SamAdams[m]> <espressocookie[m]> "is asahi usable yet" <- Yes and No. It's not intended for end users, but I find it very usable with Debian and if you use a window manager, it may lessen the load on the cpu. There is no SMC support, which means no power management. There is no audio or Bluetooth. Wi-Fi is working if you have a second computer and run the pcie experiment. I would wait until SMC support is finalized into the kernel, and then Wi-Fi and
<SamAdams[m]> Power Management will be added.
<SamAdams[m]> If you are willing to take chances and want to learn how the Linux kernel and Mac OS work under the hood, this project is great!
<SamAdams[m]> * Yes and No. It's not intended for end users, but I find it very usable with Debian and if you use a window manager, it may lessen the load on the cpu. There is no SMC support, which means no power management. There is no audio or Bluetooth. Wi-Fi is working if you have a second computer and run the pcie experiment. I would wait until SMC support is finalized into the kernel, and then Wi-Fi and Power Management will be added.
<SamAdams[m]> If you are willing to take chances and want to learn how the Linux kernel and Mac OS work under the hood, this project is great!
<SamAdams[m]> In regards to YouTube. NO, don't do it. It's horrible, since there's no video acceleration at all. Cinnamon DE runs great, but YouTube is a laggy mess. Even at 360p, it just can't handle it. Modern day CPUs have accelerators that can decode and encode video and that's not present in the kernel (yet).
<tpw_rules> youtube works fine for me
<tpw_rules> it's pointless because there was no sound but
<tpw_rules> nor vsync
<SamAdams[m]> Interesting, maybe just an issue with Firefox? I tried Debian and Ubuntu, and neither one works great. I probably need to move over to Arch.
<SamAdams[m]> Wow, the Linux kernel compiles faster now! It already is fast on the M1. Probably not coming until 5.18 or later because of the scope of the changes.
<tpw_rules> i used firefox on nixos
<tpw_rules> maybe you are using the old simplefb driver?
<tpw_rules> what machine do you have?
<tpw_rules> yeah my mini is playing 4k60 on a 1080p screen just fine. youtube debug says it's dropping maybe one frame a second but it looks great
<tpw_rules> using maybe 60-70% of all cores
phiologe has joined #asahi
<tpw_rules> SamAdams[m]: do you have a regular m1 machine?
PhilippvK has quit [Ping timeout: 480 seconds]
<tpw_rules> @SamAdams: ping test?
duckworld has joined #asahi
duckworld has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
duckworld has joined #asahi
duckworld has quit []
duckworld has joined #asahi
marvin24_ has joined #asahi
marvin24 has quit [Ping timeout: 480 seconds]
feb141985[m] has joined #asahi
eroux has joined #asahi
eroux has quit [Ping timeout: 480 seconds]
eroux has joined #asahi
<amw> SamAdams[m]: YouTube is fine on my MBA / debian bullseye + firefox, my kernel is using CONFIG_DRM_SIMPLEDRM=y and X pkg is xserver-xorg-video-fbdev
<amw> 0 frames dropped even at HD quality
darkapex has joined #asahi
darkapex4 has quit [Ping timeout: 480 seconds]
jkcoxson[m] has joined #asahi
darkapex1 has joined #asahi
ewrvvvvvvvvvvvvvvvvvvvvvvvvvvd has quit [Remote host closed the connection]
darkapex has quit [Ping timeout: 480 seconds]
jeffmiw has quit [Ping timeout: 480 seconds]
jeffmiw has joined #asahi
<Glanzmann> tpw_rules: pong
<Glanzmann> tpw_rules: About the video, if you watch in a window, its fine. If you watch fullscreen, the best results were with fbdev xorg driver (which slow for all other tasks like regular work) and using mpv -vo drm.
jeffmiw has quit [Ping timeout: 480 seconds]
<Glanzmann> But any other sound card will do. But this one supports S/PDIF if you happen to have an echo cancler you want to hook it up to.
<Glanzmann> amw: xserver-xorg-video-fbdev is fast for videoplayback, but slow for everything else (at least for me). So I'm using the modsetting xorg driver. Which is fast for everything else but not the best for videoplayback.
<landscape15[m]> <yrlf> "as you said, Ctrl+Alt+F? will..." <- I tried with ctrl+alt+f2 and it works. I also get full resolution (icons are small).
<Glanzmann> xserver-xorg-video-fbdev my xterm updates less fast, scrolling in firefox is not smooth, mouse curser jumps.
<landscape15[m]> Glanzmann: with kde plasma Firefox works very well. Also ffmpeg works good, but the mouse cursor continually lags.
vx has joined #asahi
<Glanzmann> landscape15[m]: yeah, exactly. This is why I switched to modesetting xorg driver because it feels faster for the regular tasks. KDE uses wayland. I'm using fvwm2 which is using xorg.
ewryyyyyyyyyyyyyyyyyyyyyyyyyyd has joined #asahi
<mps> kettenis: what you think about setting BOOT_TARGET_DEVICES to usb0 first and then nvme0? that way machine will boot from usb by default if usb disk is found and if not then boot from nvme
<mps> this way we could 'rescue' boot in case nvme is non bootable for some reasons
<Glanzmann> mps / tpw_rules / kettenis: Is there a write up how to do the m1n1 / uboot / grub dance, yet?
<mps> Glanzmann: I did it simply by install grub-efi on target partition
<mps> i.e. mount rootFS target partititon, mkdir /boot/efi on it, mount ESP under this dir, and do grub install
<mps> if I finish my $day_job on time I will create script to do this and put m1n1+u-boot+dtb for MB PRO and MB AIR somewhere
<mps> and maybe mini also
<mps> btw, what is dtb file name for air
<j`ey> j313
<mps> j`ey: thanks
<amw> mps: For my 2020 M1 mba it is t8103-j313
<mps> nice, I will put ready made u-boot on my site later (if something didn't trigger NMI on me)
<amw> Glanzmann: I'm very happy with laggy mouse and firefox - it's so fast anyway
<kettenis> cat m1n1.macho *.dtb u-boot-nodtb.bin > u-boot.macho
<amw> mps: What works in your u-boot : Wifi, keyboard ?
<kettenis> that results in a u-boot that works on all the M1 models
<mps> amw: didn't tested wifi in u-boot but keyboard works
<amw> Is it possible to patch the pcie_enable_devices into m1n1 ?
<mps> kettenis: ah, that is nice, thanks
<kettenis> u-boot already enables the wifi
<amw> kettenis: Great!
<Glanzmann> amw: I'm pretty sure it is, but noone has done so or told us about doing so. However hopefully SMC will be ready and then we can have wifi without needing a second machine to boot.
<Glanzmann> amw: I also though about doing it myself, but did not.
<Glanzmann> kettenis: Really, does u-boot enable wifi? I did not know.
<mps> heh, also I looked at it but decide to wait some time
<Glanzmann> kettenis: Wow u-boot enables, wifi did not know.
<Glanzmann> kettenis: Which tree should I use to build u-boot?
<amw> mps: How do I tell which partition is ESP? My first partition is APFS...
<Glanzmann> mps: Thank you, I look forward to the instructions.
<kettenis> the dtb's end up in arch/arm/dts in the u-boot tree after you build
<mps> amw: with fdisk you change part type to efi system
<mps> amw: parted also and some other partition tools
<amw> mps: So I create a new FAT32 partition and set it's GPT GUID to EFI
<amw> Sorry ESP I mean
<mps> amw: EFI System Partition is ESP (shorthand)
<Glanzmann> mps: How big did you do the fat32 efi partition? 100 MB? 1 GB?
<Glanzmann> kettenis: So m1n1 pigs automatically the right dtb if multiple are specified?
<Glanzmann> s/pigs/picks/
<mps> Glanzmann: on usb disk I use 512M, on nvme I followed Quickstart and it is 953M
<Glanzmann> I see.
<Glanzmann> mps: You used u-boot from https://github.com/kettenis/u-boot
<mps> Glanzmann: yes
<Glanzmann> I see.
sami-dev[m] has joined #asahi
<Glanzmann> Has someone build instructions for u-boot?
<amw> u-boot building : make apple_m1_defconfig; make : fails at DTC stage
<amw> Wants a DEVICE_TREE=<> argument? or CONFIG_DEFAULT_DEVICE_TREE
<kettenis> that's fine, everything that's needed has been built at that point
<landscape15[m]> Is it possible to set default root device in the Linux config (so that you don’t need to set boot-args)?
<j`ey> landscape15[m]: CONFIG_CMDLINE
<landscape15[m]> j`ey: thanks. For example I can set ‘CONFIG_CMDLINE=nvme0n1p4’. How do I specify ext4 fs?
<amw> kettenis: Yep I have a arch/arm/dts/t8103-j313.dtb but I think "make DEVICE_TREE=t8103-j313" builds that and doesn't complain
<landscape15[m]> s/‘/`/, s/’./`./
<j`ey> landscape15[m]: thats the entire command line, not just the root
<landscape15[m]> s/‘/```/, s/’./```./
<amw> So more like CONFIG_CMDLINE="earlycon console=tty0 console=tty0 debug net.ifnames=0 rw root=/dev/nvme0n1p6 rootfstype=ext4" ?
<j`ey> yes
<landscape15[m]> But I don’t think you need console=tty0
<Glanzmann> amw: Did you compile u-boot on the m1? Or did you crosscompile?
<kettenis> amw: picking a specific model in the config is a bit retarded, but that's how I "fixed" it in the upstreamed bits
<amw> Glanzmann: Yes sorry - I compiled it on the M1 - so no cross compiling for me
<kettenis> so maybe I should fix it that way on the branch as well
<sami-dev[m]> Hey, I realise the project is far from ready for general consumption but if you were to put it into a sentence or two. How far do you think we're off from being able to use the M1 Max macs for general web-development using linux?
<j`ey> some months
<j`ey> I think it's just too hard to say much beyond that. If youre ok with compiling kernels etc, probably sooner, maybe even already
<j`ey> although chromium doesnt seem to work OOTB with 16K pages
<landscape15[m]> sami-dev: for the end user, I hope by the end of the year. But you can do it yourself for now.
<sami-dev[m]> Can't say I have done much of it manually. My experience with compiling such has been through AUR packages where I simply would edit some options. Either way that sounds promising
<amw> Ok - I think the CONFIG_CMDLINE above was for Linux as u-boot seems to just have =y in the .config
<kettenis> amw: yes
<j`ey> amw: yes it was for linux
<landscape15[m]> amw: also in the Linux config I can’t find it. There is a CONFIG_CMDLINE_BOOL and CONFIG_FB_CMDLINE set to yes
<j`ey> landscape15[m]: cant find it how?
<landscape15[m]> j`ey: manually browsing the config. Should I use menuconfig?
<j`ey> yes
<j`ey> the .config doesnt contain all options
<landscape15[m]> j`ey: there are some more but are all boolean
<amw> landscape15[m]: It's in my "Boot options" section before CONFIG_EFI_STUB=y
<j`ey> my defconfig has CONFIG_CMDLINE="", btw
<amw> My linux also has CONFIG_CMDLINE_FROM_BOOTLOADER=y - I assume that is harmless...
<jannau> you can search in menuconfig with '/', on the result screen use number keys to jump directly to a specific result
<landscape15[m]> jannau: yeah I tried but I can’t find it. Maybe I should recompile.
<jannau> that might disable CONFIG_CMDLINE doesn't make sense to have an internal cmdline if the one from the bootloader is used
<Glanzmann> kettenis: Regarding '10:32 < kettenis> cat m1n1.macho *.dtb u-boot-nodtb.bin > u-boot.macho' Can I use multiple dtb or my sepcific version? Do I use the dtb from u-boot or the one from the kernel compile? I assume I can only use one and that is the one from the kernel compile?
<mps> Glanzmann: from u-boot
<mps> those from kernel doesn't work
<Glanzmann> mps: I see. Thanks.
<mps> Glanzmann: you can use just one for your machine and then have to cat it
<j`ey> landscape15[m]: in menuconfig, of linux, type / and then CMDLINE
<kettenis> there are a few tweaks in the u-boot dtbs
<j`ey> landscape15[m]: what happens?
<Glanzmann> mps: I see. Thank you.
<kettenis> but they're based on the asahi and wifi/take5 branches
<kettenis> so they should work
<amw> landscape15[m]: Are you compiling for x86 ? that has the CONFIG_CMDLINE_BOOL but arm64 doesn't
<landscape15[m]> j`ey: i send a pastelink
<j`ey> amw: i did wonder if it was something like that
<j`ey> you always need ARCH=arm64 set
<j`ey> even when running menuconfig
<amw> j`ey: I was burnt by that a couple times ...
<landscape15[m]> yeah that was the problem. Now I see a CMDLINE string
<landscape15[m]> https://paste in.com/HYmLNycp
<landscape15[m]> s/paste in/pastebin/
eroux has quit [Ping timeout: 480 seconds]
<as400[m]> Did anyone test t6000 u-boot branch ?
<amw> ok - from u-boot/tools/binman/etype/u_boot_ucode.py: Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
davidcole has joined #asahi
<amw> So the m1n1 dtb is passed through u-boot to the linux ?
davidcole has quit []
David[m]12345678 has joined #asahi
<mps> dtb is 'applied' by bootloader
<mps> in 'our' case by m1n1
<amw> Does "applied" mean patched or just passed across?
<j`ey> amw: patched
eroux has joined #asahi
<jannau> as400[m]: yes, the t6000 branch doesn't work yet, the change itself appears to be fine
<as400[m]> jannau: thx.
<jannau> I haven't spend much time looking where it breaks
<as400[m]> jannau: asking because I'm looking at the branch at there is no t6000.dtsi.
Techcable has quit [Remote host closed the connection]
Techcable has joined #asahi
<jannau> use the dtbs from the linux asahi branch for now
<kettenis> I didn't import the t6000 dts files yet on that branch since it doesn't work yet
Techcable has quit [Remote host closed the connection]
Techcable has joined #asahi
psykose has left #asahi [#asahi]
eroux has quit [Ping timeout: 480 seconds]
<as400[m]> kettenis, jannau - thank you for the info.
<mps> jannau: in drivers/hid/hid-apple.c I see few key mapping tables. is the macbookair_fn_keys only for air or also for pro?
<mps> thinking to try to map number keys to Fkeys with Fn key combo
<j`ey> i think it's 'apple_fn_keys' that is used
<Glanzmann> I did the following: Created 1 GB efi partition, changed partition table, did a mkfs.vfat mounted it to /boot/efi. Than I isntalled grub-efi package and run the intaller. I build a debian kernel package and installed it. I have no efivars partition. Than I did the cat m1n1 uboot/dtb u-boot-nodtb.bin dance and installed it from 'options' menu. I saw m1n1 flush buy and now I'm in u-boot:
eroux has joined #asahi
<Glanzmann> What is missing?
<jannau> mps: that's in flux, i currently use apple_fn_keys_spi but that's probably to change due to magic keyboard 2021 patches on the mailing list
<j`ey> on asahi/wifi/take5 it's apple_fn_keys
eroux has quit []
<j`ey> Glanzmann: and does /boot/efi have the bootaa64.efi?
<mps> jannau: j`ey: thanks
<amw> Is it ok to GPT partitions not ordered by sector? i.e. I used fdisk to add a ESP partition out of the free space just before the Mac Recovery partition and it is numbered 8 (Recovery is 7)?
<amw> I think MacOS diskutil must re-order the partitions in the GPT?
<Glanzmann> j`ey: Yes, I checked, its there.
<Glanzmann> I think it has the right device which is Scanning nvme 0:6
<Glanzmann> But than it says unable to read file.
<Glanzmann> j`ey: The bootaa64.efi? is not directly in /boot/efi IIRC but in EFI/bootaa64.efi?
<Glanzmann> without the question mark at the end.
<mps> Glanzmann: yesterday I posted image with u-boot trying to boot from nvme and looks like you hit the same problem
<mps> Glanzmann: does it looks similar to this https://arvanta.net/2x3d1kfg/u-boot-m1.jpg
<kettenis> Glanzmann: u-boot will print
<j`ey> mps: yours found grub, Glanzmann's didnt
<kettenis> Found EFI removable media binary efi/boot/bootaa64.efi
<landscape15[m]> Is grub installed on the EFI partition? Wouldn’t be the same to run Linux via u-boot (without grub)?This is what happens with embedded devices.
<kettenis> landscape15[m]: what ahppens with embedded devices is retarded
<sven> :>
<landscape15[m]> kettenis: yeah I imagine :) this means that the end user booting from the USB drive doesn’t need to install grub in order to install Linux, because grub is already there.
<kettenis> frankly, this is all a solved problem
<kettenis> any decent linux distro that supports "generic" arm64 will install an EFI bootloader for you and will probably even create an EFI system partition if one doesn't already exist
<mps> kettenis: alpine does this
<j`ey> Glanzmann: I feel like your bootaa64.efi is at the wrong path
<j`ey> maybe it's one level too deep?
<amw> grub-install has --target option arm-uboot as well as arm64-efi
<kettenis> needs to be in efi/boot/bootaa64.efi
<kettenis> but that's on the efi system partition
<amw> grub also has --dtb=FILE option to embed a DTB - presumably don't need that?
<Glanzmann> j`ey / kettenis: yes, than it is in the wrong path.
<Glanzmann> I'll correct that, try again and report back.
<kettenis> so if you're looking at it from linux it will have the path where the esp is mounted before that
<kettenis> amw: no need for that
<landscape15[m]> mps: there is also an image with u-boot preinstalled
<landscape15[m]> * also an official image with
<mps> landscape15[m]: which image?
<amw> I get a bunch of files - https://paste.debian.net/1225660/ including /boot/efi/debian/BOOTAA64.CSV
<Glanzmann> kettenis: That should be enough, shouldn't it? https://pbot.rmdir.de/u/X0Hr6UcUkit87UxTZnSAAw
<amw> grub-install /dev/nvme0n1p8 - isn't creating a /boot/efi/bootaa64.efi under debian bullseye?
<Glanzmann> amw: No, it is not. See above paste. But that one is with testing.
<kettenis> Glanzmann: no the file needs to be named efi/boot/bootaa64.efi
<Glanzmann> kettenis: I see. So when the mount point is /boot/efi it has to be /boot/efi/efi/boot/bootaa64.efi ?
<kettenis> yup
<Glanzmann> Thank you.
<Glanzmann> I'll try and report back.
<amw> Glanzmann: Won't it also want all the other files next to it in the same directory?
<Glanzmann> amw: Nope, if I understood kettenis correctly than the grub has everything it needs built in to get to the ext4 partition to load additional modules and config file.
<mps> amw: no
<mps> amw: https://tpaste.us/xnqJ this is content of my ESP
<amw> ok - it doesn't have those filenames in the strings of bootaa64.efi
___nick___ has joined #asahi
___nick___ has quit []
<Glanzmann> For me it did not work: https://tg.st/u/IMG_20220103_125302314.jpg
<Glanzmann> mps: Yeah, this is how it looks for me, too now. Only that 'alpine' is 'debian'.
___nick___ has joined #asahi
<Glanzmann> I can chainload uboot from m1n1, can't I than I don't have to change the boot object until it works.
<Glanzmann> mps: Did you get it working from the internal nvme already?
<amw> So kettenis's u-boot wants efi/boot/bootaa64.efi on the EPS partition
<mps> maybe we all should use alpine for now because it is simple and small, and would be lot easier to cooperate :D
<Glanzmann> amw: Yes.
<mps> Glanzmann: for me it boots fine from usb but not from nvme
<Glanzmann> mps: I have an idea, we have both 'EFI' written uppercase. On vfat it should matter, but maybe it does.
<amw> mps: Does yours work - it doesn't look like it could have the expected path for u-boot to find grubaa64.efi ?
<Glanzmann> So I'm now trying to rename it to lowercase letters and try again.
<mps> today I decide to make proper alpine kernel package, would be easier to make changes, install and setup
<Glanzmann> mps: I also do that with your config. But on Debian it is easy: make -j $(( 2* `nproc`)) V=0 bindeb-pkg
<mps> Glanzmann: on alpine it is 'abuild -r' :)
<mps> grub setup I have works fine on some other arm64 machines
<mps> and it works fine with upper case 'EFI' on usb disk, so this shouldn't be issue
<amw> mps: ok - you've built you own u-boot with your EFI boot path EFI/boot/bootaa64.efi it loads, what's the grubaa64.efi used for?
<mps> amw: tbh I have no idea
<mps> I didn't used grub for more than 15 years (only syslinux and u-boot)
<mps> now I need to relearn it
<j`ey> you don't have to? if alpine isn't going to use it!
<mps> j`ey: alpine uses grub-efi on all machines with efi support
<j`ey> ah
<kettenis> case shouldn't matter (and neither does the orientation of the slashes)
<mps> i.e. X86, arm64 and riscv64
<Glanzmann> kettenis: Still does not work. Do you have tried on the air? Or do you have a grub binary for me that I can try?
myon98 has quit [Ping timeout: 480 seconds]
<amw> Glanzmann: Still not loading the grub ? I also did a update-grub after installing my linux just to tweak the grub config to the kernel
<Glanzmann> amw: I did that, too. However my problem at the moment is that grub is not loading. Same as the problem that mps has.
<amw> I'm not planning to boot up m1n1 + u-boot until I get a 2nd m1n1 partition for experimenting
<Glanzmann> I'll try USB now.
<j`ey> Glanzmann: not the same, mps's setup finds and loads grub
<amw> Glanzmann: Did you see j'ey message that your problem is different to mps's?
<amw> He said mps loaded grub (or at least enough to get grub-rescue) but your's is not getting the grub at all
<Glanzmann> amw: I did. But mps loads grub from usb. It is also not working for him for nvme. Same problem that I have.
<Glanzmann> So I wonder if someone managed to load grub on the air or pro from the nvme?
<j`ey> I was under the impression that mps's grub was loaded from nvme, but that grub wasnt working from that point onwards.. but maybe not
<amw> Can probably enable more debugging on u-boot, perhaps even cmdline support via USB keyboard?
<Glanzmann> amw: The kyeboard works fine with the built in keyboard.
<as400[m]> Glanzmann: why don't you try extlinux path ?
<mps> j`ey: right, grub is loaded from nvme but it puts me in grub-rescue prompt
jeffmiw has joined #asahi
<Glanzmann> as400[m]: Because I lack the knowledge, how do I do that?
<Glanzmann> mps: So for you grub loads?
<mps> as400[m]: I tried with extlinux but it didn't worked
<j`ey> mps: to be clear, the USB wasnt plugged in, when you tried?
<as400[m]> mps: what was the error ?
<as400[m]> It didn't find extlinux.conf ?
<mps> j`ey: doesn't matter, I tried without usb plugged and with it, result is same
<j`ey> mps: ok, just checking it wasnt accidentally loading it from usb as a fallback
<mps> as400[m]: I forgot exact text (that was more than a month ago) but iirc something like this
<mps> j`ey: np
<as400[m]> mps: there was a lot of commits since then. Maybe it's worth trying again ?
<mps> as400[m]: sure, I plan to do this, but first want to finish other tasks to have script which would install alpine to usb in proper way
<as400[m]> mps: just make sure u-boot is compiled with distroboot or whatever it's called (don't remember)
<as400[m]> I mean Debian even provides u-boot-menu to update extlinux.conf automatically.
<amw> Glanzmann: If you can get u-boot cmdline working you may be able to mount the ESP partition manually and check the path to grub is there?
<amw> You might even be able to manually boot the grubaa64.efi if it is in the wrong place
<mps> as400[m]: coincidence is that I'm u-boot maintainer for alpine ;)
<as400[m]> Glanzmann: you just need config file - that's all ---> https://pastebin.com/eiM0GDRX
<as400[m]> mps: oh ok :)
<landscape15[m]> <landscape15[m]> "yeah that was the problem. Now I..." <- Is it possible to set a “rescue” boot device in Linux config (if the nvme partition is not set up)?
<Glanzmann> as400[m]: Where do I put this config file?
<as400[m]> Glanzmann: on your ESP partition in /boot/extlinux/extlinux.conf
<as400[m]> obviously you don't need fdtdir as this is passed by m1n1
<mps> landscape15[m]: this morning I asked kettenis should we change boot_targets to use 'usb0 nvme0' instead of 'nvme0 usb0' to boot from usb first if it plugged instead of nvme, to have simple rescue option ready
<kettenis> mps: I think that's a bad idea
<mps> kettenis: why
<mps> granted, it can be changed form u-boot prompt when u-boot boots
<mps> would be easier for end users if they don't have to stop u-boot and set this manually
<mps> s/form/from/
<dottedmag> (ahem) autorun.inf (ahem)
<kettenis> indeed, you don't want to accidentally boot from a random usb stick that somebody plugged into your machine
<mps> understand (though if someone can plug usb disk on my machine and boot I'll reformat machine)
<Glanzmann> Does that look good?
<as400[m]> Yes
<Glanzmann> as400[m]: That gives me: https://tg.st/u/IMG_20220103_134805783.jpg - invalid pxefile address
<Glanzmann> But it finds the extlinux thing.
<as400[m]> Yes, apparently it does.
<as400[m]> but "pxefile" ...
<as400[m]> this is strange
<as400[m]> Glanzmann: where is the kernel stored ?
<as400[m]> afaict not on ESP partition
<Glanzmann> as400[m]: On an ext4.
<as400[m]> That's why u-boot can't find kernel
<Glanzmann> I see. u-boot can't read ext4.
<as400[m]> Yes
<Glanzmann> So I have to copy and the initrd over and than it should work?
<as400[m]> Yes
<as400[m]> And change extlinux.cong accordingly
<Glanzmann> Will do so.
<mps> I got F1 on MBP by Fn+1 key, now can switch between xorg and console
<as400[m]> *extlinux.conf
<mps> Glanzmann: afaik u-boot can read ext4
<Glanzmann> as400[m]: Did I understood you correctlty that debian does support extlinux out of the box. So when I mount the esp partition as /boot and install some package it does the right thing out of the box?
<j`ey> it can
<as400[m]> Glanzmann: yes, you need u-boot-menu package installed
<Glanzmann> I see, thanks.
<Glanzmann> as400[m]: Unfortunately I get the very same error message when I copy the kernel to 'boot' on the esp partition.
<landscape15[m]> <mps> "landscape15: this morning I..." <- It’s fair to me. But many don’t want that for security reasons. I needed this because I waste time changing the boot object every time I have to switch to USB
<Glanzmann> as400[m]: This is what I have: https://pbot.rmdir.de/ZQKudfoX4RASvKarxDUpIA
<Glanzmann> Error I'm getting: https://tg.st/u/IMG_20220103_140336897.jpg
<Glanzmann> I'm trying the u-boot-menu thingy
<mps> landscape15[m]: you don't need to quote messages on irc (looks ugly)
<as400[m]> Glanzmann: you have a strange setup. Just mount ESP to boot
<Glanzmann> Yeah, that's what I'll do now.
<as400[m]> So the kernel and initrd is in the root of ESP
<landscape15[m]> mps: ok then :)
<as400[m]> Glanzmann: and when you have kernel and initrd in the root of ESP you need to change extlinux.conf accordingly like:
<as400[m]> KERNEL /Image
<Glanzmann> as400[m]: Actually debian moved the kernel and the initrd for me in /boot/boot
<Glanzmann> So it should be fine.
<Glanzmann> After installing the u-boot-menu
<Glanzmann> But I get the same error message: https://tg.st/u/IMG_20220103_141051450.jpg
<mps> Glanzmann: https://tpaste.us/yp6l this is my unfinished try to boot m1 with extlinux.conf from usb
aleasto has joined #asahi
<mps> look at part where I create extlinux.conf
<mps> line 68 and down
<Glanzmann> This is my filesystem layout: https://pbot.rmdir.de/X-Xb4kiho5um6BI3IaMkJw
<as400[m]> Glanzmann: try something like this ---> https://pastebin.com/raw/gJkbTXbK
<as400[m]> with proper path to kernel and initramfs
<as400[m]> I guess in your case it will be /boot/Image and initrd=/boot/initramfs.img
<Glanzmann> as400[m]: I checked the paths in extlinux.conf using cut and paste and they point where they should be porting to.
<Glanzmann> I think it is something else.
<Glanzmann> So the paths in extlinux.conf are correct if the vfat esp partition is '/'
<as400[m]> I think so
<as400[m]> on the last screenshot you provided, u-boot says "Device 0: unknown device" - that does not look good
<Glanzmann> I also checked the u-boot .config and both vfat and ext4 support is compiled in and CONFIG_CMD_SYSBOOT=y which seems to be extlinux as well.
<Glanzmann> kettenis: Did you test u-boot/nvme on the air?
jeffmiw has quit [Ping timeout: 480 seconds]
<as400[m]> Glanzmann: can you try "nvme info" after failed boot ?
<as400[m]> or "nvme list"
<j`ey> Glanzmann: well its reading the .conf from the nvme
<Glanzmann> j`ey: I agree.
<Glanzmann> Here is the nvme info: https://tg.st/u/IMG_20220103_142320177.jpg
<kettenis> and then it fails because something is messed up
<kettenis> but I doubt it is a u-boot problem
<kettenis> and no, I didn't test it on j313
<kettenis> but it works just fine on j274 and j293
<Glanzmann> I see. Strange.
<as400[m]> Glanzmann: "fatls nvme 0:6" ?
<Glanzmann> as400[m]: Looks good: https://tg.st/u/IMG_20220103_142758905.jpg
<Glanzmann> I have an idea, but if it is that, than you will shoot me.
<Glanzmann> Maybe I wrote the extlinux.conf in utf
<Glanzmann> No, its ascii.
<as400[m]> Glanzmann: try constructing extlinux.conf like this --> https://pastebin.com/raw/gJkbTXbK
<as400[m]> just change the "image", "initramfs" and "root" according to your setup
<Glanzmann> I tried. Does not work.
<Glanzmann> I ran the u-boot- debian thingy which just did that.
<as400[m]> wait - why is your kernel image so small ?
<as400[m]> I mean I always get something about 20MB images
<Glanzmann> It's 8.1 MB.
<Glanzmann> let me try it to boot.
<mps> kettenis: you wrote that you boot from nvme on j293 with u-boot. could you share your setup or short instructions how to make this to work
<Glanzmann> as400[m]: I tried booting it, it boots.
<as400[m]> hmmm interesting
<Glanzmann> My normal kernel image is even smaller 6 MB compressed.
<Glanzmann> kettenis: Are you using grub, extlinux.conf or something completly different?
<kettenis> I'm running OpenBSD
<Glanzmann> kettenis: But how does u-boot boot your kernel?
<kettenis> but I just verified that simply copying grubaa64.efi from the Debian 11.2 install ISO to efi/boot/bootaa64.efi on the ESP works just fine
<kettenis> but if you want to replicate my setup, just take http://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/BOOTAA64.EFI
<kettenis> and use that as your efi/boot/bootaa64.efi
<mps> kettenis: thanks
<Glanzmann> kettenis: I'll do that. How do you build u-boot? I did the following: https://pbot.rmdir.de/uO_IYaTISLciCsL7jUAPxA Is this supposed to work?
<kettenis> yup
<Glanzmann> kettenis: With your grub it works: https://tg.st/u/IMG_20220103_144531609.jpg
<marcan> fwiw I just updated some docs wiki pages (boot, storage, glossary) to try to fix the 1TR confusion
<kettenis> well, that isn't grub but the OpenBSD bootloader
<marcan> tl;dr the last partition on disk is *not* 1TR, it's "System RecoveryOS". 1TR just means "recovery booted by holding the power button down" and it *used* to be system recovery on 11.x but is now the paired OS recovery, and both are called 1TR when booted in this way
<marcan> if you see any mentions of the old confused terminology feel free to fix them
<kettenis> Glanzmann: anyway, this proves there is nothing wrong with the your ESP and u-boot just works
<kettenis> So your problem must be that you didn't properly install your grub
<kettenis> as I said, the grubaa64.efi from the debian install iso works fine
<Glanzmann> I agree. I'll try the grub from the debian install iso.
kit_ty_kate has quit [Ping timeout: 480 seconds]
<Glanzmann> as400[m]: I also tried the put the exlinux.conf as simple as possible, with your three liner, same issue.
<mps> Glanzmann: please inform me where I can download this debian iso when you test it works for you
<j`ey> Glanzmann: as400[m] the extlinux.conf isnt being read, its erroring earlier
<Glanzmann> j`ey: I see.
<Glanzmann> mps: Will do so.
<j`ey> i looked into the u-boot code
<mps> Glanzmann: TIA
<as400[m]> j`ey: really ?
<as400[m]> what did you find out ?
<Glanzmann> maybe I can load the kernel using the u-boot commandline?
<as400[m]> j`ey: great detective work
<Glanzmann> j`ey: What can I do about it?
<j`ey> scriptaddr could maybe be set in the config to some valid address. but not sure, I havent used uboot
<mps> Fn+numeric_key translate to Fkeys diff is here https://tpaste.us/5nq0 if anyone needs this on j293
<kettenis> the problem with all those legacy boot mechanisms in u-boot is that they rely on fixed memory addresses
<kettenis> that's not going to work since we want to support both m1 and m1 pro/max
<as400[m]> kettenis: so maybe it's better to just forget about it at all ?
jeffmiw has joined #asahi
<as400[m]> Although I truly hate grub
<kettenis> need to think a bit on how to make this work
<kettenis> leaving it broken is not very helpful
<as400[m]> kettenis: maybe don't bother. There are much more mandatory env vars needed than scriptaddr
<kettenis> but for now, yes, only the EFI boot path is going to be supported
<kettenis> if you don't like grub, there is systemd-boot
<as400[m]> kettenis: yes, and then you will make fun of me here ... heh
chengsun has quit [Quit: Quit]
chengsun has joined #asahi
<Glanzmann> 9
<mps> Glanzmann: thanks
<Glanzmann> Now I have grub working.
<Glanzmann> But it crashes while initalizing the kernel.
<Glanzmann> mps: And the trick is the following:
dwalt has joined #asahi
<mps> I'm 'ears' now
<Glanzmann> There are two files: https://pbot.rmdir.de/26pKo6xFxGcNueIV0A3hsw
<Glanzmann> We only coppied the grub but there seems to be another thing called bootaa64.efi and this is the one we need.
<mps> ha, that is what I thougt, to move grubaa64.efi from alpine dir to boot
<mps> Glanzmann: thank you, will try later and report back
<Glanzmann> I used the bootaa64.efi from the iso.
<Glanzmann> And the grub from debian testing. It is working.
kov has joined #asahi
<Glanzmann> The kernel loads but can't find my root filesystem but that is now easy to fix.
<Glanzmann> mps: Here is copy if you don't want to download the 330 MB ISO file: https://tg.st/u/bootaa64.efi
<Glanzmann> Is there a key combination for sysrq on the m1?
Dcow_ has joined #asahi
<Glanzmann> It boots up and has wifi.
<Glanzmann> But no usb.
<Glanzmann> I thought usb-c is enabled by the kernel and not m1n1. But maybe I'm mistaken or the reason is another reason.
<kettenis> bootaa64.efi on the debian installer is the shim loader that is needed to deal with secure boot
<kettenis> you should only need grubaa64.efi, but you need to rename it to bootaa64.efi
<Glanzmann> kettenis: This file did the trick for me.
<Glanzmann> I can reproduce it and i tried x times.
<Glanzmann> If you want I make you a video.
<Glanzmann> kettenis: Have you tried to load the grub without bootaa64.efi?
<Glanzmann> I assume you just used the iso image, didn't you?
<kettenis> I tried, it works here
<Glanzmann> So for you when you only have the grub in it, it boots?
jeffmiw has quit [Ping timeout: 480 seconds]
<mps> Glanzmann: thanks, but I already downloaded iso
<Glanzmann> kettenis: Can you try with the grub of debian testing? Here it is: https://tg.st/u/grubaa64.efi
<Glanzmann> That is the one that fails for me if I have it alone in there.
<Glanzmann> kettenis: Are you on latest and greatest or still on macos 11?
<kettenis> shouldn't matter
<kettenis> really, at the point where you have m1n1+u-boot running any generic arm64 distro should just work
<Glanzmann> I get it. But I'm pretty sure that at least for me on the macbook air, grub only loaded after I added the shim file to the directory.
<Glanzmann> I write down what I did for others to reproduce.
<j`ey> bootaa64.efi is what u-boot looks for, not grubaa64.efi
<Glanzmann> That explains it.
<Glanzmann> Maybe I just have to rename grub and it will work, too.
<Glanzmann> let me try.
<Glanzmann> j`ey: You're right. The filename matters. Thank you.
<Glanzmann> mps: So you just need to rename grub to bootaa64.efi and than it works.
yuyichao has quit [Ping timeout: 480 seconds]
<Glanzmann> mps: Btw. I just booted the air without a second machine using uboot, m1n1, grub and have wifi. USB-C does not work for me. Don't know why.
<Glanzmann> Okay I shut up, usb-c works as well.
<Glanzmann> Since u-boot can read ext4, is it necessary to use the efi partition for this? I'm the efi partition is very helpful for transfering the firmware files, but other than that?
<mps> Glanzmann: I think what is important is partition type (efi system) and iirc filesystem could be ext4
<kettenis> nope, that's a stupid idea
<mps> maybe even type is not important
<mps> kettenis: it seems stupid but once I changed type to linux and uboot found bootaa64.efi
<mps> and I'm not advocating this
yuyichao has joined #asahi
<Glanzmann> mps: This is what I did in a nutshell: https://tg.st/u/asahi-uboot-quickstart.txt
<mps> Glanzmann: thanks, ready to test
<mps> still doesn't get boot menu but got real grub prompt where all grub commands work
<mps> good for now
<tpw_rules> Glanzmann: i mean my nixos tutorial has everything i did and it works great
<tpw_rules> also i tested and uboot refuses to read an ext4 ESP
<landscape15[m]> Glanzmann: when I build u-boot, can I edit apple_m1_defconfig with menuconfig (as with Linux)?
<j`ey> yes
<tpw_rules> you can interrupt u-boot and do something like `run usb_boot` instead of reordering the disks
<tpw_rules> same as a regular UEFI firmware and the boot menu
<tpw_rules> imo leaving nvme first is best
<mps> finally got grub boot menu on nvme
<mps> thanks all for help
<mps> looks like alpine grub-efi doesn't work on nvme but debian does
joske has joined #asahi
<joske> mps: how did you get the grub menu? I have the same, boots now to grub shell and can boot manually from there, but no menu
<joske> Glanzmann: mps: can you post your entire grub.cfg?
darkapex2 has joined #asahi
<mps> joske: created /boot/grub on ESP and rsynced grub files there from rootFS /boot
<mps> joske: I copied file from debian install iso
<joske> mps: grub.cfg?
<mps> now I have to tweak grub.cfg for my rootSF and files
darkapex1 has quit [Ping timeout: 480 seconds]
joske has quit [Ping timeout: 480 seconds]
ogimgd[m] has joined #asahi
<mps> got it booting machine completely from nvme with u-boot, thank you all for help
<tpw_rules> also i'm pretty sure grub-install will put it in the right place if you use the --removable flag
darkapex3 has joined #asahi
darkapex2 has quit [Ping timeout: 480 seconds]
<kettenis> that seems to have the whole story
yamii has quit [Ping timeout: 480 seconds]
yamii has joined #asahi
yuyichao_ has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
<Glanzmann> tpw_rules: I tried, yes it does. I update my instructions.
<Glanzmann> kettenis: Thank you for the background information. I was not aware of it.
gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
gabuscus has joined #asahi
<Glanzmann> marcan: I have a wifi bug for you. When I open a personal hotspot on my android mobile phone and try to connect using wifi take 5 I get the following in dmesg: ieee80211 phy0: brcmf_set_sae_password: failed to set SAE password in firmware (len=8) See kern.log: https://tg.st/u/9dd13d1cccccf0cafd96267d4edc838b-kern.log
<Glanzmann> My personal wifi hot spot uses the same ssid and psk as my wlan I'm connected right on without any issue.
<jannau> Glanzmann: known issue with wpa3
<Glanzmann> Oh, I did not know. I see.
<Glanzmann> joske: My grub.cfg not that it is something special: https://pbot.rmdir.de/YVjHOG_6bDeqJaJjqQBg1g
<Glanzmann> mps: The palm detection with your config does not work so good for me. The mouse curser often jumps. Do you have a solution for that or the same problem. I thought I already had a configuration where it was better out of the box. Unfortunately I deleted the install so I have no way to check.
<landscape15[m]> In order to fix my custom kernel config (with which I don’t get USB working) I’m cloning every USB option from mps’s config throw menuconfig. Could it work?
<Glanzmann> landscape15[m]: I sometimes also have the feeling that usb does not work.
<Glanzmann> landscape15[m]: I'm at the moment also using mps config because I was unable to get the debian defconfig for aarch64 adopted to boot on macbook air.
<Glanzmann> Updated https://tg.st/u/asahi-uboot-quickstart.txt with kettenis and tpw_rules input.
<tpw_rules> Glanzmann: pretty sure that's an either-or
<tpw_rules> i imagine what the dpkg-reconfigure option ultimately does is invoke grub-install with --removable
<Glanzmann> tpw_rules: Yes it is either or. But if you do it with the flag.
<Glanzmann> And than you update grub2 it will not update it on the alternate location.
<Glanzmann> So yes, dpkg-reconfigure should be enough. I agree, I deleted the other line.
ewryyyyyyyyyyyyyyyyyyyyyyyyyyd has quit [Remote host closed the connection]
yuyichao has joined #asahi
yuyichao_ has quit [Ping timeout: 480 seconds]
Dcow__ has joined #asahi
Dcow_ has quit [Ping timeout: 480 seconds]
mlq has joined #asahi
<mps> Glanzmann: palm detection never worked for me on any arm chromebook/laptop
mlq_ has quit [Ping timeout: 480 seconds]
<Glanzmann> mps: I see, good to know. :-) I solved my particular problem by telling gpg to grab the keyboard, should be the default but on Debian it doesn't seem to be.
<Glanzmann> mps: Also for me the mouse pointer seems to jump to the borders. Sometimes when I type, does that happen for you, too?
<Glanzmann> So it is in the middle of the screen and than suddenly jumps all the way left side?
<Glanzmann> While I'm typing.
<Glanzmann> Anyway, have to hit the bed know. Read your answer tomorrow. :-) Macbook Air with wifi without second machine is really nice. :-)
<mps> Glanzmann: didn't noticed jumping of pointer, maybe because I use st term with patch which hide pointer when starting to type
<mps> but I never noticed jumping of it around without touching touchpad
<mps> Glanzmann: yes, also mb pro, only waiting for sound card fix
joske has joined #asahi
<joske> thx all, I also got my air booting all the way into linux :-)
<joske> grub-install --removable was the final trick
<mps> joske: which distro
<joske> manjaro mate edition
<mps> manjaro is arch linux based?
<joske> yes
jeffmiw has joined #asahi
___nick___ has quit [Ping timeout: 480 seconds]
off^ has joined #asahi
joske has quit [Remote host closed the connection]
Dcow__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dcow_ has joined #asahi
yuyichao_ has joined #asahi
yuyichao has quit [Ping timeout: 480 seconds]
<mps> jannau: what you think about this patch to have Fkeys on MB PRO https://tpaste.us/Bgyy is it worth to be added
<mps> works fine on my machine
yuyichao has joined #asahi
yuyichao_ has quit [Ping timeout: 480 seconds]
<chengsun> VinDuv: thanks for your instructions on how to get /dev/cu.debug-console on macOS 12
<chengsun> I had to tweak it a little bit to get it working for me: /Library/KernelCollections was read-only (extended attr I think), so I dumped kc.noshim.macho into ~ instead