10 Mayıs 2012 Perşembe

Patched install.sh for Mac OS X Unlocker 1.0.2 (ESXi)


Patched install.sh for Mac OS X Unlocker 1.0.2 (ESXi)

I wanted to deploy a new OSX Lion 10.7.2 virtual machine this morning so thought I best first run the latest unlocker from : http://www.insanelymac.com/forum/index.php?showtopic=267296
I downloaded the unlocker, unzipped onto one of my datastores and tried to run it from one of my ESXi hosts:
/vmfs/volumes/9fe35ffc-47004197/unlock/esxi # ./install.sh 
VMware ESXi 5.0 Unlocker 1.0.1
==============================
Patching files...
Setting permissions...
Patching bin/vmx
open failed Permission denied
Damn- the error was coming from the Unlocker.ESXi application so I couldn’t peak at the code to see which file(s) were causing the permissions error. However, as we’re passing the newly patched files from bin/ I thought it was safe to assume these were the cause of the problem. I chmod 777 bin/* then ran ./Unlock.ESXi bin/ and the permission error had gone :)
I modified install.sh and ran again:
/vmfs/volumes/9fe35ffc-47004197/unlock/esxi # ./install.sh 
VMware ESXi 5.0 Unlocker 1.0.1
==============================
Patching files...
Patching bin/vmx
Patching bin/vmx-debug
Patching bin/vmx-stats
Setting permissions...
Creating darwin.tgz...
bin/
bin/vmx
bin/vmx-stats
bin/vmx-debug
Adding darwin.tgz to boot.cfg...
Acquiring lock /tmp/bootbank.lck
Copying darwin.tgz to /bootbank/darwin.tgz
Editing /bootbank/boot.cfg to add module darwin.tgz
sed: /bootbank/boot.cfg: No such file or directory
Editing /bootbank/boot.cfg failed: 1
Please now reboot the host system!
Doh! I’m not sure whether the missing boot.cfg is worrying or normal- but I went ahead and created an empty placeholder touch /bootbank/boot/cfg then ran the unlocker again:
/vmfs/volumes/9fe35ffc-47004197/unlock/esxi # ./install.sh 
VMware ESXi 5.0 Unlocker 1.0.1
==============================
Patching files...
Patching bin/vmx
Patching bin/vmx-debug
Patching bin/vmx-stats
Setting permissions...
Creating darwin.tgz...
bin/
bin/vmx
bin/vmx-debug
bin/vmx-stats
Adding darwin.tgz to boot.cfg...
Acquiring lock /tmp/bootbank.lck
Copying darwin.tgz to /bootbank/darwin.tgz
Editing /bootbank/boot.cfg to add module darwin.tgz
Please now reboot the host system!
Perfect :) I added the permissions fix and missing boot.cfg fix to the install.sh script- see the revised script below:
#!/bin/sh
set -e

echo VMware ESXi 5.0 Unlocker 1.0.2T
echo Modified by tickett.wordpress.com
echo =================================

# Ensure we only use unmodified commands
export PATH=/bin:/sbin:/usr/bin:/usr/sbin

# Make sure working files are removed
rm -f darwin.tgz
rm -rf ./bin

# Patch the vmx files and place into bin folder
echo Patching files...
rm -rf ./bin
mkdir bin
cp /bin/vmx bin/
cp /bin/vmx-debug bin/
cp /bin/vmx-stats bin/
## tickett: added to fix open failed Permission denied
chmod 777 bin/*
##
./Unlocker.ESXi bin/

# Ensure correct permissions are set
echo Setting permissions...
chmod 4555 bin/*

# Create the tar file for ESXi kernel
echo Creating darwin.tgz...
tar -czvf darwin.tgz bin/

# Add entry to the boot configuration file
echo Adding darwin.tgz to boot.cfg...
## tickett: added to fix error when boot.cfg missing
touch /bootbank/boot.cfg
##
BootModuleConfig.sh --add=darwin.tgz --verbose

# Clean up
rm -f darwin.tgz
rm -rf ./bin

echo Please now reboot the host system!
Alıntıdır 

Hiç yorum yok:

Yorum Gönder