#!/bin/bash -ex TIZEN_KVM_SCRIPT="/etc/init.d/tizen-kvm-multi" if [ -f ${TIZEN_KVM_SCRIPT} ] then echo "tizen-kvm-multi does exist. tizen-kvm does not need to be installed." exit 0; fi TIZEN_SDK_INSTALL_PATH=`echo ${INSTALLED_PATH}` if [ -z ${TIZEN_SDK_INSTALL_PATH} ] then # echo "There is no TIZEN_SDK_PATH ENV" >> /tmp/emulator.log exit 2; fi LSB_RELEASE=`which lsb_release` if [ "${LSB_RELEASE}" = "" ]; then if [ -e /etc/os-release ]; then OS_NAME=`cat /etc/os-release | grep ID | head -n 1 | awk -F= '{print $2}'` fi # TODO: Detect other linux distributions. else OS_NAME=`lsb_release --id --short` fi if [ ! -z "${OS_NAME}" ]; then OS_NAME=`echo ${OS_NAME} | tr '[:upper:]' '[:lower:]'` fi echo "Linux Distribution: ${OS_NAME}" TMP_FILE=init_tizen-kvm.sh echo "#!/bin/bash -ex" >> ${TMP_FILE} echo "cp ${TIZEN_SDK_INSTALL_PATH}/tools/emulator/etc/tizen-kvm /etc/init.d/" >> ${TMP_FILE} echo "cp ${TIZEN_SDK_INSTALL_PATH}/tools/emulator/etc/45-tizen-kvm.rules /lib/udev/rules.d/" >> ${TMP_FILE} echo "/etc/init.d/tizen-kvm start" >> ${TMP_FILE} if [ "ubuntu" = "${OS_NAME}" ] ; then echo "update-rc.d tizen-kvm defaults" >> ${TMP_FILE} fi chmod +x ${TMP_FILE} if [ "${TSUDO}" != "" ] # since installer v2.27 then TSUDO_MSG="Enter your password to enable kvm module if your machine supports hardware virtualization." TMP_PATH="`pwd`/${TMP_FILE}" ${TSUDO} -m "${TSUDO_MSG}" sh ${TMP_PATH} else GKSUDO=`which gksudo` if [ "${GKSUDO}" = "" ] then echo "there is no gksudo." sudo ./${TMP_FILE} else gksudo ./${TMP_FILE} fi fi rm ${TMP_FILE}