Skip to content

Conversation

@dkwo
Copy link
Contributor

@dkwo dkwo commented Sep 16, 2022

Based on void-linux/void-packages#39796 and tested.

xi -S qemu-user-static lz4 xz
doas ./mkrootfs.sh aarch64
doas ./mkplatformfs.sh asahi void-aarch64-ROOTFS-20220916.tar.xz
doas ./mkimage.sh void-asahi-PLATFORMFS-20220916.tar.xz
doas xz -d void-asahi-20220916.img.xz
doas dd if=void-asahi-20220916.img of=/dev/sda bs=4M status=progress

Boots from an external drive via UEFI, after using Asahi Linux install script with "UEFI environment only".
See the docs pr for details.

@dkwo dkwo marked this pull request as ready for review September 16, 2022 21:04
@Vaelatern
Copy link
Member

I wish I had access to an M1 to test this.

@dkwo
Copy link
Contributor Author

dkwo commented Sep 27, 2022

After doing

doas xz -d void-asahi-20220916.img.xz
doas dd if=void-asahi-20220916.img of=/dev/sda bs=4M status=progress

it can boot the void kernel :)

@dkwo
Copy link
Contributor Author

dkwo commented Oct 5, 2022

While support packages are still in PR, is there a simple way to install them by modifying
# XBPS_ARCH=$ARCH xbps-install -S -r /mnt -R "$REPO" base-system
to something like
# XBPS_ARCH=$ARCH xbps-install -S -r /mnt -R "$REPO" base-system -R ??? asahi-base
The booted USB stick has those packages installed, so I'm hoping this is possible. @Duncaen

@classabbyamp
Copy link
Member

yes, use the -r flag of mkplatformfs to point it at hostdir/binpkgs/[branch]

@dkwo
Copy link
Contributor Author

dkwo commented Oct 5, 2022

@classabbyamp I've done that (see my fist comment), now I'm trying to install them from the booted image into the chroot. Did I miss something?

@classabbyamp
Copy link
Member

oh, for that you'll need to sign the packages and serve them with an http server probably

@dkwo
Copy link
Contributor Author

dkwo commented Oct 7, 2022

This now works in conjunction with void-linux/void-packages#39796

@dkwo
Copy link
Contributor Author

dkwo commented Oct 7, 2022

Simple solution for the local repo, as suggested by @Duncaen on reddit in the past:

xbps-rindex -a *.xbps
xbps-install --repository=$PWD pkgname

@ZerdoX-x
Copy link

@dkwo Hi! Thank you for your work. How can I DM you?

@dkwo
Copy link
Contributor Author

dkwo commented Oct 17, 2022

@ZerdoX-x I don't use irc much. All I did is documented in this PR, and the two linked ones. You can ask or report here if you encounter any issues.

@ZerdoX-x
Copy link

@ZerdoX-x I don't use irc much. All I did is documented in this PR, and the two linked ones. You can ask or report here if you encounter any issues.

I just wanted to know if it is possible to install void linux on M1. I installed the default Asahi linux and cannot handle it due to systemd, literally bullshit. But I don't have much technical experience manually installing a custom distro on Asahi without clear instructions from anyone who already did this.

@dkwo
Copy link
Contributor Author

dkwo commented Oct 17, 2022 via email

@classabbyamp
Copy link
Member

classabbyamp commented May 23, 2024

idk how asahi install process works but i have something for live isos on arm in the works (it isn't ready for testing, please don't go looking for it to try yet)

@dkwo
Copy link
Contributor Author

dkwo commented May 23, 2024

Got it. The first step is done from mac os, the rest is written in my first post here.
I.e. the thing you'd flash on the usb /dev/sda is already a live image, just produced locally.

@classabbyamp
Copy link
Member

i mean live iso in the x86 style, with an overlayfs root and such

@slimjimsoftware
Copy link

@dkwo @classabbyamp I've built a rudimentary installer based on the official Asahi installer here: https://gitlab.com/slimjimsoftware/vai - this should allow you install Void from a macOS terminal with curl -L https://tinyurl.com/void-asahi | sh - If anyone wants to try it then feedback would be appreciated.

