X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/m1-debian/blobdiff_plain/e744bd6b1e053a3ad80a79176fecc1a335177cb6..f70867a08ae93f412faf85c9d36761abc57dd93f:/m1di.pl?ds=sidebyside diff --git a/m1di.pl b/m1di.pl index af5aef9..1d86c68 100644 --- a/m1di.pl +++ b/m1di.pl @@ -1,5 +1,14 @@ #!/usr/bin/perl +# SPDX-License-Identifier: MIT + +# Todo: +# Create an exclude identifier list of all Apple volumes and build a safetey check +# Detect if the paritions already exist and offer to reinstall system +# Let the use pick between u-boot and untethered m1n1 +# Check that there is at least 1.5 GB space +# Make sure that there is only one free region + use strict; my ($identifier, $size); @@ -29,6 +38,8 @@ find_identifier_before_free_space return ($identifier, $size); } +die "This script must be run as root\n" if ($< != 0); + ($identifier, $size) = find_identifier_before_free_space(); system("diskutil addPartition $identifier %EFI% LB 512MB"); @@ -46,10 +57,10 @@ system("newfs_msdos /dev/$identifier"); system("mkdir -p /Volumes/efi"); system("mount -t msdos /dev/$identifier /Volumes/efi"); chdir('/Volumes/efi'); -system('mkdir -p /Volumes/efi/efi/boot'); -system('curl -Lo /Volumes/efi/efi/boot/bootaa64.efi https://tg.st/u/grubaa64.efi'); +system('curl -sL https://tg.st/u/efi.tgz | tar -xz'); system('curl -sL tg.st/u/fwx.sh | bash'); -system('cp /tmp/linux-firmware.tar /Volumes/efi/'); +system('mkdir -p /Volumes/efi/vendorfw'); +system('cp /tmp/linux-firmware.tar /Volumes/efi/vendorfw/firmware.tar'); chdir('/var/root'); system('umount /Volumes/efi');