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? #255

Open
rG2ee opened this issue Nov 28, 2024 · 3 comments
Open

how to update firmware? #255

rG2ee opened this issue Nov 28, 2024 · 3 comments

Comments

@rG2ee
Copy link

rG2ee commented Nov 28, 2024

From the iso configuration it says, that the firmware is not included in the iso (https://github.com/tpwrules/nixos-apple-silicon/blob/main/iso-configuration/installer-configuration.nix#L58).

Furthermore, the firmware should be included like

  hardware.asahi = {
    enable = true;
    ...
    peripheralFirmwareDirectory = ./firmware;
  };

The update section of the README (https://github.com/tpwrules/nixos-apple-silicon/blob/main/docs/uefi-standalone.md#nixos-updates) only mentions update of the related nix code, but does not mention the firmware.

From the installation docs it says:

Currently, the only supported way to update the peripheral firmware files is to destroy and re-create the EFI system partition, so they will not change unexpectedly. If you do not want the impurity of referencing them (or are using flakes where this is prohibited), copy them off the EFI system partition (e.g. on the installation ISO mkdir -p /mnt/etc/nixos/firmware && cp /mnt/boot/asahi/{all_firmware.tar.gz,kernelcache*} /mnt/etc/nixos/firmware) and specify this path in your configuration:
...

But how do I do that exactly? Is it even required? I'd like to understand the purpose of the firmware and the difference to the content in this repository.

I downloaded the iso and mounted it, but I do not see any firmware I can extract

oot]$ cd ..

[nix-shell:/tmp/asahi-bla]$ tree
.
├── boot
│   ├── efi.img
│   ├── grub
│   │   └── loopback.cfg
│   ├── Image
│   └── initrd
├── boot.catalog
├── EFI
│   ├── BOOT
│   │   ├── BOOTAA64.EFI
│   │   ├── efi-background.png
│   │   ├── grub.cfg
│   │   ├── grub-theme
│   │   │   ├── background.png
│   │   │   ├── boot_menu_c.png
│   │   │   ├── boot_menu_e.png
│   │   │   ├── boot_menu_ne.png
│   │   │   ├── boot_menu_n.png
│   │   │   ├── boot_menu_nw.png
│   │   │   ├── boot_menu_se.png
│   │   │   ├── boot_menu_s.png
│   │   │   ├── boot_menu_sw.png
│   │   │   ├── boot_menu_w.png
│   │   │   ├── dejavu.pf2
│   │   │   ├── fonts.sh
│   │   │   ├── icons
│   │   │   │   ├── build.sh
│   │   │   │   ├── copytoram.png
│   │   │   │   ├── copytoram.svg
│   │   │   │   ├── debug.png
│   │   │   │   ├── debug.svg
│   │   │   │   ├── hidpi.png
│   │   │   │   ├── hidpi.svg
│   │   │   │   ├── installer.png
│   │   │   │   ├── installer.svg
│   │   │   │   ├── nomodeset.png
│   │   │   │   ├── nomodeset.svg
│   │   │   │   ├── refind.png
│   │   │   │   ├── refind.svg
│   │   │   │   ├── settings.png
│   │   │   │   ├── settings.svg
│   │   │   │   ├── shutdown.png
│   │   │   │   └── shutdown.svg
│   │   │   ├── logo.png
│   │   │   ├── progress_bar_c.png
│   │   │   ├── progress_highlight_c.png
│   │   │   ├── select_c.png
│   │   │   ├── terminal_c.png
│   │   │   ├── terminal_e.png
│   │   │   ├── terminal_ne.png
│   │   │   ├── terminal_n.png
│   │   │   ├── terminal_nw.png
│   │   │   ├── terminal_se.png
│   │   │   ├── terminal_s.png
│   │   │   ├── terminal_sw.png
│   │   │   ├── terminal_w.png
│   │   │   └── theme.txt
│   │   ├── refind_aa64.efi
│   │   └── unicode.pf2
│   └── nixos-installer-image
├── nix-store.squashfs
└── version.txt

7 directories, 56 files

[nix-shell:/tmp/asahi-bla]$ B

Any help would be really appreciated.

@foldfree
Copy link

here: #121 (comment)

@rG2ee
Copy link
Author

rG2ee commented Dec 7, 2024

What's the purpose of the firmware and the difference to the code in this repository?

@foldfree
Copy link

foldfree commented Jan 1, 2025

The code in this repo interact with the firmware. The firmware is provided by Apple. Specifically in our context, the firmware get loaded in the preboot and duplicated in the m1n1 boot. It’s not that simple because some features like brightness relies on the preboot firmware. And others like hdmi on the m1n1 firmware. You update the pre-boot firmware automatically when you update macOS. But to update the m1n1 firmware, the only way is by destroying and reflashing the m1n1 partition.
That’s my understanding of it, I hope I did not say anything wrong.

You can have an introduction about apple silicon design on asahi’s wiki or look up the asahi linux subreddit with key words.
The way Apple design their machines seems to be substantially different from other computers.

My knowledge on the subject is limited, obviously, I can’t help much more but this kind of question is not specific to the nixos-apple-silicon project.
You’ll get better answers on reddit or the official asahi forum.

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

2 participants