From 1cee07b4944a3bc814d6bfaa464bc7857b39969e Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Wed, 9 Feb 2022 08:19:37 +0100 Subject: [PATCH] get rid of old pmdi --- m1di.pl | 2 ++ pmdi.pl | 71 --------------------------------------------------------- 2 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 pmdi.pl diff --git a/m1di.pl b/m1di.pl index 106ab17..ca9f749 100644 --- a/m1di.pl +++ b/m1di.pl @@ -1,5 +1,7 @@ #!/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 diff --git a/pmdi.pl b/pmdi.pl deleted file mode 100644 index 12884d4..0000000 --- a/pmdi.pl +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl - -# SPDX-License-Identifier: MIT - -use strict; - -my ($identifier, $size); - -sub -find_identifier_before_free_space -{ - my $identifier = undef; - my $size = undef; - - for my $line (`diskutil list /dev/disk0`) { - - if ($line =~ /^\s+\(free space\)\s+(\d+.\d GB)/) { - $size = $1; - $size =~ s/\s+//g; - last; - } - - if ($line =~ /(disk0s\d)$/) { - $identifier = $1; - } - } - - die if not defined $identifier; - die if not defined $size; - - return ($identifier, $size); -} - -($identifier, $size) = find_identifier_before_free_space(); -system("diskutil addPartition $identifier %EFI% LB 512MB"); - -$identifier = undef; - -for my $line (`diskutil list /dev/disk0`) { - if ($line =~ /EFI.*(disk0s\d)/) { - $identifier = $1; - } -} - -die if not defined $identifier; - -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 tg.st/u/fwx.sh | bash'); -system('cp /tmp/linux-firmware.tar /Volumes/efi/'); -chdir('/var/root'); -system('umount /Volumes/efi'); - -($identifier, $size) = find_identifier_before_free_space(); -system("diskutil addPartition $identifier %Linux% %noformat% $size"); - -$identifier = undef; - -for my $line (`diskutil list /dev/disk0`) { - if ($line =~ /Linux Filesystem.*(disk0s\d)/) { - $identifier = $1; - } -} - -die if not defined $identifier; - -system("curl -L https://tg.st/u/m1.tgz | tar -xOz | dd of=/dev/$identifier bs=8m"); -- 2.39.5