@dkwo
Copy link
Contributor Author

dkwo commented May 29, 2024

Great! In the past @ZerdoX-x was asking for a simple way to install, maybe this can help.

@ZerdoX-x
Copy link

ZerdoX-x commented Jun 6, 2024

Great! In the past @ZerdoX-x was asking for a simple way to install, maybe this can help.

Yep, thank you. I've subscribed to this PR long time ago and waiting for updates :)

BTW I've moved to gentoo and compile all stuff locally. Don't think void can be a daily runner for M1 due to lack of binary packages for aarch64. Same for arch and all binary based PM

@classabbyamp
Copy link
Member

Don't think void can be a daily runner for M1 due to lack of binary packages for aarch64

what do you mean? void builds binary packages for aarch64...

@ZerdoX-x
Copy link

ZerdoX-x commented Jun 6, 2024

void builds binary packages for aarch64...

oof. my bad! then i can consider this a good alternative for me. i'll keep an eye on void then ;)
sorry for the confusion!

@felixfjh
Copy link

Hi @dkwo, can I ask you something about the Wi-Fi setup? I'm running void linux on my m2 pro macbook and I have a trouble connecting wifi. I ran ip a and I see only the lo loopback interface. I then tried running lspci -knn to get the vendor id and device id to check them on linux-hardware website and it looks like it only supports Asahi Fedora Remix so is that mean the wifi is not currently supported on void linux?

@dkwo
Copy link
Contributor Author

dkwo commented Oct 15, 2024

wifi works fine for me, at least on m1 series.
i had to use updated wpa_supplicant, from void-linux/void-packages#51362 , to get wpa3.
are you using asahi-kernel and -scripts from void-linux/void-packages#39796 ,
and doing as in the Readme there?
does /lib/firmware/vendor contain stuff? what about dmesg?

@felixfjh
Copy link

felixfjh commented Oct 16, 2024

wifi works fine for me, at least on m1 series. i had to use updated wpa_supplicant, from void-linux/void-packages#51362 , to get wpa3. are you using asahi-kernel and -scripts from void-linux/void-packages#39796 , and doing as in the Readme there? does /lib/firmware/vendor contain stuff? what about dmesg?

There is no /lib/firmware/vendor folder created and when I ran dmesg, it seems like the brcmfmac firmware loading is failed. here is the image of the dmesg log

@dkwo
Copy link
Contributor Author

dkwo commented Oct 16, 2024

hmm, which initram are you using?
are you following the readme.voidlinux?

@dkwo
Copy link
Contributor Author

dkwo commented Oct 16, 2024

That folder is necessary, otherwise no wifi, possibly other stuff too..

@felixfjh
Copy link

felixfjh commented Oct 16, 2024

That folder is necessary, otherwise no wifi, possibly other stuff too..

Maybe I should try to re-install it, could you sent me the link to the necessary folder?
sorry for taking up your time.

@dkwo
Copy link
Contributor Author

dkwo commented Oct 16, 2024

Here's the PR: void-linux/void-packages#39796
Make sure you read https://raw.githubusercontent.com/void-linux/void-packages/891129495962aa65e8dc9b5983a2bb92c60e9574/srcpkgs/asahi-base/files/README.voidlinux
I'd suggest using either dracut or tinyramfs, as they're known to work for sure.

@dkwo
Copy link
Contributor Author

dkwo commented Dec 30, 2024

Simplified and tested again today. It still works.
Is it possible to avoid the 'Growing root partition' when booting the USB?
When mkimage'ing I used -s 1024MiB and had not much space left on root, so what is a good default?

@dkwo
Copy link
Contributor Author

dkwo commented Dec 30, 2024

Also, I had to explicitly add lzfse package, otherwise xbps-install fails even though it's available locally and a dependency of asahi-scripts.

@dkwo
Copy link
Contributor Author

dkwo commented Jan 13, 2025

Tested one more time, using Void's repos.

