aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2011-06-10 10:54:28 +0300
committerFilipp Lepalaan <filipp@mac.com>2011-06-10 10:54:28 +0300
commit50de98d5c364c429dbf67379f774535efad2f319 (patch)
tree6d17f0a6ed195d15387627f79d105a15501c96bb
parent6eff099c73db8d293a9e0e433f66bcfddee7ee3f (diff)
downloadmtk-50de98d5c364c429dbf67379f774535efad2f319.tar.gz
mtk-50de98d5c364c429dbf67379f774535efad2f319.tar.bz2
mtk-50de98d5c364c429dbf67379f774535efad2f319.zip
fixed asd2nbHEADmaster
-rw-r--r--asd2nb/asdbless.sh25
-rw-r--r--asd2nb/server.php12
2 files changed, 19 insertions, 18 deletions
diff --git a/asd2nb/asdbless.sh b/asd2nb/asdbless.sh
index e18d170..efd4065 100644
--- a/asd2nb/asdbless.sh
+++ b/asd2nb/asdbless.sh
@@ -6,13 +6,8 @@
SERVER_IP=192.168.1.10 # The IP of the NetBoot server
SERVER_URL="http://example.com/mtk/asd2nb/server.php" # URL of the server-side script
-NBI_PATH=/data/nb # Path to the ASD image repository
-ASD_ROOT=/asd #
-
-if [[ ! -d "${NBI_PATH}" ]]; then
- echo "Path ${NBI_PATH} does not exist" 2>&1
- exit 1
-fi
+NBI_PATH="/data/nb" # Path to the ASD image repository
+ASD_ROOT="/asd" #
MODEL=$(/usr/sbin/sysctl -n hw.model)
MACHINE=$(/usr/sbin/sysctl -n hw.machine)
@@ -26,11 +21,17 @@ fi
ASD=$(echo $RESULT | awk 'BEGIN { FS = "/" } ; { print $1 }')
DMG=$(echo $RESULT | awk 'BEGIN { FS = "/" } ; { print $2 }')
-/usr/sbin/bless --netboot \
- --booter tftp://${SERVER_IP}${ASD_ROOT}/${ASD}/${MACHINE}/booter \
- --kernel tftp://${SERVER_IP}${ASD_ROOT}/${ASD}/${MACHINE}/mach.macosx \
- --options "rp=nfs:${SERVER_IP}:${NBI_PATH}:${ASD_ROOT}/${RESULT}" \
- --nextonly
+if [[ $1 != "efi" ]]; then
+ /usr/sbin/bless --netboot \
+ --booter tftp://${SERVER_IP}${ASD_ROOT}/${ASD}/${MACHINE}/booter \
+ --kernel tftp://${SERVER_IP}${ASD_ROOT}/${ASD}/${MACHINE}/mach.macosx \
+ --options "rp=nfs:${SERVER_IP}:${NBI_PATH}:${ASD_ROOT}/${RESULT}" \
+ --nextonly
+else
+ /usr/sbin/bless --netboot \
+ --booter tftp://${SERVER_IP}${ASD_ROOT}/${ASD}/efi/boot.efi \
+ --nextonly
+fi
echo "Boot volume set to ${ASD}"
exit 0
diff --git a/asd2nb/server.php b/asd2nb/server.php
index 26aaf1a..365364c 100644
--- a/asd2nb/server.php
+++ b/asd2nb/server.php
@@ -8,18 +8,18 @@
* @package mtk
*/
+ $imgdir = '/data/nb/asd'; // edit this to where your NBI's are kept
+
+ require "plist.php";
+
header('Content-Type: text/plain');
-
+
if (!isset($_REQUEST['m'])) {
exit("Sorry, have to know who you are first...");
}
-
- $imgdir = '/data/nb/asd'; // edit this
-
+
$model = $_REQUEST['m'];
- require "plist.php";
-
foreach(glob("${imgdir}/*.nbi") as $nbi)
{
$p = new PropertyList("{$nbi}/NBImageInfo.plist");