Jump to content











Photo
- - - - -

Boot to an x86 OS X Installer (e.g. Yosemite) from grub4dos

mac os x yosemite

  • Please log in to reply
3 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 20 December 2014 - 09:23 AM

I recently discovered that the HFS filesystem is quite easy to boot to from grub4dos, just by using chainloader.

You can make an image of an HFS partition using RMPrepUSB - Drive -> File.

 

To see how you can make a Yosemite OS X installer image which you can boot to via grub4dos, see my blog post here.

 

A simplified menu is:

title OS X Installer\n Boot from a partition image\n This uses partition 3 of the USB drive
set HFS=/OSX_Installer.HFSPTN

set E2BDEV=hd0
#enable parttype output
debug 1
parttype (%E2BDEV%,2) | set check=
debug off
set check=%check:~-5,4%
# make empty table entry in 3rd position in ptn table
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0 0 0
echo
if /i "%check%"=="0xAF" echo WARNING: MBR PARTITION 3 IS IN USE (Type AF = HFS partition)
set ask=
if /i "%check%"=="0xAF" echo && set /p ask=OK to delete the HFS partition 3 IN MBR? (Y/[N]) :
echo
echo
# if answer Y, make empty table entry in 3rd position in ptn table
if /i "%ask%"=="Y" partnew (%E2BDEV%,2) 0 0 0
debug 1
parttype (%E2BDEV%,2) | set check=
debug off
set check=%check:~-5,4%
if not "%check%"=="0x00" echo ERROR: MBR PARTITION 3 (%check%) IS ALREADY IN USE - cannot continue! && pause && configfile /menu.lst
errorcheck off
if "%check%"=="0x00" partnew (%E2BDEV%,2) 0xAF %HFS% || echo && echo -e ERROR: %HFS% is not contiguous or is BAD!\nPlease fix using RMPrepUSB-CTRL+F2. && pause Press a key... && configfile /menu.lst
rootnoverify (%E2BDEV%,2) > nul
chainloader (%E2BDEV%,2)+1 > nul
boot


#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13745 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 December 2014 - 11:22 AM

Sure :), though strictly speaking the HFS filesystem is not "touched" at all in that grub4dos menu.lst entry, which simply chainloads it's first sector.

 

:duff:

Wonko



#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 20 December 2014 - 11:25 AM

Yes, that is what surprised me. I don't think any 'fixups' were done to the HFS PBR as far as I can see by partnew and the HFS 'partition' ends up in a completely different place than where it was when the image was made - yet it still boots from the PBR just fine.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13745 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 December 2014 - 02:05 PM

Possibly they are using a "smarter" boot code than what we are used to in Windows, if you think at the change that happened between the /NT50 and the /NT60 bootsector code (the latter has no issues with geometry, while the former has it on FAT32 and NTFS) or with chainloading of BOOTMGR on logical volume inside extended (that doesn't really-really need the "sectors before correction") :

http://reboot.pro/to...s-also-logical/

it is very possible that the good MacIntosh guys did something even more "independent".

 

:duff:

Wonko







Also tagged with one or more of these keywords: mac, os x, yosemite

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users