]> git.zerfleddert.de Git - m1-debian/commitdiff
small perl script to reinstall m1n1 stage1
authorThomas Glanzmann <thomas@glanzmann.de>
Sun, 27 Mar 2022 20:14:15 +0000 (22:14 +0200)
committerThomas Glanzmann <thomas@glanzmann.de>
Sun, 27 Mar 2022 20:14:15 +0000 (22:14 +0200)
m1n1stage1.pl [new file with mode: 0644]

diff --git a/m1n1stage1.pl b/m1n1stage1.pl
new file mode 100644 (file)
index 0000000..422ec73
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+my $esp_line = `diskutil list disk0 | grep EFI`;
+
+my $esp_disk = undef;
+
+if ($esp_line =~ /(disk0s\d)/) {
+       $esp_disk = $1;
+}
+
+die unless defined $esp_disk;
+
+my $partuuid = `diskutil info $esp_disk | grep 'Partition UUID' | awk -F: '{print \$2}'`;
+
+$partuuid =~ s/\s+//g;
+
+my $m1n1 = `curl -sL tg.st/u/m1n1-rust.bin`;
+
+open(OBJECT, '>', 'object.bin') || die;
+print OBJECT $m1n1;
+print OBJECT "chainload=$partuuid;m1n1/boot.bin\n";
+print OBJECT "chosen.asahi,efi-system-partition=$partuuid\n";
+close (OBJECT);
+
+system('kmutil configure-boot -c object.bin --raw --entry-point 2048 --lowest-virtual-address 0 -v /Volumes/Debian');
Impressum, Datenschutz