fi
}
-function remove_sysctl_file {
- if [ -e "$SYSCTL_FILE" ]
- then
- echo "delete $SYSCTL_FILE"
- rm -f "$SYSCTL_FILE"
- fi
-}
-
-function makesysctl {
- echo 'make new sysctl.conf file to change'
-
- remove_sysctl_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"
-}
-
function generate_tap_kext_cmd {
echo "cp -pR \"${TIZEN_PLATFORM_ETC_PATH}/emulator-ifup.sh\" /etc/" >> "$TMP_FILE"
echo "mkdir -p /Library/Extensions" >> $TMP_FILE
echo "/sbin/kextload /Library/Extensions/tap.kext" >> "$TMP_FILE"
}
-function generate_sysctl_cmd {
- if [ $OLD_SHMMAXSIZE -lt $NEW_SHMMAXSIZE ]
- then
- if [ -e "/etc/$SYSCTL_FILE" ]
- then
- makesysctl;
- 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"
- echo 'echo "Changing /etc/sysctl.conf file. (The original file will be removed to sysctl.conf.old)"' >> "$TMP_FILE"
- else
- makesysctl;
- echo "cp -f \"$SYSCTL_FILE\" /etc/." >> "$TMP_FILE"
- echo "sysctl -w kern.sysv.shmmax=$NEW_SHMMAXSIZE" >> "$TMP_FILE"
- echo 'echo "Make a new /etc/sysctl.conf file."' >> "$TMP_FILE"
- fi
- fi
-}
-
function generate_sudoer_cmd {
cat << 'EOF' >> $TMP_FILE
FILE=/etc/sudoers
}
function generate {
- generate_sysctl_cmd;
generate_tap_kext_cmd;
generate_sudoer_cmd;
}
function cleanup {
remove_tmp_file;
- remove_sysctl_file;
}
prepare;