From f0f85378fc8dc3e885a5ddcbf4060b33b616da9b Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 19:08:51 +0900 Subject: [PATCH] tizen 2.4 release --- filesystem/etc/emulator/mount-hostdir.sh | 11 ------ filesystem/etc/emulator/prerun | 27 +++++++++++++ .../etc/emulator/prerun.d/generate-emulator-env.sh | 45 +++++++++++++++++++++ .../emulator/prerun.d/opengl-es-setup-yagl-env.sh | 31 +++++++++++++++ .../set-model-config.sh} | 38 +++++++++++------- filesystem/etc/emulator/select-boot-animation.sh | 24 ----------- filesystem/etc/init.d/mount-hostdir | 2 - filesystem/etc/machine-id | 0 .../etc/profile.d/emulator_ecore_workaround.sh | 2 + filesystem/etc/profile.d/proxy_setting.sh | 34 ---------------- .../dev-disk-by\\x2dlabel-emulator\\x2dswap.swap" | 8 ++++ .../lib/systemd/system/emul-common-preinit.service | 9 +++-- .../lib/systemd/system/emul-mount-hostdir.service | 10 ----- .../systemd/system/emul-setup-audio-volume.service | 8 ++-- .../lib/systemd/system/tizen-generate-env.service | 1 + filesystem/usr/lib/systemd/system/wm_ready.service | 1 + .../usr/lib/udev/rules.d/95-tizen-emulator.rules | 29 ++++++-------- packaging/system-plugin-emulator.manifest | 15 ++++++- packaging/system-plugin-emulator.spec | 46 ++++++++++------------ 19 files changed, 194 insertions(+), 147 deletions(-) delete mode 100755 filesystem/etc/emulator/mount-hostdir.sh create mode 100644 filesystem/etc/emulator/prerun create mode 100644 filesystem/etc/emulator/prerun.d/generate-emulator-env.sh create mode 100755 filesystem/etc/emulator/prerun.d/opengl-es-setup-yagl-env.sh rename filesystem/etc/emulator/{model-config.sh => prerun.d/set-model-config.sh} (69%) mode change 100755 => 100644 delete mode 100755 filesystem/etc/emulator/select-boot-animation.sh delete mode 100755 filesystem/etc/init.d/mount-hostdir create mode 100644 filesystem/etc/machine-id create mode 100644 filesystem/etc/profile.d/emulator_ecore_workaround.sh delete mode 100755 filesystem/etc/profile.d/proxy_setting.sh create mode 100644 "filesystem/usr/lib/systemd/system/dev-disk-by\\x2dlabel-emulator\\x2dswap.swap" delete mode 100644 filesystem/usr/lib/systemd/system/emul-mount-hostdir.service diff --git a/filesystem/etc/emulator/mount-hostdir.sh b/filesystem/etc/emulator/mount-hostdir.sh deleted file mode 100755 index 08a9ba1..0000000 --- a/filesystem/etc/emulator/mount-hostdir.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Mount host directory on /mnt/host via virtio-9p - -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 - diff --git a/filesystem/etc/emulator/prerun b/filesystem/etc/emulator/prerun new file mode 100644 index 0000000..33451de --- /dev/null +++ b/filesystem/etc/emulator/prerun @@ -0,0 +1,27 @@ +# This script is executed in initramfs. + +if [ ! -z $1 ]; then + NEW_ROOT=$1 + # if NEW_ROOT is passed, it executed by initramfs. + # So, we should prepare some core utils. + /bin/busybox ln -sf /bin/busybox /bin/ln + ln -sf /bin/busybox /bin/sed + ln -sf /bin/busybox /bin/grep + ln -sf /bin/busybox /bin/cut + ln -sf /bin/busybox /bin/tr + ln -sf /bin/busybox /bin/expr + ln -sf /bin/busybox /bin/readlink + ln -sf /bin/busybox /bin/rm +else + NEW_ROOT= +fi + +if [ -d $NEW_ROOT/etc/emulator/prerun.d ]; then + for i in $NEW_ROOT/etc/emulator/prerun.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done + unset i +fi + diff --git a/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh b/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh new file mode 100644 index 0000000..d72ee6b --- /dev/null +++ b/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh @@ -0,0 +1,45 @@ +if [ ! -z $1 ]; then + NEW_ROOT=$1 +else + NEW_ROOT= +fi + +CMDLINE=/proc/cmdline +EMULATOR_ENV=$NEW_ROOT/etc/profile.d/emulator_env.sh + +##### network proxy environments +echo -e "*** Generating network proxy env" + +if [ -f $EMULATOR_ENV ]; then + rm -f $EMULATOR_ENV +fi + +# for busybux ash +PROXIES0="http_proxy" +PROXIES1="https_proxy" +PROXIES2="ftp_proxy" +PROXIES3="socks_proxy" + +URLS0="http" +URLS1="https" +URLS2="ftp" +URLS3="socks" + +for index in 0 1 2 3 +do + eval PROXY="\$PROXIES$index" + eval URL="\$URLS$index" + if [ ! -z ${PROXY} ] ; then + EXPORT_CONTENT="${PROXY}=" + if grep -q ${PROXY} $CMDLINE ; then + __PROXY=`sed "s/^.*${PROXY}=\([^, ]*\).*$/\1/g" $CMDLINE` + if [ "x${__PROXY}" != "x" ] ; then + EXPORT_CONTENT="${EXPORT_CONTENT}${URL}://${__PROXY}/" >> $EMULATOR_ENV + fi + fi + echo "export ${EXPORT_CONTENT}" >> $EMULATOR_ENV + echo -e "- ${EXPORT_CONTENT}" + fi +done +echo "export no_proxy=localhost,127.0.0.1/8,10.0.2.0/24" >> $EMULATOR_ENV +echo -e "- no_proxy=localhost,127.0.0.1/8,10.0.2.0/24" diff --git a/filesystem/etc/emulator/prerun.d/opengl-es-setup-yagl-env.sh b/filesystem/etc/emulator/prerun.d/opengl-es-setup-yagl-env.sh new file mode 100755 index 0000000..d713183 --- /dev/null +++ b/filesystem/etc/emulator/prerun.d/opengl-es-setup-yagl-env.sh @@ -0,0 +1,31 @@ + #!/bin/sh +if [ ! -z $1 ]; then + NEW_ROOT=$1 +else + NEW_ROOT= +fi + +USR_LIB=$NEW_ROOT/usr/lib +YAGL_PATH=/usr/lib/yagl +DUMMY_PATH=/usr/lib/dummy-gl + +echo -e "[${_G} Opengl-es acceleration module setting. ${C_}]" +if [ -e /dev/yagl ] ; then + echo -e "[${_G} Emulator support gles hw acceleration. ${C_}]" + echo -e "[${_G} Apply to use hw gles library. ${C_}]" + ln -s -f $YAGL_PATH/libEGL.so.1.0 $USR_LIB/libEGL.so + ln -s -f $YAGL_PATH/libEGL.so.1.0 $USR_LIB/libEGL.so.1 + ln -s -f $YAGL_PATH/libGLESv1_CM.so.1.0 $USR_LIB/libGLESv1_CM.so + ln -s -f $YAGL_PATH/libGLESv1_CM.so.1.0 $USR_LIB/libGLESv1_CM.so.1 + ln -s -f $YAGL_PATH/libGLESv2.so.1.0 $USR_LIB/libGLESv2.so + ln -s -f $YAGL_PATH/libGLESv2.so.1.0 $USR_LIB/libGLESv2.so.1 +else + echo -e "[${_G} Emulator does *not* support gles hw acceleration. ${C_}]" + echo -e "[${_G} Apply to use gles stub library. ${C_}]" + ln -s -f $DUMMY_PATH/libEGL_dummy.so $USR_LIB/libEGL.so + ln -s -f $DUMMY_PATH/libEGL_dummy.so $USR_LIB/libEGL.so.1 + ln -s -f $DUMMY_PATH/libGLESv1_dummy.so $USR_LIB/libGLESv1_CM.so + ln -s -f $DUMMY_PATH/libGLESv1_dummy.so $USR_LIB/libGLESv1_CM.so.1 + ln -s -f $DUMMY_PATH/libGLESv2_dummy.so $USR_LIB/libGLESv2.so + ln -s -f $DUMMY_PATH/libGLESv2_dummy.so $USR_LIB/libGLESv2.so.1 +fi diff --git a/filesystem/etc/emulator/model-config.sh b/filesystem/etc/emulator/prerun.d/set-model-config.sh old mode 100755 new mode 100644 similarity index 69% rename from filesystem/etc/emulator/model-config.sh rename to filesystem/etc/emulator/prerun.d/set-model-config.sh index 96a29e1..92767e5 --- a/filesystem/etc/emulator/model-config.sh +++ b/filesystem/etc/emulator/prerun.d/set-model-config.sh @@ -1,15 +1,22 @@ -#!/bin/sh +if [ ! -z $1 ]; then + NEW_ROOT=$1 +else + NEW_ROOT= +fi + CMDLINE=/proc/cmdline -XML=/etc/config/model-config.xml +XML=$NEW_ROOT/etc/config/model-config.xml +echo -e "*** Setting model-config.xml" -echo -e "[${_G} model config setting ${C_}]" +if [ ! -f $XML ] ; then + echo -e "- model-config.xml does not exist" + exit +fi # display resolution -if grep --silent "video=" $CMDLINE ; then - echo -e "[${_G} modify the resolution value of platform features: ${C_}]" - +if grep -q "video=" $CMDLINE ; then VIDEO=`sed s/.*video=// $CMDLINE | cut -d ' ' -f1` FORMAT=`echo $VIDEO | cut -d ':' -f2 | cut -d ',' -f2` RESOLUTION=`echo $FORMAT | cut -d '-' -f1` @@ -18,13 +25,13 @@ if grep --silent "video=" $CMDLINE ; then TR_NUM=`echo $WIDTH$HEIGHT | tr -d '[0-9]'` if [ "$TR_NUM" != "" ] ; then - echo "non-integer argument" + echo -e "- resolution value is non-integer argument" else WIDTH_KEY="tizen.org\/feature\/screen.width\" type=\"int\"" sed -i s/"$WIDTH_KEY".*\"$WIDTH"\"$HEIGHT"\"$SCREEN_DPI"\ /run/tizen-mobile-env' +ExecStartPost=/usr/bin/chsmack -a "_" /run/tizen-mobile-env [Install] WantedBy=basic.target diff --git a/filesystem/usr/lib/systemd/system/wm_ready.service b/filesystem/usr/lib/systemd/system/wm_ready.service index d8c182f..00d287f 100644 --- a/filesystem/usr/lib/systemd/system/wm_ready.service +++ b/filesystem/usr/lib/systemd/system/wm_ready.service @@ -6,6 +6,7 @@ Before=tizen-boot.target [Service] Type=oneshot ExecStart=/bin/sh -c 'while [ ! -e /tmp/.wm_ready ]; do sleep 0.1 ; done' +TimeoutSec=30s [Install] WantedBy=tizen-boot.target diff --git a/filesystem/usr/lib/udev/rules.d/95-tizen-emulator.rules b/filesystem/usr/lib/udev/rules.d/95-tizen-emulator.rules index 18b3fae..a801686 100644 --- a/filesystem/usr/lib/udev/rules.d/95-tizen-emulator.rules +++ b/filesystem/usr/lib/udev/rules.d/95-tizen-emulator.rules @@ -1,16 +1,13 @@ -KERNEL=="glmem", MODE="0666", SECLABEL{smack}="*" -KERNEL=="yagl", MODE="0666", SECLABEL{smack}="*" -KERNEL=="esm", MODE="0666", SECLABEL{smack}="*" - -KERNEL=="brillcodec", GROUP="hwcodec", MODE="0666", SECLABEL{smack}="*" - -KERNEL=="video0", GROUP="camera", MODE="0660", SECLABEL{smack}="device::camera" -KERNEL=="video1", GROUP="video", MODE="0660", SECLABEL{smack}="device::video" -KERNEL=="video2", GROUP="video", MODE="0660", SECLABEL{smack}="device::video" - -KERNEL=="vdpram*", MODE="0644" - -# Moved from /etc/rc.d/rc3.d/S30brightness -SUBSYSTEM=="lcd", ATTR{lcd_power}=="?*", RUN+="/bin/chown :system_bklight 0664 %S/%p/lcd_power" - -SUBSYSTEM=="drm", SECLABEL{smack}="*" +KERNEL=="yagl", GROUP="video", MODE="0660", SECLABEL{smack}="*" +SUBSYSTEM=="drm", GROUP="video", MODE="0660", SECLABEL{smack}="*" +KERNEL=="brillcodec", GROUP="hwcodec", MODE="0666", SECLABEL{smack}="*" +KERNEL=="video0", GROUP="camera", MODE="0660", SECLABEL{smack}="device::camera" +KERNEL=="video1", GROUP="video", MODE="0660", SECLABEL{smack}="device::video" +KERNEL=="video2", GROUP="video", MODE="0660", SECLABEL{smack}="device::video" +KERNEL=="vdpram*", GROUP="system", MODE="0660", SECLABEL{smack}="*" + +# not enabled now +#KERNEL=="esm", MODE="0660", SECLABEL{smack}="*" + +# SDCard +KERNEL=="vd[a-z]", ENV{ID_FS_LABEL_ENC}=="emul-sdcard*" SYMLINK+="sdcard/%k" diff --git a/packaging/system-plugin-emulator.manifest b/packaging/system-plugin-emulator.manifest index 017d22d..c79ed98 100644 --- a/packaging/system-plugin-emulator.manifest +++ b/packaging/system-plugin-emulator.manifest @@ -1,5 +1,16 @@ - + - + + + + + + + + + + + + diff --git a/packaging/system-plugin-emulator.spec b/packaging/system-plugin-emulator.spec index 29f25fc..f0ad6ac 100644 --- a/packaging/system-plugin-emulator.spec +++ b/packaging/system-plugin-emulator.spec @@ -1,5 +1,5 @@ Name: system-plugin-emulator -Version: 0.1.5 +Version: 0.1.11 Release: 1 %define systemd_dir /usr/lib/systemd @@ -28,21 +28,14 @@ System plugin files for emulator find . -name .gitignore -exec rm -f {} \; cp -arf filesystem/* %{buildroot} -# for legacy init -if [ ! -d %{buildroot}/etc/rc.d/rc3.d ]; then - mkdir -p %{buildroot}/etc/rc.d/rc3.d -fi -ln -s /etc/init.d/mount-hostdir %{buildroot}//etc/rc.d/rc3.d/S03mount-hostdir -ln -s /etc/init.d/ssh %{buildroot}/etc/rc.d/rc3.d/S50ssh - # for systemd # for emulator_preinit.target mkdir -p %{buildroot}/%{systemd_dir}/system/basic.target.wants ln -s %{systemd_dir}/system/emulator_preinit.target %{buildroot}/%{systemd_dir}/system/basic.target.wants/ mkdir -p %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants ln -s %{systemd_dir}/system/emul-setup-audio-volume.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/ -ln -s %{systemd_dir}/system/emul-mount-hostdir.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/ ln -s %{systemd_dir}/system/emul-common-preinit.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/ +ln -s %{systemd_dir}/system/dev-disk-by\\x2dlabel-emulator\\x2dswap.swap %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/ # for emulator.target mkdir -p %{buildroot}/%{systemd_dir}/system/multi-user.target.wants ln -s %{systemd_dir}/system/emulator.target %{buildroot}/%{systemd_dir}/system/multi-user.target.wants/ @@ -59,21 +52,20 @@ mkdir -p %{buildroot}/%{systemd_dir}/system/tizen-boot.target.wants ln -s ../wm_ready.service %{buildroot}/%{systemd_dir}/system/tizen-boot.target.wants/ mkdir -p %{buildroot}/%{systemd_dir}/system/tizen-system.target.wants -# for host file sharing -mkdir -p %{buildroot}/mnt/host - # include license mkdir -p %{buildroot}/usr/share/license cp LICENSE %{buildroot}/usr/share/license/%{name} +%if "%{?tizen_profile_name}" == "mobile" || "%{?tizen_profile_name}" == "tv" +touch %{buildroot}/etc/machine-id +%else +rm %{buildroot}/etc/machine-id +%endif + %post #make fstab if [ -e /etc/fstab ]; then -%if "%{?tizen_profile_name}" == "mobile" - echo "/opt/var /var bind bind 0 0" >> /etc/fstab -%endif echo "tmpfs /tmp tmpfs comment=havefs-smackfs-smackfsroot=* 0 0" >> /etc/fstab - echo "/dev/vdb swap swap defaults 0 0" >> /etc/fstab fi %posttrans @@ -81,20 +73,21 @@ fi /etc/preconf.d/emulator_ns.preinit %files -/etc/emulator/mount-hostdir.sh -/etc/emulator/model-config.sh -/etc/emulator/select-boot-animation.sh -/etc/init.d/mount-hostdir +/etc/emulator/prerun +/etc/emulator/prerun.d/set-model-config.sh +/etc/emulator/prerun.d/generate-emulator-env.sh +/etc/emulator/prerun.d/opengl-es-setup-yagl-env.sh /etc/inittab +%if "%{?tizen_profile_name}" == "mobile" || "%{?tizen_profile_name}" == "tv" +/etc/machine-id +%endif /etc/preconf.d/emulator_ns.preinit /etc/preconf.d/systemd_conf.preinit -/etc/profile.d/proxy_setting.sh +/etc/profile.d/emulator_ecore_workaround.sh /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/S03mount-hostdir -/etc/rc.d/rc3.d/S50ssh /etc/systemd/default-extra-dependencies/ignore-units /usr/lib/systemd/system/emulator_preinit.target /usr/lib/systemd/system/emulator.target @@ -107,11 +100,11 @@ fi /usr/lib/systemd/system/multi-user.target.wants/tizen-system.target /usr/lib/systemd/system/multi-user.target.wants/tizen-runtime.target /usr/lib/systemd/system/emul-setup-audio-volume.service -/usr/lib/systemd/system/emul-mount-hostdir.service /usr/lib/systemd/system/emul-common-preinit.service +/usr/lib/systemd/system/dev-disk-by\x2dlabel-emulator\x2dswap.swap /usr/lib/systemd/system/emulator_preinit.target.wants/emul-setup-audio-volume.service -/usr/lib/systemd/system/emulator_preinit.target.wants/emul-mount-hostdir.service /usr/lib/systemd/system/emulator_preinit.target.wants/emul-common-preinit.service +/usr/lib/systemd/system/emulator_preinit.target.wants/dev-disk-by\x2dlabel-emulator\x2dswap.swap /usr/lib/systemd/system/tizen-boot.target /usr/lib/systemd/system/tizen-system.target /usr/lib/systemd/system/tizen-runtime.target @@ -122,5 +115,6 @@ fi /usr/lib/systemd/system/tizen-generate-env.service /usr/lib/udev/rules.d/51-tizen-udev-default.rules /usr/lib/udev/rules.d/95-tizen-emulator.rules -%dir /mnt/host /usr/share/license/%{name} +%manifest packaging/%{name}.manifest + -- 2.7.4