Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
Okay, so it looks like Apple removed some Board ID's from boot.efi. There's now only 4 Macs in there:
MacBookPro10,1
MacBookPro10,2
MacBookPro11,1
MacPro6,1

Not sure why.
@w0lf I was going to change the script so it just changes the MBP10,1 ID instead but I don't know what I'm looking at. Maybe you could make it so that it just finds whatever the first Board ID is?

Updated to grab and replace first ID:

snip
 
Last edited:

Manic Harmonic

macrumors 6502
Original poster
Dec 4, 2011
299
1
Updated to grab and replace first ID:

Code:
#! /bin/bash

#####
#
#		Yosemite dark boot for unsupported machines
#		Created By	:	w0lf			
#		Last Edited	:	7/26/2014			
#		About		:	Adds your board ID to boot.efi to get new dark boot screen						
#			
#####

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 boot.efi hex\n"
	xxd -c 26 /System/Library/CoreServices/boot.efi /tmp/___boot.efi

	echo -e "Finding ID to replace\n"
	old_ID=$(grep -m 1 Mac-................ /tmp/___boot.efi)
	old_ID=$(echo "$old_ID" | sed 's/^.*Mac-/Mac-/')
	old_ID=${old_ID:0:20}

	echo -e "Your ID : $new_ID"
	echo -e "Old  ID : $old_ID\n"

	echo -e "Converting IDs hex\n"

	# New ID Conversion
	nhex_ID=$(echo -n $new_ID | xxd -ps | sed 's/[[:xdigit:]]\{2\}/\\x&/g')
	nhex_ID=$(echo "$nhex_ID" | sed 's/\\x//g')
	#nhex_ID=$(echo "$nhex_ID" | tr 'a-z' 'A-Z')
	while [[ ${#nhex_ID} -lt 40 ]]; do
		nhex_ID=${nhex_ID}0
	done
	nhex_ID=$(echo -e $nhex_ID | sed 's/..../& /g')
	echo -e "Your ID : $nhex_ID"

	# Old ID Conversion
	ohex_ID=$(echo -n $old_ID | xxd -ps | sed 's/[[:xdigit:]]\{2\}/\\x&/g')
	ohex_ID=$(echo "$ohex_ID" | sed 's/\\x//g')
	#ohex_ID=$(echo "$ohex_ID" | tr 'a-z' 'A-Z')
	while [[ ${#ohex_ID} -lt 40 ]]; do
		ohex_ID=${ohex_ID}0
	done
	ohex_ID=$(echo -e $ohex_ID | sed 's/..../& /g')
	echo -e "Old  ID : $ohex_ID\n"	

	echo -e "Editing boot.efi hex\n"
	if ! $(grep -q "$nhex_ID" /tmp/___boot.efi); then 
		echo -e "Your board ID couldn't be found in boot.efi"
		echo -e "Your board ID will now be added\n"
		sed -i -e "s|$ohex_ID|$nhex_ID|g" /tmp/___boot.efi
	else
		echo -e "Your board ID already exists in boot.efi"
		echo -e "Your board ID will now be removed\n"
		sed -i -e "s|$nhex_ID|4d61 632d 3335 4331 4538 3831 3430 4333 4536 4346|g" /tmp/___boot.efi
	fi
	
	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
	#rm /tmp/_boot.efi

	echo -e "Adjusting permissions and locking boot.efi\n"
	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.\n\n\n"
	sleep 1
	osascript -e 'tell app "loginwindow" to «event aevtrrst»'
}

clear
echo -e "Welcome\n"
new_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id)
new_ID=${new_ID##*<\"}
new_ID=${new_ID%%\">}
osx_ver=$(sw_vers -productVersion)
if [[ $osx_ver = "10.10" ]]; then
	if [[ ${#new_ID} -lt 21 ]]; then
		do_work
	fi
else
	echo -e "Sorry this only works on OSX 10.10 Yosemite\n"
fi

Thanks, I updated the OP with this one.
 

128keaton

macrumors 68020
Jan 13, 2013
2,029
418
I have a late 2011 MacBook Pro that it doesn't want to work on. I ran the script and rebooted twice, when the dialog came up and then again at the login prompt. Am I missing something?
 

Manic Harmonic

macrumors 6502
Original poster
Dec 4, 2011
299
1
I have a late 2011 MacBook Pro that it doesn't want to work on. I ran the script and rebooted twice, when the dialog came up and then again at the login prompt. Am I missing something?

can you verify that your board id is in the boot.efi?
 

nikkofsx

macrumors newbie
Jul 27, 2014
1
0
Weird string

I don't have much knowledge on this stuff.
The script didn't work on my MBP 2012 13" running PB1 :( I tried doing the manual procedure via Hex Fiend but i'm getting some weird strings on the right column. I though it was Hex Fiend's fault, so I looked up on the internet for an integer decoder, the results were worse XD
Any ideas???

UPDATE: My bad, I wasn't searching well on HexFiend, I hope I can get it done now :)

UPDATE 2: I could do it manually!!! I chose the board ID of the Macbookpro10,1; which is Mac-C3EC7CD22292981F.
 
Last edited:

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
Yes, I did it manually again just to make sure, but it doesn't want to work. I get the black shutdown image, but not the black startup image.

Do you have an external monitor or any other stuff attached to your computer?
 

mikecwest

macrumors 65816
Jul 7, 2013
1,188
493
Still not working for me, I tried twice...

I doubt this is the problem, but is it possible that changing the wifi card for 2012 card is the problem?
 

Manic Harmonic

macrumors 6502
Original poster
Dec 4, 2011
299
1
Still not working for me, I tried twice...

I doubt this is the problem, but is it possible that changing the wifi card for 2012 card is the problem?

No, that shouldn't be related at all. I wish I could help but I can't think of why it wouldn't be working, it seems like you did it correctly.
 

mragapigc

macrumors newbie
Jul 29, 2014
1
0
Panama
Yes, I did it manually again just to make sure, but it doesn't want to work. I get the black shutdown image, but not the black startup image.

same here. in my case. i did the install, fresh one in my late 2011 i7 13 Macbook Pro, I got the black shutdown screen. but grey on the startup.

let me check the treat complete so i can check my number

update. I run the automatic scrip as noted. but does not for me. I run the file, password, reset 2 times and nothing.
 
Last edited:

Don MC

macrumors member
Nov 25, 2010
98
49
Finland
same here. in my case. i did the install, fresh one in my late 2011 i7 13 Macbook Pro, I got the black shutdown screen. but grey on the startup.

let me check the treat complete so i can check my number

update. I run the automatic scrip as noted. but does not for me. I run the file, password, reset 2 times and nothing.
Does not work here either. I have a 2011 Mac Mini with 2 displays attached. Tried disconnecting them one after another, but to no effect.

Curiously, I get 2 different bootup screens depending if I do a 'cold boot' (from power off state) or a Restart. The progress bar switches displays! In a cold boot, it's on my secondary display. In a restart, it's on the primary. There are some differences to the progress bar's behavior as well.

Check these (shaky) videos:
Cold boot: https://www.youtube.com/watch?v=4PwernEVmwk
Restart: https://www.youtube.com/watch?v=cnPz3OQy6Ik

It's been like this all the time. Running the script from this thread does not matter.
 

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
Well my only advice would be to check that your ID was actually added by my script after running it.

Code:
var_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id);var_ID=${var_ID##*<\"};var_ID=${var_ID%%\">};grep -a $var_ID /System/Library/CoreServices/boot.efi || echo Not there

Running that will either return the line containing your ID or it will return "Not there".

I assume not all boot.efi files are the same? If that's the case it's possible my script doesn't work right for some.

If it is adding your ID but you're still not getting the black boot screen, I'm not sure there is any fix. Unplugging all external devices was what got it to work from me.
 

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
Okay I'm guessing people have been just running my script and not even checking if it's editing their boot.efi :eek:

So now the script lets you know if it worked or not.

Here's an updated version of the script that should be more robust, now it process the boot.efi file as one long string whereas before it was in chunks and in theory if every ID was split between chunks it wouldn't find any to replace.

Link: GDrive
Mirror: MediaFire

Changes:
*should work on any machine (maybe?)
*gives output post-run to let user know if it worked or not
*auto-restart changed to y/n prompt in terminal
*option to null your ID out

Code:
#! /bin/bash

#####
#
#		Yosemite dark boot for unsupported machines
#
#		Created By	:	w0lf			
#		Last Edited	:	7/30/2014			
#		About		:	Adds your board ID to boot.efi to get new dark boot screen.
#		Changes		:	Scans file as one string, should work on all machines now.
#					Warns users if ID is not found after script completion.								
#			
#####

do_work()
{
	echo -e "Now you'll need to enter your password for some sudo commands"
	echo -e "You won't see your password as you type it, just enter it and press return\n"
	sudo -v
	echo -e ""

	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 boot.efi hex\n"
	xxd -p /System/Library/CoreServices/boot.efi | tr -d '\n' > /tmp/___boot.efi

	echo -e "Finding ID to replace\n"
	ohex_ID=$(sed -e 's|^.*4d61632d|4d61632d|' /tmp/___boot.efi)
	ohex_ID=${ohex_ID:0:40}
	old_ID=$(echo -n $ohex_ID | xxd -r -ps)

	echo -e "Your ID : $new_ID"
	echo -e "Old  ID : $old_ID\n"

	echo -e "Converting ID to hex\n"
	nhex_ID=$(echo -n $new_ID | xxd -ps | sed 's|[[:xdigit:]]\{2\}|\\x&|g')
	nhex_ID=$(echo "$nhex_ID" | sed 's|\\x||g')
	while [[ ${#nhex_ID} -lt 40 ]]; do nhex_ID=${nhex_ID}0; done
	
	echo -e "Your ID : $nhex_ID"
	echo -e "Old  ID : $ohex_ID\n"	

	echo -e "Editing boot.efi hex\n"
	if ! $(grep -q "$nhex_ID" /tmp/___boot.efi); then 
		echo -e "Your board ID couldn't be found in boot.efi"
		echo -e "Your board ID will now be added\n"
		sed -i -e "s|$ohex_ID|$nhex_ID|g" /tmp/___boot.efi
	else
		a_test=true
		echo -e "Your board ID already exists in boot.efi"
		echo -n "Would you like to REMOVE your ID? (y/n): "	
		read rm_ID
		if [[ $rm_ID = "y" ]]; then
			echo -e "Your board ID will now be nulled\n"
			sed -i -e "s|$nhex_ID|4d61632d00000000000000000000000000000000|g" /tmp/___boot.efi
		else
			echo -e "Canceling..."
			rm /tmp/___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
			sleep 1
			exit
		fi
	fi
	
	perl -pe 'chomp if eof' /tmp/___boot.efi > /tmp/__boot.efi
	xxd -r -p /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
	#rm /tmp/_boot.efi

	echo -e "Adjusting permissions and locking boot.efi\n"
	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

	export LANG=C
	if $(cat /System/Library/CoreServices/boot.efi | tr -d '\n' | grep -q $new_ID); then
		echo -e "Success!"
		echo -e "Now all you need to do is reboot twice.\n"
		echo -n "Would you like to reboot now? (y/n): "	
		read rb_now
		if [[ $rb_now = "y" ]]; then sudo reboot; fi
	else
		if ($a_test); then
			echo -e "Your ID has been removed."
		else
			echo -e "Hmmm... something went wrong your ID is not in boot.efi\n"
			echo -e "Try adding it manually, you can find out how here:\n\n"
			echo -e "https://forums.macrumors.com/threads/1751446/\n"
		fi
	fi
}

clear
echo -e "Welcome\n"
a_test=false
new_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id)
new_ID=${new_ID##*<\"}
new_ID=${new_ID%%\">}
osx_ver=$(sw_vers -productVersion)
if [[ $osx_ver = "10.10" ]]; then
	if [[ ${#new_ID} -lt 21 ]]; then
		do_work
	fi
else
	echo -e "Sorry this only works on OSX 10.10 Yosemite\n"
fi

Please post if this works for you. So I know this actually works for other people. Thanks.

:cool:
 
Last edited:

Don MC

macrumors member
Nov 25, 2010
98
49
Finland
Okay I'm guessing people have been just running my script and not even checking if it's editing their boot.efi :eek:

Please post if this works for you. So I know this actually works for other people...
That's just what I've been doing. Didn't know how to check if the boot.efi was edited or not.

The latest script does edit the boot.efi and adds the board ID. But my bootscreen is still grey.
 

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
That's just what I've been doing. Didn't know how to check if the boot.efi was edited or not.

The latest script does edit the boot.efi and adds the board ID. But my bootscreen is still grey.

Try booting once with nothing but the power cord connected to your mini.

The second video you posted was exactly the same screen I was getting on my Macbook Pro with an external monitor hooked up. Booting with nothing connected fixed it for me (I imagine it would have worked by just unplugging the monitor but it was easier to just go all out).
 
Last edited:

Don MC

macrumors member
Nov 25, 2010
98
49
Finland
Try booting once with nothing but the power cord connected to your mini.
No dice. Tried resetting the PRAM as well. Your script also has an option to remove the ID, so I tried that too. And then after restarting I ran the script again. But no.
Maybe it just isn't supposed to work on this machine.

The first restart after running the script goes like my "Cold boot" video. Every subsequent restart goes just like the "Restart" video.
Cold boots naturally go like the "Cold boot" video.

I thank you for your kind efforts. I'm not devastated by this. It's just a freakin' boot screen. But maybe some other users would like it to be working.



The second video you posted was exactly the same screen I was getting on my Macbook Pro with an external monitor hooked up. Booting with nothing connected fixed it for me (I imagine it would have worked by just unplugging the monitor but it was easier to just go all out).
Unplugging the external monitor from your MBP still leaves one monitor hooked up; the built-in one. Maybe it requires one display of a certain kind to be connected. Neither of my displays are Apple products (they're HP).
 

mikecwest

macrumors 65816
Jul 7, 2013
1,188
493
I tried again, and again, on two different partitions... finally, it just started working....I didn't do anything different this time around...
 

floyd-pinkerton

macrumors newbie
Mar 11, 2013
21
0
Not sure if this is helpful or been covered but I couldn't get this working on the PB1, tried at least 2 versions of your script. But when I switched to the DP5 last night I ran it again and it worked first time. Thank you!
 

mattjohnson78

macrumors member
Aug 6, 2014
71
4
Southern California
Old Background on Login

I did everything correctly and have the black screen on start up but when I get to the login screen I have an old background showing with a translucent layer over top of it. How can i get rid of the old login background and have just a black background.

Before it was grey startup screen with a grey login screen.

Edited: I believe I found the problem. Had to change permissions and then background.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.