Two remarks:

  1. had to increase size to 1024, otherwise I get errors.
  2. had to add explicitly lzfse, otherwise the command mkplatform fails. I would expect it is picked up as a dependency, but no.

Other than that, it works as expected.

@dkwo dkwo requested a review from classabbyamp January 13, 2025 12:33
@dkwo
Copy link
Contributor Author

dkwo commented Jan 14, 2025

Both issues addressed.

@classabbyamp
Copy link
Member

classabbyamp commented Jan 16, 2025

added live iso support, kinda tested it (as in it builds an image, I don't have the hardware to test)

it did spit out this error during build, which might be good to look into (kconfig fix?):

dracut-install: Failed to find module 'ahci'
dracut[E]: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.Vrs9IG/initramfs --kerneldir /lib/modules/6.12.8-asahi_1/ -m ahci

please build and test a proper live iso, they're much better/more ergonomic than mkimage images...

# ./mkiso.sh -a asahi -b base
# ./mkiso.sh -a asahi-musl -b xfce
...

@classabbyamp
Copy link
Member

also, the current asahi modules path doesn't include the +1? shouldn't it do so?

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

Thanks! I tested # ./mkiso.sh -a asahi -b base and it boots fine.
The xfce version however is using mesa, not mesa-asahi: it can launch a graphical login, which is usable but a bit laggy.

I noticed that the hook in asahi-base likely runs too early, when the whole /var/service folder is not found, and so the speakersafetyd service not enabled. This works fine on a normal system, as I checked, but not in the installer.

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

There's no ahci module, because that stuff is turned off in kconfig.
Do we care about this on apple silicon, and more generally about sata? I thought this was superseded by nvme by now.

@classabbyamp
Copy link
Member

The xfce version however is using mesa, not mesa-asahi: it can launch a graphical login, which is usable but a bit laggy.

then some adjustments to mkiso should be made for that

I noticed that the hook in asahi-base likely runs too early, when the whole /var/service folder is not found, and so the speakersafetyd service not enabled. This works fine on a normal system, as I checked, but not in the installer.

the hook for enabling services should be symlinking to /etc/runit/runsvdir/default not /var/service

There's no ahci module, because that stuff is turned off in kconfig.
Do we care about this on apple silicon, and more generally about sata? I thought this was superseded by nvme by now.

flash drives don't use nvme... turn it on

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

modules path fixed and ahci added at void-linux/void-packages#53976

@classabbyamp
Copy link
Member

i think that might work for mesa/mesa-asahi

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

The mesa-asahi should come before xorg stuff, then dependency work fine.

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

Btw, do you want to add asahi-audio to the pipewire stage?

@classabbyamp
Copy link
Member

classabbyamp commented Jan 16, 2025

yes, that should be done

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

Btw, tested again the musl xfce and it works (of course xorg is not really supported by upstream asahi, so it is what it is).

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

audio added.

@classabbyamp
Copy link
Member

don't think that will work because ARCH gets redefined before setup_pipewire is run. we should probably have a "raw" arch var that ARCH gets set to if not otherwise set

@dkwo
Copy link
Contributor Author

dkwo commented Jan 16, 2025

You're right. Now it's hacky but it works.

@classabbyamp
Copy link
Member

this should be a little less hacky, pls try

@dkwo
Copy link
Contributor Author

dkwo commented Jan 17, 2025

This installs asahi-audio for every aarch64 (not just asahi), not sure this is optimal.

Also, asahi-base (even after the most recent update) still fails at creating the symlink (no file or directory). Any ideas? It works on my system, but not in the mkiso.

A small nitpick: when you mkiso asahi, the last step is numbered as 12/11.

@classabbyamp
Copy link
Member

oh whoops, the case should be

case "$ARCH" in
asahi*)

@classabbyamp
Copy link
Member

pls give one last test, squashed

@dkwo
Copy link
Contributor Author

dkwo commented Jan 21, 2025 via email

@classabbyamp classabbyamp merged commit 90be3de into void-linux:master Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants