Fedora Asahi Remix installieren

Der »Fedora Asahi Remix« ist eine für moderne Macs (Apple Silicon) optimierte Version von Fedora 39. Ich habe mich mit Asahi Linux ja schon vor rund zwei Jahren beschäftigt. Seither hat sich viel getan. Zeit also für einen neuen Versuch! Dieser Beitrag beschreibt die Installation des Fedora Asahi Remix auf einem Mac Mini mit M1-CPU. Demnächst möchte ich einen zweiten Artikel schreiben, der auf die Konfiguration eingeht und praktische Erfahrungen zusammenfasst.

Installationsstart

Die Projektseite von Asahi Linux empfiehlt, die Installation von Asahi Linux in einem Terminal wie folgt zu starten:

curl https://alx.sh | sh

Ich habe bei solchen Dingen immer etwas Bauchweh, zumal das Script sofort nach dem sudo-Passwort fragt. Was, wenn irgendjemand alx.sh gekapert hat und mir ein Script unterjubelt, das einen Trojaner installiert? Daher:

curl https://alx.sh -o alx.sh
less alx.sh
sh alx.sh 

Die Kontrolle hilft auch nur bedingt. Das Script ist nur wenige Zeilen lang und lädt alle erdenklichen weiteren Tools herunter. Aber der Code sieht zumindest so aus, als würde er tatsächlich Asahi Linux installieren, keine Malware. Eine echte Garantie, dass das alles gefahrlos ist, gibt auch less nicht. Nun gut …

Zuerst aufräumen

Auf meinem Mac fristet eine uralte Asahi-Installation schon seit Jahren ein Schattendasein. Ich wollte das neue Asahi Linux einfach darüber installieren — aber das Installationsprogramm bietet dazu keine Möglichkeit. Die richtige Vorgehensweise sieht so aus: Zuerst müssen die drei damals eingerichteten Partitionen gelöscht werden. Dann kann das Installationsprogramm den partitionsfreien Platz auf der SSD für eine Neuinstallation nutzen.

Dankenswerterweise hat Asahi-Chefentwickler Hector Martin auf einer eigenen Seite eine Menge Know-how zur macOS-Partitionierung zusammengefasst. Dort gibt es auch gleich ein Script, mit dem alte Asahi-Linux-Installationen entfernt werden können. Gesagt, getan!

curl -L https://github.com/AsahiLinux/asahi-installer/raw/main/tools/wipe-linux.sh -o wipe-linux.sh
less wipe-linux.sh
sh wipe-linux.sh

THIS SCRIPT IS DANGEROUS!
DO NOT BLINDLY RUN IT IF SOMEONE JUST SENT YOU HERE.
IT WILL INDISCRIMINATELY WIPE A BUNCH OF PARTITIONS
THAT MAY OR MAY NOT BE THE ONES YOU WANT TO WIPE.

You are much better off reading and understanding this guide:
https://github.com/AsahiLinux/docs/wiki/Partitioning-cheatsheet

Press enter twice if you really want to continue.
Press Control-C to exit.

Started APFS operation on disk1
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Unmounting Volume "Asahi Linux - Data" on disk1s1
Unmounting Volume "Asahi Linux" on disk1s2
Unmounting Volume "Preboot" on disk1s3
Unmounting Volume "Recovery" on disk1s4
Unmounting Volume "Update" on disk1s5
...

Bei meinem Test hat das Script exakt getan, was es soll. Ein kurzer Test mit diskutil zeigt, dass sich zwischen Partition 2 und 3 eine Lücke von rund 200 GiB befindet. Dort war vorher Asahi Linux, und dorthin soll das neue Asahi Linux wieder installiert werden.

Zurück an den Start

Nach diesen Vorbereitungsarbeiten (natürlich habe ich vorher auch ein Backup aller wichtiger Daten erstellt, eh klar …) habe ich den zweiten Versuch gestartet.

sh alx.sh 

Bootstrapping installer:
  Checking version...
  Version: v0.7.1
  Downloading...
  Extracting...
  Initializing...

The installer needs to run as root.
Please enter your sudo password if prompted.
Password:*******

Welcome to the Asahi Linux installer!

This installer will guide you through the process of setting up
Asahi Linux on your Mac.

Please make sure you are familiar with our documentation at:
  https://alx.sh/w

Press enter to continue.

