Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add asahi to image builder #281

Merged
merged 5 commits into from
Jan 21, 2025
Merged

add asahi to image builder #281

merged 5 commits into from
Jan 21, 2025

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 dkwo force-pushed the asahi branch 3 times, most recently from 77a6380 to e66d7b3 Compare September 27, 2022 20:42
@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

@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
Development

Successfully merging this pull request may close these issues.

6 participants