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

How to update firmware for HDMI support? #121

Open
yu-re-ka opened this issue Dec 12, 2023 · 5 comments
Open

How to update firmware for HDMI support? #121

yu-re-ka opened this issue Dec 12, 2023 · 5 comments

Comments

@yu-re-ka
Copy link
Contributor

The documentation says the firmware can be updated by "re-creating the ESP partition" but it is unclear how to do that.

@tpwrules
Copy link
Owner

tpwrules commented Dec 12, 2023

What I meant by that is to delete the macOS stub and ESP, then do a UEFI-only installation using the latest installer, and finally do the repair steps to recreate the ESP contents (see the "extreme circumstances" note here). I had hoped that users would not have to do this as it's annoying and potentially dangerous.

It's unfortunate that HDMI needs new firmware too? What files? Upstream doesn't have any official way to solve this yet? I had some ideas but I was hoping better solutions come along too.

@yu-re-ka
Copy link
Contributor Author

https://social.treehouse.systems/@AsahiLinux/111515422125309592

This requires 13.5 firmware, so users who installed prior to August will not have the feature enabled. We're working on an upgrade/support solution for those users.

this is as of 9 days ago, and there hasn't been news on a solution for upgrading firmware.

@tpwrules
Copy link
Owner

tpwrules commented Dec 17, 2023

Turns out the issue here is outdated DCP firmware stored in the macOS stub partition, NOT the firmware files passed to hardware.asahi.peripheralFirmwareDirectory.

I don't have any sort of solution then, this is a different case to the stuff needed for the webcam. Currently the only possibility is indeed to delete and recreate the macOS stub and ESP.

@diegobfernandez
Copy link

What I meant by that is to delete the macOS stub and ESP, then do a UEFI-only installation using the latest installer, and finally do the repair steps to recreate the ESP contents (see the "extreme circumstances" note here). I had hoped that users would not have to do this as it's annoying and potentially dangerous.

I've done this and now HDMI is working.

It was not a difficult procedure but you have to piece together the steps from the link in the mention and how to safely delete the partitions from the Asahi Partitioning cheatsheet.

Read the cheatsheet carefully to not make any mistakes during deletion and make sure you are familiar with NixOS installation process.

@n8henrie
Copy link

n8henrie commented Mar 23, 2024

Giving the "firmware update" a go with slightly more explicit instructions.

Reading https://github.com/AsahiLinux/docs/wiki/Partitioning-cheatsheet, it looks like I want to delete the EFI partition (disk0s4 in my configuration below) and the stub partition -- in the instructions it looks a little difficult to identify the stub; in their documentation it's disk0s5 and is 2.5 GB. In my data below it looks like it should be disk0s3, identified by also being 2.5 GB.

diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk0
   1:             Apple_APFS_ISC Container disk1         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk4         1.9 TB     disk0s2
   3:                 Apple_APFS Container disk3         2.5 GB     disk0s3
   4:                        EFI EFI - ASAHI             500.2 MB   disk0s4
   5:           Linux Filesystem                         92.2 GB    disk0s5
   6:        Apple_APFS_Recovery Container disk2         5.4 GB     disk0s6

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.5 GB     disk3
                                 Physical Store disk0s3
   1:                APFS Volume Asahi Linux - Data      4.4 MB     disk3s1
   2:                APFS Volume Asahi Linux             1.2 MB     disk3s2
   3:                APFS Volume Preboot                 126.1 MB   disk3s3
   4:                APFS Volume Recovery                1.8 GB     disk3s4

/dev/disk4 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.9 TB     disk4
                                 Physical Store disk0s2
   1:                APFS Volume NateSSD                 10.1 GB    disk4s1
   2:              APFS Snapshot com.apple.os.update-... 10.1 GB    disk4s1s1
   3:                APFS Volume Preboot                 6.1 GB     disk4s2
   4:                APFS Volume Recovery                922.3 MB   disk4s3
   5:                APFS Volume Data                    1.7 TB     disk4s5
   6:                APFS Volume VM                      24.6 KB    disk4s6
   7:                APFS Volume Nix Store               78.3 GB    disk4s7
$ diskutil mountDisk disk0s4
$ mkdir -p ~/Desktop/tmp/asahi-efi
$ sudo rsync -av /Volumes/EFI\ -\ ASAHI ~/Desktop/tmp/asahi-efi
...
$ diskutil unmountDisk disk0s4
$ diskutil eraseVolume free free disk0s4
$ diskutil eraseVolume free free disk0s4
$ diskutil apfs deleteContainerdisk0s3
  • next, /usr/bin/curl https://alx.sh | sh (curl from nixpkgs doesn't seem to work, I have to specify the system curl).
  • enter password, follow prompts:
  • f: Install an OS into free space
  • 5: UEFI environment only (m1n1 + U-Boot + ESP)
  • Reboot and follow the asahi instructions to finalize installation
  • My old root partition is not discovered / mounted -- reboot from UEFI back into MacOS

Looks like the new EFI is still disk0s4:

$ diskutil mountDisk disk0s4
$ sudo rsync -av /Users/n8henrie/Desktop/tmp/asahi-efi/EFI /Volumes/EFI\ -\ NIXOS/
$ 
$ # edit: don't forget to include the loader directory
$ sudo rsync -av /Users/n8henrie/Desktop/tmp/asahi-efi/loader /Volumes/EFI\ -\ NIXOS/
$
$ diskutil unmountDisk disk0s4

Submitting to not lose my comment, we'll see if it works by just re-copying over the old EFI fileI can still see my old root disk0s5, so hopefully I can figure out how to boot it from UEFI (I'm sure someone that knows UEFI could just boot it directly from the UEFI shell).

EDIT: Posting from NixOS again, with updated firmware, after a little work:

Mistakes from above:

  • I originally forgot to also restore the loader directory to EFI -- inserted this step above
  • Even with this step, the UUID for the EFI partition changed (duh), and my filesystem mounts are UUID based, so my boot process unfortunately failed (and I have a locked root account so was unable to drop into emergency mode)
  • I ended up booting from a rescue USB to fix the UUID, but I could probably have prevented this from being an issue if I had just used the nofail mount option for the EFI partition; others may consider switching into a configuration with this option set, because otherwise things went overall according to plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants