From 42ba9b40d81a605012ec806374b4797fdd389c72 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 27 Mar 2022 22:14:15 +0200 Subject: [PATCH 1/1] small perl script to reinstall m1n1 stage1 --- m1n1stage1.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 m1n1stage1.pl diff --git a/m1n1stage1.pl b/m1n1stage1.pl new file mode 100644 index 0000000..422ec73 --- /dev/null +++ b/m1n1stage1.pl @@ -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'); -- 2.39.5