--- /dev/null
+YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+DaiYoung Kim <daiyoung777.kim@samsung.com>
+SeokYeon Hwang <syeon.hwang@samsung.com>
+SangJin Kim <sangjin3.kim@samsung.com>
+KiTae Kim <kt920.kim@samsung.com>
+JinHyung Jo <jinhyung.jo@samsung.com>
+SungMin Ha <sungmin82.ha@samsung.com>
+MunKyu Im <munkyu.im@samsung.com>
+JiHye Kim <jihye1128.kim@samsung.com>
+GiWoong Kim <giwoong.kim@samsung.com>
+SooYoung Ha <yoosah.ha@samsnung.com>
+HyunGoo Kang <hyungoo1.kang@samsung.com>
+
--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+ Apache License\r
+ Version 2.0, January 2004\r
+ http://www.apache.org/licenses/\r
+\r
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+ 1. Definitions.\r
+\r
+ "License" shall mean the terms and conditions for use, reproduction,\r
+ and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+ "Licensor" shall mean the copyright owner or entity authorized by\r
+ the copyright owner that is granting the License.\r
+\r
+ "Legal Entity" shall mean the union of the acting entity and all\r
+ other entities that control, are controlled by, or are under common\r
+ control with that entity. For the purposes of this definition,\r
+ "control" means (i) the power, direct or indirect, to cause the\r
+ direction or management of such entity, whether by contract or\r
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+ outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+ "You" (or "Your") shall mean an individual or Legal Entity\r
+ exercising permissions granted by this License.\r
+\r
+ "Source" form shall mean the preferred form for making modifications,\r
+ including but not limited to software source code, documentation\r
+ source, and configuration files.\r
+\r
+ "Object" form shall mean any form resulting from mechanical\r
+ transformation or translation of a Source form, including but\r
+ not limited to compiled object code, generated documentation,\r
+ and conversions to other media types.\r
+\r
+ "Work" shall mean the work of authorship, whether in Source or\r
+ Object form, made available under the License, as indicated by a\r
+ copyright notice that is included in or attached to the work\r
+ (an example is provided in the Appendix below).\r
+\r
+ "Derivative Works" shall mean any work, whether in Source or Object\r
+ form, that is based on (or derived from) the Work and for which the\r
+ editorial revisions, annotations, elaborations, or other modifications\r
+ represent, as a whole, an original work of authorship. For the purposes\r
+ of this License, Derivative Works shall not include works that remain\r
+ separable from, or merely link (or bind by name) to the interfaces of,\r
+ the Work and Derivative Works thereof.\r
+\r
+ "Contribution" shall mean any work of authorship, including\r
+ the original version of the Work and any modifications or additions\r
+ to that Work or Derivative Works thereof, that is intentionally\r
+ submitted to Licensor for inclusion in the Work by the copyright owner\r
+ or by an individual or Legal Entity authorized to submit on behalf of\r
+ the copyright owner. For the purposes of this definition, "submitted"\r
+ means any form of electronic, verbal, or written communication sent\r
+ to the Licensor or its representatives, including but not limited to\r
+ communication on electronic mailing lists, source code control systems,\r
+ and issue tracking systems that are managed by, or on behalf of, the\r
+ Licensor for the purpose of discussing and improving the Work, but\r
+ excluding communication that is conspicuously marked or otherwise\r
+ designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+ "Contributor" shall mean Licensor and any individual or Legal Entity\r
+ on behalf of whom a Contribution has been received by Licensor and\r
+ subsequently incorporated within the Work.\r
+\r
+ 2. Grant of Copyright License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ copyright license to reproduce, prepare Derivative Works of,\r
+ publicly display, publicly perform, sublicense, and distribute the\r
+ Work and such Derivative Works in Source or Object form.\r
+\r
+ 3. Grant of Patent License. Subject to the terms and conditions of\r
+ this License, each Contributor hereby grants to You a perpetual,\r
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+ (except as stated in this section) patent license to make, have made,\r
+ use, offer to sell, sell, import, and otherwise transfer the Work,\r
+ where such license applies only to those patent claims licensable\r
+ by such Contributor that are necessarily infringed by their\r
+ Contribution(s) alone or by combination of their Contribution(s)\r
+ with the Work to which such Contribution(s) was submitted. If You\r
+ institute patent litigation against any entity (including a\r
+ cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+ or a Contribution incorporated within the Work constitutes direct\r
+ or contributory patent infringement, then any patent licenses\r
+ granted to You under this License for that Work shall terminate\r
+ as of the date such litigation is filed.\r
+\r
+ 4. Redistribution. You may reproduce and distribute copies of the\r
+ Work or Derivative Works thereof in any medium, with or without\r
+ modifications, and in Source or Object form, provided that You\r
+ meet the following conditions:\r
+\r
+ (a) You must give any other recipients of the Work or\r
+ Derivative Works a copy of this License; and\r
+\r
+ (b) You must cause any modified files to carry prominent notices\r
+ stating that You changed the files; and\r
+\r
+ (c) You must retain, in the Source form of any Derivative Works\r
+ that You distribute, all copyright, patent, trademark, and\r
+ attribution notices from the Source form of the Work,\r
+ excluding those notices that do not pertain to any part of\r
+ the Derivative Works; and\r
+\r
+ (d) If the Work includes a "NOTICE" text file as part of its\r
+ distribution, then any Derivative Works that You distribute must\r
+ include a readable copy of the attribution notices contained\r
+ within such NOTICE file, excluding those notices that do not\r
+ pertain to any part of the Derivative Works, in at least one\r
+ of the following places: within a NOTICE text file distributed\r
+ as part of the Derivative Works; within the Source form or\r
+ documentation, if provided along with the Derivative Works; or,\r
+ within a display generated by the Derivative Works, if and\r
+ wherever such third-party notices normally appear. The contents\r
+ of the NOTICE file are for informational purposes only and\r
+ do not modify the License. You may add Your own attribution\r
+ notices within Derivative Works that You distribute, alongside\r
+ or as an addendum to the NOTICE text from the Work, provided\r
+ that such additional attribution notices cannot be construed\r
+ as modifying the License.\r
+\r
+ You may add Your own copyright statement to Your modifications and\r
+ may provide additional or different license terms and conditions\r
+ for use, reproduction, or distribution of Your modifications, or\r
+ for any such Derivative Works as a whole, provided Your use,\r
+ reproduction, and distribution of the Work otherwise complies with\r
+ the conditions stated in this License.\r
+\r
+ 5. Submission of Contributions. Unless You explicitly state otherwise,\r
+ any Contribution intentionally submitted for inclusion in the Work\r
+ by You to the Licensor shall be under the terms and conditions of\r
+ this License, without any additional terms or conditions.\r
+ Notwithstanding the above, nothing herein shall supersede or modify\r
+ the terms of any separate license agreement you may have executed\r
+ with Licensor regarding such Contributions.\r
+\r
+ 6. Trademarks. This License does not grant permission to use the trade\r
+ names, trademarks, service marks, or product names of the Licensor,\r
+ except as required for reasonable and customary use in describing the\r
+ origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+ 7. Disclaimer of Warranty. Unless required by applicable law or\r
+ agreed to in writing, Licensor provides the Work (and each\r
+ Contributor provides its Contributions) on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+ implied, including, without limitation, any warranties or conditions\r
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+ PARTICULAR PURPOSE. You are solely responsible for determining the\r
+ appropriateness of using or redistributing the Work and assume any\r
+ risks associated with Your exercise of permissions under this License.\r
+\r
+ 8. Limitation of Liability. In no event and under no legal theory,\r
+ whether in tort (including negligence), contract, or otherwise,\r
+ unless required by applicable law (such as deliberate and grossly\r
+ negligent acts) or agreed to in writing, shall any Contributor be\r
+ liable to You for damages, including any direct, indirect, special,\r
+ incidental, or consequential damages of any character arising as a\r
+ result of this License or out of the use or inability to use the\r
+ Work (including but not limited to damages for loss of goodwill,\r
+ work stoppage, computer failure or malfunction, or any and all\r
+ other commercial damages or losses), even if such Contributor\r
+ has been advised of the possibility of such damages.\r
+\r
+ 9. Accepting Warranty or Additional Liability. While redistributing\r
+ the Work or Derivative Works thereof, You may choose to offer,\r
+ and charge a fee for, acceptance of support, warranty, indemnity,\r
+ or other liability obligations and/or rights consistent with this\r
+ License. However, in accepting such obligations, You may act only\r
+ on Your own behalf and on Your sole responsibility, not on behalf\r
+ of any other Contributor, and only if You agree to indemnify,\r
+ defend, and hold each Contributor harmless for any liability\r
+ incurred by, or claims asserted against, such Contributor by reason\r
+ of your accepting any such warranty or additional liability.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ APPENDIX: How to apply the Apache License to your work.\r
+\r
+ To apply the Apache License to your work, attach the following\r
+ boilerplate notice, with the fields enclosed by brackets "[]"\r
+ replaced with your own identifying information. (Don't include\r
+ the brackets!) The text should be enclosed in the appropriate\r
+ comment syntax for the file format. We also recommend that a\r
+ file or class name and description of purpose be included on the\r
+ same "printed page" as the copyright notice for easier\r
+ identification within third-party archives.\r
+\r
+ Copyright [yyyy] [name of copyright owner]\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+\r
+\r
--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
--- /dev/null
+#!/bin/sh
+#
+# Copyright 2010
+# Read the file COPYING
+#
+# Authors: Yeongil Jang
+#
+# Copyright Samsung Electronics
+#
+FOTA_CONFIG_FILE="/sys/devices/platform/s3c_samsung_fota/samsung_fota_config"
+FUS_CONFIG_FILE="/sys/devices/platform/s3c_samsung_fota/samsung_fus_config"
+UPDATE_CONFIG_FILE="/sys/devices/platform/s3c_samsung_fota/samsung_update_config"
+RTL_CONFIG_FILE="/sys/devices/platform/s3c_samsung_fota/samsung_rtl_config"
+
+# print help message
+do_help()
+{
+ cat >&2 <<EOF
+change-booting-mode: usage:
+ -?/--help this message
+ --fota reboot for fota update
+ --fus reboot for fus update
+ --fus_binary reboot for fus binary update
+ --update reboot for developer update
+ --rtl reboot for rtl mode
+ --fota_disable remove fota update flag
+ --fus_disable remove fus update flag
+ --fus_binary_disable remove fus binary update flag
+ --update_disable remove for developer update flag
+ --rtl_disable remove rtl test flag
+EOF
+}
+
+# get and check specified options
+do_options()
+{
+ # note: default settings have already been loaded
+
+ while [ "$#" -ne 0 ]
+ do
+ arg=`printf %s $1 | awk -F= '{print $1}'`
+ val=`printf %s $1 | awk -F= '{print $2}'`
+ shift
+ if test -z "$val"; then
+ local possibleval=$1
+ printf %s $1 "$possibleval" | grep ^- >/dev/null 2>&1
+ if test "$?" != "0"; then
+ val=$possibleval
+ if [ "$#" -ge 1 ]; then
+ shift
+ fi
+ fi
+ fi
+
+ case "$arg" in
+
+ --fota)
+ echo "Setting fota update mode" >&2
+ echo fota_enable > $FOTA_CONFIG_FILE
+ /bin/fw_setenv SLP_FLAG_FOTA 1
+ /bin/fw_setenv SLP_FOTA_PATH $val
+ ;;
+ --fus)
+ echo "Setting fus update mode" >&2
+ echo fus_enable > $FUS_CONFIG_FILE
+ /bin/fw_setenv SLP_FLAG_FUS 1
+ echo "kill mtp-ui, data-router" >> /opt/var/log/fus_update.log 2>&1
+ killall mtp-ui >> /opt/var/log/fus_update.log 2>&1
+ killall data-router >> /opt/var/log/fus_update.log 2>&1
+ umount /dev/gadget >> /opt/var/log/fus_update.log 2>&1
+ lsmod >> /opt/var/log/fus_update.log 2>&1
+ rmmod g_samsung >> /opt/var/log/fus_update.log 2>&1
+ ;;
+ --fus_binary)
+ echo "Setting fus binary update mode" >&2
+ echo fus_enable > $FUS_CONFIG_FILE
+ /bin/fw_setenv SLP_FLAG_FUS 2
+ /bin/fw_setenv SLP_FUS_PATH $val
+# echo "kill mtp-ui, data-router" >> /opt/var/log/fus_update.log 2>&1
+# killall mtp-ui >> /opt/var/log/fus_update.log 2>&1
+# killall data-router >> /opt/var/log/fus_update.log 2>&1
+# umount /dev/gadget >> /opt/var/log/fus_update.log 2>&1
+# lsmod >> /opt/var/log/fus_update.log 2>&1
+# rmmod g_samsung >> /opt/var/log/fus_update.log 2>&1
+ ;;
+ --update)
+ echo "Setting update mode for engineers" >&2
+ echo 0 > /sys/power/always_resume
+# touch /opt/etc/.hib_capturing # make fastboot image again on next booting
+ mount -o remount,rw /
+ exit
+ ;;
+ --rtl)
+ echo "Setting rtl mode" >&2
+ echo rtl_enable > $RTL_CONFIG_FILE
+ /bin/fw_setenv SLP_FLAG_RTL 1
+ ;;
+ --fota_disable)
+ echo "Clear fota update flag" >&2
+ /bin/fw_setenv SLP_FLAG_FOTA 0
+ ;;
+ --fus_disable)
+ echo "Clear fus update flag" >&2
+ /bin/fw_setenv SLP_FLAG_FUS 0
+ ;;
+ --fus_binary_disable)
+ echo "Clear fus binary update flag" >&2
+ /bin/fw_setenv SLP_FLAG_FUS 0
+ ;;
+ --update_disable)
+ echo "Clear engineer update flag" >&2
+ /bin/fw_setenv SLP_FLAG_UPDATE 0
+ ;;
+ --rtl_disable)
+ echo "Clear rtl test flag" >&2
+ /bin/fw_setenv SLP_FLAG_RTL 0
+ ;;
+
+ -?|--help)
+ do_help
+ exit 0
+ ;;
+ *)
+ echo "Unknown option \"$arg\". See --help" >&2
+ do_help
+ exit 0
+ ;;
+ esac
+ done
+}
+
+## main
+
+if test -z "$1"; then
+ do_help
+ exit 0
+fi
+
+do_options $@
+reboot
--- /dev/null
+/bin/busybox
\ No newline at end of file
--- /dev/null
+/bin/busybox
\ No newline at end of file
--- /dev/null
+/bin/busybox
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+#
+# ubimnt.sh : mount ubifs volume on directory
+# ubifs [ubi_vol_name] [mnt pos] [force]
+# ubi_vol_name : volume name
+# mnt_pos : mount directory
+# force : if failed print error and stop
+#
+# ex) ./ubifs csa /csa -f
+#
+if [ $# -lt 2 ];then
+ echo "$0 Error : no volume name or mount directory"
+ echo "ex) $0 modem /modem"
+ exit 1
+fi
+
+_volname=$1
+_mntpos=$2
+_force=$3
+
+_kernelver=$(uname -r)
+_modpath="/lib/modules/${_kernelver}"
+_ubisysfs="/sys/class/ubi"
+_winpower="/sys/devices/platform/s3cfb/win_power"
+_vtcon="/sys/class/vtconsole/vtcon1"
+_vt_insmod="font softcursor bitblit fbcon"
+_vt_rmmod="fbcon bitblit softcursor font"
+_fbcondev="/dev/tty1"
+_stdcon="/dev/console"
+_condev="${_stdcon}"
+
+_mtdname=$(grep ${_volname} /proc/mtd | cut -d : -f 1)
+_mtdnum=${_mtdname#mtd}
+
+fbcon_open() {
+ for i in `echo ${_vt_insmod}`
+ do
+ if [ ! -f "${_modpath}/${i}.ko" ];then
+ _condev=${_stdcon}
+ return 1
+ fi
+ insmod ${_modpath}/${i}.ko >/dev/null 2>&1
+ done
+ echo 0 1 > ${_winpower}
+ echo 3 0 > ${_winpower}
+
+ _condev="${_fbcondev}"
+}
+
+fbcon_close() {
+ if [ ! -f "${_vtcon}/bind" ];then
+ echo "FB console is not opened"
+ return 1
+ fi
+
+ echo 0 > ${_vtcon}/bind
+ echo 3 1 > ${_winpower}
+ echo 0 0 > ${_winpower}
+ for i in `echo ${_vt_rmmod}`
+ do
+ rmmod ${i} >/dev/null 2>&1
+ done
+ _condev=${_stdcon}
+}
+
+put_error1() {
+ echo -e "\n\nFATAL !!! Can't mount ${_volname} partition." >${_condev}
+ echo -e " Please contact sh0130.kim(010-8820-2960) or anyone in kernel part.\n\n" >${_condev}
+}
+
+put_error2() {
+ echo -e "\n\nFATAL !! Can't make ${_volname} volume in ${_ubidev}." >${_condev}
+ echo -e " Please contact sh0130.kim(010-8820-2960) or anyone in kernel part." >${_condev}
+}
+
+############################
+# Main
+############################
+
+# Check volume exists.
+_ubidev=$(grep ${_volname} $(find ${_ubisysfs} -name name)|cut -d "/" -f 5)
+
+if [ -z "${_ubidev}" ];then
+
+ if [ -z "${_force}" ]; then
+ exit 0
+ fi
+
+ fbcon_open
+
+ echo -e "\n\nWARNNING !!! ${_volname} partition is not exists." >${_condev}
+
+ # Check if failed on csa. CSA may need to initialize.
+ if [ "${_volname}" == "csa" ];then
+ echo -e " Initilize ${_volname} forcibly despite of not in manufacturing process, you may loose your data (eg, IMEI)." >${_condev}
+ echo -e "\nErase anyway? [y/N] " >${_condev}
+ read _answer; _answer=$(echo ${_answer} | tr a-z A-Z)
+
+ if [ "${_answer}" == "Y" ];then
+
+ /bin/ubidetach -p /dev/${_mtdname}
+
+ /bin/ubiformat -y /dev/${_mtdname}
+ if [ $? -ne 0 ]; then
+ echo -e "\nubiformat error\n" >${_condev}
+ put_error2
+ exit 1
+ fi
+
+ /bin/ubiattach -p /dev/${_mtdname}
+ if [ $? -ne 0 ]; then
+ echo -e "\nubiattach error\n" >${_condev}
+ put_error2
+ exit 1
+ fi
+
+ _ubidev=$(grep "^${_mtdnum}$" $(find ${_ubisysfs} -name mtd_num)|cut -d / -f 5)
+ _devmajor=$(cat ${_ubisysfs}/${_ubidev}/dev|cut -d : -f 1)
+
+ echo -e "\t$ /bin/mknod /dev/${_ubidev} c ${_devmajor} 0"
+ /bin/mknod /dev/${_ubidev} c ${_devmajor} 0
+
+ echo -e "\t$ /bin/ubimkvol /dev/${_ubidev} -m -N ${_volname}"
+ /bin/ubimkvol /dev/${_ubidev} -m -N ${_volname}
+
+ if [ $? -ne 0 ]; then
+ put_error2
+ exit 1
+ fi
+ else
+ put_error1
+ exit 1
+ fi
+ else
+ put_error1
+ exit 1
+ fi
+
+ fbcon_close
+
+ _ubidev=$(grep ${_volname} $(find ${_ubisysfs} -name name)|cut -d "/" -f 5)
+fi
+
+# Check if mounted already
+_mounted_already=$(grep "${_ubidev}!${_volname} ${_mntpos}" /etc/mtab)
+if [ -n "${_mounted_already}" ];then
+ echo -e "\nWARNNING !!! ${_volname} partition seems to be mounted already.\n"
+ exit 0
+fi
+
+# Mount it.
+mount -t ubifs -o bulk_read,no_chk_data_crc ${_ubidev}!${_volname} ${_mntpos}
+if [ $? -ne 0 ]; then
+ fbcon_open
+ put_error1
+ exit 1
+fi
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+_csa_part=`mount | grep csa | awk '{print $3}'`
+_bak_path="/opt/system/csa"
+_bak_end="$_bak_path/.backup_end"
+_log_file="$_bak_path/.log"
+_src_stamp="$_csa_part/.backup_stamp"
+
+chk_must_have () {
+ _must_have="$_csa_part/nv/nvdata.bin"
+
+ for file in $_must_have; do
+ if [ ! -e $file ]; then
+ return 1
+ fi
+ done
+ return 0
+}
+
+do_backup () {
+ # wait for making nv data
+ sleep 60
+ for i in 10 20 30; do
+ chk_must_have
+ if [ $? -eq 0 ]; then
+ break
+ fi
+ sleep $i
+ done
+
+ chk_must_have
+ if [ $? -ne 0 ]; then
+ echo "$file does not exist." >> $_log_file
+ date >> $_log_file
+ exit 1
+ fi
+
+ cp -rf $_csa_part ${_bak_path%/csa}
+ echo "Success CSA backup!!!"
+ echo "Success CSA backup!!!" > $_log_file
+ date >> $_log_file
+ touch $_src_stamp
+ sync
+ mount | grep csa > $_bak_end
+}
+
+do_restore () {
+ if [ "z$_bak_path" == "z" ]; then
+ mkdir -p $_bak_path
+ echo "Failed to restore CSA, no backup data" >> $_log_file
+ date >> $_log_file
+ exit 1
+ fi
+
+ _csa_dev=`mount | grep csa | awk '{print $1}'`
+ if [ $_csa_dev ]; then
+ # CSA partition is mounted but we don't trust it. Clean up
+ umount $_csa_part
+ if [ -e $_csa_dev ]; then
+ dd if=/dev/zero of=$_csa_dev bs=1024 count=1024
+ fi
+ fi
+ # format and mount csa partition
+ /usr/bin/mount_slp.sh -f csa
+ cp -rf $_bak_path ${_csa_part%csa}
+
+ echo "Success to restore CSA"
+ echo "Success to restore CSA" >> $_log_file
+ date >> $_log_file
+ touch $_src_stamp
+ sync
+}
+
+do_mount () {
+ if [ "z$_csa_part" == "z" ]; then
+ /usr/bin/mount_slp.sh -f csa
+ _csa_part=`mount | grep csa | awk '{print $3}'`
+ _src_stamp="$_csa_part/.backup_stamp"
+
+ chk_must_have
+ if [[ "$?" == "0" && -e $_src_stamp ]]; then
+ echo "CSA is mounted and seems normal."
+ echo "Don't restore CSA"
+ echo "[modem power on]"
+ echo on > /sys/devices/platform/modemctl/exec_util
+ else
+ do_restore
+ echo "[modem power on]"
+ echo on > /sys/devices/platform/modemctl/exec_util
+ exit 1
+ fi
+
+ else
+ echo "CSA is already mounted.."
+ mount | grep csa
+ fi
+}
+
+do_start () {
+ mkdir -p $_bak_path
+ if [ ! -e $_bak_path ]; then
+ echo "There is no available backup dir, $_bak_path"
+ exit 1
+ fi
+
+ if [ ! -e "$_bak_end" ]; then
+ $0 backup &
+ fi
+}
+
+case "$1" in
+ start)
+ do_start
+ ;;
+ backup)
+ do_backup
+ ;;
+ restore)
+ do_restore
+ ;;
+ mount)
+ do_mount
+ ;;
+ *)
+ echo "Usage: $0 start | backup | restore | mount"
+esac
+
+exit 0
+
--- /dev/null
+#System startup
+si::sysinit:/etc/rc.d/rc.sysinit
+net::once:/etc/rc.d/rc.network
+
+id:1:initdefault:
+
+# Console
+#ttyS0::respawn:/bin/sh
+#con:12345:respawn:/sbin/agetty ttyS0 115200 vt100
+#::askfirst:/bin/sh
+
+#Logging , move to rc.sysinit
+#::sysinit:/bin/cp -rf /var/log/messages /var/log/messages.prev
+#::sysinit:/bin/cp -rf /var/log/messages.0 /var/log/messages.0.prev
+#::sysinit:/bin/touch /var/log/messages
+#::once:/sbin/syslogd
+#::once:/sbin/klogd
+
+#System shutdown
+#ca:12345:ctrlaltdel:/sbin/reboot
+bye:06:wait:/etc/rc.d/rc.shutdown
+rebt:6:wait:/sbin/reboot -d -f -i
+
+# Frambuffer Console
+#ttyS1::respawn:/bin/sh
+#tty1::respawn:/bin/sh
+#tty2::respawn:/bin/sh
--- /dev/null
+audio 0:5 0666
+console 0:5 0600
+controlC[0-9] 0:0 0660 @cp -R /dev/$MDEV /dev/snd/
+dsp 0:5 0666
+event[0-9] 0:0 0600
+fb 0:5 0666
+nfs 0:5 0770
+null 0:0 0777
+pcmC[0-1]D[0-9][a-z] 0:0 0660 @mv /dev/$MDEV /dev/snd/
+timer 0:0 0660 @mv /dev/$MDEV /dev/snd/
+rtc 0:0 0666
+tty 0:5 0660
+tty0* 0:5 0660
+tty1* 0:5 0660
+tty2* 0:5 0660
+tty3* 0:5 0660
+tty4* 0:5 0660
+tty5* 0:5 0660
+tty6* 0:5 0660
+ttyS* 0:5 0640
+urandom 0:0 0444
+zero 0:0 0666
--- /dev/null
+# Example mtools.conf files. Uncomment the lines which correspond to
+# your architecture and comment out the "SAMPLE FILE" line below
+# SAMPLE FILE
+
+# # Linux floppy drives
+# drive a: file="/dev/fd0" exclusive
+# drive b: file="/dev/fd1" exclusive
+
+# # First SCSI hard disk partition
+# drive c: file="/dev/sda1"
+
+# # First IDE hard disk partition
+# drive c: file="/dev/hda1"
+
+# # dosemu floppy image
+# drive m: file="/var/lib/dosemu/diskimage"
+
+# # dosemu hdimage
+# drive n: file="/var/lib/dosemu/diskimage" offset=3840
+
+# # Atari ramdisk image
+# drive o: file="/tmp/atari_rd" offset=136
+
+# # ZIP disk for Solaris:
+# Drive X is ZIP-100 at target 5
+# drive X: file="/dev/rdsk/c0t5d0s2" partition=4 scsi=1 nodelay
+
+# # ZIP disk for SunOS:
+# # Zip drive is at target 5, which default kernel calls tape st1 !!
+# drive Y: file="/dev/rsd5c" partition=4 scsi=1 nodelay
+
+# # autoselect zip drive/floppy on HP-UX 9/10
+# drive a: file="/dev/rdsk/c201d5" exclusive partition=4
+# drive a: file="/dev/rdsk/c201d5s0" exclusive partition=4
+# drive a: file="/dev/rfloppy/c201d0s0" exclusive
+
+# A/UX target 5 on 1st scsi bus jaz or zip
+# drive X: file="/dev/rdsk/c105d0s31" partition=4
+
+
+# Some examples for BeOS.
+# floppy drive. hardcoded in devices.c, so no real need to define it here
+#drive a: file="/dev/floppy_disk" exclusive
+# ZIP drive on SCSI ID 6
+#drive z: file="/dev/scsi_disk_060" offset=16384 fat_bits=16
+
+# SCO Unix 3.2v4
+# # Floppy disk drives
+#
+# drive a: file="/dev/install" exclusive
+# drive b: file="/dev/install1" exclusive
+#
+# # SCSI hard disk partitions
+#
+# drive c: file="/dev/dsk/0sC"
+# drive d: file="/dev/dsk/0sD"
+# drive e: file="/dev/dsk/0sE"
+drive f: file="/dev/mmcblk0p1"
+# drive g: file="/dev/dsk/0sG"
+# drive h: file="/dev/dsk/0sH"
+
+mtools_skip_check=1
+
+# # uncomment the following line to display all file names in lower
+# # case by default
+# mtools_lower_case=1
--- /dev/null
+#!/bin/sh
+
+# Create state directory for sshd(8)
+mkdir -p /opt/var/empty
--- /dev/null
+# Supposedly used by menu-screen
+export LAUNCHER_ENGINE=x11
--- /dev/null
+#!/bin/sh
+if grep -q "http_proxy=" /proc/cmdline ; then
+ __proxy=`sed 's/^.*http_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ echo -e "[Export environment variable: http_proxy=${__proxy}]"
+ export "http_proxy=${__proxy}"
+fi
+if grep -q "https_proxy=" /proc/cmdline ; then
+ __proxy=`sed 's/^.*https_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ echo -e "[Export environment variable: https_proxy=${__proxy}]"
+ export "https_proxy=${__proxy}"
+fi
+if grep -q "ftp_proxy=" /proc/cmdline ; then
+ __proxy=`sed 's/^.*ftp_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ echo -e "[Export environment variable: ftp_proxy=${__proxy}]"
+ export "ftp_proxy=${__proxy}"
+fi
+if grep -q "socks_proxy=" /proc/cmdline ; then
+ __proxy=`sed 's/^.*socks_proxy=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ echo -e "[Export environment variable: socks_proxy=${__proxy}]"
+ export "socks_proxy=${__proxy}"
+fi
+if grep -q "dns1=" /proc/cmdline ; then
+ __dns1=`sed 's/^.*dns1=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ rm -rf /etc/resolv.conf
+ echo "nameserver ${__dns1}" >> /etc/resolv.conf
+fi
+if grep -q "dns2=" /proc/cmdline ; then
+ __dns2=`sed 's/^.*dns2=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ echo "nameserver ${__dns2}" >> /etc/resolv.conf
+fi
+if grep -q "sdb_port=" /proc/cmdline ; then
+ __sdb_port=`sed 's/^.*sdb_port=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ rm -rf /opt/home/sdb_port.txt
+ echo "${__sdb_port}" >> /opt/home/sdb_port.txt
+fi
--- /dev/null
+#!/bin/sh
+
+CHECK_SENSOR="/opt/sensor"
+CHECK_ACCEL="/opt/sensor/accel"
+CHECK_LIGHT="/opt/sensor/light"
+CHECK_PROXI="/opt/sensor/proxi"
+CHECK_GEO="/opt/sensor/geo"
+CHECK_GYRO="/opt/sensor/gyro"
+CHECK_NFC="/opt/nfc"
+CHECK_NFC_FILE="/opt/nfc/sdkMsg"
+
+if [ ! -d $CHECK_SENSOR ]; then
+ mkdir /opt/sensor
+
+ if [ ! -d $CHECK_ACCEL ]; then
+ mkdir /opt/sensor/accel
+ fi
+
+ if [ ! -d $CHECK_LIGHT ]; then
+ mkdir /opt/sensor/light
+ fi
+
+ if [ ! -d $CHECK_PROXI ]; then
+ mkdir /opt/sensor/proxi
+ fi
+
+ if [ ! -d $CHECK_GEO ]; then
+ mkdir /opt/sensor/geo
+ fi
+
+ if [ ! -d $CHECK_GYRO ]; then
+ mkdir /opt/sensor/gyro
+ fi
+
+ touch /opt/sensor/accel/name
+ echo "accel_sim" > /opt/sensor/accel/name
+ touch /opt/sensor/accel/xyz
+ echo "0, 980665, 0" > /opt/sensor/accel/xyz
+
+ touch /opt/sensor/light/name
+ echo "light_sim" > /opt/sensor/light/name
+ touch /opt/sensor/light/adc
+ echo "65535" > /opt/sensor/light/adc
+ touch /opt/sensor/light/level
+ echo "10" > /opt/sensor/light/level
+
+ touch /opt/sensor/proxi/name
+ echo "proxi_sim" > /opt/sensor/proxi/name
+ touch /opt/sensor/proxi/enable
+ echo "1" > /opt/sensor/proxi/enable
+ touch /opt/sensor/proxi/vo
+ echo "8" > /opt/sensor/proxi/vo
+
+ touch /opt/sensor/gyro/name
+ echo "gyro_sim" > /opt/sensor/gyro/name
+ touch /opt/sensor/gyro/gyro_x_raw
+ echo "0" > /opt/sensor/gyro/gyro_x_raw
+ touch /opt/sensor/gyro/gyro_y_raw
+ echo "0" > /opt/sensor/gyro/gyro_y_raw
+ touch /opt/sensor/gyro/gyro_z_raw
+ echo "0" > /opt/sensor/gyro/gyro_z_raw
+
+ touch /opt/sensor/geo/name
+ echo "geo_sim" > /opt/sensor/geo/name
+ touch /opt/sensor/geo/raw
+ echo "0 -90 0 3" > /opt/sensor/geo/raw
+ touch /opt/sensor/geo/tesla
+ echo "1 0 -10" > /opt/sensor/geo/tesla
+else
+ echo "0, 980665, 0" > /opt/sensor/accel/xyz
+ echo "65535" > /opt/sensor/light/adc
+ echo "10" > /opt/sensor/light/level
+ echo "1" > /opt/sensor/proxi/enable
+ echo "8" > /opt/sensor/proxi/vo
+ echo "0" > /opt/sensor/gyro/gyro_x_raw
+ echo "0" > /opt/sensor/gyro/gyro_y_raw
+ echo "0" > /opt/sensor/gyro/gyro_z_raw
+ echo "0 -90 0 3" > /opt/sensor/geo/raw
+ echo "1 0 -10" > /opt/sensor/geo/tesla
+fi
+
+if [ ! -d $CHECK_NFC ]; then
+ mkdir /opt/nfc
+ touch /opt/nfc/sdkMsg
+else
+ if [ ! -f $CHECK_NFC_FILE ]; then
+ touch /opt/nfc/sdkMsg
+ fi
+fi
+
--- /dev/null
+export TSLIB_TSDEVICE=/dev/input/touchscreen0
+export KEY_DEVICE=/dev/input/event0
+export TSLIB_CONFFILE=/usr/etc/ts.conf
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:./lib:/opt/lib
+export PATH=$PATH:/sbin:/usr/sbin:/opt/bin
+export TSLIB_CALIBFILE=/usr/etc/pointercal
+export ELM_FONT_PATH=/usr/share/SLP/fonts:/usr/share/SLP/licensed_fonts:/usr/share/fonts/truetype/ttf-bitstream-vera
+export FONTNAME=HelveN_Asia
--- /dev/null
+#!/bin/sh
+
+. /etc/virtgl.sh
+# yagl init script should be modified to old symlink mode, not a LD_LIBRARY_PATH mode.
+#. /etc/yagl.sh
--- /dev/null
+
+export PWROFF_DUR=3
--- /dev/null
+#!/bin/sh
+
+amixer cset name='Master Playback Switch' 1
+amixer cset name='Master Playback Volume' 50
+amixer cset name='PCM Playback Switch' 1
+amixer cset name='PCM Playback Volume' 50
--- /dev/null
+#!/bin/sh
+
+# Color set for ANSI TERM
+_R='\033[0;31;1m' #Red
+_G='\033[0;32;1m' #Green
+_Y='\033[0;33;1m' #Yellow
+C_='\033[0m' #Color off
+
+echo -e "[${_G}rc.emul : script start ${C_}]"
+
+echo -e "[${_G}sshd start ${C_}]"
+/etc/init.d/ssh start
+
+echo -e "[${_G}chmod +x /opt/media for various apps ${C_}]"
+chmod -R 777 /opt/media
+
+echo -e "[${_G}make symbolic link ${C_}]"
+ln -sf /mnt/mmc /sdcard
+ln -sf /proc/mounts /etc/mtab
+
+echo -e "[${_G}Setting power manager state value ${C_}]"
+/usr/bin/vconftool set -t int memory/pm/state 1 -f
+
+echo -e "[${_G}Initialize battery level ${C_}]"
+#/usr/bin/vconftool set -t int memory/Battery/Level 5 -f
+/usr/bin/vconftool set -t int memory/sysman/battery_status_low 4 -f
+
+#echo -e "[${_G}Mount SD card ${C_}]"
+#mount -o umask=000 /dev/mmcblk0 /mnt/mmc
+#chmod 777 /opt/storage/sdcard
+
+#MMC_MOUNT=`/bin/mount | grep mmc`
+#if [ -n "$MMC_MOUNT" ]; then
+# echo -e "[${_G}MMC storage detected ${C_}]"
+# /usr/bin/vconftool set -t memory/sysman/mmc 1 -f
+# /usr/bin/vconftool set -t int memory/filemanager/Mmc 2 -f
+#fi
+
+echo -e "[${_G}Mount host directory${C_}]"
+test -d "/mnt/host" || mkdir "/mnt/host"
+if grep "cifs=" /proc/cmdline ; then
+ cifs=`sed 's/^.*cifs=\([^, ]*\).*$/\1/g' /proc/cmdline`
+ opts=`sed 's/^.*cifs=\([^, ]*\),username=\([^, ]*\),password=\([^, ]*\).*$/username=\2,password=\3/g' /proc/cmdline`
+ cifs=`echo $cifs | tr [a-z] [A-Z]`
+ if mount -t cifs //10.0.2.2/$cifs /mnt/host -o $opts,file_mode=0777,dir_mode=0777; then
+ echo -e "[${_Y}Mount.cifs succeed${C_}]"
+ else
+ echo -e "[${_R}Mount.cifs fail!!!!${C_}]"
+ fi
+fi
+if grep "virtio-9p" /proc/cmdline ; then
+ if mount -t 9p -o trans=virtio fileshare /mnt/host -oversion=9p2000.L -o msize=65536; then
+ echo -e "[${_Y}Mount.9pfs succeed${C_}]"
+ else
+ echo -e "[${_R}Mount.9pfs fail!!!!${C_}]"
+ fi
+fi
+
+if grep -q "enable_cam" /proc/cmdline ; then
+ if grep -q "enable_cam=1" /proc/cmdline ; then
+ echo -e "[${_Y}Webcam is connected. We can use '/dev/video0' for camera.${C_}]"
+ else
+ echo -e "[${_Y}Webcam is not connected! We will remove '/dev/video0'.${C_}]"
+ rm -rf /dev/video0
+ fi
+fi
+
+echo -e "[${_G}to generate modules.dep and map files${C_}]"
+depmod -a
+
+#--move to rc3.d/S30brgihtness
+#echo -e "[${_G}to change brightness's group${C_}]"
+#chgrp system_bklight /sys/class/backlight/emulator/brightness
+#chmod g+w /sys/class/backlight/emulator/brightness
+
+#echo -e "[${_G}to change lcd_power's group${C_}]"
+#chown -R root:system_bklight /sys/devices/virtual/lcd/emulator/lcd_power
+#--
+
+echo -e "[${_G}Initialize display setting value${C_}]"
+##/usr/bin/vconftool set -t int db/setting/Brightness "24" -f
+/usr/bin/vconftool set -t int db/sysman/lcd_backlight_normal "600" -f
+
+echo -e "[${_G}For menu_screen booting..${C_}]"
+/usr/bin/vconftool set -t int memory/startapps/sequence 1 -f
+
+echo -e "[${_G}rc.emul : script end ${C_}]"
--- /dev/null
+#!/bin/sh
+
+/sbin/ldconfig
+
+if [ -e /opt/system/csc/.factoryreset ]; then
+ rm -f /opt/system/csc/.factoryreset
+fi
--- /dev/null
+export DISPLAY=:0
+killall power_manager
+killall -9 udevd
+#killall -9 system_server
+killall -9 xinit
+
+rm -rf /tmp/vip/*
+rm -rf /tmp/permanent/*
+
+echo "Run Shutdown animation..."
+nice -n -15 /usr/bin/boot-animation --offmsg " " &
+sleep 1
+
+echo "Stopping menu screen..."
+killall -9 menu_screen
+
+echo "Stopping all applications..."
+/usr/bin/enter_deepsleep
+
+echo "Stopping indicator..."
+killall -9 indicator
+
+value=1
+while [&value != "0"];
+do
+ value='vconftool get memory/boot_animation/finished | awk '{print $4}''
+ sleep 0.5
+done
+sleep 1
+echo "Turn off LCD after finishing boot-animation"
+xset dpms force off
+
+# factory resetting...
+# flag set by factory-reset.sh
+if [ -f /opt/.factoryreset ]; then
+ /usr/bin/run-factory-reset.sh
+fi
+
+#echo 4 > /sys/class/graphics/fb0/blank
+
--- /dev/null
+#!/bin/sh
+
+# Color set for ANSI TERM
+_R='\033[0;31;1m' #Red
+_G='\033[0;32;1m' #Green
+_Y='\033[0;33;1m' #Yellow
+C_='\033[0m' #Color off
+
+echo -e "[${_G}rc.sysinit : script starts${C_}]"
+echo -e "[${_G}mount...${C_}]"
+mount -t proc none /proc
+mount -t tmpfs tmpfs /tmp
+#for emulator : /var/run only for supporting dpkg command
+mount -t tmpfs tmpfs /var/run
+mount -t sysfs none /sys
+mount -t tmpfs runfs /run
+mount -t devtmpfs devtmpfs /dev
+mkdir -p /dev/pts
+mkdir -p /dev/shm
+mount -t tmpfs none /dev/shm
+mount -t devpts devpts /dev/pts
+mount -t debugfs none /sys/kernel/debug
+
+echo -e "[${_G}check codec dev node${C_}]"
+test -c /dev/codec || mknod -m 666 /dev/codec c 240 0
+
+echo -e "[${_G}mount filesystems storage${C_}]"
+mount -a
+
+#emulator's swapon
+echo -e "[${_G}mount swap /dev/vdb ${C_}]"
+/sbin/swapon /dev/vdb
+
+
+echo -e "[${_G}udev start${C_}]"
+UDEVD_MAX_CHILDS=1 /sbin/udevd --daemon
+/sbin/udevadm trigger
+
+echo -e "[${_G}create base directory in /opt, /var${C_}]"
+# construct directory hierarchy
+mkdir -p /opt/var/log/apt
+mkdir -p /opt/var/lib
+mkdir -p /opt/var/cache
+mkdir -p /var/run
+
+#make a file for /dev/rtc1
+touch /dev/rtc1
+chmod 777 /dev/rtc1
+
+if [ ! -e /opt/etc/.firstboot ]; then
+ echo -e "[${_Y}rc.firstboot${C_}]"
+ /etc/rc.d/rc.firstboot
+ touch /opt/etc/.firstboot
+fi
+
+echo -e "[${_G}set device node perm & security${C_}]"
+# Set device node permissions for security
+chown 0:6501 /dev/video0
+chown 0:6509 /dev/log_main
+chown 0:6509 /dev/log_events
+chown 0:6509 /dev/log_radio
+chown :audio /dev/snd/
+chmod 775 /dev/snd/
+chown :audio /dev/snd/controlC0
+chown :audio /dev/snd/pcmC0D0p
+chown :audio /dev/snd/pcmC0D1p
+chown :audio /dev/snd/timer
+chown 0:6508 /dev/snd/pcmC0D0c
+chown :video /dev/fb0
+chown :video /dev/video1
+chmod 666 /dev/glmem
+chmod 666 /dev/yagl
+
+if [ -e /opt/etc/.coredump ]; then
+ # enable coredump
+ echo "/opt/usr/share/crash/core/%p_%s_%e.core" > /proc/sys/kernel/core_pattern
+ ulimit -c unlimited
+else
+ echo "core dump disabled"
+ ulimit -c 0
+fi
+
+echo -e "[${_G}run profile${C_}]"
+# Run profile
+. /etc/profile
+
+# Check rw mode
+DEVEL_UPDATE_MODE=`grep devel_update_boot /proc/cmdline`
+if [ -f /opt/etc/.devel_update ] && [ -z "$DEVEL_UPDATE_MODE" ]; then
+ touch /opt/etc/.hib_capturing
+ rm /opt/etc/.devel_update
+fi
+
+#for emulator
+echo -e "[${_G}make symbolic link for i686${C_}]"
+cd /usr/lib/enlightenment/modules/comp-slp/
+ln -s linux-gnu-i686-ver-pre-svn-08 linux-gnu-i486-ver-pre-svn-08
+cd /usr/lib/enlightenment/modules/e17-extra-module-keyrouter/
+ln -s linux-gnu-i686-ver-pre-svn-08 linux-gnu-i486-ver-pre-svn-08
+cd /usr/lib/enlightenment/modules/e17-extra-module-wmready/
+ln -s linux-gnu-i686-ver-pre-svn-08 linux-gnu-i486-ver-pre-svn-08
+cd /usr/lib/enlightenment/modules/illume2-slp/
+ln -s linux-gnu-i686-ver-pre-svn-08 linux-gnu-i486-ver-pre-svn-08
+cd /usr/lib/edje/modules/icon_calendar/
+ln -s linux-gnu-i686-1.0.0 linux-gnu-i486-1.0.0
+
+#for emulator : where is press binary?
+/usr/bin/press 1 # wait input to stop running scripts
+if [ $? -eq 0 ]; then
+ echo "script is stopped"
+ # prepare usbnet before exit
+ insmod /opt/driver/g_ether.ko
+ sleep 1
+ ifconfig usb0 192.168.129.3 netmask 255.255.255.0
+ # Run all rc0 scripts
+ for i in /etc/rc.d/rc0.d/*; do
+ echo -e "[${_G}${i} start${C_}]"
+ $i start
+ done
+elif [ -f /opt/etc/.hib_capturing ] && [ -z "$DEVEL_UPDATE_MODE" ]; then
+ echo -e "[${_Y}run all rc4 scripts${C_}]"
+ # Run all rc4 scripts
+ /usr/bin/write-to-lcd /dev/fb3 "Initializing daemons"
+ echo "there is /opt/etc/.hib_capturing hibernation capturing mode"
+ for i in /etc/rc.d/rc4.d/*; do
+ echo -e "[${_G}${i} start${C_}]"
+ $i start
+ done
+else
+ # Run all rc3 scripts
+ echo -e "[${_G}run all rc3 scripts${C_}]"
+ echo "normal boot"
+ # modify script for checking boot up progress...
+ NUMBER_OF_RCS=`ls /etc/rc.d/rc3.d/ | wc -l`
+ count=0;
+ for i in /etc/rc.d/rc3.d/*; do
+ echo -e "[${_G}${i} start${C_}]"
+ $i start
+ count=$((count + 1))
+ echo `expr $count \* 100 / $NUMBER_OF_RCS` > /dev/esm
+ done
+fi
+
+
+# symbolic link
+if [ ! -e /opt/apps ]; then
+ echo -e "[${_G}link /opt/apps -> /opt/media/apps${C_}]"
+ ln -s /opt/media/apps /opt/apps
+fi
+
+# inhouse home-directory
+chown 5000:5000 /home/inhouse
+
+if [ "$DEVEL_UPDATE_MODE" ]; then
+ touch /opt/etc/.devel_update
+fi
+
+#for emulator :
+/etc/rc.d/rc.emul
+
+echo -e "[${_G}rc.sysinit : script end ${C_}]"
--- /dev/null
+../init.d/simulator-alsa
\ No newline at end of file
--- /dev/null
+chmod 777 /opt/var/kdb/db
+
+if test -x /usr/bin/vmodem_x86 ; then
+ /usr/bin/vmodem_x86 &
+fi
+
+/usr/bin/emuld &
+/usr/sbin/sensord &
--- /dev/null
+#!/bin/sh
+echo -e "[${_G}set a vconf for menu-screen sw backend${C_}]"
+/usr/bin/vconftool set -t string file/private/org.tizen.menu-screen/engine "x11" -i -u 5000 -f
--- /dev/null
+/usr/sbin/gpsd udp://10.0.2.16:3579
+vconftool set -t int db/msg/smsc/val_period/0 255
--- /dev/null
+../init.d/csa-tools
\ No newline at end of file
--- /dev/null
+# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# Disable legacy (protocol version 1) support in the server for new
+# installations. In future the default will change to require explicit
+# activation of protocol 1
+Protocol 2
+
+# HostKey for protocol version 1
+#HostKey /usr/etc/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /usr/etc/ssh_host_rsa_key
+#HostKey /usr/etc/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 1024
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+PermitRootLogin yes
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+#AuthorizedKeysFile .ssh/authorized_keys
+
+# For this to work you will also need host keys in /usr/etc/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+PermitEmptyPasswords yes
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+UsePrivilegeSeparation no
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+#ChrootDirectory none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+#Subsystem sftp /usr/libexec/sftp-server
+Subsystem sftp /usr/lib/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# ForceCommand cvs server
--- /dev/null
+ #!/bin/sh
+
+echo -e "[${_G} Opengl-es acceleration module setting. ${C_}]"
+if grep "gles=1" /proc/cmdline ; then
+ echo -e "[${_G} Emulator support gles hw acceleration. ${C_}]"
+ echo -e "[${_G} Change permission of /dev/glmem. ${C_}]"
+ chmod 666 /dev/glmem
+ echo -e "[${_G} Apply to use hw gles library. ${C_}]"
+ ln -s -f /usr/lib/host-gl/libEGL.so.1.0 /usr/lib/libEGL.so
+ ln -s -f /usr/lib/host-gl/libEGL.so.1.0 /usr/lib/libEGL.so.1
+ ln -s -f /usr/lib/host-gl/libGLESv1_CM.so.1.0 /usr/lib/libGLESv1_CM.so
+ ln -s -f /usr/lib/host-gl/libGLESv1_CM.so.1.0 /usr/lib/libGLESv1_CM.so.1
+ ln -s -f /usr/lib/host-gl/libGLESv2.so.1.0 /usr/lib/libGLESv2.so
+ ln -s -f /usr/lib/host-gl/libGLESv2.so.1.0 /usr/lib/libGLESv2.so.1
+ rm /usr/lib/st_GL.so
+ rm /usr/lib/egl_gallium.so
+ rm /usr/lib/libglapi.so*
+else
+ echo -e "[${_G} Emulator does not support gles hw acceleration. ${C_}]"
+ echo -e "[${_G} Apply to use sw mesa gles library. ${C_}]"
+ ln -s -f /usr/lib/mesa-gl/libEGL.so.1.0 /usr/lib/libEGL.so
+ ln -s -f /usr/lib/mesa-gl/libEGL.so.1.0 /usr/lib/libEGL.so.1
+ ln -s -f /usr/lib/mesa-gl/libGLESv1_CM.so.1.1.0 /usr/lib/libGLESv1_CM.so
+ ln -s -f /usr/lib/mesa-gl/libGLESv1_CM.so.1.1.0 /usr/lib/libGLESv1_CM.so.1
+ ln -s -f /usr/lib/mesa-gl/libGLESv2.so.2.0.0 /usr/lib/libGLESv2.so
+ ln -s -f /usr/lib/mesa-gl/libGLESv2.so.2.0.0 /usr/lib/libGLESv2.so.1
+ ln -s -f /usr/lib/mesa-gl/st_GL.so /usr/lib/st_GL.so
+ ln -s -f /usr/lib/mesa-gl/egl_gallium.so /usr/lib/egl_gallium.so
+ ln -s -f /usr/lib/mesa-gl/libglapi.so.0.0.0 /usr/lib/libglapi.so
+ ln -s -f /usr/lib/mesa-gl/libglapi.so.0.0.0 /usr/lib/libglapi.so.0
+ ln -s -f /usr/lib/mesa-gl/libglapi.so.0.0.0 /usr/lib/libglapi.so.0.0.0
+fi
--- /dev/null
+#!/bin/sh
+
+if test -f '/usr/lib/yagl/libGLESv2.so' && grep -q 'yagl=1' /proc/cmdline; then
+ export LD_LIBRARY_PATH="/usr/lib/yagl${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+ export ELM_ENGINE=gl
+ export YAGL_DEBUG=4
+# export YAGL_DEBUG_FUNC_TRACE=1
+
+ # XXX FIXME: This has to be dropped too
+ ulimit -SHl unlimited
+fi
--- /dev/null
+ACTION=="add|change", SUBSYSTEM=="tty", KERNEL=="s3c2410_serial2", SYMLINK="serial_console"
+SUBSYSTEM=="tty", KERNEL=="s3c2410_serial[0-9]*", TAG+="systemd"
--- /dev/null
+#!/bin/sh\r
+\r
+# script for launcher exit\r
+\r
+\r
+# find scim process and kill it first\r
+LIST=`ps ax | grep 'scim' | grep 'lib' | awk '{print $1}'`\r
+for PID in $LIST\r
+do\r
+kill -9 $PID\r
+done\r
+\r
--- /dev/null
+#!/bin/sh
+# mount_slp.sh : mount variable partitions and the partition described on fstab for slp
+#
+#
+
+_device=
+_mnt_point=
+_fs_type=
+_var_part=
+_ignore_part="/mnt/csc"
+_force=
+
+mount_fail() {
+ for part in $_ignore_part
+ do
+ if [ "$part" == "$_mnt_point" ]; then
+ return
+ fi
+ done
+ echo -e "\n\nFATAL !!! ${_device} is not mounted on ${_mnt_point} as $_fs_type."
+ echo -e " Please contact wonil22.choi@samsung.com or anyone in kernel part.\n\n"
+# Wait until user's input
+ echo -e "\nPress 'y' key and press enter"
+ read _answer < /dev/console; _answer=$(echo ${_answer} | tr a-z A-Z)
+ while [ "${_answer}" != "Y" ]; do
+ echo -e "\nPress 'y' key and press enter"
+ read _answer < /dev/console; _answer=$(echo ${_answer} | tr a-z A-Z)
+ done
+}
+
+# $1 - device
+# $2 - mount point
+# $3 - fs type
+# if mounted properly, return 1 or return 0
+chk_mnt() {
+ if [ -z $_device ]; then
+ return 0
+ fi
+ _tmp_mp=`grep $_mnt_point /etc/mtab | awk '{print $2}' | grep $_mnt_point`
+ _tmp_ft=`grep $_mnt_point /etc/mtab | awk '{print $3}'| grep $_fs_type`
+ if [[ -z "$_tmp_mp" || -z "$_tmp_ft" ]]; then
+ return 0
+ fi
+ return 1
+}
+
+chk_mnt_fstab() {
+ while read line
+ do
+ if [[ "z" != "z$line" && "#" != "${line:0:1}" ]]; then
+ _device=`echo $line | awk '{print $1}'`
+ _mnt_point=`echo $line | awk '{print $2}'`
+ _fs_type=`echo $line | awk '{print $3}'`
+ chk_mnt
+ if [ $? -eq 0 ]; then
+ mount_fail
+ fi
+ fi
+ done < /etc/fstab
+}
+
+# If we have each fstab file for each specific target,
+# following scripts are not required.
+# But we don't have that now, so we get the variable partitions from the
+# bootloader environment variable, that is SLP_VAR_PART.
+# SLP_VAR_PART has "<partition name> <device> <mount point> <fs type>"
+
+get_fw_env() {
+ _tmp_vp=`/bin/fw_printenv | grep SLP_VAR_PART`
+ if [ "z$_tmp_vp" == "z" ]; then
+ echo "There is no SLP_VAR_PART variable from bootloader"
+ return
+ fi
+ _var_part="${_tmp_vp#SLP_VAR_PART=}"
+}
+
+mount_one_part() {
+
+ chk_mnt
+ if [ $? -eq 1 ]; then
+ echo "$_device is already mounted on $_mnt_point"
+ return
+ fi
+
+ _tmp_ft=`/sbin/fs-type-checker $_device`
+ if [[ "$_tmp_ft" == "Unknown fs-type" && "$_fs_type" == "ext4" ]]; then
+ echo -e " Initilize ${_device} forcibly despite of not in manufacturing process, you may loose your data."
+ echo -e "\nErase anyway? [y/N] "
+ if [ -z "$_force" ]; then
+ read _answer < /dev/console; _answer=$(echo ${_answer} | tr a-z A-Z)
+ else
+ _answer=Y
+ fi
+
+ if [ "${_answer}" == "Y" ];then
+ /sbin/mkfs.ext4 $_device -F
+ if [ $? -ne 0 ]; then
+ echo "mkfs.ext4 error"
+ exit 1
+ fi
+ fi
+ fi
+
+ if [ $_fs_type == "ubifs" ]; then
+ if [ -z "$_force" ]; then
+ /bin/ubimnt.sh $_name $_mnt_point -F
+ else
+ /bin/ubimnt.sh $_name $_mnt_point -F << EOF
+y
+EOF
+ fi
+ else
+ mount -t $_fs_type $_device $_mnt_point
+ fi
+ if [ $? -ne 0 ]; then
+ mount_fail
+ exit 1
+ fi
+}
+
+# get one partition info from SLP_VAR_PART and mount it
+mount_var() {
+ get_fw_env
+ i=0
+ for word in $_var_part; do
+ case `expr $i % 4` in
+ 0)
+ _name=$word
+ ;;
+ 1)
+ _device=$word
+ ;;
+ 2)
+ _mnt_point=$word
+ ;;
+ 3)
+ _fs_type=${word%;}
+ mount_one_part
+ ;;
+ esac
+ let i+=1
+ done
+}
+
+_arg=
+parse_arg() {
+ get_fw_env
+ i=0
+ _match=
+ for word in $_var_part; do
+ if [ "$_arg" == "$word" ]; then
+ _match=1
+ fi
+ case `expr $i % 4` in
+ 0)
+ _name=$word
+ ;;
+ 1)
+ _device=$word
+ ;;
+ 2)
+ _mnt_point=$word
+ ;;
+ 3)
+ _fs_type=${word%;}
+ if [ "z$_match" == "z1" ]; then
+ mount_one_part
+ return
+ fi
+ ;;
+ esac
+ let i+=1
+ done
+# It is not a variable partition. mount with fstab.
+ echo "mount with fstab"
+ mount $_arg
+
+ if [ $? -eq 255 ]; then
+ _mnt_chk=`grep $_arg /etc/mtab`
+ if [ "z$_mnt_chk" == "z" ]; then
+ exit 1
+ fi
+ echo "WARNING !!! $_arg seems to be mounted already."
+ elif [ $? -ne 0 ]; then
+ exit 1
+ fi
+}
+
+# print help
+do_help() {
+ echo
+ echo "Usage: $0 -a/PART_NAME/DEVICE/MOUNT_POINT"
+ echo
+ echo " Mount partition(s) for SLP."
+ echo " PART_NAME is only availalbe with SLP_VAR_PART variable of the bootloader"
+ echo
+ echo -e " ex) $0 csa \t For specified partition on SLP_VAR_PART"
+ echo -e " $0 -a \t For mount all partitions"
+ echo -e " $0 /dev/mmcblk0p3\t For mount /dev/mmcblk0p3"
+ echo
+ get_fw_env
+ if [ "z" != "z$_var_part" ]; then
+ echo -e "There is one or more variable partition(s)..\n\t $_var_part\n"
+ fi
+}
+
+
+
+# mount all for SLP partitions
+mount_all() {
+ mount_var
+ mount -a
+ if [ $? -ne 0 ]; then
+ chk_mnt_fstab
+ exit 1
+ fi
+}
+
+case "$1" in
+ -a)
+ mount_all
+ ;;
+ -f)
+ if [ $# != 2 ]; then
+ do_help
+ else
+ _force=$1
+ _arg=$2
+ parse_arg
+ fi
+ ;;
+ *)
+ if [ $# != 1 ]; then
+ do_help
+ else
+ _arg=$1
+ parse_arg
+ fi
+ ;;
+esac
+
+date > /opt/etc/mnt.log
+cat /opt/etc/info.ini >> /opt/etc/mnt.log
+mount >> /opt/etc/mnt.log
+exit 0
+
--- /dev/null
+#!/bin/sh
+#
+# save_blenv: Save env variables of bootloader
+# Usage) save_blenv VARIABLE_NAME VALUE
+#
+# This script is for saving variables of bootloader which is required to be
+# shared between bootloader and platform. (ex) display brightness level)
+#
+# Manufacturer SHOULD modify this file adapted to their target and bootloader.
+# (If there is no shared variables, this file can be removed.)
+
+usage () {
+ echo "Not supported variable(s) or wrong usage"
+ echo "Usage: $0 NAME VALUE"
+ exit 1
+}
+
+_val="$2"
+case "$1" in
+# Supported variables for SLP : usbpath, uartpath, SLP_LCD_BRIGHT
+ usbpath | uartpath)
+ case "$2" in
+ AP | ap)
+ _val="ap"
+ ;;
+ CP | cp)
+ _val="cp"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ ;;
+ SLP_LCD_BRIGHT)
+ if [ "z$2" == "z" ]; then
+ usage
+ fi
+ ;;
+# NOT SUPPOTED
+ *)
+ usage
+ ;;
+esac
+
+# This is for uboot. If you don't use uboot, change following command.
+/bin/fw_setenv $1 $_val
+
+exit 0
+
--- /dev/null
+#!/bin/sh
+
+#PWRND=/proc/btwlan/bcm4329
+DRV_PATH=/lib/modules/2.6.32.9
+FW_PATH=/lib/firmware
+
+# Driver path
+DRIVER=$DRV_PATH/dhd.ko
+MFTDRV=$DRV_PATH/wlan_manufacture.ko
+
+# Firmware path
+FIRMWARE=$FW_PATH/sdio-g-cdc-full11n-reclaim-roml-wme-idsup-pktfilter.bin
+SOFTAP_FIRMWARE=$FW_PATH/sdio-g-cdc-roml-reclaim-wme-apsta-idsup-idauth.bin
+MFTFW=$FW_PATH/sdio-ag-cdc-11n-roml-mfgtest.bin
+
+# NVRAM path
+NVRAM_COB=$FW_PATH/nvram_bcm4329_26.txt
+NVRAM_MOD=$FW_PATH/nvram_bcm4329_38.txt
+NVRAM=$NVRAM_COB
+MFTNVRAM_COB=$FW_PATH/nvram_mfg_rev09.txt
+MFTNVRAM_MOD=$FW_PATH/nvram_mfg_h2.txt
+MFTNVRAM=$MFTNVRAM_COB
+
+
+check_hw()
+{
+ REVISION_NUM=`grep Revision /proc/cpuinfo | awk "{print \\$3}"`
+ echo $REVISION_NUM > /tmp/revision_tmp
+ REVISION_LOW=`cut -c3- /tmp/revision_tmp`
+ REVISION_HIGH=`cut -c1-2 /tmp/revision_tmp`
+
+ #echo $REVISION_LOW
+ echo "HW revision = $REVISION_NUM"
+ rm /tmp/revision_tmp
+# hw rev
+# H2=200c S1=100e AQ03=0809 LM08=8002
+
+ if [ "$REVISION_HIGH" == 20 ]||[ "$REVISION_NUM" == 200c ]||
+ [ "$REVISION_NUM" == 1008 ]||[ "$REVISION_NUM" == 100e ]||
+ [ "$REVISION_NUM" == 0809 ]
+ then
+ NVRAM=$NVRAM_MOD
+ MFTNVRAM=$MFTNVRAM_MOD
+ echo "This is for H2 S1"
+ fi
+}
+start()
+{
+check_hw
+ rfkill unblock wlan
+ echo $FIRMWARE
+ insmod $DRIVER firmware_path=$FIRMWARE nvram_path=$NVRAM
+
+ sleep 1
+ ifconfig eth0 up
+# exit 1
+
+# while true
+# do
+# if ifconfig -a | grep eth0 > /dev/null
+# then
+# ifconfig eth0 up
+# exit 1
+# fi
+# done
+}
+stop()
+{
+ killall udhcpd
+ ifconfig eth0 down
+ rmmod dhd
+ rfkill block wlan
+}
+
+softap()
+{
+ if ifconfig -a | grep eth0 > /dev/null
+ then
+ stop
+ fi
+ FIRMWARE=$SOFTAP_FIRMWARE
+ start
+ create_softap
+ ifconfig wl0.1 192.168.16.1 up
+ udhcpd /etc/udhcpd_wl01.conf
+}
+
+mfton()
+{
+check_hw
+ rfkill unblock wlan
+
+ lsmod | grep 'wlan_' > /dev/null
+ if [ $? -ne 0 ]; then
+ echo manufacture mode is not on! proceed
+ else
+ echo manufacture mode is already running! quit
+ exit 1
+ fi
+
+ insmod $DRIVER firmware_path=$MFTFW nvram_path=$MFTNVRAM
+ sleep 1
+ ifconfig eth0 up
+ wl PM 0
+ mknod /dev/wlanserial c 230 0
+ echo 0 > /proc/sys/kernel/printk
+ insmod $MFTDRV
+ mft_wlan
+
+}
+mftphone()
+{
+check_hw
+ rfkill unblock wlan
+
+ lsmod | grep 'wlan_' > /dev/null
+ if [ $? -ne 0 ]; then
+ echo manufacture mode is not on! proceed
+ else
+ echo manufacture mode is already running! quit
+ exit 1
+ fi
+
+ insmod $DRIVER firmware_path=$MFTFW nvram_path=$MFTNVRAM
+ sleep 1
+ ifconfig eth0 up
+
+ wl PM 0
+# getWifiMac
+# mknod /dev/wlanserial c 230 0
+# echo 0 > /proc/sys/kernel/printk
+# insmod /lib/modules/wlan_manufacture.ko
+# mft_wlan -m
+}
+mftoff()
+{
+ ifconfig eth0 down
+ killall mft_wlan
+ rmmod wlan_manufacture
+ rmmod dhd
+ rm /dev/wlanserial
+ rfkill block wlan
+}
+rftest()
+{
+check_hw
+ rfkill unblock wlan
+ insmod $DRIVER firmware_path=$MFTFW nvram_path=$MFTNVRAM
+ sleep 1
+ ifconfig eth0 up
+ wl PM 0
+}
+
+
+case $1 in
+"start")
+start
+;;
+"stop")
+stop
+;;
+"softap")
+softap
+;;
+"mfton")
+mfton
+;;
+"mftphone")
+mftphone
+;;
+"mftoff")
+mftoff
+;;
+"rftest")
+rftest
+;;
+"test")
+check_hw
+;;
+*)
+echo wlan.sh [start] [stop] [softap] [mfton] [mftoff] [rftest]
+exit 1
+;;
+esac
--- /dev/null
+[Unit]
+Description=ALSA setup
+DefaultDependencies=no
+Before=basic.target
+
+[Service]
+Type=oneshot
+ExecStart=/etc/rc.d/init.d/simulator-alsa
--- /dev/null
+[Unit]
+Description=Legacy emulator startup script
+DefaultDependencies=no
+Before=basic.target
+
+[Service]
+Type=oneshot
+ExecStart=/etc/rc.d/rc.emul
--- /dev/null
+[Unit]
+Description=OpenGL mode
+DefaultDependencies=no
+Before=basic.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c '/etc/virtgl.sh'
--- /dev/null
+[Unit]
+Description=OpenGL "YAGL"
+DefaultDependencies=no
+After=emul-opengl-mode.service
+Before=basic.target
+ConditionKernelCommandLine=yagl=1
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c 'systemctl set-environment LD_LIBRARY_PATH="/usr/lib/yagl${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"'
--- /dev/null
+[Unit]
+Description=emuld
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/emuld
--- /dev/null
+[Unit]
+Description=sdbd
+Before=sensord.service
+
+[Service]
+Type=forking
+Environment=DISPLAY=:0
+PIDFile=/tmp/.sdbd.pid
+RemainAfterExit=yes
+ExecStart=/usr/sbin/sdbd
--- /dev/null
+[Unit]
+Description=sensord
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/sensord
--- /dev/null
+[Unit]
+Description=VModem (x86)
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/vmodem_x86
--- /dev/null
+KERNEL=="glmem", MODE="0666"
+KERNEL=="yagl", MODE="0666"
+KERNEL=="vdpram*", MODE="0644", SYMLINK+="dpram/%n"
+
+# Moved from /etc/rc.d/rc3.d/S30brightness
+SUBSYSTEM=="lcd", ATTR{lcd_power}=="?*", RUN+="/bin/chown :system_bklight 0664 %S/%p/lcd_power"
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Summary: System plugin for emulator
+Name: system-plugin-emulator
+Version: 0.0.1
+Release: 1
+License: Apache-2.0
+Group: System/Base
+Requires: udev
+Requires: util-linux
+Requires: sysvinit
+Requires(post): setup
+Requires(post): coreutils
+Source0: %{name}-%{version}.tar.gz
+Source1001: packaging/%{name}.manifest
+
+%description
+System plugin files for emulator
+
+%prep
+
+%setup -q
+
+%build
+
+%install
+find . -name .gitignore -exec rm -f {} \;
+cp -arf filesystem/* %{buildroot}
+
+mkdir -p %{buildroot}/usr/lib/systemd/system/basic.target.wants
+mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
+ln -s ../sdbd.service %{buildroot}/usr/lib/systemd/system/basic.target.wants/sdbd.service
+ln -s ../emul-opengl-mode.service %{buildroot}/usr/lib/systemd/system/basic.target.wants/emul-opengl-mode.service
+ln -s ../emul-opengl-yagl.service %{buildroot}/usr/lib/systemd/system/basic.target.wants/emul-opengl-yagl.service
+ln -s ../emul-alsa.service %{buildroot}/usr/lib/systemd/system/basic.target.wants/emul-alsa.service
+ln -s ../emul-legacy-start.service %{buildroot}/usr/lib/systemd/system/basic.target.wants/emul-legacy-start.service
+ln -s ../emuld.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/emuld.service
+ln -s ../sensord.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/sensord.service
+ln -s ../vmodem-x86.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/vmodem-x86.service
+
+%post
+mkdir -p /opt/usr
+if [ -d /opt/media ]; then
+ cp -aprf /opt/media/* /opt/usr/media/.
+ rm -rf /opt/media
+else
+ mkdir -p /opt/usr/media
+fi
+if [ -d /opt/apps ]; then
+ cp -aprf /opt/apps/* /opt/usr/apps/.
+ rm -rf /opt/apps
+else
+ mkdir -p /opt/usr/apps
+fi
+if [ -d /opt/live ]; then
+ cp -aprf /opt/live/* /opt/usr/live/.
+ rm -rf /opt/live
+else
+ mkdir -p /opt/usr/live
+fi
+if [ -d /opt/ug ]; then
+ cp -aprf /opt/ug/* /opt/usr/ug/.
+ rm -rf /opt/ug
+else
+ mkdir -p /opt/usr/ug
+fi
+mkdir -p /opt/osp
+mkdir -p /opt/usr/dbspace
+ln -sf /opt/usr/apps /opt/apps
+ln -sf /opt/usr/media /opt/media
+ln -sf /opt/usr/live /opt/live
+ln -sf /opt/usr/osp/share /opt/osp/share
+ln -sf /opt/usr/ug /opt/ug
+
+#make fstab
+if [ -e /etc/fstab ]; then
+ echo "/opt/var /var bind bind 0 0" >> /etc/fstab
+ echo "/tmpfs /tmp tmpfs defaults 0 0" >> /etc/fstab
+fi
+
+#make rtc1 device for alarm service
+touch /dev/rtc1
+
+%files
+/bin/change-booting-mode.sh
+/bin/ifconfig
+/bin/mdev
+/bin/route
+/bin/ubimnt.sh
+/etc/init.d/csa-tools
+/etc/inittab
+/etc/mdev.conf
+/etc/mtools.conf
+/etc/preconf.d/sshd.sh
+/etc/profile.d/launcher.sh
+/etc/profile.d/proxy_setting.sh
+/etc/profile.d/sensord_setting.sh
+/etc/profile.d/simulator-env.sh
+/etc/profile.d/simulator-opengl.sh
+/etc/profile.d/system.sh
+/etc/rc.d/init.d/simulator-alsa
+/etc/rc.d/rc.emul
+/etc/rc.d/rc.firstboot
+/etc/rc.d/rc.shutdown
+/etc/rc.d/rc.sysinit
+/etc/rc.d/rc3.d/S01simulator-alsa
+/etc/rc.d/rc3.d/S20vmodem
+/etc/rc.d/rc3.d/S45vconf-menuscreen
+/etc/rc.d/rc3.d/S96set_valperiod
+/etc/rc.d/rc5.d/S99zzzbackup_csa
+/etc/sshd_config
+/etc/virtgl.sh
+/etc/yagl.sh
+/lib/udev/rules.d/99-serial-console.rules
+/opt/home/root/.launcher/launcher.exit
+/opt/media/.emptydir
+/usr/bin/mount_slp.sh
+/usr/bin/save_blenv
+/usr/bin/wlan.sh
+/usr/lib/systemd/system/basic.target.wants/emul-alsa.service
+/usr/lib/systemd/system/basic.target.wants/emul-legacy-start.service
+/usr/lib/systemd/system/basic.target.wants/emul-opengl-mode.service
+/usr/lib/systemd/system/basic.target.wants/emul-opengl-yagl.service
+/usr/lib/systemd/system/basic.target.wants/sdbd.service
+/usr/lib/systemd/system/emul-alsa.service
+/usr/lib/systemd/system/emul-legacy-start.service
+/usr/lib/systemd/system/emul-opengl-mode.service
+/usr/lib/systemd/system/emul-opengl-yagl.service
+/usr/lib/systemd/system/emuld.service
+/usr/lib/systemd/system/multi-user.target.wants/emuld.service
+/usr/lib/systemd/system/multi-user.target.wants/sensord.service
+/usr/lib/systemd/system/multi-user.target.wants/vmodem-x86.service
+/usr/lib/systemd/system/sdbd.service
+/usr/lib/systemd/system/sensord.service
+/usr/lib/systemd/system/vmodem-x86.service
+/usr/lib/udev/rules.d/95-tizen-emulator.rules