Collecting system information...
  Product name: Mac mini (M1, 2020)
  SoC: Apple M1
  Device class: j274ap
  Product type: Macmini9,1
  Board ID: 0x22
  Chip ID: 0x8103
  System firmware: iBoot-10151.81.1
  Boot UUID: 284E...
  Boot VGID: 284E...
  Default boot VGID: 284E...
  Boot mode: macOS
  OS version: 14.3 (23D56)
  OS restore version: 23.4.56.0.0,0
  Main firmware version: 14.3 (23D56)
  No Fallback System Firmware / rOS
  SFR version: 23.4.56.0.0,0
  SystemRecovery version: 22.7.74.0.0,0 (13.5 22G74)
  Login user: kofler

Collecting partition information...
  System disk: disk0

Collecting OS information...

Nach der Darstellung einiger Infos ermittelt das Script eine Partitionstabelle und bietet dann an, Asahi Linux im freien Bereich der Disk zu installieren (Option f).

Partitions in system disk (disk0):
  1: APFS [Macintosh HD] (795.73 GB, 6 volumes)
    OS: [B*] [Macintosh HD] macOS v14.3 [disk3s1s1, 284E...]
  2: (free space: 198.93 GB)
  3: APFS (System Recovery) (5.37 GB, 2 volumes)
    OS: [  ] recoveryOS v14.3 [Primary recoveryOS]

  [B ] = Booted OS, [R ] = Booted recovery, [? ] = Unknown
  [ *] = Default boot volume

Using OS 'Macintosh HD' (disk3s1s1) for machine authentication.

Choose what to do:
  f: Install an OS into free space
  r: Resize an existing partition to make space for a new OS
  q: Quit without doing anything

» Action (f): f

Im nächsten Schritt haben Sie die Wahl zwischen verschiedenen Fedora-Varianten. Ich habe mich für Gnome entschieden:

Choose an OS to install:
  1: Fedora Asahi Remix 39 with KDE Plasma
  2: Fedora Asahi Remix 39 with GNOME
  3: Fedora Asahi Remix 39 Server
  4: Fedora Asahi Remix 39 Minimal
  5: UEFI environment only (m1n1 + U-Boot + ESP)

» OS: 2

Jetzt beginnt die eigentliche Installation. Leider haben Sie keine Möglichkeit, auf die Partitionierung oder Verschlüsselung Einfluss zu nehmen. Es werden zwei kleine Partitionen für /boot (500 MiB) und /boot/efi eingerichtet (1 GiB). Den restlichen Platz füllt ein btrfs-Dateisystem ohne Verschlüsselung. Immerhin können Sie bei Bedarf festlegen, dass nicht der gesamte partitionsfreie Platz von Fedora Asahi Linux genutzt wird.

Downloading OS package info...
- 

Minimum required space for this OS: 14.94 GB

Available free space: 198.93 GB

How much space should be allocated to the new OS?
  You can enter a size such as '1GB', a fraction such as '50%',
  the word 'min' for the smallest allowable size, or
  the word 'max' to use all available space.

» New OS size (max): max

The new OS will be allocated 198.93 GB of space,
leaving 167.94 KB of free space.

Enter a name for your OS
» OS name (Fedora Linux with GNOME):  <return>

Using macOS 13.5 for OS firmware
Downloading macOS OS package info...
Creating new stub macOS named Fedora Linux with GNOME
Installing stub macOS into disk0s5 (Fedora Linux with GNOME)
Preparing target volumes...
Checking volumes...
Beginning stub OS install...
Setting up System volume...
Setting up Data volume...
Setting up Preboot volume...
Setting up Recovery volume...
Wrapping up...

Stub OS installation complete.

Adding partition EFI (524.29 MB)...
  Formatting as FAT...
Adding partition Boot (1.07 GB)...
Adding partition Root (194.83 GB)...
Collecting firmware...
Installing OS...
  Copying from esp into disk0s4 partition...
  Copying firmware into disk0s4 partition...
  Extracting boot.img into disk0s7 partition...
  Extracting root.img into disk0s6 partition...
Downloading extra files...
  Downloading gstreamer1-plugin-openh264-1.22.1-1.fc39.aarch64.rpm (1/3)...
  Downloading mozilla-openh264-2.3.1-2.fc39.aarch64.rpm (2/3)...
  Downloading openh264-2.3.1-2.fc39.aarch64.rpm (3/3)...
Preparing to finish installation...
Collecting installer data... 

To continue the installation, you will need to enter your macOS
admin credentials.

Password for kofler: **********

Setting the new OS as the default boot volume...
Installation successful!
Install information:
  APFS VGID: 0E76...
  EFI PARTUUID: 8d47...

