All pastes #914222 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-22 18:44 UTC
rendered paste body
--- Generation of Apple TV Patchstick ---

 Created by Marook.
 Thanks to: MacTijn, Alan_Quatermain & ericIII
 Leopard remake by joda

-----------------------------------------

Are you sure you want to partition disk /dev/disk2? [yes|no]yes



 Partitioning /dev/disk2:
Started partitioning on disk disk2
Creating partition map
Formatting disk2s3 as Mac OS Extended with name Patchstick
Formatting disk2s2 as Mac OS Extended with name Patchstick-root
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ] 
Finished partitioning on disk disk2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *3.8 Gi     disk2
   1:                        EFI                         200.0 Mi   disk2s1
   2:                  Apple_HFS Patchstick-root         80.0 Mi    disk2s2
   3:                  Apple_HFS Patchstick              3.4 Gi     disk2s3
 Patitions done.
Creating System folders...
Copying System Extentions...
Copying System files...
Adding Kerberos...
Copying Patchstick files...
Changing Patchstick-root to Apple TV Mode...
Unmount of all volumes on disk2 was successful
/dev/disk2s1 removed
Unmount of all volumes on disk2 was successful
/dev/disk2s1 added
Unmount of all volumes on disk2 was successful

Your disk /dev/disk2 is now unmounted and ready to patch your AppleTV.
Enjoy... :-)

-----------------------------------

    start     size  index  contents
        0        1         PMBR
        1        1         Pri GPT header
        2       32         Pri GPT table
       34        6         
       40   409600      1  GPT part - 5265636F-7665-11AA-AA11-00306543ECAC
   409640   163840      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
   573480  7225264      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  7798744   262150         
  8060894       32         Sec GPT table
  8060926        1         Sec GPT header


disk_atv_mode() {
	echo "Changing Patchstick-root to Apple TV Mode..."
	START=$(gpt -r show $THEDISK | grep '1  GPT part' | awk '{print $1}')
	SIZE=$(gpt -r show $THEDISK | grep '1  GPT part' | awk '{print $2}')
	diskutil unmountDisk $THEDISK
	gpt remove -i 1 $THEDISK
	diskutil unmountDisk $THEDISK
	gpt add -b $START -s $SIZE -i 1 -t "5265636F-7665-11AA-AA11-00306543ECAC" $THEDISK
	diskutil unmountDisk $THEDISK
	echo
	echo "Your disk $THEDISK is now unmounted and ready to patch your AppleTV."
}