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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

add asahi to image builder #281

wants to merge 5 commits into from

Conversation

dkwo
Copy link

@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 -r ../void-packages/hostdir/binpkgs/asahi/ 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
xbps-rindex -a *.xbps
xbps-install --repository=$PWD pkgname

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
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
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
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
Author

dkwo commented Oct 7, 2022

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

@dkwo
Copy link
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
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
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
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
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
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
Author

dkwo commented Oct 16, 2024

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

@dkwo
Copy link
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
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.

@felixfjh
Copy link

felixfjh commented Oct 18, 2024

Make sure you read https://raw.githubusercontent.com/void-linux/void-packages/891129495962aa65e8dc9b5983a2bb92c60e9574/srcpkgs/asahi-base/files/README.voidlinux

I got a build error when building linux-asahi, my host machine is x86_64 Debian. I ran ./xbps-src -a aarch64 pkg srcpkgs/asahi-base asahi-base and after about 10 minutes of compiling, it quits and throws this error message:

make[1]: *** [/builddir/linux-asahi-6.11.2p1/Makefile:1926: .] Error 2
make: *** [Makefile:224: __sub-make] Error 2
=> ERROR: linux-asahi-6.11.2p1_1: do_build: 'make ARCH=$arch ${_cross} ${makejobs} ${_args}' exited with 2
=> ERROR: in do_build() at srcpkgs/linux-asahi/template:100

edited: In the 3rd attempt, I instead run ./xbps-src -a aarch64 pkg srcpkgs/linux-asahi linux-asahi to just solely install the linux-asahi, and it compiles without any error which is pretty bizarre.

@dkwo
Copy link
Author

dkwo commented Oct 18, 2024

Perhaps look a bit at Void's instructions, you may have to clean your masterdir etc, but pkg -f linux-asahi should work.

In fact, if you have already Void running on that machine, it may be enough to just build updated versions of the packages (like asahi-base, the linux-asahi, m1n1) and install them, together with an initram, say dracut: this should be enough to trigger the regeneration of initram, and the creation of /lib/firmware/vendor

@felixfjh
Copy link

Perhaps look a bit at Void's instructions, you may have to clean your masterdir etc, but pkg -f linux-asahi should work.

In fact, if you have already Void running on that machine, it may be enough to just build updated versions of the packages (like asahi-base, the linux-asahi, m1n1) and install them, together with an initram, say dracut: this should be enough to trigger the regeneration of initram, and the creation of /lib/firmware/vendor

Thank you! now, I'm able to generate the void-asahi.img file and I write the entire img file to my fat32 partition on my external hard disk using sudo dd if=void-asahi-20241019.img of=/dev/sdb1 bs=4M status=progress and connect it to the macbook then boot in to asahi uboot, but it seems like it cannot find the image file. Do I have to partition my external hard drive into 2 partitions? the fat32 one which contains dtbs, efi, grub, m1n1, config-asahi, initramfs-asahi, vmlinux-asahi and ext4 partition which contains rootfs? Sorry for such a noob question.

@dkwo
Copy link
Author

dkwo commented Oct 19, 2024

No: as in my first post or in the docs https://docs.voidlinux.org/installation/live-images/prep.html you should dd to the whole drive, not to a partition in it.

lib.sh Outdated Show resolved Hide resolved
@dkwo
Copy link
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
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.

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