From 8c9b56440b8da6a714d63a3df559f710c49e15bc Mon Sep 17 00:00:00 2001 From: "munkyu.im" Date: Mon, 29 Oct 2012 22:05:31 +0900 Subject: [PATCH] package: add install script for mac It contains shared memory setting Signed-off-by: Munkyu Im --- package/emulator-qemu-x86.install.macos-64 | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 package/emulator-qemu-x86.install.macos-64 diff --git a/package/emulator-qemu-x86.install.macos-64 b/package/emulator-qemu-x86.install.macos-64 new file mode 100755 index 0000000..ef88dec --- /dev/null +++ b/package/emulator-qemu-x86.install.macos-64 @@ -0,0 +1,63 @@ +#!/bin/sh + +TIZEN_SDK_INSTALL_PATH=`echo $INSTALLED_PATH` +SIZE=83886080 +SHMMAXSIZE=`sysctl -n kern.sysv.shmmax` +COCOASUDOPATH="./cocoasudo" +SYSCTL_FILE=sysctl.conf +if [ -z $TIZEN_SDK_INSTALL_PATH ] +then + echo "There is no TIZEN_SDK_PATH ENV" >> /tmp/emulator.log +# exit 2; +fi + +echo 'make sysctl.conf file' + +echo "kern.sysv.shmmax=83886080" >> $SYSCTL_FILE +echo "kern.sysv.shmmin=1" >> $SYSCTL_FILE +echo "kern.sysv.shmmni=128" >> $SYSCTL_FILE +echo "kern.sysv.shmseg=32" >> $SYSCTL_FILE +echo "kern.sysv.shmall=20480" >> $SYSCTL_FILE + +TIZEN_BIN_PATH=$TIZEN_SDK_INSTALLED_PATH/tools/emulator/bin +#TIZEN_BIN_PATH=./ +TMP_FILE=setshmmax.sh +NEW_SHMMAXSIZE=268435456 +if [ $SHMMAXSIZE -lt $SIZE ] +then + if [ -e /etc/$SYSCTL_FILE ] + then + echo "mv -f /etc/sysctl.conf /etc/sysctl.conf.old" >> $TMP_FILE + echo "cp -f ./$SYSCTL_FILE /etc/." >> $TMP_FILE + echo "sysctl -w kern.sysv.shmmax=$NEW_SHMMAXSIZE" >> $TMP_FILE + chmod +x $TMP_FILE + + $TIZEN_BIN_PATH/cocoasudo "--prompt=Changing /etc/sysctl.conf file requires that you type your password.(The original file will be removed to sysctl.conf.old)" sh -x ./$TMP_FILE + else + echo "cp -f ./$SYSCTL_FILE /etc/." >> $TMP_FILE + echo "sysctl -w kern.sysv.shmmax=$NEW_SHMMAXSIZE" >> $TMP_FILE + chmod +x $TMP_FILE + + $TIZEN_BIN_PATH/cocoasudo "--prompt=Make a new /etc/sysctl.conf file requires that you type your password." sh -x ./$TMP_FILE + fi +fi + +NEW_SHMMAXSIZE=`sysctl -n kern.sysv.shmmax` + +if [ -e $TMP_FILE ] +then + rm -f $TMP_FILE +fi + +if [ -e $SYSCTL_FILE ] +then + rm -f $SYSCTL_FILE +fi + +if [ ! $SHMMAXSIZE -eq $NEW_SHMMAXSIZE ] +then + + echo 'need reboot' + exit 99 +fi + -- 2.7.4