summaryrefslogtreecommitdiff
path: root/package/3.0-emulator-qemu-x86.remove.ubuntu-64
blob: 5728dc6ca131b45d657b3715203bed7cb8053371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/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 uninstalled."
	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=remove_tizen-init.sh
echo "#!/bin/bash -ex" >> ${TMP_FILE}
if [ "ubuntu" = "${OS_NAME}" ] ; then
	echo "update-rc.d -f tizen-kvm remove" >> ${TMP_FILE}
	echo "update-rc.d -f tizen-vhost-net remove" >> ${TMP_FILE}
fi
echo "rm -f /etc/init.d/tizen-kvm" >> ${TMP_FILE}
echo "rm -f /lib/udev/rules.d/45-tizen-kvm.rules" >> ${TMP_FILE}
echo "rm -f /etc/init.d/tizen-vhost-net" >> ${TMP_FILE}
echo "rm -f /lib/udev/rules.d/45-tizen-vhost-net.rules" >> ${TMP_FILE}

chmod +x ${TMP_FILE}

if [ "${TSUDO}" != "" ] # since installer v2.27
then
	TSUDO_MSG="Enter your password to remove /etc/init.d/tizen-kvm, /etc/init.d/tizen-vhost-net."
	TMP_PATH="`pwd`/${TMP_FILE}"
	$TSUDO -m "${TSUDO_MSG}" bash "${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}