Help us improve Asahi Linux!
We'd love to know how many people are installing Asahi and on what
kind of hardware. Would you mind sending a one-time installation
report to us?

This will only report what kind of machine you have, the OS you're
installing, basic version info, and the rough install size.
No personally identifiable information (such as serial numbers,
specific partition sizes, etc.) is included. You can view the
exact data that will be sent.

Report your install?
  y: Yes
  n: No
  d: View the data that will be sent

» Choice (y/n/d): y

Your install has been counted. Thank you! ❤

Zuletzt zeigt das Installations-Script genaue Anweisungen für den ersten Start von Asahi Linux an:

To be able to boot your new OS, you will need to complete one more step.
Please read the following instructions carefully. Failure to do so
will leave your new installation in an unbootable state.

Press enter to continue.

When the system shuts down, follow these steps:

1. Wait 25 seconds for the system to fully shut down.
2. Press and hold down the power button to power on the system.
   * It is important that the system be fully powered off before this step,
     and that you press and hold down the button once, not multiple times.
     This is required to put the machine into the right mode.
3. Release it once you see 'Loading startup options...' or a spinner.
4. Wait for the volume list to appear.
5. Choose 'Fedora Linux with GNOME'.
6. You will briefly see a 'macOS Recovery' dialog.
   * If you are asked to 'Select a volume to recover',
     then choose your normal macOS volume and click Next.
     You may need to authenticate yourself with your macOS credentials.
7. Once the 'Asahi Linux installer' screen appears, follow the prompts.

If you end up in a bootloop or get a message telling you that macOS needs to
be reinstalled, that means you didn't follow the steps above properly.
Fully shut down your system without doing anything, and try again.
If in trouble, hold down the power button to boot, select macOS, run
this installer again, and choose the 'p' option to retry the process.

Press enter to shut down the system.

Ich habe den Installationsprozess auch in Screenshots dokumentiert:

Asahi-Linux, Teil 1

Asahi-Installation, Teil 2

Reboot

Das Script fährt nun macOS herunter. Zum Neustart drücken Sie die Power-Taste und halten diese ca. 15 Sekunden lang gedrückt, bis ein Auswahlmenü erscheint. Dort wählen Sie Asahi Linux. Dieses wird allerdings nicht gleich gestartet, vielmehr muss nun die Bootkonfiguration fertiggestellt werden. Ich habe die folgenden Schritte mit Fotos dokumentiert.

Fedora Linux auswählen
Bootloader Installation
Bootloader-Installation (Forts.)
Bootloader-Installation (Forts.)
Bootloader-Installation (Forts.)
Bootloader-Installation (Forts.)
Meldungen beim ersten »echten« Linux-Bootprozess. »Failed to load« klingt schlimm, aber unmittelbar danach geht es zum Glück weiter.
Geschafft! Jetzt muss nur noch die Fedora-Installation abgeschlossen werden.

Fedora-Installation abschließen

Fedora Linux läuft zum ersten Mal. Nun müssen Sie einige grundlegende Konfigurationsschritte erledigen (User-Name + Passwort, WLAN, Sprache, Tastaturlayout, Update).

Wechseln zwischen macOS und Fedora

Der Bootprozess ist jetzt so eingerichtet, dass bei jedem Neustart automatisch Fedora gestartet wird. Wenn Sie macOS verwenden möchten, müssen Sie den Rechner zuerst komplett herunterfahren. Dann drücken Sie wieder die Power-Taste, halten Sie ca. 15 Sekunden gedrückt, bis das OS-Menü erscheint, und wählen macOS.

Unter macOS können Sie das Default-OS voreinstellen. Es ist aber leider nicht möglich, den Mac so zu konfigurieren, dass bei jedem Bootprozess automatisch das Auswahlmenü erscheint. Sie müssen sich für eine Hauptvariante entscheiden. Jeder Bootprozess in ein anderes OS bleibt mühsam (Power-Taste 15 Sekunden drücken …).

Default-OS einstellen

Geekbench

Wie schnell ist Linux im Vergleich zu macOS? Ich habe auf meinem Mac Mini M1 Geekbench 6 jeweils unter macOS und unter Fedora Asahi ausgeführt. Das Ergebnis: im Rahmen der Messgenauigkeit etwa gleich schnell.

               Single     Multi Core
---------- ----------   ------------
macOS            2360           8050
Fedora           2357           7998

Quellen/Links