add support 64-bits paths 29/110729/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 20 Dec 2016 13:38:21 +0000 (16:38 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 17 Jan 2017 13:32:29 +0000 (16:32 +0300)
Change-Id: If95dd482e3f901648a5561d0945c9e1178f54fb2
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
daemon/Makefile
packaging/swap-manager.spec
scripts/gen_gtp_data.sh
scripts/gen_loader_header.sh
scripts/gen_preload_header.sh
scripts/gen_uihv_header.sh
scripts/gen_wsi_prof.sh
ui_viewer/Makefile

index 22d48e1..fa6ff4a 100644 (file)
@@ -232,11 +232,11 @@ debug: rmheaders headers $(SCRIPTS) $(OBJS)
        $(CPP) $(OBJS) -o $(TARGET) $(LDFLAGS)
 
 
-install: BINDIR = $(DESTDIR)/usr/bin
+install: BDIR = $(DESTDIR)/$(BINDIR)
 install: $(TARGET) $(SCRIPTS)
-       mkdir -p $(BINDIR)
-       install $(TARGET) -t $(BINDIR)
-       install -m 755 $(SCRIPTS) -t $(BINDIR)
+       mkdir -p $(BDIR)
+       install $(TARGET) -t $(BDIR)
+       install -m 755 $(SCRIPTS) -t $(BDIR)
 
 clean:
        rm -f $(TARGET) $(OBJS)
index 1697599..a19e1c0 100644 (file)
@@ -88,17 +88,17 @@ This binary will be installed in target.
 %setup -q -n %{name}_%{version}
 
 %build
-%if %{WSI_SUPPORT}
-export WAYLAND_SUPPORT=y
-%endif
-
 pushd scripts
 echo "__tizen_profile_name__="%{?profile} > dyn_vars
 echo "__tizen_product__="%{?TIZEN_PRODUCT} >> dyn_vars
 echo "__tizen_product_wearable__="%{sec_product_feature_profile_wearable} >> dyn_vars
 echo "__tizen_product_lite__="%{sec_product_feature_profile_lite} >> dyn_vars
 popd
-cd daemon
+
+# set environment
+%if %{WSI_SUPPORT}
+  export WAYLAND_SUPPORT=y
+%endif
 
 %if %{NSP_SUPPORT}
   export NSP_SUPPORT=y
@@ -112,18 +112,33 @@ cd daemon
   export WSI_SUPPORT=y
 %endif
 
+export INCLUDEDIR=%{_includedir}
+export LIBDIR=%{_libdir}
+export LIB=%{_lib}
+export LINKER_PATH=$(readlink -f $(parse_elf -f %{_bindir}/parse_elf -i))
+
+# build manager
+cd daemon
 make
 
+# build ui_viewer
 cd ../ui_viewer
-$SWAP_BUILD_CONF make
+make
 
 %install
 rm -rf ${RPM_BUILD_ROOT}
 mkdir -p %{buildroot}/usr/share/license
 cp LICENSE %{buildroot}/usr/share/license/%{name}
+
+# set environment
+export BINDIR=%{_bindir}
+export LIBDIR=%{_libdir}
+
+# install manager
 cd daemon
 %make_install
 
+# install ui_viwer
 cd ../ui_viewer
 %make_install
 
@@ -135,14 +150,14 @@ touch %{TZ_SYS_ETC}/resourced_proc_exclude.ini
 /usr/share/license/%{name}
 %manifest swap-manager.manifest
 %defattr(-,root,root,-)
-%{_prefix}/bin/da_manager
-/usr/bin/swap_start.sh
-/usr/bin/swap_stop.sh
-/usr/bin/swap_init_loader.sh
-/usr/bin/swap_init_preload.sh
-/usr/bin/swap_init_uihv.sh
-/usr/bin/swap_init_wsp.sh
-/usr/bin/swap_init_gtp.sh
+%{_bindir}/da_manager
+%{_bindir}/swap_start.sh
+%{_bindir}/swap_stop.sh
+%{_bindir}/swap_init_loader.sh
+%{_bindir}/swap_init_preload.sh
+%{_bindir}/swap_init_uihv.sh
+%{_bindir}/swap_init_wsp.sh
+%{_bindir}/swap_init_gtp.sh
 
 %{_libdir}/da_ui_viewer.so
 
index 73638ce..745959c 100755 (executable)
@@ -1,10 +1,9 @@
 #!/bin/bash
-linker_path="/lib/"
-test_bin="/bin/su"
-handlers_lib="/usr/lib/da_probe_tizen.so"
+
+handlers_lib="$LIBDIR/da_probe_tizen.so"
 fixup_handler="__dl_fixup_wrapper"
 reloc_handler="__dl_reloc_wrapper"
-linker_info_header="/usr/local/include/linker_info.h"
+linker_info_header="$INCLUDEDIR/linker_info.h"
 libpthread_pkg_name="glibc"
 libpthread_init_func="__pthread_initialize_minimal"
 
@@ -23,14 +22,7 @@ function print_header()
 function print_linker()
 {
     filename=$1
-
-    if [ ! -f $test_bin ]; then
-        echo "[ERROR] No ${test_bin} to get linker path"
-        exit 1
-    fi
-
-    el=$(readelf -p .interp $test_bin | grep "/lib/" | awk '{print $3}')
-    linker=$(readlink -f $el)
+    linker=$LINKER_PATH
 
     echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/got_patcher/linker/path" >> $filename
 }
@@ -78,7 +70,7 @@ function print_libpthread()
 {
     filename=$1
 
-    libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/lib/libpthread" | head -1)
+    libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/${LIB}/libpthread" | head -1)
     addr=$(readelf -sW $libpthread_path | grep $libpthread_init_func | awk '{print "0x" $2}')
 
     echo -e "/bin/echo \"$libpthread_path\" > /sys/kernel/debug/swap/got_patcher/pthread/path" >> $filename
index 9ac8a94..bfad856 100755 (executable)
@@ -1,10 +1,7 @@
 #!/bin/bash
-loader_library_pattern="libdl[.-].*"
-loader_library_path="/lib/"
+
 loader_open_function="dlopen"
-linker_path="/lib/"
 linker_sym="_r_debug"
-test_bin="/bin/su"
 output=$1
 
 
@@ -20,7 +17,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 function print_loader()
 {
     filename=$1
-    el=$(find $loader_library_path -regextype posix-extended -regex $loader_library_path$loader_library_pattern | head -n1)
+    el=$(rpm -ql glibc | grep "libdl[.-].*" | head -1)
     loader_lib=$(readlink -f $el)
     addr=$(parse_elf -f $loader_lib --addr_format=swap --syms | grep "$loader_open_function\(@\|$\)" | head -1 | cut -f1 -d' ')
 
@@ -31,14 +28,7 @@ function print_loader()
 function print_linker()
 {
     filename=$1
-
-    if [ ! -f $test_bin ]; then
-        echo "[ERROR] No ${test_bin} to get linker path"
-        exit 1
-    fi
-
-    el=$(readelf -p .interp $test_bin | grep "/lib/" | awk '{print $3}')
-    linker=$(readlink -f $el)
+    linker=$LINKER_PATH
     r_debug_offset=$(readelf -sW $linker | grep $linker_sym | awk '{print $2}' | uniq)
 
     echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/loader/linker/linker_path" >> $filename
index 36733a7..5fcafa4 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/bash
-handlers_lib="/usr/lib/da_probe_tizen.so"
+handlers_lib="$LIBDIR/da_probe_tizen.so"
 loader_library_pattern="libdl[.-].*"
 linker_library_pattern="ld-.*"
 libc_pkg_name="glibc"
 libpthread_pkg_name="glibc"
-libsmack_pkg_name="smack"
+libsmack_pkg_name="libsmack"
 
 output=$1
 
@@ -44,15 +44,14 @@ function print_libc()
 {
     filename=$1
 
-    libc_path=$(rpm -ql $libc_pkg_name | grep "/lib/libc" | head -1)
-    echo -e "/bin/echo \"$libc_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
+    echo -e "/bin/echo /$LIB/libc.so.6 > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
 }
 
 function print_libpthread()
 {
     filename=$1
 
-    libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/lib/libpthread" | head -1)
+    libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "libpthread" | head -1)
     echo -e "/bin/echo \"$libpthread_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
 }
 
@@ -60,7 +59,7 @@ function print_libsmack()
 {
     filename=$1
 
-    libsmack_path=$(rpm -ql $libsmack_pkg_name | grep "/lib/libsmack" | head -1)
+    libsmack_path=$(rpm -ql $libsmack_pkg_name | grep "libsmack" | head -1)
     echo -e "/bin/echo \"$libsmack_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
 }
 
index e21b489..2337ab6 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-ui_viewer_lib="/usr/lib/da_ui_viewer.so"
+ui_viewer_lib="$LIBDIR/da_ui_viewer.so"
 
 output=$1
 
index 8f7cdcf..a062c6f 100755 (executable)
@@ -19,9 +19,9 @@ source $script_dir/dyn_vars
 webkit_package_name=chromium-efl
 
 if [ "$__tizen_product_tv__" == "1" ]; then
-       lib_file=$(rpm -ql ${webkit_package_name} | grep "/usr/lib/libchromium-ewk.so" | head -1)
+       lib_file=$(rpm -ql ${webkit_package_name} | grep "$LIBDIR/libchromium-ewk.so" | head -1)
 else
-       lib_file=$(rpm -ql ${webkit_package_name}-debuginfo | grep "/usr/lib/debug/usr/lib/libchromium-ewk.so.debug" | head -1)
+       lib_file=$(rpm -ql ${webkit_package_name}-debuginfo | grep "/usr/lib/debug$LIBDIR/libchromium-ewk.so.debug" | head -1)
 fi
 
 
index 31bed97..59ed15f 100644 (file)
@@ -36,7 +36,6 @@ INCLUDE := \
        -I/usr/include/ethumb-1 \
        -I/usr/include/e_dbus-1 \
        -I/usr/include/dbus-1.0 \
-       -I/usr/lib/dbus-1.0/include \
        -I/usr/include/wayland-extension
 
 WARN_CFLAGS = -g                        \
@@ -106,10 +105,10 @@ debug:  $(OBJS)
        $(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
 
 
-install: BINDIR = $(DESTDIR)/usr/lib
+install: BDIR = $(DESTDIR)/$(LIBDIR)
 install: $(TARGET)
-       mkdir -p $(BINDIR)
-       install $(TARGET) -t $(BINDIR)
+       mkdir -p $(BDIR)
+       install $(TARGET) -t $(BDIR)
 clean:
        rm -f $(TARGET) $(OBJS)