Try my new version of the script.
Download Link :
MediaFire
Interestingly enough as of Beta 3 my external monitor started to boot with a black screen with a grey rectangle in the middle and the old grey progress bar and it would also shut down with a black screen.
So going off a hunch I unplugged everything from my Macbook pro and restarted. With that reboot it started booting with the black boot screen. I've plugged everything back in now and it boots with the black screen every time now
😀.
Subsequently I stayed up until like 1AM adjusting my script to work for both 8char and 16char machines (as well as any number in between). Couldn't get sed to insert null characters
😡 so had to read the whole boot.efi as hex convert the board ID to hex pad that with 0s if it was too short and then substitute.
Code:
do_work()
{
echo -e "Now you'll need to enter your password for some sudo commands\n"
sudo -v
echo -e "\n"
echo -e "Unlocking boot.efi"
sudo chflags nouchg /System/Library/CoreServices/boot.efi
cur_time=$(date +%y%m%d%H%M%S)
echo -e "Backing up boot.efi to ~/Desktop/boot${cur_time}.efi"
sudo cp /System/Library/CoreServices/boot.efi ~/Desktop/boot${cur_time}.efi
echo -e "Getting ID hex"
hexedID=$(echo -n $var_ID | xxd -ps | sed 's/[[:xdigit:]]\{2\}/\\x&/g')
hexedID=$(echo "$hexedID" | sed 's/\\x//g')
hexedID=$(echo "$hexedID" | tr 'a-z' 'A-Z')
while [[ ${#hexedID} -lt 40 ]]; do
hexedID=${hexedID}0
done
hexedID=$(echo -e $hexedID | sed 's/..../& /g')
echo -e "Getting boot.efi hex"
xxd -c 26 /System/Library/CoreServices/boot.efi /tmp/___boot.efi
echo -e "Editing boot.efi hex"
sed -i -e "s|4d61 632d 3335 4331 4538 3831 3430 4333 4536 4346|$hexedID|g" /tmp/___boot.efi
perl -pe 'chomp if eof' /tmp/___boot.efi > /tmp/__boot.efi
xxd -r -c 26 /tmp/__boot.efi /tmp/_boot.efi
echo -e "Replacing boot.efi and cleaning up /tmp"
sudo mv /tmp/_boot.efi /System/Library/CoreServices/boot.efi
rm /tmp/___boot.efi-e
rm /tmp/___boot.efi
rm /tmp/__boot.efi
echo -e "Adjusting permissions and locking boot.efi"
sudo chmod 644 /System/Library/CoreServices/boot.efi
sudo chown root:wheel /System/Library/CoreServices/boot.efi
sudo chflags uchg /System/Library/CoreServices/boot.efi
echo -e "Done!\n\nNow all you need to do is reboot twice."
sleep 1
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
}
clear
echo -e "Welcome\n"
var_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id)
var_ID=${var_ID##*<\"}
var_ID=${var_ID%%\">}
echo -e "Your ID : $var_ID\nOld ID : Mac-35C1E88140C3E6CF\n"
if [[ ${#var_ID} -lt 21 ]]; then
do_work
fi
Image