diff --git a/docs/platform/tool/ASan.md b/docs/platform/tool/ASan.md new file mode 100644 index 0000000000..81edc2aee9 --- /dev/null +++ b/docs/platform/tool/ASan.md @@ -0,0 +1,507 @@ +Address Sanitizer +================= + +Tizen applications are mainly implemented in unmanaged programming +languages (C and C++) which do not provide any protection against +invalid memory accesses. Such accesses often result in memory corruption +and eventually cause program crashes or other abnormal behavior. +AddressSanitizer (or ASan for short) is a part of Google toolsuite for +program quality assurance (the other tools being ThreadSanitizer, +MemorySanitizer and UBSanitizer). The advantages of ASan are + +- much (\~40x) faster than valgrind +- actively evolving (in contrast to mudflap which has been recently + removed from GCC) +- cross-platform (in contrast to Intel MPX) + +Current AddressSanitizer handles the following classes of errors (see +): + +- use after free (dangling pointer dereference) +- heap buffer overflow +- stack buffer overflow +- global buffer overflow +- stack use after return +- initialization order bugs +- memory leaks (on 64-bit systems only) + +Quick start +=========== + +Build your application as usual adding +`--extra-packs asan-force-options` to gbs flags: + +`gbs build -A armv7l --include-all --clean --extra-packs asan-force-options` + +Usage details +============= + +Enabling sanitized build for single package +------------------------------------------- + +### Using gbs build + +The `gbs` support is already integrated into Tizen toolchain and the +sanitized build can be performed using + +`gbs build -A armv7l --include-all --clean --extra-packs asan-force-options` + +If you get build time issues refer the [known issues +section](#Known_issues "wikilink"). + +### Using manual .spec change + +If you want to apply the Address Sanitizer to your application you have +to add the following compiler flags to your package: + +`CFLAGS+="-fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer -fno-common"`\ +`CXXFLAGS+="-fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer -fno-common"`\ +`LDFLAGS+="-fsanitize=address"` + +Their meaning is following: + +- `-fsanitize=address` switches on injection of special code sections + to your application (the actual sanitization) +- `-fsanitize-recover=address` allows application to continue + execution after ASan report is printed (in the other case the + application will report error and exit) +- `-fno-omit-frame-pointer` instructs GCC to leave the frame pointer + information needed for stack trace printing +- `-U_FORTIFY_SOURCE` disables GCC source fortification, because it + doesn\'t work well with ASan (see + for details) +- `-fno-common` forbids merging of variables with equal names from + different compilation units to increase report accuracy (see + [corresponding section for details](#-fno-common_issues "wikilink")) + +Running sanitized package on target device +------------------------------------------ + +### Preparing runtime environment + +To be able run your sanitized package on target device (e.g. TM1) you +need: + +- upload and install + [https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/libasan-6.2.1-6.2.armv7l.rpm + libasan.rpm](https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/libasan-6.2.1-6.2.armv7l.rpm_libasan.rpm "wikilink") + and + [https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm + asan-runtime-env](https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm_asan-runtime-env "wikilink") + packages to your device. +- upload your newly built sanitized package to target device and + install it. +- sync and reboot your device. + +**※** **asan-runtime-env** inserts **libasan.so** to +**/etc/ld.so.preload** and some ASan defects like SEGV are reported +without rebuilding. If you don\'t want to get ASan report from other +processes not yours, you can set **LD\_PRELOAD** instead of +**/etc/ld.so.preload** to detect your process only. + +`LD_PRELOAD=/lib/libasan.so [your process]` + +### Tuning ASan runtime + +ASan run-time can be tuned using special `/ASAN_OPTIONS` file installed +from `asan-runtime-env rpm package`. The contents of the file is a +colon-separated list of options. Description of all existing options can +be found in +[https://github.com/google/sanitizers/wiki/AddressSanitizerFlags\#run-time-flags +official +wiki](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags_official_wiki "wikilink"). +The most common ones are described in the table below. Default set from +`asan-runtime-env` is appropriate for most Tizen developers: + +`cat /ASAN_OPTIONS`\ +`halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0:log_path=/tmp/asan.log:log_exe_name=1` + + Option Value Description + ---------------------- --------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------ + halt\_on\_error false **true**: print report and exit application if error found. **false** print report and continue execution if error found. + start\_deactivated true **true**: reduce ASan memory overhead as much as possible before the instrumented module is loaded into the process. + print\_cmdline true Print application command line to ASan report + quarantine\_size\_mb 1 Size (in Mb) of quarantine used to detect use-after-free errors. Lower value may reduce memory usage but increase the chance of missing error. + detect\_leaks true for 64 bit targets, false for 32 bit targets Switches off LeakSanitizer since there is no armv7l architecture support yet. + log\_path /tmp/asan.log Write logs to \"log\_path.pid\". The special values are \"stdout\" and \"stderr\". + log\_exe\_name 1 Mention name of executable when reporting error and append executable name to logs (as in \"log\_path.exe\_name.pid\"). + + + : ASan options description + +If you want to tune the flags you can rewrite them in the +`/ASAN_OPTIONS` file inside your build-root, or just export +ASAN\_OPTIONS env variable directly. + + Option Value Description + ---------------------------- -------- ----------------------------------------------------------------------------- + log\_to\_syslog false Write all sanitizer output to syslog in addition to other means of logging. + fast\_unwind\_on\_malloc true If available, use the fast frame-pointer-based unwinder on malloc/free. + malloc\_context\_size 30 Max number of stack frames kept for each allocation/deallocation. + allocator\_release\_to\_os false Experimental. If true, try to periodically release unused memory to the OS. + heap\_profile false Experimental heap profiler, asan-only. + html\_cov\_report false Generate html coverage report. + sancov\_path sancov Sancov tool location. + + + : Other interesting options + +### Getting result + +To perform the check you have to execute the compiled application either +on device or in gbs build root under qemu. If your package has unit +tests running them will do as well. If ASan finds the memory issue it +prints report in the following format + +`=================================================================`\ +`==369==ERROR: AddressSanitizer: stack-buffer-underflow on address 0xbeca8d9f at pc 0xb6f02813 bp 0xbeca8d40 sp 0xbeca8d44`\ +`READ of size 1 at 0xbeca8d9f thread T0`\ +`   #0 0xb6f02811  (/usr/sbin/sdbd+0x35811)`\ +`   #1 0xb6f059cd  (/usr/sbin/sdbd+0x389cd)`\ +`   #2 0xb6f079b5 in service_to_fd (/usr/sbin/sdbd+0x3a9b5)`\ +`   #3 0xb6efdc2d in create_local_service_socket (/usr/sbin/sdbd+0x30c2d)`\ +`   #4 0xb6ee157f in handle_packet (/usr/sbin/sdbd+0x1457f)`\ +`   #5 0xb6eed035  (/usr/sbin/sdbd+0x20035)`\ +`   #6 0xb6eeafa9 in fdevent_loop (/usr/sbin/sdbd+0x1dfa9)`\ +`   #7 0xb6ee5a6d in sdb_main (/usr/sbin/sdbd+0x18a6d)`\ +`   #8 0xb665b4bb in __libc_start_main (/lib/libc.so.6+0x164bb)`\ +\ +`Address 0xbeca8d9f is located in stack of thread T0 at offset 31 in frame`\ +`   #0 0xb6f0257f  (/usr/sbin/sdbd+0x3557f)`\ +` This frame has 1 object(s):`\ +`   [32, 1056) 'buf' <== Memory access at offset 31 underflows this variable`\ +`HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext`\ +`     (longjmp and C++ exceptions *are* supported)`\ +`SUMMARY: AddressSanitizer: stack-buffer-underflow (/usr/sbin/sdbd+0x35811) `\ +`Shadow bytes around the buggy address:`\ +`  0x37d95160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d95170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d95180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d95190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d951a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`=>0x37d951b0: f1 f1 f1[f1]00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d951c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d951d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d951e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d951f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d95200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`Shadow byte legend (one shadow byte represents 8 application bytes):`\ +` Addressable:           00`\ +` Partially addressable: 01 02 03 04 05 06 07 `\ +` Heap left redzone:       fa`\ +` Heap right redzone:      fb`\ +` Freed heap region:       fd`\ +` Stack left redzone:      f1`\ +` Stack mid redzone:       f2`\ +` Stack right redzone:     f3`\ +` Stack partial redzone:   f4`\ +` Stack after return:      f5`\ +` Stack use after scope:   f8`\ +` Global redzone:          f9`\ +` Global init order:       f6`\ +` Poisoned by user:        f7`\ +` Container overflow:      fc`\ +` Array cookie:            ac`\ +` Intra object redzone:    bb`\ +` ASan internal:           fe`\ +` Left alloca redzone:     ca`\ +` Right alloca redzone:    cb`\ +`Command: /usr/sbin/sdbd` + +### Report symbolization + +If symbols are not available in sanitized binaries, ASan log will not +include symbol information in backtraces. To fix this run +`asan_symbolize.py` script under collected log files on host where +symbol files are available. The `asan_symbolize.py` script delivered by +**sanitizer-devel.rpm** package, so you\'ll need to install it to your +buildroot: + +`gbs build -A armv7l --include-all --clean --extra-packs asan-force-options,sanitizer-devel` + +Then, you\'ll need to chroot to your buildroot and **install** newly +built packages: + +`sudo chroot ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +`rpm -Uihv --force --nodeps home/abuild/rpmbuild/RPMS/armv7l/sdbd*` + +Finally, run `asan_symbolize.py` feeding it with ASan log file: + +`asan_symbolize.py < asan.log` + +`==379==ERROR: AddressSanitizer: stack-buffer-underflow on address 0xbea74c1f at pc 0xb6f00347 bp 0xbea74bb8 sp 0xbea74bbc`\ +`READ of size 1 at 0xbea74c1f thread T0`\ +`    #0 0xb6f00345 in get_env /usr/src/debug/sdbd-3.0.13/src/services.c:532`\ +`    #1 0xb6f02e15 in create_subproc_thread /usr/src/debug/sdbd-3.0.13/src/services.c:584`\ +`    #2 0xb6f056c1 in service_to_fd /usr/src/debug/sdbd-3.0.13/src/services.c:1035`\ +`    #3 0xb6efb761 in create_local_service_socket /usr/src/debug/sdbd-3.0.13/src/sockets.c:420`\ +`    #4 0xb6ede98d in handle_packet /usr/src/debug/sdbd-3.0.13/src/sdb.c:690 (discriminator 4)`\ +`    #5 0xb6eeab69 in transport_socket_events /usr/src/debug/sdbd-3.0.13/src/transport.c:208`\ +`    #6 0xb6ee8add in fdevent_loop /usr/src/debug/sdbd-3.0.13/src/fdevent.c:697`\ +`    #7 0xb6ee3355 in sdb_main /usr/src/debug/sdbd-3.0.13/src/sdb.c:2286`\ +`    #8 0xb64964fb in __libc_start_main ??:? (/lib/libc.so.6+0x164fb)`\ +\ +`Address 0xbea74c1f is located in stack of thread T0 at offset 31 in frame`\ +`    #0 0xb6f000b3 in get_env /usr/src/debug/sdbd-3.0.13/src/services.c:517`\ +\ +`  This frame has 1 object(s):`\ +`    [32, 1056) 'buf' <== Memory access at offset 31 underflows this variable`\ +`HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext`\ +`      (longjmp and C++ exceptions *are* supported)`\ +`SUMMARY: AddressSanitizer: stack-buffer-underflow (/usr/sbin/sdbd+0x36345)`\ +`Shadow bytes around the buggy address:`\ +`  0x37d4e930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`=>0x37d4e980: f1 f1 f1[f1]00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`  0x37d4e9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`\ +`Shadow byte legend (one shadow byte represents 8 application bytes):`\ +`  Addressable:           00`\ +`  Partially addressable: 01 02 03 04 05 06 07`\ +`  Heap left redzone:       fa`\ +`  Heap right redzone:      fb`\ +`  Freed heap region:       fd`\ +`  Stack left redzone:      f1`\ +`  Stack mid redzone:       f2`\ +`  Stack right redzone:     f3`\ +`  Stack partial redzone:   f4`\ +`  Stack after return:      f5`\ +`  Stack use after scope:   f8`\ +`  Global redzone:          f9`\ +`  Global init order:       f6`\ +`  Poisoned by user:        f7`\ +`  Container overflow:      fc`\ +`  Array cookie:            ac`\ +`  Intra object redzone:    bb`\ +`  ASan internal:           fe`\ +`  Left alloca redzone:     ca`\ +`  Right alloca redzone:    cb `\ +\ +`Command: /usr/sbin/sdb` + +ASan + LSan +=========== + +If you are working with 64 bit emulator, you may want to run ASan and +LSan together. Since Tizen LSan is **disabled by default**, you\'ll need +to enable it manually: + +- If you have `/ASAN_OPTIONS` on your emulator (installed by + **asan-runtime-env** package or created manually), set + `detect_leaks=1` into this file, like + +` halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=1:log_path=/tmp/asan.log:log_exe_name=1` + +- Otherwise, just do `export ASAN_OPTIONS=detect_leaks=1` on your + emulator. + +ASan + Fuzzing +============== + +ASan may be combined with [Fuzz +testing](https://en.wikipedia.org/wiki/Fuzzing) in order to find even +more bugs. See [Fuzzing](https://wiki.tizen.org/Fuzzing) for details +regarding applying fuzz testing for Tizen components. + +Known issues +============ + +Build issues +------------ + +### "multiple definition of" linking error due to -fno-common + +When `–fno-common` flag is added to compiler (which is default in +asan-force-options) some linking may fail with error like this: + +`[    4s] Linking C executable system_server`\ +`` [    4s] CMakeFiles/system_server.dir/src/core/predefine.c.o: In function `module_exit': ``\ +`` [    4s] /home/abuild/rpmbuild/BUILD/system-server-2.0.0/src/core/predefine.c:118: multiple definition of `g_pm_callback' ``\ +`[    4s] CMakeFiles/system_server.dir/src/core/device-change-handler.c.o:/home/abuild/rpmbuild/BUILD/system-server-2.0.0/src/core/device-change-handler.c:325: first defined here` + +The reason of the bug is that global is defined in more than one +compilation unit without `extern` or `static`. + +When using default `–fcommon` option global variables with the same name +are merged into the same variable without signaling errors. When +`-fno-common` option is enabled all global variables are treated +separately as they supposed to be. It means that each global variable +should be defined only once. Otherwise means an error in source code and +is reported at linking stage. It must be fixed by modifying each +declaration as static or merging into an `extern` declaration and a +definition in a single `.c` file. + +As a workaround the option may be excluded for sanitization with +expected reduce of global variables sanitization: + +`sudo chroot ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +`-bash-3.2$ gcc-unforce-options`\ +`-bash-3.2$ gcc-force-options -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer`\ +`-bash-3.2$ exit` + +Then rerun gbs build with additional `-–noinit` option: + +` $ gbs build -A  armv7l  --include-all  --noinit` + +### "undefined reference to" linking error due to ASan reexports some symbols + +Some packages fail to link when built with ASan with such kinds of +errors: + +`` [  232s] .libs/module_policy_la-module-policy.o: In function `module_policy_LTX_pa__init': ``\ +`` [  232s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3081: undefined reference to `dlsym' ``\ +`` [  232s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3082: undefined reference to `dlsym' ``\ +`` [  232s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3083: undefined reference to `dlsym' ``\ +`` [  233s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3084: undefined reference to `dlsym' ``\ +`` [  233s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3085: undefined reference to `dlsym' ``\ +`` [  233s] .libs/module_policy_la-module-policy.o:/home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3086: more undefined references to `dlsym' follow ``\ +`` [  233s] .libs/module_policy_la-module-policy.o: In function `module_policy_LTX_pa__init': ``\ +`` [  233s] /home/abuild/rpmbuild/BUILD/pulseaudio-4.0.73+tv/src/modules/module-policy.c:3107: undefined reference to `dlerror' ``\ +`[  233s] collect2: error: ld returned 1 exit status` + +This happens because **libasan.so** reexports *dlopen* symbol and +configure tests use it to find out if it\'s needed to link against +**libdl.so**. Since **libasan.so** defines *dlopen* symbol and reexports +it, configure doesn\'t add **-ldl** flag to **\$LIBS** variable used by +make utility and we have undefined references. We can overcome this by +linking against **libdl.so** manually, e.g. by adding missed library to +**\$LIBS**: + +`export $LIBS=”$LIBS -ldl”` + +The same problems may encounter with **libpthread**, **libm** and +**librt** libraries - just add **-pthread**(**-lm**, **-lrt**) flag to +**\$LIBS**: + +`export $LIBS=”$LIBS -pthread”` + +or + +`export $LIBS=”$LIBS -lm”` + +or + +`export $LIBS=”$LIBS -lrt”` + +### Unresolved symbols with underscore + +Some applications like **gzip** may check the compiler for generating +symbol names with a certain convention, e.g. external symbols starts +with **\_** sign. But ASan generates special ASan symbols starting with +**\_symbolname** which breaks the build and causes failure at link time. +Example fix can be seen in **gzip** fix +[1](https://review.tizen.org/gerrit/#/c/143815/1) + +### "ERROR: AddressSanitizer setrlimit() failed 1" build error due to OSC sets VMA rlimit for 64-bit architectures + +This error frequently arises when user tries to build sanitized package +for 64-bit target (e.g. x86\_64 or aarch64). To overcome the issue, one +need to disable ulimit restriction for GBS build. This would require +deleting **ulimit -v \$limit** line from OSC **/usr/lib/build/build** +script (hacky, but works) on Ubuntu systems. For other systems the +method is the same, although path to **build** might be different. + +Now, fixed in GCC [2](https://review.tizen.org/gerrit/#/c/146109/) + +### \"ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD\_PRELOAD\" runtime error + +Add **asan-build-env** package to your GBS build command and rebuild +your package: + +` gbs build -A armv7l --include-all --clean --extra-packs asan-force-options,asan-build-env` + +**NOTE:** **asan-build-env** will add **libasan.so** library in +**/etc/ld.so.preload** file in your newly created buildroot. Thus, if +you want to chroot into this buildroot and do some stuff, you\'ll need +to remove **/etc/ld.so.preload** file manually: + +` $ sudo chroot ~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +` -bash-3.2$ rm -f /etc/ld.so.preload` + +### \"relocation R\_X86\_64\_PC32 against symbol \`\_\_asan\_option\_detect\_stack\_use\_after\_return\' can not be used when making a shared object; recompile with -fPIC\" + +Sometimes when linking a shared library with ASan you can get a +following error: + +``  relocation R_X86_64_PC32 against symbol `__asan_option_detect_stack_use_after_return' can not be used when making a shared object; recompile with -fPIC `` + +This happens because you try to link some object file compiled with +**-fPIE** option to your shared library (this is actually wrong). To +overcome the issue, remove **-fPIE** from compilation flags or replace +it with **-fPIC**. + +===gcc-real: error: cannot specify -static with -fsanitize=address=== +ASan doesn\'t work with static binaries, consider removing **-static** +from you build flags. + +### there\'re mounted directories to build root. Please unmount them manually to avoid being deleted unexpectly + +/proc mount: Since even init process (systemd in Tizen) is sanitized, +the environment must be prepared ready for the task, so ASan runtime +library libasan.so was patched to check needed mount points, like /proc +and log path and mounts them when needed: + +`sudo umount `**`~/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/proc/`** + +Now, fixed in **depanneur** +tool[3](https://review.tizen.org/gerrit/#/c/177437/) applied in +[4](http://download.tizen.org/tools/archive/18.01.4/Ubuntu_16.04/depanneur_0.16.2.tar.gz) + +### error: r7 cannot be used in asm here + +ASan requires additional register to make instrumentation work. Calls to +\_\_asan\_load() and \_\_asan\_store() require that register and +therefore register pressure is too high: + +`set `**`no_sanitize_address`**` for this function` + +or + +`set `**`%{?asan:--disable-inline-asm}`**` to the .spec` + +Runtime issues +-------------- + +### \"ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD\_PRELOAD\" runtime error + +- Short answer: you probably forgot to install + [https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm + asan-runtime-env](https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm_asan-runtime-env "wikilink") + package. Try to install it to your device. +- Long answer: One of the main requirements for ASan to work correctly + is that **libasan.so** library should be **the first in ELF symbol + search lookup order** + (https://docs.oracle.com/cd/E19683-01/817-3677/auto25/index.html). + This could be achieved by preloading libasan.so by exporting + **LD\_PRELOAD=libasan.so** or writing libasan.so to + **/etc/ld.so.preload** file: + +`cat /etc/ld.so.preload`\ +`/usr/lib/libasan.so.3.0.0` + +The +[https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm +asan-runtime-env](https://build.tizen.org/build/Tizen:Base/arm/armv7l/linaro-gcc/asan-runtime-env-6.2.1-6.2.armv7l.rpm_asan-runtime-env "wikilink") +package should do it for you automatically, but if you already installed +it and the issue still occurs, try add **libasan.so** to +**/etc/ld.so.preload** manually: + +`echo '/usr/lib/libasan.so.3.0.0'  > /etc/ld.so.preload`\ +`sync` + +### \"Your application is linked against incompatible ASan runtimes.\" runtime error + +- Short answer: you probably try to run the application built with + \"-static-libasan\" option under dynamic libasan.so preloaded. +- So, for the application built with \"-static-libasan\" option, you + need to run without libasan.so to avoid conflict. + +`sed -e '/libasan.so/d' -i /etc/ld.so.preload` + +[Category:Security](Category:Security "wikilink") diff --git a/docs/platform/tool/Analyzing_Workflow_of_Gbs_Export.md b/docs/platform/tool/Analyzing_Workflow_of_Gbs_Export.md new file mode 100644 index 0000000000..dc717c9ffc --- /dev/null +++ b/docs/platform/tool/Analyzing_Workflow_of_Gbs_Export.md @@ -0,0 +1,737 @@ +Introduction +------------ + +This document will introduce the basic workflow of \`gbs export\`. First +the whole structure will be shown as follow, the following sections will +analyze each section in details. + +.. image:: ../../../data/images/gbs\_packaging.png + +Upstream Branch Existing +------------------------ + +Upstream branch is the first condition to enable non-native packaging +development model, the default upstream branch is \`upstream\`, which +can be customized with the following ways: + +1.Configure in gbs conf: + +` [general]`\ +` upstream_branch=upstream_tizen`\ +` upstream_tag=upstream/${upstreamversion}` + +2.Command line option: \--upstream-branch + +` $ gbs export --upstream-branch=123` + +### Code Analysis + +` 151     if is_native_pkg(repo, args) or args.no_patch_export:`\ +` 152         argv.extend(["--git-no-patch-export",`\ +` 153                      "--git-upstream-tree=%s" % commit])`\ +` 154     else:`\ +` 155         # Check if the revision seems to be of an orphan development branch`\ +` 156         is_orphan = False`\ +` 157         export_commitish = 'HEAD' if commit == 'WC.UNTRACKED' else commit`\ +` "gitbuildsys/cmd_export.py" 320 lines --38%--                                  `\ +` --------`\ +` 52     def is_native_pkg(repo, args):`\ +` 53         """`\ +` 54         Determine if the package is "native"`\ +` 55         """`\ +` 56         upstream_branch = configmgr.get_arg_conf(args, 'upstream_branch')`\ +` 57         return not repo.has_branch(upstream_branch)`\ +` 58 `\ +` "gitbuildsys/cmd_export.py" 320 lines --18%--` + +Generate Tarball from \'HEAD\'(No patch generated) +-------------------------------------------------- + +Not having a upstream branch in specific project git tree indicates that +the corresponding package is in a native packaging deevelopment model. +For native packages, gbs simply creates tarball from the HEAD of the +current branch, no patch generated. + +### Code Analysis + +1\. buildpackage\_rpm.py calls is\_native() and git\_archive(). + +` 619   # Get/build the orig tarball`\ +` 620   if is_native(repo, options):`\ +`               ...`\ +` 626           if not git_archive(repo, spec, source_dir, options.tmp_dir,`\ +` 627                              tree, options.orig_prefix,`\ +` 628                              options.comp_level,`\ +` 629                              options.with_submodules):`\ +` 630               raise GbpError, "Cannot create source tarball at '%s'" % export_dir`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +2\. git\_archive() calls git\_archive\_single(). + +` 54 def git_archive(repo, spec, output_dir, tmpdir_b, treeish, prefix,`\ +` 55                 comp_level, with_submodules):`\ +`            ...`\ +` 73         else:`\ +` 74             git_archive_single(repo, treeish, output, prefix,`\ +` 75                                spec.orig_src['compression'], comp_level, comp_opts,`\ +` 76                                spec.orig_src['archive_fmt'])`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +3\. git\_archive\_single() calls archive(). + +` 101 def git_archive_single(repo, treeish, output, prefix, comp_type, comp_level,`\ +` 102                        comp_opts, format='tar'):`\ +`             ...`\ +` 115         popen = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=archive_fd)`\ +` 116         for chunk in repo.archive(format, prefix, None, treeish):`\ +` 117             popen.stdin.write(chunk)`\ +` 118         popen.stdin.close()`\ +` "git-buildpackage/gbp/scripts/common/buildpackage.py"` + +4\. archive() calls \_git\_inout2(). + +` 1837   def archive(self, format, prefix, output, treeish, paths=None):`\ +`            ...`\ +` 1862       if output:`\ +` 1863           out, err, ret = self._git_inout('archive', args.args)`\ +` 1864           if ret:`\ +` 1865               raise GitRepositoryError("Unable to archive %s: %s" % (treeish,`\ +` 1866                                                                      err))`\ +` 1867       else:`\ +` 1868           return self._git_inout2('archive', args.args)`\ +` "git-buildpackage/gbp/git/repository.py"` + +5\. \_git\_inout2() calls \_git\_inout(). + +` 194   def _git_inout2(self, command, args, stdin=None, extra_env=None, cwd=None,`\ +` 195                   capture_stderr=False):`\ +`           ...`\ +` 207       try:`\ +` 208           for outdata in self.__git_inout(command, args, stdin, extra_env,`\ +` 209                                           cwd, capture_stderr, True):`\ +` 210               stderr += outdata[1]`\ +` 211               yield outdata[0]`\ +` "git-buildpackage/gbp/git/repository.py"` + +6\. \_git\_inout() executes git command:\*\*git archive \--format=tar +\--prefix=/ HEAD \--\*\* + +` 217   def __git_inout(cls, command, args, stdin, extra_env, cwd, capture_stderr,`\ +` 218                   capture_stdout):`\ +`           ...`\ +` 232       cmd = ['git', command] + args`\ +` 233       env = cls.__build_env(extra_env)`\ +` "git-buildpackage/gbp/git/repository.py"` + +7\. Compress command (gzip, bzip2) takes the output of \`git archive\` as +input to generate compressed files by using pipe technology. + +` 101 def git_archive_single(repo, treeish, output, prefix, comp_type, comp_level,`\ +` 102                        comp_opts, format='tar'):`\ +`                ...`\ +` 108     prefix = sanitize_prefix(prefix)`\ +` 109     with open(output, 'w') as archive_fd:`\ +` 110         if comp_type:`\ +` 111             cmd = [comp_type, '--stdout', '-%s' % comp_level] + comp_opts`\ +` 112         else:`\ +` 113             cmd = ['cat']`\ +` 114`\ +` 115    popen = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=archive_fd)` + +` This is equivalent to the following command when the comp_type is tar.bz2: `\ +` git archive --format=tar --prefix=``/ HEAD -- | bzip2 --stdout -6 > fake-0.1.tar.bz2` + +HEAD and Upstream Branch has Common Ancestor +-------------------------------------------- + +If current HEAD and upstream branch have common ancestor, this is the +joint-packaging development model, the next step is to check tag exists +or not. Else if current HEAD and upstream branch don\'t have common +ancestor, gbs will regards current branch as orphan-packaging branch, +this means your are in orphan-packaging development model, the next step +is to copy packaging files from packaging branch during gbs generates +tarball. + +Upstream Tag Exists +------------------- + +In joint-packageing model,If there is upstream branch, gbs will generate +patches first, during this period, the upstream tag is the most +importand role, individual patches (one per commit) are generated from +the upstream tag to the exported revision. So if no related upstream +tag, gbs will displays the error message and exit. + +Whether the tag exist or not will result two consequences: + +- If yes, gbs will check whether tag is the ancester of current HEAD. +- If no, gbs will exist abnormally with error message:\*\*Invalid + upstream treeish \*\*. + +### Code Analysis + +1\. buildpackage\_rpm.py calls export\_patches(). + +` 580  if options.patch_export and not is_native(repo, options):`\ +` 581      if options.patch_export_rev:`\ +` 582          patch_tree = get_tree(repo, options.patch_export_rev)`\ +` 583      else:`\ +` 584          patch_tree = tree`\ +` 585      export_patches(repo, spec, patch_tree, options)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +2\. export\_patches calls get\_upstream\_tree(). + +` 296 def export_patches(repo, spec, export_treeish, options):`\ +`      ...`\ +` 300     try:`\ +` 301         upstream_tree = get_upstream_tree(repo, spec, options)`\ +` 302         update_patch_series(repo, spec, upstream_tree, export_treeish, options)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +3\. get\_upstream\_tree() calls has\_treeish(). + +` 157 def get get_upstream_tree():`\ +`         ...`\ +` 169     if not repo.has_treeish(upstream_tree):`\ +` 170         raise GbpError('Invalid upstream treeish %s' % upstream_tree)`\ +` 171     return upstream_tree`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +4\. has\_treeish() calls \_git\_inout(). + +` 1019   def has_treeish(self, treeish):`\ +`            ...`\ +` 1028       _out, _err, ret =  self._git_inout('ls-tree', [treeish],`\ +` 1029                                          capture_stderr=True)`\ +` 1030       return [ True, False ][ret != 0]`\ +` "git-buildpackage/gbp/git/repository"` + +5\. \_git\_inout() calls its \_git\_inout() class method. + +` 161   def _git_inout(self, command, args, input=None, extra_env=None, cwd=None,`\ +` 162                  capture_stderr=False, capture_stdout=True):`\ +`           ...`\ +` 184       try:`\ +` 185           for outdata in self.__git_inout(command, args, input, extra_env,`\ +` 186                                           cwd, capture_stderr,`\ +` 187                                           capture_stdout):`\ +` 188               stdout += outdata[0]`\ +` 189               stderr += outdata[1]`\ +` "git-buildpackage/gbp/git/repository"` + +6\. \_git\_inout() class method executes the git command: \*\*git ls-tree +\*\*. + +` 216   @classmethod`\ +` 217   def __git_inout(cls, command, args, stdin, extra_env, cwd, capture_stderr,`\ +` 218                   capture_stdout):`\ +`           ...`\ +` 232       cmd = ['git', command] + args`\ +` 233       env = cls.__build_env(extra_env)`\ +` 234       stdout_arg = subprocess.PIPE if capture_stdout else None`\ +` 235       stdin_arg = subprocess.PIPE if stdin else None`\ +` 236       stderr_arg = subprocess.PIPE if capture_stderr else None`\ +` "git-buildpackage/gbp/git/repository"` + +Upstream Tag is Ancestor of Current HEAD +---------------------------------------- + +GBS uses tag as the boundary of tarball creation and patch generation, +that is, tag and all its ancestors will be included in tarball, whereas +every child of tag will be generated as a patch, hence, upstream tag +must be reachable for the current HEAD and tag must be ancestor of HEAD. + +And there are two consequences about this topic: + +- If ancestor of HEAD, gbs will generate patches from upstream tag to + current \`HEAD\`. +- If not, gbs will exist abnormally with error message: \*\*Start + commit \'\' not an ancestor of end commit \'HEAD\'\*\* + +### Three Incorrect Cases + +Here we graphical three incorrect cases, what we need pay attentions are +the relations among upstream branch, current HEAD and position of the +tag. + +: + + : images: + +- For case one, tag is on upstream branch, but tag isn\'t the ancestor + of the current HEAD, the HEAD to the tag is unreachable. For + details, see \"merge\_base = repo.get\_merge\_base(parent\_sha1, + child\_sha1)\" in step-05. + + + +- For case two, upstream branch and current branch don\'t have any + intersection, in this case, current HEAD and tag are unreachable. + For details, see \"merge\_base = repo.get\_merge\_base(parent\_sha1, + child\_sha1)\" in step-05. + + + +- For case three, current HEAD and tag is reachable, but tag is not + the ancestor of current HEAD. For details, see \"return merge\_base + == parent\_sha1\" in step-05. + +### Code Analysis + +1\. buildpackage\_rpm.py calls export\_patches(). + +` 579  # Generate patches, if requested`\ +` 580  if options.patch_export and not is_native(repo, options):`\ +` 581      if options.patch_export_rev:`\ +` 582          patch_tree = get_tree(repo, options.patch_export_rev)`\ +` 583      else:`\ +` 584          patch_tree = tree`\ +` 585      export_patches(repo, spec, patch_tree, options)`\ +` "/home/rui/projects/git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +2\. export\_patches() calls update\_patch\_series(). + +` 258 def export_patches(repo, options):`\ +`         ...`\ +` 274     update_patch_series(repo, spec, upstream_commit, export_treeish, options)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +3\. update\_patch\_series() calls generate\_patches(). + +` 198 def update_patch_series(repo, spec, start, end, options):`\ +`         ...`\ +` 211     patches, commands = generate_patches(repo, start, squash, end,`\ +` 212                                          spec.specdir, options)`\ +` "git-buildpackage/gbp/scripts/pq_rpm.py"` + +4\. generate\_patches() calls is\_ancestor(). + +` 91 def generate_patches(repo, start, squash, end, outdir, options):`\ +`         ...`\ +` 115     if not is_ancestor(repo, start_sha1, end_commit_sha1):`\ +` 116         raise GbpError("Start commit '%s' not an ancestor of end commit "`\ +` 117                        "'%s'" % (start, end_commit))`\ +` "git-buildpackage/gbp/scripts/pq_rpm.py"` + +5\. is\_ancestor() calls repo.get\_merge\_base(): \*\*git merge-base HEAD +upstream\*\* + +` 81 def is_ancestor(repo, parent, child):`\ +` 82     """Check if commit is ancestor of another"""`\ +` 83     parent_sha1 = repo.rev_parse("%s^0" % parent)`\ +` 84     child_sha1 = repo.rev_parse("%s^0" % child)`\ +` 85     try:`\ +` 86         merge_base = repo.get_merge_base(parent_sha1, child_sha1)`\ +` 87     except GitRepositoryError:`\ +` 88         merge_base = None`\ +` 89     return merge_base == parent_sha1`\ +` 90`\ +` "git-buildpackage/gbp/scripts/pq_rpm.py"` + +Generate Patches from Upstream Tag to HEAD +------------------------------------------ + +In joint-packaging development model, after checking the upstream tag, +next is generate patches from upstream tag to the HEAD. + +### Code Analysis + +1.With the gbp parameters about patches are transfered to gbp code, the +function \`export\_patches(repo, spec, export\_treeish, options)\` is +called for patches generation. + +` 294 def export_patches(repo, spec, export_treeish, options):`\ +` 295     """`\ +` 296     Generate patches and update spec file`\ +` 297     """`\ +` 298     try:`\ +` 299         upstream_tree = get_upstream_tree(repo, spec, options)`\ +` 300         update_patch_series(repo, spec, upstream_tree, export_treeish, options)`\ +` 301     except (GitRepositoryError, GbpError) as err:`\ +` 302         raise GbpAutoGenerateError(str(err))` + +2.In function \`update\_patch\_series\`, it calles +\`generate\_patches\`. And the function \`format\_patch\` is key for +patches\' generation. + +` 91 def generate_patches(repo, start, squash, end, outdir, options):`\ +`         ...`\ +` 153     for commit in reversed(repo.get_commits(start, end_commit)):`\ +` 154         info = repo.get_commit_info(commit)`\ +` 155         cmds = parse_gbp_commands(info, 'gbp-rpm', ('ignore'),`\ +` 156                                   ('if', 'ifarch'))[0]`\ +` 157         if not 'ignore' in cmds:`\ +` 158             patch_fn = format_patch(outdir, repo, info, patches,`\ +` 159                                     options.patch_numbers,`\ +` 160                                     options.patch_export_ignore_path)`\ +` 161             if patch_fn:`\ +` 162                 commands[os.path.basename(patch_fn)] = cmds`\ +` "git-buildpackage/gbp/scripts/pq_rpm.py"` + +3.We can see that patches\' generation including two steps, first is get +code diff in git tree by git command, second is write code diff to a +file which endwith .patch, this file is the patch we want. + +` Git command to get code diff, we take project platform/upstream/js as an example:`\ +` git diff -p --no-ext-diff --stat=80 --summary --text --ignore-submodules`\ +` db4843164340e965dc0e6168dbb59b3e795e511c^! -- js/src/  configure js/src/configure.in` + +` 237 def format_patch(outdir, repo, commit_info, series, numbered=True,`\ +` 238                  path_exclude_regex=None, topic=''):`\ +` 260     ...`\ +` 261     # Finally, create the patch`\ +` 262     patch = None`\ +` 263     if paths:`\ +` 264         diff = repo.diff('%s^!' % commit_info['id'], paths=paths, stat=80,`\ +` 265                          summary=True, text=True)`\ +` 266         patch = write_patch_file(filepath, commit_info, diff)`\ +` "git-buildpackage/gbp/scripts/common/pq.py"` + +4.This function achieves execute git command with subprocess.Popen. + +` 217    def __git_inout(cls, command, args, stdin, extra_env, cwd, capture_stderr,`\ +` 218                    capture_stdout):`\ +` 231`\ +` 232        cmd = ['git', command] + args`\ +` 239        popen = subprocess.Popen(cmd,`\ +` 240                                 stdin=stdin_arg,`\ +` 241                                 stdout=stdout_arg,`\ +` 242                                 stderr=stderr_arg,`\ +` 243                                 env=env,`\ +` 244                                 close_fds=True,`\ +` 245                                 cwd=cwd)`\ +` "git-buildpackage/gbp/git/repository.py"  ` + +5.After patches are generated, macro defines about patches will be added +in specfile. + +` 197 def update_patch_series(repo, spec, start, end, options):`\ +`         ...`\ +` 212     spec.update_patches(patches, commands)`\ +` 213     spec.write_spec_file()`\ +` "git-buildpackage/gbp/scripts/pq_rpm.py"` + +6.Addition + +- With the subcommand :\*\*\--squash-patches-until\*\*. Gbs will + squash commits(from upstream) up to certain tree-ish into one + monolithic diff. Diff file also including two steps, first is get + code diff with git command, second is wirte code diff into a file + which endwith .diff, this diff file is the final file generated with + subcommand \`\--squash-patches-until\`. + +`  91 def generate_patches(repo, start, squash, end, outdir, options):  `\ +`          ...`\ +`  117     # Squash commits, if requested`\ +`  126             # Shorten SHA1s`\ +`  127             squash_sha1 = repo.rev_parse(squash_sha1, short=7)`\ +`  128             start_sha1 = repo.rev_parse(start_sha1, short=7)`\ +`  129             gbp.log.info("Squashing commits %s..%s into one monolithic diff" %`\ +`  130                          (start_sha1, squash_sha1))`\ +`  131             patch_fn = format_diff(outdir, squash[1], repo,`\ +`  132                                    start_sha1, squash_sha1,`\ +`  133                                    options.patch_export_ignore_path)`\ +`  "git-buildpackage/gbp/scripts/pq_rpm.py"`\ +`  -----------------`\ +`  272 def format_diff(outdir, filename, repo, start, end, path_exclude_regex=None):`\ +`  288     if paths:`\ +`  289         diff = repo.diff(start, end, paths=paths, stat=80, summary=True,`\ +`  290                          text=True)`\ +`  291         return write_patch_file(filename, info, diff)`\ +`  "git-buildpackage/gbp/scripts/common/pq.py"` + +- The last merge commit are squashed into one diff if \"Merge\" + commits are found in the revision list, from which patches are to be + generated. Diff file generation is the same as \`With the subcommand + : \--squash-patches-until\` part. + +`  91 def generate_patches(repo, start, squash, end, outdir, options):`\ +`          ...`\ +`  137     # Check for merge commits, yet another squash if merges found`\ +`  138     merges = repo.get_commits(start, end_commit, options=['--merges'])`\ +`  139     if merges:`\ +`  140         # Shorten SHA1s`\ +`  141         start_sha1 = repo.rev_parse(start, short=7)`\ +`  142         merge_sha1 = repo.rev_parse(merges[0], short=7)`\ +`  143         patch_fn = format_diff(outdir, None, repo, start_sha1, merge_sha1,`\ +`  144                                options.patch_export_ignore_path)`\ +`  145         if patch_fn:`\ +`  146             gbp.log.info("Merge commits found! Diff between %s..%s written "`\ +`  147                          "into one monolithic diff" % (start_sha1, merge_sha1))`\ +`  "git-buildpackage/gbp/scripts/pq_rpm.py"`\ +`  -----------------`\ +`  272 def format_diff(outdir, filename, repo, start, end, path_exclude_regex=None):`\ +`  288     if paths:`\ +`  289         diff = repo.diff(start, end, paths=paths, stat=80, summary=True,`\ +`  290                          text=True)`\ +`  291         return write_patch_file(filename, info, diff)`\ +`  "git-buildpackage/gbp/scripts/common/pq.py"` + +Copy Packaging Files from HEAD +------------------------------ + +In joint-packaging model, gbs will copy packaging files from current +HEAD to the target export directory. After copying packaging files, the +next step is generate tarball from pristine-tar branch. + +### Code Analysis + +1.Specdir is packaging dir, code bellow achieves copy all pkgfiles under +packaging dir to export\_dir, export\_dir\'s creation is under /var/tmp/ +dir temporary. + +` 591     # Move packaging files`\ +` 592     gbp.log.debug("Exporting packaging files in '%s' to '%s'" % (spec.specdir, export_dir))`\ +` 593     pkgfiles = os.listdir(spec.specdir)`\ +` 594     for f in pkgfiles:`\ +` 595         src = os.path.join(spec.specdir, f)`\ +` 596         if f == spec.specfile:`\ +` 597             dst = os.path.join(spec_dir, f)`\ +` 598         else:`\ +` 599             dst = os.path.join(source_dir, f)`\ +` 600         try:`\ +` 601             if os.path.isdir(src):`\ +` 602                 # dir is not packaging files, skip it`\ +` 603                 continue`\ +` 604             else:`\ +` 605                 shutil.copy2(src, dst)`\ +` 606         except IOError, err:`\ +` 607             raise GbpError, "Error exporting files: %s" % err`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +2.After gbs finish copying packaging files and generating tarball(see +the next two parts), gbs will move files under export\_dir to dest +source git tree. + +` 314     shutil.move(export_dir, outdir)`\ +` "gbs/gitbuildsys/cmd_export.py"` + +Pristine-tar Branch Exists and Checkout Tarball +----------------------------------------------- + +For tarball\'s generation, gbs will check pristine-tar branch exists or +not, if pristine-tar branch exists and also contain the tarball with +correct version, gbs will generation from pristine-tar directly.But even +with correct version, tarball generation from pristine-tar would failed +sometimes,not to mention no corrent tarball in that branch, in this +case, gbs will generate tarball using upstream tag. + +### Code Analysis + +1.Code analysis bellow, if current git tree is non-native development +model, the function \`prepare\_upstream\_tarball(repo, spec, options, +source\_dir)\` will be called for generating tarball. + +` 631    elif spec.orig_src:`\ +` 632         prepare_upstream_tarball(repo, spec, options, source_dir)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"` + +2.The function bellow shows gbs will check pristine-tar branch first, if +there is pristine-tar branch in git tree, gbs will checkout tarball from +there by calling the function \`pristine\_tar\_build\_orig(repo, +orig\_file, output\_dir, options)\`. + +` 91 def prepare_upstream_tarball(repo, spec, options, output_dir):`\ +` 103`\ +` 104     # build an orig unless the user forbids it, always build (and overwrite pre-existing) if user forces it`\ +` 105     if options.force_create or (not options.no_create_orig and not RpmPkgPolicy.has_orig(orig_file, output_dir)):`\ +` 106         if not pristine_tar_build_orig(repo, orig_file, output_dir, options):`\ +` 107             upstream_tree = git_archive_build_orig(repo, spec, output_dir, options)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"`\ + +3.Check pristine-tar branch exists or not: + +` Check branch command : **git show-ref refs/heads/pristine-tar**` + +` 137 def pristine_tar_build_orig(repo, orig_file, output_dir, options):`\ +`         ...`\ +` 142     if options.pristine_tar:`\ +` 143         if not repo.has_branch(repo.pristine_tar_branch):`\ +` 144             gbp.log.warn('Pristine-tar branch "%s" not found' %`\ +` 145                          repo.pristine_tar.branch)`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"`\ +` -----------------`\ +` 448     def has_branch(self, branch, remote=False):`\ +` 458         if remote:`\ +` 459             ref = 'refs/remotes/%s' % branch`\ +` 460         else:`\ +` 461             ref = 'refs/heads/%s' % branch`\ +` 462         try:`\ +` 463             self._git_command('show-ref', [ ref ])`\ +` "git-buildpackage/gbp/git/repository.py"` + +4.For example, we take generate tarball js185-1.0.0.tar.bz2 from +pristine-tar branchas an example, the final function to execute cmd by +subprocess.Popen is \`\_\_call(self, args)\`, let\'s see the code +segment bellow: + +` Checkout tarball command : **/usr/bin/pristine-tar checkout /var/tmp/.gbs_export_pTzq29/js185-1.0.0.tar.bz2**` + +` 137 def pristine_tar_build_orig(repo, orig_file, output_dir, options):`\ +`             ...`\ +` 146         try:`\ +` 147             repo.pristine_tar.checkout(os.path.join(output_dir, orig_file))`\ +` 148             return True`\ +` 149         except CommandExecFailed:`\ +`                     ...`\ +` 155                 raise`\ +` 156     return False`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"`\ +` -----------------`\ +` 55    def __call(self, args):`\ +` 66`\ +` 67        cmd = [ self.cmd ] + self.args + args`\ +` 68        if self.shell:`\ +` 70            cmd = " ".join(cmd)`\ +` 71        popen = subprocess.Popen(cmd,`\ +` 72                                 cwd=self.cwd,`\ +` 73                                 shell=self.shell,`\ +` 74                                 env=self.env,`\ +` 75                                 preexec_fn=default_sigpipe,`\ +` 76                                 stderr=stderr_arg)`\ +` "git-buildpackage/gbp/command_wrappers.py"` + +Generate Tarall Using Upstream Tag +---------------------------------- + +If no pristine-tar branch or no correct tarball in pristine-tar branch +or generate tarball failed, gbs will generate tarball using upstream +tag. + +### Code Analysis + +1.Tarball\'s generation is by calling the function +\`git\_archive\_build\_orig(repo, spec, output\_dir, options)\` + +` 91 def prepare_upstream_tarball(repo, spec, options, output_dir):`\ +` 103`\ +` 107             upstream_tree = git_archive_build_orig(repo, spec, output_dir, options)`\ +` ""` + +2.Let us suppose tarball js185-1.0.0.tar.bz2 checkout from pristine-tar +failed, we will generate it with the upstream tag, take this as an +example: + +``  The final function to execute cmd by subprocess.Popen is `__git_inout`: ``\ +` Archive tarball command: **git archive --format=tar --prefix=js-1.0.0/ upstream/1.0.0 -- | bzip2 --stdout -6 > js185-1.0.0.tar.bz2**` + +` 262 def git_archive_build_orig(repo, spec, output_dir, options):`\ +` 285         if not git_archive(repo, spec, output_dir, options.tmp_dir,`\ +` 286                            upstream_tree, options.orig_prefix,`\ +` 287                            options.comp_level, options.with_submodules):`\ +` "git-buildpackage/gbp/scripts/buildpackage_rpm.py"`\ +` -----------------`\ +` 217def __git_inout(cls, command, args, stdin, extra_env, cwd, capture_stderr,`\ +` 218                capture_stdout):`\ +` 231    ...`\ +` 232    cmd = ['git', command] + args`\ +` 239    popen = subprocess.Popen(cmd,`\ +` 240                             stdin=stdin_arg,`\ +` 241                             stdout=stdout_arg,`\ +` 242                             stderr=stderr_arg,`\ +` 243                             env=env,`\ +` 244                             close_fds=True,`\ +` 245                             cwd=cwd)`\ +` "git-buildpackage/gbp/git/repository.py"` + +Update Spec Files (Adding VCS tag) +---------------------------------- + +After gbs generates tarball successfuly, the final step is update spec +file with adding VCS tag. + +### Code Analysis + +` 673                 Command(options.posttag, shell=True,`\ +` 674                         extra_env={'GBP_TAG': tag,`\ +` 675                                    'GBP_BRANCH': branch,`\ +` 676                                    'GBP_SHA1': sha})()`\ +` 677         else:`\ +` 678             vcs_info = get_vcs_info(repo, tree)`\ +` 679         # Put 'VCS:' tag to .spec`\ +` 680         spec.set_tag('VCS', None, options.spec_vcs_tag % vcs_info)`\ +` 681         spec.write_spec_file()`\ +` 682 `\ +` 683     except CommandExecFailed:`\ +` "gbp/scripts/buildpackage_rpm.py"` + +Orphan\_packaging Branch Exist +------------------------------ + +If you get the result that current HEAD and upstream branch don\'t have +common ancestor, this means you\'ve been on orphan packaging branch +already. Gbs export wouldn\'t generate patches on orphan packaging +branch, because gbp parameters about generate patches won\'t be +transfered to gbp code. + +The parameters such as:\"\--git-patch-export\", +\"\--git-patch-export-compress=100k\", +\"\--git-patch-export-squash-until=%s\", +\"\--git-patch-export-ignore-path=\^(%s/.\*\|.gbs.conf)\". + +Check whether you are on orphan packaging branch in orphan-packaging +model, follow the code segment bellow: + +### Code Analysis + +1.The result of final command \*\*git merge-base HEAD upstream\*\* +called by function \`repo.get\_merge\_base(export\_commitish, +upstream\_branch)\` will affect the bool value of is\_orhpan, if +\`is\_orphan = True\` means you are on orphan-packaging branch, let\'s +see the gbp parameters about patches handled for this branch by the +second code segment. + +` 156    is_orphan = False`\ +` 157    export_commitish = 'HEAD' if commit == 'WC.UNTRACKED' else commit`\ +` 158    try:`\ +` 159        repo.get_merge_base(export_commitish, upstream_branch)`\ +` 160    except GitRepositoryError:`\ +` 161        is_orphan = True`\ +` 162`\ +` "gbs/gitbuildsys/cmd_export.py"` + +2.This code segment shows if the current branch you are on isn\'t the +orphan-packaging branch, the gbp parameters about patches will be +transfered to gbp code by adding them in argv. On the opposite,if on the +orphan-packaging branch, these parameters won\'t be added in argv, also +won\'t be transfered to gbp code.So no patches would be generated +finally. + +` 165    if not is_orphan:`\ +` 166        argv.extend(["--git-patch-export",`\ +` 167                     "--git-patch-export-compress=100k",`\ +` 168                     "--git-patch-export-squash-until=%s" %`\ +` 169                        squash_patches_until,`\ +` 170                     "--git-patch-export-ignore-path=^(%s/.*|.gbs.conf)" %`\ +` 171                        packaging_dir,`\ +` 172                    ])`\ +` "gbs/gitbuildsys/cmd_export.py"` + +Copy Packaging Files from Packaging Branch +------------------------------------------ + +In orphan-packaging develoment model, during gbs export period on +orphan-packaging branch, without patch generate action, the first step +is copy packaging files from the packaging branch to the target export +directory. + +Code segment is the same as \`Copy Packaging files from HEAD\` part. + +Generate Tarball in Orphan Packaging Model +------------------------------------------ + +In orphan-packaging model,on orphan-packaging branch,when developers +export the package gbs will verify the pristine-tar branch first, if +pristine-tar branch is available, tarball will be generated from there; +else gbs will generate tarball from upstream branch. + +The tarball generation procedure is the same as joint-packaging +development model, + +Verify pristine-tar and checkout tarball from there please refer to +\`Pristine-tar Branch Exists and Checkout Tarball\` part. + +Generate tarball with upstream tag please refer to \`Generate Tarall +Using Upstream Tag\` part. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Build_images_from_a_Dockerfile.md b/docs/platform/tool/Build_images_from_a_Dockerfile.md new file mode 100644 index 0000000000..f98560f1e1 --- /dev/null +++ b/docs/platform/tool/Build_images_from_a_Dockerfile.md @@ -0,0 +1,151 @@ +Introduction +------------ + +To build an image from a source repository, create a description file +called Dockerfile at the root of your repository. This file will +describe the steps to assemble the image.\ +Download Dockerfile on review.tizen.org\ + + Log in on review.tizen.org + ssh clone + +Gerrit Image +------------ + +\$ git clone +id\]\@review.tizen.org:29418/scm/services/docker-script -b gerrit\ +\$ cd devgerrit\ +\$ ls\ + + Dockerfile dgerrit.sh env jdk proxy script supervisor + config.conf drupal gerrit phpldapadmin root slap + + #### Description #### + * Dockerfile : A Dockerfile is a text document that contains all the commands + you would normally execute manually in order to build a Docker image + * config.conf : Metaconfig file of container + * env : Environment variables of container + * root : Specific configuration files to be applied on container + + +\$ sudo ./dgerrit.sh build\ + + Build docker images: + Sending build context to Docker daemon 104.4 kB + Sending build context to Docker daemon + Step 0 : FROM opensuse:13.1 + ---> c8ad3d804d48 + ... + Successfully built 1a5ffc17324d + +\$ docker images + + $ docker images + tizendocker:443/gerritdrupalldap 2.9.4.0.2 + +Jenkins Image +------------- + +\$ git clone ssh://\[user +id\]\@review.tizen.org:29418/scm/services/docker-script -b jenkins\ +\$ cd devjenkins\ +\$ ls\ + + Dockerfile config.conf djenkins.sh env jenkins root script supervisor + + #### Description #### + * Dockerfile : A Dockerfile is a text document that contains all the commands + you would normally execute manually in order to build a Docker image + * config.conf : Metaconfig file of container + * env : Environment variables of container + * root : Specific configuration files to be applied on container + + +\$ sudo ./djenkins.sh build\ + + Build docker images: + Sending build context to Docker daemon 104.4 kB + Sending build context to Docker daemon + ... + Successfully built 1a5ffc17324d + + +\$ docker images\ + + $ docker images + tizendocker:443/jenkins 1.580.3-1.2.0.4 + +OBS Server Image +---------------- + +\$ git clone +id\]\@review.tizen.org:29418/scm/services/docker-script -b +obsserver-2.4\ +\$ cd devobsserver\ +\$ ls\ + + Dockerfile dobsserver.sh obsserver root supervisor + config.conf env script + + #### Description #### + * Dockerfile : A Dockerfile is a text document that contains all the commands + you would normally execute manually in order to build a Docker image + * config.conf : Metaconfig file of container + * env : Environment variables of container + * root : Specific configuration files to be applied on container + + +\$ sudo ./dobsserver.sh build\ + + Build docker images: + Sending build context to Docker daemon 104.4 kB + Sending build context to Docker daemon + ... + Successfully built 1a5ffc17324d + + +\$ docker images\ + + $ docker images + tizendocker:443/obsserver 2.4.0.7 + +OBS Worker Image +---------------- + +\$ git clone +id\]\@review.tizen.org:29418/scm/services/docker-script -b +obsworker-2.4\ +\$ cd devobsworker\ +\$ ls\ + + Dockerfile config.conf dobsworker.sh env obsw root script supervisor + + #### Description #### + * Dockerfile : A Dockerfile is a text document that contains all the commands + you would normally execute manually in order to build a Docker image + * config.conf : Metaconfig file of container + * env : Environment variables of container + * root : Specific configuration files to be applied on container + +\$ sudo ./dobsworker.sh build + + Build docker images: + Sending build context to Docker daemon 104.4 kB + Sending build context to Docker daemon + ... + Successfully built 1a5ffc17324d + +\$ docker images + + $ docker images + tizendocker:443/obsworker 2.4.0.3 + +References +---------- + +Docker can build images automatically by reading the instructions from a +Dockerfile + +[Setup\_of\_Tizen\_Infrastructure\_with\_Docker](Setup_of_Tizen_Infrastructure_with_Docker "wikilink") + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Cordova.md b/docs/platform/tool/Cordova.md new file mode 100644 index 0000000000..6bf7c2c565 --- /dev/null +++ b/docs/platform/tool/Cordova.md @@ -0,0 +1,87 @@ +Apache Cordova is a mobile software development framework, underlying +PhoneGap. + +Consider using it when HTML5 is not enough for +[Application\_Development](Application_Development "wikilink"). + +### Onsen UI: + +![](Monaca.png "Monaca.png") + +Monaca / OnSen is providing cloud IDE facilities for +[hybrid](hybrid "wikilink") [mobile](mobile "wikilink") +[Application\_Development](Application_Development "wikilink") based on +(Phonegap/Cordova). + +- + +Tizen is not fully supported but it\'s possible to repackage app. + +Here are some hints + +- Register and start IDE : +- Create project / Sample Apps +- \"Bricks\" +- Open : \... +- File / Export project +- Title: bricks +- unzip project.zip +- Adapt [wgt](wgt "wikilink")\'s config.xml or replace to something + based on this minimal config.xml : + + + + + + + + + main + + + + +- - If you keep generated config.xml make sure to: + - Declare in widget element this attribute : + \"xmlns:tizen=\"\" + - Add \"tizen:application + - Keep content src=\"www/index.html\" + - Add + +- Then deploy using [SDK](SDK "wikilink"), or CLI SDK (we assume you + know about generating [certificates](certificates "wikilink")) + + + + cert=tizen + wgt_file=main.wgt + package=ComExample + ~/tizen-studio/tools/ide/bin/tizen build-web + ~/tizen-studio/tools/ide/bin/tizen package -t wgt -s ${cert} + ~/tizen-studio/tools/ide/bin/tizen install -n ${wgt_file} -- . + ~/tizen-studio/tools/sdb shell pkgcmd -l -t wgt + ~/tizen-studio/tools/ide/bin/tizen run --pkgid ${package} + +Et voila ! + +May sample code could be ported to Tizen, for instance check this +[OpenSource](OpenSource "wikilink") +[Application](Application "wikilink") using [React](React "wikilink") +[JavaScript](JavaScript "wikilink") framework: + +- +- + +Ask me more \--[Pcoval](User:Pcoval "wikilink") +([talk](User_talk:Pcoval "wikilink")) 11:36, 23 October 2016 (UTC) + +### Resources: + +- +- +- +- +- + +[Category:Application](Category:Application "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Further_OBS_Signing_Configurations.md b/docs/platform/tool/Further_OBS_Signing_Configurations.md new file mode 100644 index 0000000000..e2628b0fbd --- /dev/null +++ b/docs/platform/tool/Further_OBS_Signing_Configurations.md @@ -0,0 +1,101 @@ +You need additional configurations after +\ + +### Installing obssignd + +#### Prepare gnupg + +- The mainline gnupg cannot use obs-signd. +- You may use other standard signd (you won\'t be able to do + per-project sign) +- However, the author did never test with other signd. + +\ +\ +\* You need to apply the patch from obs-sign to gnupg. + +- - The patch is available at + ( + gnupg-1.4.7-files\_are\_digests.patch ) + - Or download at + + +- The patch is intended for 1.4.7, but the author used 1.4.16 (Ubuntu + 14.04) with some additional modifications. +- Apply the patch to your gnupg source + - In recent gnupg, g10/sign.c requires additional changes: + - add \#include \"../include/host2net.h\" + - modify buffer\_to\_u32 to buf32\_to\_u32 +- Recompile gnupg +- Install the modified & recompiled gnupg to your system. + +\ +==== Prepare obssignd ==== + +- Download +- Do what dist/obs-signd.spec says (if your system does not use RPM). + It\'s pretty short and straightforward. +- Modify dist/obssignd to configure /etc/init.d/obssignd for your + system. + - For example, in Ubuntu 14.04, modify the main daemon-start part + to: + - start-stop-daemon \--start \--background \--no-close \--exec + \${SN\_BIN} -p \${PID} \-- \${SN\_OPTS} \> + \"\$logdir\"/signd.log +- Run the \"obssignd\" daemon along with obssigner + +\ +=== Apply Tizen-Wide Public Key, Not Public Key per Project === + +- Edit /usr/lib/obs/server/BSConfig.pm (The official openSUSE guide + configures a public key per project) + +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ + + our $sign = "/usr/bin/sign"; + our $sign_project = 0; + our $keyfile = "/etc/ourkeyfile.asc"; + our $forceprojectkeys = 0; + +······\ + \|} + +- Delete per-project public keys if they are already created + +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ + + $ for X in `osc ls`; do osc signkey --delete $X; done + +······\ + \|} + +- - Projects published after this will use the public key configured + as in the openSUSE official guide (/etc/ourkeyfile.asc) + +\ + +### Verifying the Key + +- Note that MIC automatically checks the corresponding public key. + - It rejects creating images if the public key is not recognized. + - You need to import the public key in your system (\$ gpg + \--import keyfile) + + + +- Verifying repmod.xml (both repmod.xml and repmod.xml.asc should + exist in the current path) + - \$ gpg \--verify repmod.xml.asc + + + +- Importing the key + - \$ gpg \--import repmod.xml.key + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/GBS.md b/docs/platform/tool/GBS.md new file mode 100644 index 0000000000..4cffa41657 --- /dev/null +++ b/docs/platform/tool/GBS.md @@ -0,0 +1,146 @@ +GBS Design +---------- + +- [Package Dependency of Gbs](Package_Dependency_of_Gbs "wikilink") + + + +- [Debugging Gbs Submodules](Debugging_Gbs_Submodules "wikilink") + + + +- [Analyzing Workflow of + Gbs-export](Analyzing_Workflow_of_Gbs-export "wikilink") + + + +- [Native Package Processing in + Gbs-export](Native_Package_Processing_in_Gbs-export "wikilink") + + + +- [Dependency Structure for + Gbs-export](Dependency_Structure_for_Gbs-export "wikilink") + + + +- [Debian Package Processing in + Git-buildpackage](Debian_Package_Processing_in_Git-buildpackage "wikilink") + + + +- [Interface Between Tools-Service and + Git-buildpackage](Interface_Between_Tools-Service_and_Git-buildpackage "wikilink") + + + +- [Working Mechanism of + Depanneur](Working_Mechanism_of_Depanneur "wikilink") + +GBS Development +--------------- + +- [GBS Development Workflow](GBS_Development_Workflow "wikilink") + + + +- [Upgrade Third Party + Packages](Upgrade_Third_Party_Packages "wikilink") + +GBS Local Full Build +-------------------- + +- [Analyzing GBS Local Full Build + Errors](Analyzing_GBS_Local_Full_Build_Errors "wikilink") + + + +- [Analyzing Errors Related to Build + Circles](Analyzing_Errors_Related_to_Build_Circles "wikilink") + + + +- [Enabling New Profile Support for Local Full + Build](Enabling_New_Profile_Support_for_Local_Full_Build "wikilink") + + + +- [Preparing Pre-Built Binaries for Local Full + Build](Preparing_Pre-Built_Binaries_for_Local_Full_Build "wikilink") + + + +- [Switching between Branches](Switching_between_Branches "wikilink") + +Newly Supported Distros +----------------------- + +- [Guidelines for Testing Newly Supported + Distros](Guidelines_for_Testing_Newly_Supported_Distros "wikilink") + +Tools Release Process +--------------------- + +- [Release Process](Release_Process "wikilink") + +Tools Announcement +------------------ + +- [Tools-Announcement-16.02](Tools-Announcement-16.02 "wikilink") + + + +- [Tools-Announcement-15.01](Tools-Announcement-15.01 "wikilink") + + + +- [Tools-Announcement-14.03.1](Tools-Announcement-14.03.1 "wikilink") + + + +- [Tools-Announcement-14.02.2](Tools-Announcement-14.02.2 "wikilink") + + + +- [Tools-Announcement-14.02](Tools-Announcement-14.02 "wikilink") + + + +- [Tools-Announcement-14.01](Tools-Announcement-14.01 "wikilink") + + + +- [Tools-Announcement-13.08](Tools-Announcement-13.08 "wikilink") + + + +- [Tools-Announcement-13.07](Tools-Announcement-13.07 "wikilink") + + + +- [Tools-Announcement-13.06](Tools-Announcement-13.06 "wikilink") + + + +- [Tools-Announcement-13.05](Tools-Announcement-13.05 "wikilink") + +Reference +--------- + +- + +Notes +----- + +Problem: + +` chroot: failed to run command 'sh': No such file or directory` + +Solution: + +` sudo sh -c "echo -1 >/proc/sys/fs/binfmt_misc/arm "` + +[Category:Development](Category:Development "wikilink") +[Category:Platform](Category:Platform "wikilink") +[Category:Software](Category:Software "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/GBS_for_ubuntu_15.04_and_15.10.md b/docs/platform/tool/GBS_for_ubuntu_15.04_and_15.10.md new file mode 100644 index 0000000000..96e4847d23 --- /dev/null +++ b/docs/platform/tool/GBS_for_ubuntu_15.04_and_15.10.md @@ -0,0 +1,48 @@ +Unfortunately, the Tizen +tools(http://download.tizen.org/tools/latest-release) are only supported +until ubuntu 14.10. When you try to build your package with gbs build on +ubuntu 15.04/15.10, you\'ve got below error message. + + Traceback (most recent call last): + File "/usr/bin/gbs", line 30, in + from gitbuildsys import cmd_build + File "/usr/lib/pymodules/python2.7/gitbuildsys/cmd_build.py", line 33, in + from gitbuildsys.cmd_export import get_packaging_dir, config_is_true + File "/usr/lib/pymodules/python2.7/gitbuildsys/cmd_export.py", line 34, in + from gbp.scripts.buildpackage_rpm import main as gbp_build + ImportError: No module named buildpackage_rpm + +It seems that the git-buildpackage of the ubuntu 15.04 is newer version +of the tizen\'s one. Thus, the gbp of the tizen will be not installed. +It already discussed in tizen mailing list\[1\], but source.tizen.org +doesn\'t provide the guide. Like rafal\'s guide\[1\], to address this +conflict, we should raise the tizen repository up than the ubuntu +repository. + + sudo sh -c 'echo "Package: *\nPin: origin download.tizen.org\nPin-Priority: 1001" > /etc/apt/preferences.d/tizen' + sudo apt-get update + sudo apt-get dist-upgrade + +When you\'ve got below error, + + Errors were encountered while processing: + /var/cache/apt/archives/git-buildpackage-common_0.6.15-tizen20140828_all.deb + E: Sub-process /usr/bin/dpkg returned an error code (1) + +Just try below: + + sudo apt-get install -f + +- Trouble shooting + +When you try to build for arm/arm64 architecture, it will be failed due +to cpio error.\[2\] You\'ll need to apply openSUSE patch\[3\] into the +init\_buildsystem script. + + sed -i "/CPIO=\"cpio --extract/ a \\\tcpio --help 2>\/dev\/null | grep -q -e --extract-over-symlinks && CPIO=\"\$CPIO --extract-over-symlinks\"" /usr/lib/build/init_buildsystem + +\[1\]:\ +\[2\]:\ +\[3\]: + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/How_to_create_Tizen_Native_Application_by_Tizen_SDK.md b/docs/platform/tool/How_to_create_Tizen_Native_Application_by_Tizen_SDK.md new file mode 100644 index 0000000000..f7ac768605 --- /dev/null +++ b/docs/platform/tool/How_to_create_Tizen_Native_Application_by_Tizen_SDK.md @@ -0,0 +1,67 @@ +Scope +----- + +A How-to page to show the example about How to create and Customize +Tizen Native Application(OSP) with Tizen [SDK](SDK "wikilink"). + +Installation +------------ + +Download Install Manager and SDK image from +, for example, try it +in Ubuntu® 32bits Below shows example about how to create and Customize +Tizen Native Application by Tizen SDK step by step + +Create Native Application by SDK sample +--------------------------------------- + +- Run Tizen IDE, then New -\> Project\... -\> Tizen Native Project, + then choose Sample -\> UiControls + +\| + +- Then Run -\> Run As -\> Tizen Native Application in Emulator image + +See Animation button + +\| + +It is pretty easy to create the application by SDK. + +Customize Native Application by UI Builder and source code changing +------------------------------------------------------------------- + +Now we start to check how to customize the Animation button control. + +- Go to Project Explorer, double click \[Project Name\] -\> res -\> + screen-size-normal -\> IDF\_FORM\_ANIMATION.xml to launch the UI + Builder. +- Drag and Drop the new button, set the ID as + \"IDC\_BUTTON\_TESTTIZEN\" + +\| + +- Then Run it to see the new UI control in Emulator + +\| + +- Customize the source code in src\\AnimationForm.cpp and + inc\\AnimationForm.h to define the new Tizen::Ui::Controls::Button + ID and its ActionId etc + +\| inc\\AnimationForm.h \| +src\\AnimationForm.cpp + +- Customize the button press event in OnActionPerformed Function + +\| src\\AnimationForm.cpp + +- Click the testTizen button to see the result + + from 2013-09-15 21\_38\_28.png\| + +Now the customization of new UI control and button press event handle +has been done, we can see it is pretty easy for application developer to +do the customization. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/How_to_do_distributed_build_with_icecream_to_improve_compilation_speed_of_Tizen_packages.md b/docs/platform/tool/How_to_do_distributed_build_with_icecream_to_improve_compilation_speed_of_Tizen_packages.md new file mode 100644 index 0000000000..403f6b8f1a --- /dev/null +++ b/docs/platform/tool/How_to_do_distributed_build_with_icecream_to_improve_compilation_speed_of_Tizen_packages.md @@ -0,0 +1,15 @@ +Using icecream/GBS +================== + +- + +Using icecream/OBS +================== + +- + + + +- + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/IRIS_3rd_Party_Dependencies_Maintenance.md b/docs/platform/tool/IRIS_3rd_Party_Dependencies_Maintenance.md new file mode 100644 index 0000000000..83bf625ce1 --- /dev/null +++ b/docs/platform/tool/IRIS_3rd_Party_Dependencies_Maintenance.md @@ -0,0 +1,9 @@ +- git-based project + +`  `[`https://otctools.jf.intel.com/pm/projects/tools-project-mgmt/wiki/Package_Maintenance_Guide`](https://otctools.jf.intel.com/pm/projects/tools-project-mgmt/wiki/Package_Maintenance_Guide) + +- hg-based project + +` Add source tar package and spec file to `[`IRIS:Devel`](IRIS:Devel)`, then copy this package from `[`IRIS:Devel`](IRIS:Devel)` to `[`IRIS:Pre-release`](IRIS:Pre-release)` and IRIS with 'copypac'` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/IRIS_Release_Announcement.md b/docs/platform/tool/IRIS_Release_Announcement.md new file mode 100644 index 0000000000..9c036d3df8 --- /dev/null +++ b/docs/platform/tool/IRIS_Release_Announcement.md @@ -0,0 +1,43 @@ +Highlight +--------- + +- New PackageDB application + +`- Shows metadata for Domains, including the following:`\ +`  + Sub-domains and Git trees`\ +`  + All Roles: Architects, Maintainers, Reviewers, Integrators and Developers`\ +`- Shows relationship between Products and Git trees.`\ +`- Shows metadata for packages and images.`\ +`  For packages, following metadata is presented:`\ +`  + Package name and Git tree path`\ +`  + Domain and subdomain`\ +`  For images, following metadata is presented:`\ +`  + Image name and product`\ +`  + Target and architecture`\ +`- Provides RESTful APIs for developers to obtain the data.` + +Planned Features +---------------- + +Planned features include the following: + +- Submissions application (IRIS v0.2) + +` Submissions application will enable Tizen stakeholders to track the entire`\ +` life-cycle of a patch by providing metadata for CI (Continuous Integration)`\ +` and build systems as well as package integration.` + +- Reports application (IRIS v0.3) + +` Reports application will provide a variety of reports for Tizen stakeholders`\ +` to grasp a big-picture view of Tizen development.` + +Links +----- + +`[1]: `[`https://bugs.tizen.org/jira/browse/TINF/component/11900`](https://bugs.tizen.org/jira/browse/TINF/component/11900)\ +`       "Bug tracker"`\ +`[2]: `[`https://wiki.tizen.org/wiki/IRIS`](https://wiki.tizen.org/wiki/IRIS)\ +`       "Wiki"` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/IRIS_Release_Announcement_0.1.md b/docs/platform/tool/IRIS_Release_Announcement_0.1.md new file mode 100644 index 0000000000..9c036d3df8 --- /dev/null +++ b/docs/platform/tool/IRIS_Release_Announcement_0.1.md @@ -0,0 +1,43 @@ +Highlight +--------- + +- New PackageDB application + +`- Shows metadata for Domains, including the following:`\ +`  + Sub-domains and Git trees`\ +`  + All Roles: Architects, Maintainers, Reviewers, Integrators and Developers`\ +`- Shows relationship between Products and Git trees.`\ +`- Shows metadata for packages and images.`\ +`  For packages, following metadata is presented:`\ +`  + Package name and Git tree path`\ +`  + Domain and subdomain`\ +`  For images, following metadata is presented:`\ +`  + Image name and product`\ +`  + Target and architecture`\ +`- Provides RESTful APIs for developers to obtain the data.` + +Planned Features +---------------- + +Planned features include the following: + +- Submissions application (IRIS v0.2) + +` Submissions application will enable Tizen stakeholders to track the entire`\ +` life-cycle of a patch by providing metadata for CI (Continuous Integration)`\ +` and build systems as well as package integration.` + +- Reports application (IRIS v0.3) + +` Reports application will provide a variety of reports for Tizen stakeholders`\ +` to grasp a big-picture view of Tizen development.` + +Links +----- + +`[1]: `[`https://bugs.tizen.org/jira/browse/TINF/component/11900`](https://bugs.tizen.org/jira/browse/TINF/component/11900)\ +`       "Bug tracker"`\ +`[2]: `[`https://wiki.tizen.org/wiki/IRIS`](https://wiki.tizen.org/wiki/IRIS)\ +`       "Wiki"` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/IRIS_Release_Announcement_0.2.md b/docs/platform/tool/IRIS_Release_Announcement_0.2.md new file mode 100644 index 0000000000..1393917851 --- /dev/null +++ b/docs/platform/tool/IRIS_Release_Announcement_0.2.md @@ -0,0 +1,54 @@ +Highlight +--------- + +- New Submissions application + +` - Enable Tizen stakeholders to track the entire life-cycle of a patch by`\ +`   providing metadata for CI (Continuous Integration) and build systems as`\ +`   well as package integration.`\ +` - Shows types for Submissions: Open, Accepted, Rejected`\ +` - Shows metadata for Submissions, including the following:`\ +`   + Name, Owner`\ +`   + Related Git Tree, related Product`\ +`   + Last update time`\ +`   + Building result`\ +` - Shows metadata for packages and images building.`\ +`   For packages, following metadata is presented:`\ +`   + Package name, Git tree path, Target and Arch`\ +`   + Created time and updated time`\ +`   + Packages building status`\ +`   + Packages building log`\ +`   For images, following metadata is presented:`\ +`   + Image name and repo`\ +`   + Created time and updated time`\ +`   + Images building status`\ +`   + Images downloading url`\ +` - Provides schema migrations for Submissions app.` + +Planned Features +---------------- + +Planned features include the following: + +- Improved Submissions application (IRIS v0.3) + +` Submissions application will enable Tizen stakeholders to track the entire`\ +` life-cycle of an SR(Submission Request) by providing metadata for snapshot`\ +` and release as well as delta information.` + +- Reports application (IRIS v0.4) + +` Reports application will provide a variety of reports for Tizen stakeholders`\ +` to grasp a big-picture view of Tizen development.` + +Links +----- + +`[1]: `[`https://bugs.tizen.org/jira/browse/TINF/component/11900`](https://bugs.tizen.org/jira/browse/TINF/component/11900)\ +`       "Bug tracker"`\ +`[2]: `[`https://wiki.tizen.org/wiki/IRIS`](https://wiki.tizen.org/wiki/IRIS)\ +`       "Wiki"`\ +`[3]: `[`http://download.tizen.org/iris/latest-release/RELEASE_NOTES_IRIS-CORE.txt`](http://download.tizen.org/iris/latest-release/RELEASE_NOTES_IRIS-CORE.txt)\ +`       "IRIS Release Notes"` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Install_Tizen_SDK_using_CDN.md b/docs/platform/tool/Install_Tizen_SDK_using_CDN.md new file mode 100644 index 0000000000..2921866f83 --- /dev/null +++ b/docs/platform/tool/Install_Tizen_SDK_using_CDN.md @@ -0,0 +1,21 @@ +1. Run The Tizen [SDK](SDK "wikilink") Update Manager. + + : ![](Cdn1.png "fig:Cdn1.png") + +2. After the Update Manager launched, click configuration + button.:![](image2016-1-14_13-59-40.png "fig:image2016-1-14_13-59-40.png") +3. In order to change another repository url, click down arrow button + and open CDN list. + + : ![](Cdn2.png "fig:Cdn2.png") + +4. Select alternative CDN repository. + + : ![](Cdn3.png "fig:Cdn3.png") + +5. To apply CDN repository, Click confirm button. + + : ![](Cdn4.png "fig:Cdn4.png") + +[Category:SDK](Category:SDK "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Installing_Web_Applications_on_Tizen:Common_and_Tizen_IVI.md b/docs/platform/tool/Installing_Web_Applications_on_Tizen:Common_and_Tizen_IVI.md new file mode 100644 index 0000000000..e32d031b51 --- /dev/null +++ b/docs/platform/tool/Installing_Web_Applications_on_Tizen:Common_and_Tizen_IVI.md @@ -0,0 +1,66 @@ +This tutorial demonstrates how to install [HTML5](HTML5 "wikilink") +application, packages as wgt files, on devices with +Tizen:[Common](Common "wikilink") and other [Tizen3](Tizen3 "wikilink") +profiles as well as how to run installed HTML5 applications using the +[Crosswalk](Crosswalk "wikilink") web runtime. + +Install +------- + +Follow the instructions below to transfer, install and launch an +application to Tizen [device](device "wikilink") or +[Emulator](Emulator "wikilink") with Tizen [IVI](IVI "wikilink") or +another Tizen 3 profile based on Tizen:Common: + +1. Make sure that [SDB](SDB "wikilink") is running on the device. For + example, execute the following command as root on the device to + start it on port : + sdbd --listen-port= + +2. Connect to the devices using sdb by executing the following command + on a personal computer: + sdb connect : + +3. Verify that the device appears at the list of connected devices: + sdb devices + +4. Update wgt file to an appropriate directory at the device, for + example: + sdb push /home/bob/ + +5. Open a terminal on the device on the behalf of an existing user. +6. Install the web application by running the following command: + pkgcmd -i -t wgt -p -q + +7. Verify that the application has been installed successfully and + retrieve its ID: + app_launcher -l + +8. Launch the application using its ID: + app_launcher -s + +The application can be terminated through the command line with the +following command: + + app_launcher -k + +Uninstall +--------- + +Replace with the corresponding package name of the application +and execute the following command in shell to manually uninstall it: + + pkgcmd -u -n + +Troubleshooting +--------------- + +You might be unable to install wgt file due to the following issues: + +- The package your installing is using the same id as another package + and they conflict. You should uninstall the other package first. +- The icon reference in config.xml does not map to an image file. + +[Category:IVI](Category:IVI "wikilink") +[Category:SDK‏‎](Category:SDK‏‎ "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Interface_Between_Tools-Service_and_Git-buildpackage.md b/docs/platform/tool/Interface_Between_Tools-Service_and_Git-buildpackage.md new file mode 100644 index 0000000000..7a796877f3 --- /dev/null +++ b/docs/platform/tool/Interface_Between_Tools-Service_and_Git-buildpackage.md @@ -0,0 +1,72 @@ +Introduction +------------ + +This document reveals the interface between Tizen tools backend service +and gbp. + +Function Calling Procedure +-------------------------- + +1\. command.py calls gbp\_export(). + +`      def main(argv=None):`\ +`              """Main function"""`\ +`      ...`\ +`      # Run GBP`\ +`              ret = gbp_export(repo, args, config)`\ +`      "obs-service-git-buildpackage1/obs_service_gbp/command.py"` + +- Note: In comparison, in GBS\'s procedure, cmd\_export.py calls + export\_sources(). + +`      277     with utils.Workdir(workdir):`\ +`      278         export_sources(repo, commit, export_dir, main_spec, args)`\ +`      "gbs/gitbuildsys/cmd_export.py"` + +2\. gbp\_export() calls fork\_call() after confirming the export target +as RPM package. + +`      128         if args.rpm == 'yes' or (args.rpm == 'auto' and specs_found):`\ +`      129             LOGGER.info('Exporting RPM packaging files with GBP')`\ +`      130             LOGGER.debug('git-buildpackage-rpm args: %s', ' '.join(rpm_args))`\ +`      131             import ipdb;ipdb.set_trace()`\ +`      132             ret = fork_call(uid, gid, gbp_rpm)(rpm_args)`\ +`      133             if ret:`\ +`      134                 LOGGER.error('Git-buildpackage-rpm failed, unable to export '`\ +`      135                              'RPM packaging files')`\ +`      136                 return 2`\ +`      "gbs/gitbuildsys/cmd_export.py"` + +- Note: In comparison, in GBS\'s procedure, export\_sources() directly + calls buildpackage\_rpm.py. + +`      198 def export_sources(repo, commit, export_dir, spec, args, create_tarball=True):`\ +`              ...`\ +`      205     gbp_args = create_gbp_export_args(repo, commit, export_dir, tmp.path,`\ +`      206                                       spec, args, create_tarball=create_tarball)`\ +`      207     try:`\ +`      208         ret = gbp_build(gbp_args)`\ +`      "gbs/gitbuildsys/cmd_export.py"` + +3\. fork\_call() calls partial(), then partial() calls \_fork\_call. + +`      118 def fork_call(user, group, func):`\ +`      119     """Fork and call a function. The function should return an integer.`\ +`      120        Returns a callable that runs the function."""`\ +`      121     return partial(_fork_call, user, group, func)`\ +`      "obs-service-git-buildpackage1/obs_service_gbp_utils/__init__.py"` + +4\. \_fork\_call calls process(). + +`       99 def _fork_call(user, group, func, *args, **kwargs):`\ +`               ...`\ +`       104     # Run function in a child process`\ +`       105     data_q = Queue()`\ +`       106     import ipdb;ipdb.set_trace()`\ +`       107     child = Process(target=_demoted_child_call,`\ +`       108                     args=(uid, gid, data_q, partial(func, *args, **kwargs)))`\ +`       ""obs-service-git-buildpackage1/obs_service_gbp_utils/__init__.py` + +5\. process() calls buildpackage\_rpm(). + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Jenkins-0.12.md b/docs/platform/tool/Jenkins-0.12.md new file mode 100644 index 0000000000..4faa493b3d --- /dev/null +++ b/docs/platform/tool/Jenkins-0.12.md @@ -0,0 +1,51 @@ +0.12 relaese plan and schedule +------------------------------ + +- PM wiki page cleanup + +` 1. roadmap cleanup`\ +` 2. wiki Jenkins documents, design, plan, workflow`\ +` 3. update wiki, one new feature, one wiki page, groups submission, pre-release, pre-release deployment steps,` + +- Jenkins job code cleanup + +` 1. git depends on gbp.git `\ +` 2. git operation cleanup  `\ +` 3. local .oscrc file depends cleanup, integrate with OSC module in gbs  `\ +` 4. submit-obs, policy check cleanup `\ +` 5. gerrit module cleanup, private key issue ` + +### due to Feb 28 + +Prerelease project support + +` 1. design & review at Feb 21`\ +` 2. repomaker restructure`\ +` 3. group build/generate image`\ +` 4. imager clean up`\ +` 5. repo/image sync` + +### due to Mar 8 + +Feature freeze, tested in staging env 0.12 released + +### due to Mar 15 + +group submission + +` 1. group build in temp project (0.12)`\ +` 2. generate image to include the submissions(0.12)`\ +` 3. select changes to build (0.13)`\ +` 4. group merge changes to trunk (0.13)` + +0.13 features +------------- + +Repomaker replace Imager replace Repodiff for Jenkins Reports for +Jenkins Drop the depends on rabbitmq + +### Workflow chart + +![ 1000px](jenkins-workflow1.jpg " 1000px") + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Jenkins-0.14.md b/docs/platform/tool/Jenkins-0.14.md new file mode 100644 index 0000000000..05cd683304 --- /dev/null +++ b/docs/platform/tool/Jenkins-0.14.md @@ -0,0 +1,18 @@ +0.14 release plan +----------------- + +1\. Full testing of all jobs on pptest farm in Finland + +2\. Fixing of found bugs + +3\. Creation of release-0.14 branch when testing and fixing is done + +4\. Installation from scratch from Services:Pre-release and testing + +5\. Fixing of found issues in release branch + +6\. Tagging in release branch, resetting master to the tag + +7\. Deploying in production + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Jenkins-Preparation.md b/docs/platform/tool/Jenkins-Preparation.md new file mode 100644 index 0000000000..40ac8008e5 --- /dev/null +++ b/docs/platform/tool/Jenkins-Preparation.md @@ -0,0 +1,73 @@ +Preparation +----------- + +### Server requirement (hardware & software) + +`   1.  Hardware`\ +`       •  Disk > 500G`\ +`   2.  Software`\ +`       •  Jenkins LTS version 1.509.2`\ +`       •  Linux distribution, recommend use openSuse 12.3 64-bit`\ +`       •  Jenkins component: jenkins, jenkins-plugins, jenkins-jobs-common, jenkins-jobs, jenkins-scripts-common, jenkins-scripts` + +### Service installation and Configuration + +- Setting up for Gerrit accessing + +` After getting a gerrit account, you need to create an ssh key, and add your ssh key to Gerrit to enable the connection to gerrit.` + +### Register your contact info on Gerrit + +Log into Gerrit on UI, follow the links below to register your email +address and update your full name: + +`* Settings --> Contact Information --> Register New Email...`\ +`* Settings --> Contact Information --> Full Name..` + +After you register the email, you will receive an email which contains a +link. Please copy the link to your browser to activate the account. + +### Create SSH keys + +`$ su jenkins`\ +`$ ssh-keygen -t rsa` + +After pressing the Enter key at several prompts, an SSH key-pair will be +created in \~/.ssh/id\_rsa.pub. + +### Upload SSH pubkey to Gerrit + +Click the links below to set up the Gerrit WebUI. + +` Settings --> SSH Public Keys --> Add Key...` + +Paste your SSH public key there, and then click \'Add\'. + +### Verify your SSH connection + +You can verify your Gerrit connection by executing this command: + +` $ ssh -p 29418 username@gerrit_hostname` + +Make sure to add the server RSA key fingerprint to the known hosts of +jenkins account if connect to gerrit server in the first time. + +If your settings are correct, you\'ll see the message below. If not, +check SSH proxy and SSH public key on Gerrit. + +` Welcome to Gerrit Code Review`\ +` ...` + +### Config Git for Gerrit Access + +After the above installation, which will include git, is complete, you +can configure git. + +` $ git config --global user.name "First_Name Last_Name"`\ +` $ git config --global user.email "account@host"` + +Note: It is recommended that you use the same email address you used for +your Gerrit account for the \"user.email\" setting. Make sure you have +developer access first. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Know-How.md b/docs/platform/tool/Know-How.md new file mode 100644 index 0000000000..dca059ff6a --- /dev/null +++ b/docs/platform/tool/Know-How.md @@ -0,0 +1,133 @@ +How to use iSCSI + +`# Discover iSCSI targets`\ +`> sudo iscsiadm -m discovery -t st -p 10.89.62.166`\ +`(-m, --mode op)`\ +`(-t, --type=type --> st == sendtargets)`\ +`(-p, --portal=ip[:port])` + +`# List discovery records`\ +`> sudo iscsiadm -m discovery` + +`# Display all data for every discovery`\ +`> sudo iscsiadm -m discovery -o show` + +`# List node records`\ +`> sudo iscsiadm -m node` + +`# Display all data for every node`\ +`> sudo iscsiadm -m node -o show` + +`# Display data for a given target`\ +`> sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260`\ +`(-T, --targetname=targetname)` + +`# Display all data for a given target`\ +`> sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 -o show` + +`# Login`\ +`> sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 --login`\ +`  (-l, --login)` + +`# List session records`\ +`> sudo iscsiadm -m session` + +`# Display all data for every session`\ +`> sudo iscsiadm -m session -o show` + +`# logout a session`\ +`> sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 --logout` + +`# Logout all sessions`\ +`> sudo iscsiadm -m session -u`\ +`> sudo iscsiadm -m node -u`\ +`  (-u, --logout)` + +`# Delete node records`\ +`> sudo iscsiadm -m node -p 10.89.62.166 --op delete`\ +`> sudo iscsiadm -m node -p 192.168.0.2 --op delete` + +`# Delete discovery records`\ +`> sudo iscsiadm -m discovery -p 10.89.62.166 --op delete` + +------------------------------------------------------------------------ + +1. 1. Extend LV and expand ext4 filesystem + + + +1. Unmount the filesystem if possible + +umount /home + +1. Extend the LV to use all free space + +lvextend -l +100%FREE /dev/vg\_home/home + +1. Check the LV if the filesystem has already been unmounted + +e2fsck -f /dev/vg\_home/home + +1. Resize the partition to fill the LV + +resize2fs -p /dev/vg\_home/home + +1. Check the LV if the filesystem has already been unmounted + +e2fsck -f /dev/vg\_home/home + +1. Mount the LV if the filesystem has already been unmounted + +mount /home + +------------------------------------------------------------------------ + +1. 1. For shrinking a LV, it is better to unmount the file system + first to avoid data loss. + + + +1. Unmount the filesystem and check its\' LV + +umount /home e2fsck -f /dev/vg\_home/home + +1. Shrink ext4 and then the LV to the desired size + +resize2fs -p /dev/vg\_home/home 40G lvreduce -L 40G /dev/vg\_home/home + +1. Before continuing, run e2fsck. If it bails because the partition +2. is too small, don\'t panic! The LV can still be extended with +3. lvextend until e2fsck succeeds, e.g.: +4. lvextend -L +1G /dev/vg\_home/home + +e2fsck -f /dev/vg\_home/home + +1. Resize the filesystem to match the LVs size, check and mount it + +resize2fs -p /dev/vg\_home/home e2fsck -f /dev/vg\_home/home + +mount /home + +------------------------------------------------------------------------ + +1. vgdisplay vg\_srv + +If you want to create an LV that uses the entire VG + +1. lvcreate -l 100%VG -n srv vg\_srv + + + +1. lvcreate -L 128GB -n obs vg\_srv + +` Logical volume "obs" created` + +If you want to create an LV that uses all free PEs in the VG + +1. lvcreate -l 100%FREE -n obs vg\_srv + + + +1. mkfs -t ext4 /dev/vg\_srv/obs + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Laboratory.md b/docs/platform/tool/Laboratory.md new file mode 100644 index 0000000000..b38c0946d0 --- /dev/null +++ b/docs/platform/tool/Laboratory.md @@ -0,0 +1,24 @@ +![Testlab](Testlab.JPG "fig:Testlab"){width="700"} ![Testlab +host](Testlabhost.JPG "fig:Testlab host"){width="700"} + +**Automated Testing Laboratory** is an autonomous device to help with +developing, testing and releasing images of operating system. It was +primarily designed for Tizen, but turned out to be so generic that can +be used with any operating system. + +The basic idea behind the device is to do automated testing on many +boards at once. In order to achieve that, there is a setup of different +boards, which can be flashed with images to be tested. Next, the +compliance tests are run on each individual board and the results are +published. All the steps, from downloading and flashing images to +uploading and running tests and finally publishing results, are fully +automated and can be run without any attention from operator. + +Testing laboratory consists of 6 boards with different architectures +([x86](x86 "wikilink"), [x86\_64](x86_64 "wikilink"), +[ARM](ARM "wikilink"), [ARM64](ARM64 "wikilink")) and 6 +[SD-MUX](SD_MUX "wikilink") units. + +[Category:Tool](Category:Tool "wikilink") +[Category:Testlab](Category:Testlab "wikilink") +[Category:Hardware](Category:Hardware "wikilink") diff --git a/docs/platform/tool/Litmus.md b/docs/platform/tool/Litmus.md new file mode 100644 index 0000000000..f55fca6882 --- /dev/null +++ b/docs/platform/tool/Litmus.md @@ -0,0 +1,277 @@ +Litmus is an automated testing tool for tizen platform on +[ARM](ARM "wikilink") [Devices](Devices "wikilink"). + +This tool provides python APIs for controlling devices.(Flash binaries +to device/ Power up and down device/ Run commands on device/ Push and +pull files/ Take screenshots) And this also provides test project +manager and test project launcher. + +Getting Started +--------------- + +### Prerequisite + +Litmus uses sdb to communicate with device. sdb is not released on +download.tizen.org/tools but you can find it from sdk. Install sdb from +tizen sdk or download binary from below url. + +32bit: + + http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_2.3.0_ubuntu-32.zip + +64bit: + + http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_2.3.0_ubuntu-64.zip + +Unzip this package and copy sdb binary to /usr/bin + +### Step1. Install Litmus + +Litmus supports ubuntu distro only. (Ubuntu 14.04 and Ubuntu 16.04). If +someone wants to use this tool and APIs on other linux distro, please +contribute sources and packages, dependencies for that distro. + +First, open the **/etc/apt/sources.list.d/litmus.list** file in your +favorite editor. If the file doesn\'t exist, create it. And add entries +for your ubuntu system. + +For Ubuntu 14.04 + + deb http://download.tizen.org/live/Tools/Ubuntu_14.04/ / + +For Ubuntu 16.04 + + deb http://download.tizen.org/live/Tools/Ubuntu_16.04/ / + +Update apt cache. + + sudo apt-get update + +And install a package litmus. + + sudo apt-get install litmus + +You can also clone source code from github and create a debian package +to use latest version. + +First, clone latest source code from github. + + git clone https://github.com/dhs-shine/litmus + +Build a deb package with debuild + + cd litmus + debuild + +Install the deb package by using dpkg + + cd .. + sudo dpkg -i litmus_0.3.4-1_amd64.deb + +### Step2. Create a Litmus test project + +Litmus project manager helps you to manage your test project with +command line interface. First, list all of Litmus project on your +environment. + + litmus ls + +Result: + + =====list of all litmus projects===== + +There\'s no test project. Let\'s create a new test project. + + litmus mk + +Example: + + $ litmus mk 3.0-mobile-tm1 + Enter the device type (u3/xu3/artik5/artik10/standalone_tm1/standalone_tm2/standalone_tw1/standalone_u3/standalone_xu3/empty): standalone_tm1 + Enter descriptions for this project : my first test project for tm1 device + $ litmus ls + =====list of all litmus projects===== + 3.0-mobile-tm1 (my first test project for tm1 device : /home/dhsshin/litmus/3.0-mobile-tm1) + +You can see that the following project components exist under the +project path. + + -rwxrwxr-x 1 dhsshin dhsshin 0 Oct 21 14:59 __init__.py + drwxrwxr-x 2 dhsshin dhsshin 4096 Oct 21 15:05 __pycache__ + -rwxrwxr-x 1 dhsshin dhsshin 162 Oct 21 14:59 conf_mobile.yaml + -rwxrwxr-x 1 dhsshin dhsshin 263 Oct 21 14:59 conf_tv.yaml + -rwxrwxr-x 1 dhsshin dhsshin 172 Oct 21 14:59 conf_wearable.yaml + -rwxrwxr-x 1 dhsshin dhsshin 1507 Oct 21 14:59 tc_mobile.yaml + -rwxrwxr-x 1 dhsshin dhsshin 723 Oct 21 14:59 tc_tv.yaml + -rwxrwxr-x 1 dhsshin dhsshin 1519 Oct 21 14:59 tc_wearable.yaml + -rwxrwxr-x 1 dhsshin dhsshin 1545 Oct 21 14:59 userscript.py + +These are config files and python scripts for your testing. If you run +this test project with litmus test launcher then userscript.py is the +entry point of this. Please open it. + +userscript.py: + + #!/usr/bin/env python3 + import os + from litmus.core.util import load_yaml + from litmus.core.manager import manager + from litmus.helper.helper import tizen_snapshot_downloader as downloader + from litmus.helper.tests import add_test_helper + + + def main(*args, **kwargs): + + # init manager instance + mgr = manager(*args, **kwargs) + + # init working directory + mgr.init_workingdir() + + # get projectinfo + project_info = load_yaml('conf_mobile.yaml') + + username = project_info['username'] + password = project_info['password'] + binary_urls = project_info['binary_urls'] + + # get version from parameter + # ex) 20160923.3 + try: + version = kwargs['param'][0] + except (IndexError, TypeError): + version = None + + # download binaries from snapshot download server + filenames = [] + for url in binary_urls: + filenames.extend(downloader(url=url, + username=username, + password=password, + version=version)) + + # get an available device for testing. + dut = mgr.acquire_dut('standalone_tm1', max_retry_times=180) + + # flash binaries to device. + dut.flash(filenames) + + # turn on dut. + dut.on() + + # run helper functions for testing. + if not os.path.exists('result'): + os.mkdir('result') + + testcases = load_yaml('tc_mobile.yaml') + add_test_helper(dut, testcases) + dut.run_tests() + + # turn off dut. + dut.off() + + # release a device + mgr.release_dut(dut) + +This is a simple python script and main() is the entry point. You can +find classes and functions under litmus package and these can control +your device connected to your host PC. + +This default template just download a latest 3.0 mobile profile binary +for TM1 and acquire an available device from your environment, and flash +the binary to acquired device. And just run testcases from +tc\_mobile.yaml. + +conf\_mobile.yaml: + + binary_urls: + - http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/ + username: + password: + +tc\_mobile.yaml: + + testcases: + - name: verify_process_is_running + from: litmus.helper.tests + result_dir: result + plan: + - name: dbus_is_running + param: dbus + pattern: .*/usr/bin/dbus-daemon.* + - name: enlightenment_is_running + param: enlightenment + pattern: .*/usr/bin/enlightenment.* + - name: sensord_is_running + param: sensord + pattern: .*/usr/bin/sensord.* + - name: deviced_is_running + param: deviced + pattern: .*/usr/bin/deviced.* + - name: pulseaudio_is_running + param: pulseaudio + pattern: .*/usr/bin/pulseaudio.* + - name: sdbd_is_running + param: sdbd + pattern: .*/usr/sbin/sdbd.* + - name: msg-server_is_running + param: msg-server + pattern: .*/usr/bin/msg-server.* + - name: connmand_is_running + param: connmand + pattern: .*/usr/sbin/connmand.* + - name: callmgrd_is_running + param: callmgrd + pattern: .*/usr/bin/callmgrd.* + - name: alarm-server_is_running + param: alarm-server + pattern: .*/usr/bin/alarm-server.* + - name: media-server_is_running + param: media-server + pattern: .*/usr/bin/media-server.* + - name: verify_dmesg + from: litmus.helper.tests + result_dir: result + plan: + - name: panel_is_alive + param: panel + pattern: .*panel is dead.* + - name: verify_wifi_is_working + from: litmus.helper.tests + wifi_apname: setup + wifi_password: + result_dir: result + +### Step3. Run the Litmus test project + +Before running this test project, you have to configure topology file. +Default path of topology file is **\~/.litmus/topology**. Please open +it. + + [TM1_001] + dev_type = standalone_tm1 + serialno = 0000d86100006200 + +You have to write this ini file as above to create a topology of your +test environment. If you don\'t know serial number of your device then +please use \'sdb devices\' command. + + $ sdb devices + List of devices attached + 0000d86100006200 device TM1 + +After configuring topology, you can run your test project as follow: + + litmus run 3.0-mobile-tm1 + +This will create a temporary directory as working dir and copy all files +under project path to working dir. main() function will be executed and +temporary working dir will be deleted after testing. If you want to keep +test results in working directory then please use -d option. + + litmus run 3.0-mobile-tm1 -d ~/test_result + +\~/test\_result will be the working dir and litmus test launcher does +not delete this after testing. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Manually_installing_apps.md b/docs/platform/tool/Manually_installing_apps.md new file mode 100644 index 0000000000..6ea0b4b828 --- /dev/null +++ b/docs/platform/tool/Manually_installing_apps.md @@ -0,0 +1,145 @@ +If you\'re not using the [SDK](SDK "wikilink") (e.g. you don\'t have the +right operating system), but still want to install apps on a Tizen +developer device (as handed out at the Tizen conference), there is a +manual method you can use. + +This article explains this method, showing how to manually package and +install an app using command line tools on Linux. (Note that it\'s +likely you could follow a similar process on Windows if you don\'t want +the whole SDK, e.g. using +[PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/) and +[7zip](http://www.7-zip.org/), though I\'m not sure how/if USB +networking works on Windows.) + +If you want to read more generally about Tizen development, see [the +Tizen developer +documentation](http://developer.tizen.org/documentation). + +NB I call the \"Tizen developer device\" a \"phone\" below, for brevity. + +

+ +Packaging an app + +

+ +Tizen apps are packaged according to [the W3C widget packaging +spec](http://www.w3.org/TR/widgets/). The steps below explain how to +manually create one of these packages, but for a real project you\'d +probably want to script it. + +1. Write your app first. As a minimum, you need an HTML page. Make a + new file called `index.html` with this HTML in it: + + + + + Tizen test app + + +

Nominally a Tizen app...

+ + + + (See [these + docs](https://developer.apple.com/library/safari/documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html) + for more information about the viewport meta element. We add it here + so the application appears fullscreen.) + +2. Create a 128x128 pixel png for an icon. If you can\'t be bothered to + make one yourself, generate a placeholder by visiting the URL + in your browser. Then save + the image as `icon.png`, in the same directory as `index.html`. This + icon is optional, but having one makes it slightly easier to find + your application on the Tizen home screen. And you\'d want one in a + real project. +3. Add a `config.xml` file (which tells Tizen\'s web runtime how to + install, display and run your app). It should look like this as a + minimum: + + + + + myapp + + +4. Make a zip file with your app\'s files in it, but give the file a + `.wgt` suffix. For example, you can do this from a command line in + your app\'s directory (the one containing `index.html`, `icon.png` + and `config.xml`) like this: + zip myapp.wgt config.xml index.html icon.png + + The zip file\'s structure will look like this: + + myapp.wgt + index.html + config.xml + +

+ +Installing an app on the phone + +

+ +1. The next bit involves making a USB network connection between your + PC and the phone. I found instructions on [Flashing to + device](Flashing_to_device "wikilink"), but I repeat them here for + convenience: + 1. Turn the phone on. + 2. Connect the phone to your computer via a USB lead. + 3. On the phone\'s home screen, press the Settings icon; + at the top of the settings screen, press All to show + all settings. Then select USB utilities and check the + USB debugging option. This enables the phone to act as + a [usbnet device](http://www.linux-usb.org/usbnet/). + 4. On the computer, configure the USB connection by entering the + following: + sudo ifconfig usb0 192.168.129.4 + + 5. You should now be able to login to the device from the computer. + On the computer (not the phone), use SSH from a command line + like this: + ssh root@192.168.129.3 + + Check that this works before you try to do the next step. +2. Once the ssh login works, you can copy the `.wgt` file to the device + with scp: + scp root@192.168.129.3:/opt/home/root + +3. Now login to the device over SSH again: + ssh root@192.168.129.3 + + You should be in the /opt/home/root directory, where you scp\'d the + file to. + +4. At the command prompt, install the widget with: + wrt-installer -i myapp.wgt + + You should now see its icon on the home screen:\ + ![400 px\|App icon on the Tizen home + screen](Myapp_on_tizen.jpg "fig:400 px|App icon on the Tizen home screen") + +5. Touching the icon should open it in the web runtime, like this:\ + ![400 px\|App running on + Tizen](Myapp_running-in_wrt.jpg "fig:400 px|App running on Tizen") + +That\'s it. + +If anything goes wrong, you can uninstall the app on the phone via +Settings \> All \> Manage applications. Select the app from the +list, then click on the Uninstall button. + +You can also update an existing app from the command line with: + + wrt-installer -iu myapp.wgt + +(though if the app is running, you\'ll have to stop it to get the update +to take). + +[Category:Application](Category:Application "wikilink") +[Category:Development](Category:Development "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Mic-bootstrap-doc.md b/docs/platform/tool/Mic-bootstrap-doc.md new file mode 100644 index 0000000000..b5ce63dff6 --- /dev/null +++ b/docs/platform/tool/Mic-bootstrap-doc.md @@ -0,0 +1,103 @@ +MIC Bootstrap +------------- + +### Description + +This documentation is to present how to create mic-bootstrap in +technical, it includes baselibs.conf and \_aggregate feature on build +service. + +The package \'mic-bootstrap\' is used for mic bootstrap, this package +will be repackaged for i586 and arm libs. it provides a x86 bootstrap +environment for unified usage, especially to speed up the performance of +arm image creation. + +As an instance, you can find \'mic-bootstrap\' at \[\#\]\_. Also you can +find \'mic-bootstrap\_aggregate\' at \[\#\]\_. + +### Workflow of mic-bootstrap.spec + +In this section, it will present the main workflow of +mic-bootstrap.spec: + +\- get a list of files to include:: + +`  $ rpm -qla > filestoinclude1` + +\- tar copy to bootstrap directory:: + +`  $ tar -T filestoinclude1 -cpf - | ( cd %buildroot/bootstrap && tar -xpf - )` + +\- generate file list of this rpm:: + +`  $ find %buildroot | sed -e "s#%{buildroot}##g" | uniq | sort > filestoinclude1`\ +``   $ for i in `cat filestoinclude1`; do \ ``\ +`  $    if test -h %buildroot/$i || ! test -d %buildroot/$i; then \`\ +`  $        echo "$i" >> filestoinclude \`\ +`  $    fi \`\ +`  $ done` + +\- explicit %files with file list:: + +`  %files -f filestoinclude` + +### Mechanism of baselibs.conf + +In this section, it will show the mechanism of baselibs.conf used in +mic-bootstrap: + +\- specify how to handle mic-bootstrap package:: + +`  arch i686 targets armv7l:x86-arm i586:x86-arm aarch64:x86-arm`\ +`  arch x86_64 targets armv7l:x86-arm x86_64:x86-arm aarch64:x86-arm` + +`| it means that subsequent package directives i686 and x86_64 will be repackaged to`\ +`| armv7l, i586, aarch64 using ``=x86-arm.` + +\- declare a package with targettype directives:: + +`  targettype x86-arm package mic-bootstrap` + +`| it means just to create mic-bootstrap-x86-arm package by repackaging mic-bootstrap.` + +\- allow filtering of the actions applied:: + +`    autoreqprov off`\ +`    extension -x86-arm`\ +`    +/` + +`| 'autoreqprov off' means to limit the provides and requires to only those specified.`\ +`| 'extension -x86-arm' means the package name uses 'x86-64' as extension.`\ +`| '+/' means all files in %buildroot will be repackaged to new package.` + +### Build Service baselibs.conf + +Open Build Service provides a mechanism that by including a file called +baselibs.conf in the package sources, it can be instructed to create +so-called \"bi-arch\" packages, so that in 32-bit environments, 32-bit +packages need to be created for use with 64-bit environments, and +potentially also vice-versa. + +See details at \[\#\]\_. + +### Build Service \_aggregate + +To avoid rebuilds of packages that are just needed as build requirement +for other packages or just needed because the Project wants to +distribute a complete set of packages for end-users, there is the +\_aggregate feature in Open Build Service. + +See details at \[\#\]\_. + +### Reference + +- \[\#\] + +- \[\#\] + +- \[\#\] + +- \[\#\] + + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Mic-chroot.md b/docs/platform/tool/Mic-chroot.md new file mode 100644 index 0000000000..786be1f1cb --- /dev/null +++ b/docs/platform/tool/Mic-chroot.md @@ -0,0 +1,66 @@ +mic-chroot Manual Page +---------------------- + +`  Author: Tizen` + +Name +---- + +`  mic chroot (ch) - Runs command or interactive shell inside an image.` + +Synopsis +-------- + +`   mic chroot (ch) [-h, --help]`\ +`                   [-s SAVETO, --saveto=SAVETO]`\ +`                   `\ +`                   [Command [Arguments] ... ]` + +Description +----------- + +This command runs command or interactive shell inside an image. + +MIC can create various types of images, including fs, livecd, liveusb, +loop and raw, only the fs type image can be chroot into by using the +ordinary Linux \`chroot\` command. \`mic chroot\` enables users to +chroot into the other types of images by enhancing the original +\`chroot\` command provided by Linux. + +An example is shown below: + +: + + : + +`   $ sudo mic cr loop handset_blackbay.ks` + +`   $ cd mic-output/` + +`   $ sudo mic chroot platform.img`\ +`     mic 0.22.3 (Ubuntu 12.10 quantal)`\ +`     INFO: Launching shell. Exit to continue.`\ +`     ----------------------------------`\ +`     bash-4.1#`\ +`   $ sudo mic chroot platform.img ls`\ +`     mic 0.22.3 (Ubuntu 12.10 quantal)`\ +`     INFO: Launching shell. Exit to continue.`\ +`     ----------------------------------`\ +`     bin  boot  dev  etc  lib  lost+found  proc  run  sbin  sys  tmp  usr  var` + +Parameters +---------- + +### Mandatory Parameters + +`   ``        Specifies the source image to be processed.` + +### Optional Parameters + +`   -h, --help          Shows this help message and exit.`\ +`   -s SAVETO, --saveto=SAVETO`\ +`                       Saves the unpacked image to specific directory.`\ +`   Command [Arguments] ...`\ +`                       Runs specific Linux command after executing chroot.` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Mic-convert.md b/docs/platform/tool/Mic-convert.md new file mode 100644 index 0000000000..c71c2766c7 --- /dev/null +++ b/docs/platform/tool/Mic-convert.md @@ -0,0 +1,49 @@ +mic-convert Manual Page +----------------------- + +Author: Tizen.org + +Name +---- + +mic convert (cv) - Converts the image format. + +Synopsis +-------- + +: + + : + +`   $ mic convert (cv) [-h] [-S, --shell] `` ` + +Description +----------- + +This command converts the format of the source image into various format +supported by MIC, for example fs, loop, livecd, and liveusb. + +Parameters +---------- + +### Mandatory Parameters + +: + + : + +`   ``        Specifies the source image to be processed.`\ +`   `\ +`                       Specifies the format into which MIC converts the`\ +`                       source image, for example, fs, loop.` + +### Optional Parameters + +: + + : + +`   -h, --help          Shows this help message and exit.`\ +`   -S, --shell         Lauches shell before packaging the converted image.` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Mic-create.md b/docs/platform/tool/Mic-create.md new file mode 100644 index 0000000000..d99fc50792 --- /dev/null +++ b/docs/platform/tool/Mic-create.md @@ -0,0 +1,212 @@ +mic-create Manual Page +---------------------- + +Author: Tizen.org + +Name +---- + +mic create (cr) - Creates and manipulates images for Linux +distributions. + +Synopsis +-------- + +### Subcommmand + +` ::` + +`     mic create(cr) `` `\ +`                                           [-h, --help] [--logfile=LOGFILE]`\ +`                                           [-c CONFIG, --config=CONFIG]`\ +`                                           [-k CACHEDIR, --cachedir=CACHEDIR]`\ +`                                           [-o OUTDIR, --outdir=OUTDIR]`\ +`                                           [-A ARCH, --arch=ARCH]`\ +`                                           [--release=RID]`\ +`                                           [--record-pkgs=RECORD_PKGS]`\ +`                                           [--pkgmgr=PKGMGR]`\ +`                                           [--local-pkgs-path=LOCAL_PKGS_PATH]`\ +`                                           [--runtime=RUNTIME]`\ +`                                           [--pack-to=PACK_TO] [--copy-kernel]`\ +`                                           [--install-pkgs=INSTALL_PKGS]`\ +`                                           [--check-pkgs=CHECK_PKGS] [--tmpfs]` + +### Second Level Subcommands + +` ::` + +`     mic create(cr) help `\ +`     mic create(cr) auto `` [-h, --help]`\ +`     mic create(cr) fs `` [-h, --help] [--include-src]`\ +`     mic create(cr) livecd `` [-h, --help]`\ +`     mic create(cr) liveusb `` [-h, --help]`\ +`     mic create(cr) loop `` [-h, --help][--shrink]`\ +`                                  [--compress-image=COMPRESS_IMAGE]`\ +`                                  [--compress-disk-image=COMPRESS_IMAGE]`\ +`     mic create(cr) raw  `` [-h, --help]`\ +`                                  [--fstab-entry=FSTAB_ENTRY]`\ +`                                  [--generate-bmap]`\ +`                                  [--compress-image=COMPRESS_IMAGE]`\ +`                                  [--compress-disk-image=COMPRESS_IMAGE]` + +Description +----------- + +This command creates and manipulates images for Linux distributions. +With a variety of second level subcommands, \*\*mic-create\*\* enables +users to do the following: + +### mic create auto + +` Create an image with the format automatically detected from the magic line`\ +``  which is wrapped by "`-*-mic2-options-*-`" in ksfile. `` + +` Assuming the magic line in the ksfile is as follows:` + +` ::` + +`     # -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-` + +` Then the result of running **mic cr auto *.ks** is equivalent to`\ +` **mic cr loop *.ks --pack-to=@NAME@-rs.zip**.` + +### mic create fs + +` Create a file system image.` + +` In this scenario, MIC installs all the Tizen files to the specified directory,`\ +` which can be used directly as chroot environment.` + +### mic create help + +` Show detailed help message of specific second level subcommand.` + +### mic create livecd + +` Create an image that can be burnt to CD, based on which a live system or`\ +` installation UI can be booted up.` + +### mic create liveusb + +` Create an image that can be burnt to usbdisk, based on which a live system or`\ +` installation UI can be booted up.` + +### mic create loop + +` Create a loop image for mobile devices.` + +`   **Note:** Each loop corresponds to specific partition, multiple loop images`\ +`   can be packed into a single archive file.` + +` In this scenario, MIC generates multiple loop images for a configuration with`\ +` multiple partitions specified in the ksfile.` + +### mic create raw + +` Create a raw image for IVI devices.` + +` In this scenario, MIC creates a bootable image in raw format similar to`\ +` disk dumping.` + +Parameters +---------- + +### Mandatory Parameter + +: + + : + +`   ``            Specifies the ksfile that describes how to create`\ +`                       an image.` + +For more information, refer to \`Fedora ksfile\`\_. + +### Optional Parameters for Subcommands + +: + + : + +`   -h, --help          Shows this help message and exit.`\ +`   --logfile=LOGFILE   Specifies the path of logfile.`\ +`   -c CONFIG, --config=CONFIG`\ +`                       Specifies config file for MIC.`\ +`   -k CACHEDIR, --cachedir=CACHEDIR`\ +`                       Specifies cache directory to store downloaded files.`\ +`   -o OUTDIR, --outdir=OUTDIR`\ +`                       Specifies the output directory.`\ +`   -A ARCH, --arch=ARCH`\ +`                       Specifies repo architecture.`\ +`   --release=RID       Specifies the repo with specific Release ID (RID) and`\ +`                       adds the RID to the name of generated files.`\ +`                       When @BUILD_ID@ is contained in kickstart file, it`\ +`                       will be replaced by RID.`\ +`   --record-pkgs=RECORD_PKGS`\ +`                       Records the info of installed packages. Multiple values`\ +`                       must be separated by comma. Valid values: name,`\ +`                       content, license, vcs.`\ +`   --pkgmgr=PKGMGR     Specifies backend package manager. Valid values:`\ +`                       yum, zypp.`\ +`   --local-pkgs-path=LOCAL_PKGS_PATH`\ +`                       Specifies the installation path of local RPM packages.`\ +`   --runtime=RUNTIME_MODE`\ +`                       Sets runtime mode, the default value is bootstrap mode.`\ +`                       Valid values: native, bootstrap. "native" indicates`\ +`                       MIC uses localhost environment to create image, whereas`\ +`                       "bootstrap" indicates MIC uses one tizen chroot`\ +`                       environment to create image.`\ +`   --pack-to=PACK_TO   Packs the images together into the specified achive,`\ +`                       extension supported: .zip, .tar, .tar.gz, .tar.bz2,`\ +`                       etc. The default value is .tar.`\ +`   --copy-kernel       Copies kernel files from image /boot directory to the`\ +`                       image output directory.`\ +`   --install-pkgs=INSTALL_PKGS`\ +`                       Specifies the type of packages to be installed. Valid`\ +`                       values: source, debuginfo, debugsource.`\ +`   --check-pkgs=CHECK_PKGS`\ +`                       Checks whether the given packages will be installed,`\ +`                       packages must be separated by comma.`\ +`   --tmpfs             Sets up tmpdir as tmpfs to accelerate. This is`\ +`                       experimental feature recommended to use when the memory`\ +`                       of the host machine is more than 4G.` + +### Optional Parameters for Second Level Subcommands + +- Parameters for \*\*mic create fs\*\* + +` ::` + +`   --include-src       Generates an image with source RPMs included.` + +- Parameters for \*\*mic create loop\*\* + +` ::` + +`   --shrink`\ +`                       Specifies whether to shrink loop images to minimal size.`\ +`   --compress-image=COMPRESS_IMAGE`\ +`                       Sets the disk image compression. Note: The available`\ +`                       values may depend on the file system type.`\ +`   --compress-disk-image=COMPRESS_IMAGE`\ +`                       Same with --compress-image.` + +- Parameters for \*\*mic create raw\*\* + +` ::` + +`   --fstab-entry=FSTAB_ENTRY`\ +`                       Sets fstab entry. Valid values: name, uuid. "name"`\ +`                       indicates MIC uses device names, "uuid" indicates MIC`\ +`                       uses file system uuid.`\ +`   --generate-bmap`\ +`                       Generates the block map file.`\ +`   --compress-image=COMPRESS_IMAGE`\ +`                       Sets the disk image compression. Note: The available`\ +`                       values may depend on the filesystem type.`\ +`   --compress-disk-image=COMPRESS_IMAGE`\ +`                       Same with --compress-image.` + +Fedora ksfile: + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Mic_Redesign_Framework.md b/docs/platform/tool/Mic_Redesign_Framework.md new file mode 100644 index 0000000000..51cb7a9d90 --- /dev/null +++ b/docs/platform/tool/Mic_Redesign_Framework.md @@ -0,0 +1,166 @@ +Introduction +------------ + +This document provides information about mic redesign framework, +including the following aspects. + +- System composition +- Work flow +- File directory structure + +System Composition +------------------ + +This section provides information about system composition of mic. + +### Mic Instruction + +#### What is mic? + +MIC is an image creator. It\'s used to create images for Tizen. + +#### How many types of images are supported by mic? + +There are 5 types of images supported by mic, including live CD images, +live USB images, raw images for KVM, loop images for IVI platforms, and +fs images for chrooting. + +#### What functions are provided by mic? + +With the MIC tool, users can create images of different types for +different verticals. Also users can chroot into an image using MIC\'s +enhanced chroot command. Besides, MIC enables converting an image to +another image format, a very useful function for those sensitive to +image format. + +### Mic Components + +#### Main Program + +- The main program for mic is formed by three subcommands: create, + convert, chroot. +- They are user interfaces. + +#### Config Manager + +- store the configure information from mic config-file. +- keep the value of the options. +- take as data center for other components + +#### Plugin Manager + +- find all types of plugins from the plugin directory +- store all found plugins in categories +- provide interface to create, convert, and chroot + +#### Plugin Class + +- consist of three types: imager, backend, hook +- imager - implement the special interface for create, convert, and + chroot: + +` do_create, do_pack, do_unpack` + +- backend - provide interface to use package manager +- hook - deal the hook function +- considered as mid-ware between main program and imager class + +#### Imager Class + +- Implement the necessary interfaces of the image creating and + converting process +- such as mount, install, configure, umount + +### Mic System Composition Diagram + + System Composition Diagram + +Work Flow +--------- + +The mic flowchart include three parts: main option parse, sub option +parse,and result output. + +The first part parse \"sudo mic create/convert/chroot/help\" do\_option +mathod object. Parsing sub option is the second part by using first part +return do\_option object ,includeing file arg, setting mic format image +arg and so on. Last part output files and information about mic. + + System Flowchart.png\|Mic System Flowchart + +File Directory Structure +------------------------ + +This section provides information about mic file directory structure. + +### The directory structure + +A simple description about the file directory structure omitted some of +the compiler configuration files and some documentation. + +: + + : + +`   Mic`\ +`   | ----- Makefile`\ +`   | ----- mic`\ +`   | -----| ----- archive.py`\ +`   |      | ----- bootstrap.py`\ +`   |      | ----- chroot.py`\ +`   |      | ----- conf.py`\ +`   |      | ----- creator.py`\ +`   |      | ----- imager`\ +`   |      |      | ----- baseimager.py`\ +`   |      |      | ----- fs.py`\ +`   |      |      | ----- livecd.py`\ +`   |      |      | ----- liveusb.py`\ +`   |      |      | ----- loop.py`\ +`   |      |      | ----- raw.py`\ +`   |      | -----  msger.py`\ +`   |      | -----  pluginbase.py`\ +`   |      | -----  plugin.py`\ +`   |      | -----  utils`\ +`   | -----  plugins`\ +`   |      | ----- backend`\ +`   |      |      | ----- yumpkgmgr.py`\ +`   |      |      | ----- zypppkgmgr.py`\ +`   |      | -----  hook`\ +`   |      |      | ----- empty_hook.py`\ +`   |      | -----  imager`\ +`   |      |      | ----- fs_plugin.py`\ +`   |      |      | ----- livecd_plugin.py`\ +`   |      |      | ----- liveusb_plugin.py`\ +`   |      |      | ----- loop_plugin.py`\ +`   |      |      | ----- raw_plugin.py`\ +`   | -----  tests`\ +`   | -----  tools`\ +`   |      | ----- mic` + +### Directory Use Instructions + +- Mic package is formed with three sub-packages: mic main + sub-package,mic plugins sub-package,and mic tools sub-package. + + + +- The directory \`mic/\` presents mic main sub-package, \`plugins\` + presents mic plugins sub-package, and \`tools/\` presents mic tools + sub-package. + + + +- The code will be placed in categories in \`mic/\`. Main program + class will be placed in \`mic/\` , imager class will be placed in + \`mic/ imager/\`,some common code and utility code could be placed + in \`mic/utils/\`. + + + +- Some plugin creator could be placed in \`plugins/\` . + + + +- Code for unit test would be placed in tests/. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Multiple-runtime-mode-design.md b/docs/platform/tool/Multiple-runtime-mode-design.md new file mode 100644 index 0000000000..1bc3bc6d96 --- /dev/null +++ b/docs/platform/tool/Multiple-runtime-mode-design.md @@ -0,0 +1,147 @@ +UI Design +--------- + +### cmdln options of mic create + +One more command line option: \--runtime, valid values base on provided +plugins + +Example:: + +` mic cr loop abc.ks [--runtime bootstrap]` + +### config file + +One more key in config file: runtime, value can be invalid in the case +corresponding plugin not available. The default value can be \"native\", +which is a special and basic runtime mode. + +Add \[bootstrap\] subsection to save official repo url for creating +bootstrap Example:: + +` [create]`\ +` ...`\ +` runtime = bootstrap`\ +` [bootstrap]`\ +` bootstrap1_ID=BS1`\ +` bootstrap1_repo1=...`\ +` bootstrap1_repo2=...`\ +` bootstrap1_rpmversion=4.8`\ +` .`\ +` .`\ +` bootstrap2_ID=BS2`\ +` bootstrap2_repo=...`\ +` bootstrap2_rpmversion=4.9` + +For bootstrap section, we would config several bootstrap using +bootstrapN\_\*, and each bootstrap, would contains ID, repo url, and +rpmversion. rpmversion is used to compare with ks file user specified to +create image. + +### new subcommand of mic: runtime + +This new subcommand: runtime, is for create/manage/cleanup runtime +environments for all the valid runtime plugins. + +The command line options design as blow:: + +- mic runtime listmode + +` List all the supported runtime mode, e.g. boottrap, kvm. Decided by loaded`\ +` plugins.` + +- mic runtime list \[-l\] {mode} + +` List all available runtime environments of this {mode}, the {mode} is one of`\ +` the supported runtime mode.`\ +` All envs will be listed as folder path, and with a numbering prefix, like ::` + +`   > 1 /var/tmp/mic/bootstrap/1.netbook-ia32`\ +`     2 /var/tmp/mic/bootstrap/2.ivi-ia32` + +` or for kvm ::` + +`   > 1 /var/tmp/mic/kvm/1.netbook-ia32` + +` The optional "> " prefix means the default selection to be used.` + +` Optional "-l" is for more details, e.g. datetime of creation, datetime of`\ +` last update, repos, etc.` + +- mic runtime create {mode} \<\--ks\|\--repo\|\--ID\> + +` Create a runtime env for specified {mode}, and need to specify kickstart`\ +` file by "--ks" or repo URL by "--repo", or bootstrap ID from config file.` + +- mic runtime clean {mode} \[number\] + +` Clean up the exist runtime env of {mode}. User might need to specify the`\ +` number of envs by argument, if multiple ones exist. W/o ``, it should`\ +` ask user to select which one to be cleaned up.` + +- mic runtime udpate {mode} \[number\] + +` Update the specified runtime env of {mode}. If the [number] argument not`\ +` specified, the default one will be updated, but w/ warning message if`\ +` multiple ones exist.` + +` After each update, the updated one will be selected as the default one by`\ +` default.` + +Some Ideas for Implementation +----------------------------- + +As Chengui\'s original proposals, make the runtime level as a separate +daemon is not a good idea. Even making it as a separate process is also +not good enough. We need to keep the code and logic simple to avoid +unnecessary complicate. + +Before the final design nailed down, several ideas from our discussion: + +- When re-launching \"mic\" in runtime env, we should avoid to modify + current + +command line string or configuration file. And we can this by the +following pseudo code :: + +` if detect_current_runtime() == "native":`\ +`   if opts.runmode == 'bootstrap':`\ +`     do_the_steps_for_bootstrap`\ +`     exit`\ +`   elif opts.runmode == 'kvm':`\ +`     do_the_steps_for_kvm`\ +`     exit` + +` # the following is the normal path`\ +` ...` + +- We\'d better place all runtime envs files under the specified + tmpdir, the /var/tmp/mic/ as the default. + + + +- How to copy mic running code to runtime environment? It\'s not good + enough + +if we hard-coded the file path in code. Let\'s refer the method of +virtualenv tools, it\'s a nice solution. + +- Create a separate prj/repo only for mic bootstrap creation + + + +- Basic workflow for bootstrap mode: + +`   1. Check if any ready bootstrap env, if have continue, or goto 4`\ +`   2. Check each bootstrap and get the rpmversion for each bootstrap, then`\ +`      get the rpm version for target image, check if any bootstrap's rpm`\ +`      version match with target image rpm vesion, if have, continue, or goto 4.`\ +`   3. Use that bootstrap to create image, go to 5;`\ +`   4. Check bootstrap section of config file, and select correct bootstrap info:`\ +`      bootstrap_ID, bootstrap_repo, bootstrap_rpmversion, where target image rpm`\ +`      version should match with bootstrap_rpmversion. Two choice here, one is`\ +`      show waring to ask user to create bootstrap manually, bootstrap ID should`\ +`      be show; another choise is create bootstrap directly. Then, goto 3;`\ +`   5. finished` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_2.4_Distributed_Servers.md b/docs/platform/tool/OBS_2.4_Distributed_Servers.md new file mode 100644 index 0000000000..fc9da4e360 --- /dev/null +++ b/docs/platform/tool/OBS_2.4_Distributed_Servers.md @@ -0,0 +1,710 @@ +### ***Add zypper repositories*** + +: Refer to the \"[**OBS 2.4 Zypper + Repositories**](OBS_2.4_Zypper_Repositories "wikilink")\" page. + +\ + +------------------------------------------------------------------------ + +### ***Install BACKEND Server*** + +BACKEND server = REPO server + SCHEDULER + DISPATCHER + PUBLISHER + +WARDEN\ +\ + +#### Make HOME directory for OBS (*if necessary*) + +: Refer to the \"[**Make a HOME directory for + OBS**](OBS_2.4_All-in-One_Server#make_obs_home "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Make repository directory + +: Refer to the \"[**Make repository + directory**](OBS_2.4_All-in-One_Server#make_repos_dir "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install BACKEND packages + +: \# zypper install obs-server +: \# zypper install obs-utils + +\ + +#### Install BUILD packages + +: Refer to the \"[**Install BUILD + packages**](OBS_2.4_All-in-One_Server#Install_BUILD_packages "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify OBS account + +: Refer to the \"[**Modify OBS + account**](OBS_2.4_All-in-One_Server#Modify_OBS_account "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Set owner of OBS HOME directory (*if necessary*) + +: Refer to the \"[**Set owner of OBS HOME + directory**](OBS_2.4_All-in-One_Server#chown_obs_home "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + + +#### Modify *BSConfig.pm* file + +: \# vi /usr/lib/obs/server/BSConfig.pm +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| my \$frontend = undef; \# FQDN of the +WebUI/API server if it\'s not \$hostname\ + my \$api\_host = +\"**xxx.xxx.xxx.xxx**\";    +*\#\# FQDN, IP address, or short hostname of the API +(FRONTEND) server*\ +my \$rep\_host = \"**yyy.yyy.yyy.yyy**\";    +*\#\# FQDN, IP address, or short hostname of the REPO +(BACKEND) server*\ +my \$src\_host = \"**zzz.zzz.zzz.zzz**\";    +*\#\# FQDN, IP address, or short hostname of the SRC +(STORAGE) server*\ +my \$api\_ip = quotemeta inet\_ntoa(inet\_aton(\$api\_host));\ +my \$rep\_ip = quotemeta inet\_ntoa(inet\_aton(\$rep\_host));\ +my \$src\_ip = quotemeta inet\_ntoa(inet\_aton(\$src\_host));\ +\ +······\ +\ +our \$ipaccess = {\ +   \'127\\..\*\' =\> \'rw\', \# only the localhost can write to the +backend\ +   \"\^\$ip\" =\> \'rw\', \# Permit IP of FQDN\ +    \"\^\$api\_ip\" =\> \'rw\', \# Permit IP of API +server\ +   \"\^\$rep\_ip\" =\> \'rw\', \# Permit IP of REPO server\ +   \"\^\$src\_ip\" =\> \'rw\', \# Permit IP of SRC server\ +    \'.\*\' =\> \'worker\', \# build results can be delivered +from any client in the network\ +};\ +\ +······\ +\ +\#our \$obsname = \$hostname; \# unique +identifier for this Build Service instance\ +our \$obsname = \$rep\_host;\ +\ +······\ +\ +\#our \$srcserver = \"http://\$hostname:5352\";\ +our \$srcserver = \"http://\$src\_host:5352\";\ + \#our \$reposerver = +\"http://\$hostname:5252\";\ +our \$reposerver = \"http://\$rep\_host:5252\";\ + \#our \$serviceserver = +\"http://\$hostname:5152\";\ +our \$serviceserver = \"http://\$src\_host:5152\";\ +\ +······\ +\ +\#our \$repodownload = +\"http://\$hostname/repositories\";\ +our \$repodownload = \"http://\$rep\_host:82\";\ +\ +······\ +\ +\#our \@reposervers = +(\"http://\$hostname:5252\");\ +our \@reposervers = (\"http://\$rep\_host:5252\");\ +\ +······\ +\ +\#our \$noproxy = \"localhost, 127.0.0.1\";\ +*\#\# Domains, FQDNs, IP addresses, short +hostnames*\ +our \$noproxy = =\"localhost, 127.0.0.1, +**pilot.tizen.org, build, frontend, front, fe, api, +webui, backend, be, rep, storage, src, db**\";\ +\ +······\ + \|} \ + +#### Install Apache2 for REPO download + +    **Install Apache2** + +: \# zypper install apache2 + +\ +    **Set up *server name* for apache2 service** + +: \# vi /etc/sysconfig/apache2 +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +APACHE\_SERVERNAME=\"**yyy.yyy.yyy.yyy**\"    +*\#\# FQDN, IP address, or short hostname of the REPO +(BACKEND) server*\ +······\ + \|}\ + +#### Configure Apache2 for REPO download + +    **Edit httpd.conf file** + +: Refer to the \"[**Edit httpd.conf + file**](OBS_2.4_All-in-One_Server#httpd_conf "wikilink")\" + subsection in the \"[**Set up Apache2 for + WebUI**](OBS_2.4_All-in-One_Server#Set_up_Apache2_for_WebUI "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ +    **Edit obs.conf file** + +: \# vi /etc/apache2/vhosts.d/obs.conf +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| + + Listen 82 + + # Build Results + + ServerName rep + + # The resulting repositories + DocumentRoot "/srv/obs/repos" + + + Options FollowSymLinks + + + + Options Indexes FollowSymLinks + Allow from all + + + +\|}\ + +#### Set up firewall for BACKEND server + +    **Add TCP ports for BACKEND server** + +: YaST \--\> Security and Users \--\> Firewall \--\> Allowed Services + \--\> Advanced\... \--\> TCP Ports +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| 5252 82 \|}\ + +#### Start BACKEND services + +: \# systemctl start obsrepserver obsscheduler obsdispatcher + obspublisher obswarden apache2 + +\ + +#### Test BACKEND server installation + +: Browse to ***http://yyy.yyy.yyy.yyy:82*** + with your web browser (yyy.yyy.yyy.yyy = FQDN or IP address of the + REPO server) + +\ + +#### Register BACKEND services + +: \# chkconfig \--add obsrepserver obsscheduler obsdispatcher + obspublisher obswarden apache2 + +\ + +------------------------------------------------------------------------ + +### ***Install STORAGE Server*** + +STORAGE server = SOURCE server + SERVICE server + MySQL server\ +\ + +#### Make HOME directory for OBS (*if necessary*) + +: Refer to the \"[**Make a HOME directory for + OBS**](OBS_2.4_All-in-One_Server#make_obs_home "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install MySQL (MariaDB) + +: Refer to the \"[**Install MySQL + (MariaDB)**](OBS_2.4_All-in-One_Server#Install_MySQL_(MariaDB) "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install SOURCE/SERVICE packages + +    **Install OBS packages** + +: \# zypper install obs-server +: \# zypper install obs-utils +: \# zypper install obs-source\_service obs-service-download\_files + obs-service-tar\_scm + +\ +    **Install GBS service packages (for only Tizen)** + +: \# zypper install obs-service-gbs obs-service-git-buildpackage +: \# zypper install librpm-tizen + +\ + +#### Configure OBS services + +: Refer to the \"[**Configure OBS + services**](OBS_2.4_All-in-One_Server#Configure_OBS_services "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify OBS account + +: Refer to the \"[**Modify OBS + account**](OBS_2.4_All-in-One_Server#Modify_OBS_account "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Set owner of OBS HOME directory (*if necessary*) + +: Refer to the \"[**Set owner of OBS HOME + directory**](OBS_2.4_All-in-One_Server#chown_obs_home "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Create OBS databases + +: Refer to the \"**[Create OBS + databases](OBS_2.4_All-in-One_Server#Create_OBS_databases "wikilink")**\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify *BSConfig.pm* file + +: Refer to the \"[**Modify BSConfig.pm file**](#bsconfig "wikilink")\" + section in the \"**[Install BACKEND + Server](#Install_BACKEND_Server "wikilink")**\" chapter. + +\ + +#### Set up firewall for STORAGE server + +    **Add TCP ports for STORAGE server** + +: YaST \--\> Security and Users \--\> Firewall \--\> Allowed Services + \--\> Advanced\... \--\> TCP Ports +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| 3306 5152 5352\ + \|}\ + +#### Start STORAGE services + +: \# systemctl start obssrcserver obsservice + +\ + +#### Register STORAGE services + +: \# chkconfig \--add mysql obssrcserver obsservice + +\ + +------------------------------------------------------------------------ + +### ***Install FRONTEND Server*** + +FRONTEND server = WebUI server + API server\ +\ + +#### Install Apache2 for FE + +    **Install apache2 package** + +: \# zypper install apache2 + +\ +    **Set up *server name* for apache2 service** + +: \# vi /etc/sysconfig/apache2 +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +APACHE\_SERVERNAME=\"**xxx.xxx.xxx.xxx**\"    +*\#\# FQDN, IP address, or short hostname of the WebUI +(FRONTEND) server*\ +······\ + \|}\ + +#### Install PHP5 + +: Refer to the \"[**Install + PHP5**](OBS_2.4_All-in-One_Server#Install_PHP5 "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install FRONTEND packages + +: \# zypper install obs-api +: \# zypper install obs-utils +: \# zypper install perl-GD + +\ + +#### Configure {api,webui} database.yml files + +    **API** + +: \# vi /srv/www/obs/api/config/database.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +production:\ +  adapter: mysql2\ +  database: api\_production\ +  host: +**zzz.zzz.zzz.zzz**    +*\#\# The hostname of the MySQL server for OBS*\ +  port: **3306**    +*\#\# The port number of the MySQL service in the MySQL +server*\ +  username: ~~root~~**obs**    +*\#\# The user name in the step of \"[Create OBS +databases](OBS_2.4_All-in-One_Server#Create_OBS_databases "wikilink")\"*\ +  password: ~~opensuse~~**obspassword**    +*\#\# The password in the step of \"[Create OBS +databases](OBS_2.4_All-in-One_Server#Create_OBS_databases "wikilink")\"*\ +  encoding: utf8\ +······\ + \|}\ +    **WebUI** + +: \# vi /srv/www/obs/webui/config/database.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +production:\ +  adapter: mysql2\ +  database: webui\_production\ +  host: +**zzz.zzz.zzz.zzz**    +*\#\# The hostname of the MySQL server for OBS*\ +  port: **3306**    +*\#\# The port number of the MySQL service in the MySQL +server*\ +  username: ~~root~~**obs**    +*\#\# The user name in the step of \"[Create OBS +databases](OBS_2.4_All-in-One_Server#Create_OBS_databases "wikilink")\"*\ +  password: ~~opensuse~~**obspassword**    +*\#\# The password in the step of \"[Create OBS +databases](OBS_2.4_All-in-One_Server#Create_OBS_databases "wikilink")\"*\ +  encoding: utf8\ +······\ + \|}\ + +#### Populate {api,webui}\_production databases + +: Refer to the \"[**Populate {api,webui}\_production + databases**](OBS_2.4_All-in-One_Server#populate_obs_db "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure {api,webui} options.yml files + +    **API** + +: \# vi /srv/www/obs/api/config/options.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#use\_xforward: true\ +use\_xforward: true\ +······\ +\#source\_host: localhost\ +source\_host: +\"**zzz.zzz.zzz.zzz**\"    +*\#\# The hostname or the IP address of the SRC +server*\ +······\ +\#download\_url: http://localhost:82/\ +download\_url: +**yyy.yyy.yyy.yyy**:82/    +*\#\# The hostname or the IP address of the REPO +server*\ +······\ + \|}\ +    **WebUI** + +: \# vi /srv/www/obs/webui/config/options.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#download\_url: http://myhost:82/\ +download\_url: +**yyy.yyy.yyy.yyy**:82/    +*\#\# The hostname or the IP address of the REPO +server*\ +······\ +\#use\_xforward: true\ +use\_xforward: true\ +······\ +\#frontend\_host: api.opensuse.org\ +frontend\_host: +\"**xxx.xxx.xxx.xxx**\"    +*\#\# The hostname or the IP address of the API +(FRONTEND) server*\ +······\ +*\#\# **If the HTTP protocol must be used** for OBS API +service **instead of HTTPS**, the port number for API should be +81.*\ +\#frontend\_port: 443\ +frontend\_port: 81\ +\#frontend\_protocol: https\ +frontend\_protocol: http\ +······\ + \|}\ + +#### Configure Apache2 for FE + +    **Edit /etc/sysconfig/apache2 file** + +: Refer to the \"[Edit /etc/sysconfig/apache2 + file](OBS_2.4_All-in-One_Server#setup_syscfg_apache2 "wikilink")\" + subsection in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ +    **Generate SSL certificate** ***(if HTTPS is +used)*** + +: Refer to the \"[Generate SSL certificate + \...](OBS_2.4_All-in-One_Server#gen_ssl_cert "wikilink")\" + subsection in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ +    **Edit httpd.conf file** + +: Refer to the \"[Edit httpd.conf + file](OBS_2.4_All-in-One_Server#httpd_conf "wikilink")\" subsection + in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure virtual hosts for Web UI and API + +: \# vi /etc/apache2/vhosts.d/obs.conf +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| Listen 80\ +Listen 81\ +~~Listen 82~~\ +*Listen 443*\ +*Listen 444*\ +\ + ······\ +\ +~~\\ +    \# just give an overview about this OBS instance via static web +page\ +    DocumentRoot \"/srv/www/obs/overview\"\ +\ +    \ +        Options Indexes\ +        Allow from all\ +    \ +\ +~~\ +~~\\ +    \# The resulting repositories\ +    DocumentRoot \"/srv/obs/repos\"\ +\ +    \ +        Options Indexes FollowSymLinks\ +        Allow from all\ +    \ +\ +~~ \ + \# OBS WEB interface\ +\\ +    ServerName webui\ +\ +    DocumentRoot \"/srv/www/obs/webui/public\"\ +    ErrorLog /srv/www/obs/webui/log/apache\_error\_log\ +    TransferLog /srv/www/obs/webui/log/apache\_access\_log\ +\ +    PassengerPreStart http://build\ +\ +    \ +        AllowOverride all\ +        Options -MultiViews +FollowSymLinks\ +        XForward on\ +        Allow from all\ +    \ +\ +\ +\# OBS API\ +\\ +    ServerName api\ +\ +    DocumentRoot \"/srv/www/obs/api/public\"\ +    ErrorLog /srv/www/obs/api/log/apache\_error\_log\ +    TransferLog /srv/www/obs/api/log/apache\_access\_log\ +\ +    PassengerMinInstances 2\ +    PassengerPreStart http://api:81\ +\ +    \ +        AllowOverride all\ +        Options -MultiViews\ +        XForward on\ +        Allow from all\ +    \ +\ +\|}\ + +#### Change owner/group of {api,webui} directories + +: \# chown -R wwwrun:www /srv/www/obs/{api,webui} + +\ + +#### Set up firewall for FRONTEND server + +    **Add TCP ports for FRONTEND server** + +: YaST \--\> Security and Users \--\> Firewall \--\> Allowed Services + \--\> Advanced\... \--\> TCP Ports +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| 80 81 *443 444*\ + \|} + +: † *\"443 444\" ports should be enabled only if it is + used.*\ + +\ + +#### Start FRONTEND services + +: \# systemctl start apache2 memcached obsapidelayed + +\ + +#### Test FRONTEND server installation + +: Refer to the \"**[Test OBS server + installation](OBS_2.4_All-in-One_Server#test_fe "wikilink")**\" + section in the \"**[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")**\" + chapter in the \"**[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")**\" page. + +\ + +#### Register FRONTEND services + +: \# chkconfig \--add apache2 memcached obsapidelayed + +\ + +------------------------------------------------------------------------ + +### ***Install Workers*** + +Refer to the \"[**Install +Workers**](OBS_2.4_All-in-One_Server#Install_Workers "wikilink")\" +chapter in the \"[**OBS 2.4 All-in-One +Server**](OBS_2.4_All-in-One_Server "wikilink")\" page.\ +\ + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_2.4_Zypper_Repositories.md b/docs/platform/tool/OBS_2.4_Zypper_Repositories.md new file mode 100644 index 0000000000..59dba015f8 --- /dev/null +++ b/docs/platform/tool/OBS_2.4_Zypper_Repositories.md @@ -0,0 +1,13 @@ +### ***Add zypper repositories*** + +: \# zypper ar -f + +: \# zypper ar -Gf -t rpm-md -n \"Tizen Services (openSUSE\_12.3)\" + + tizen-services +: \# zypper ar -Gf -t rpm-md -n \"Tizen Tools (openSUSE\_12.3)\" + + tizen-tools +: \# zypper refresh + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_2.5_All-in-One_Server.md b/docs/platform/tool/OBS_2.5_All-in-One_Server.md new file mode 100644 index 0000000000..586d9cf290 --- /dev/null +++ b/docs/platform/tool/OBS_2.5_All-in-One_Server.md @@ -0,0 +1,456 @@ +### ***Add zypper repositories*** + +: Refer to the \"[**OBS 2.5 Zypper + Repositories**](OBS_2.5_Zypper_Repositories "wikilink")\" page. + +\ + +------------------------------------------------------------------------ + +### ***Install All-in-One Server*** + +#### Make HOME directory for OBS (*if necessary*) + +: Refer to the \"[**Make a HOME directory for + OBS**](OBS_2.4_All-in-One_Server#make_obs_home "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Make repository directory + +: Refer to the \"[**Make repository + directory**](OBS_2.4_All-in-One_Server#make_repos_dir "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install MySQL (MariaDB) + +: Refer to the \"[**Install MySQL + (MariaDB)**](OBS_2.4_All-in-One_Server#Install_MySQL_(MariaDB) "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install Apache2 + +: Refer to the \"[**Install + Apache2**](OBS_2.4_All-in-One_Server#Install_Apache2 "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install PHP5 + +: Refer to the \"[**Install + PHP5**](OBS_2.4_All-in-One_Server#Install_PHP5 "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install BUILD packages + +: \# zypper remove -u build build-mkbaselibs + build-mkdrpms build-initvm-x86\_64 build-initvm-i586 +: \# zypper install build-20140424-1.1 build-mkbaselibs-20140424-1.1 + build-mkdrpms-20140424-1.1 +: \# zypper install build-initvm-x86\_64-20140424-1.1 + build-initvm-i586-20131112-7.1 +: (\# zypper install build-initvm-x86\_64 + build-initvm-i586) +: † *The latest build package + (build-20150115-4.1.noarch) from + \"http://download.opensuse.org/update/13.1\" makes ARM build in OBS + very slow.* + +\ + +#### Fix build script bugs + +: \# vi /usr/lib/build/qemu-reg +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#:aarch64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff:/usr/bin/qemu-aarch64-binfmt:P\ +:aarch64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff:/usr/bin/qemu-arm64-binfmt:P\ +······\ + \|} + +: † *This is because duplicated definitions for + \"**aarch64**\" makes ARM build in OBS impossible.* + +\ +: \# vi /usr/lib/build/build-pkg-rpm + +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +pkg\_finalize\_rpm() {\ +    if test -n \"\${CUMULATED\_LIST\[\*\]}\" ; then\ +        echo \"now installing cumulated packages\"\ +        ADDITIONAL\_PARAMS=\ +        for ((num=0; num\<=cumulate; num++)) ; do\ +······\ + \|} + +: † *This bug in the \"**Cumulation**\" functionality + makes ARM build in OBS impossible.* + +\ + +#### Install OBS packages + +: Refer to the \"[**Install OBS + packages**](OBS_2.4_All-in-One_Server#Install_OBS_packages "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install additional packages for dependencies + +: \# zypper install sqlite3 perl perl-Net-SSLeay perl-GD perl-BSSolv + perl-Socket-MsgHdr ruby rubygem-rails rubygem-delayed\_job + rubygem-exception\_notification rubygem-nokogiri rubygem-sqlite3 + rubygem-daemons rubygem-erubis rubygem-ci\_reporter rubygem-rdoc + rubygem-json rubygem-xmlhash +: † Refer to + + +\ + +#### Configure OBS services + +: Refer to the \"[**Configure OBS + services**](OBS_2.4_All-in-One_Server#Configure_OBS_services "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Generate configuration.xml file + +: \# vi /srv/obs/configuration.xml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| + + + + Tizen OBS + Open Build Service + + armv7l + i586 + x86_64 + + + + \|}\ + +#### Modify OBS account + +: \# vi /etc/passwd +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +obsrun:x:482:481:User for build service +backend:/usr/lib/obs:~~/bin/false~~**/bin/bash**\ +······\ + \|} + +: † This is for OBS shell scripts to be executed by + the OBS account. + +\ + +#### Set owner of OBS HOME directory (*if necessary*) + +: Refer to the \"[**Set owner of OBS HOME + directory**](OBS_2.4_All-in-One_Server#chown_obs_home "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify *BSConfig.pm* file + +: \# vi /usr/lib/obs/server/BSConfig.pm +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| \#our \$service\_maxchild = 20;\ +our \$service\_maxchild = 20;\ +······\ +\#our \$repodownload = +\"http://\$hostname/repositories\";\ +our \$repodownload = \"http://\$hostname:82\";\ +······\ + \|}\ + +#### Create OBS database + +: \# mysql -u root -p +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| /\* Create empty databases \*/\ +mysql\> create database +api\_production;\ +/\* Create new account +obs with password +obspassword \*/\ +mysql\> create user +\'obs\'@\'%\' identified by \'obspassword\';\ +mysql\> create user +\'obs\'@\'localhost\' identified by \'obspassword\';\ +/\* Configure permissions \*/\ +mysql\> GRANT all privileges ON +api\_production.\* TO \'obs\'@\'%\', \'obs\'@\'localhost\';\ +mysql\> FLUSH +PRIVILEGES;\ +/\* Exit MySQL \*/\ +mysql\> exit\ +\|}\ + +#### Configure API database.yml file + +: \# vi /srv/www/obs/api/config/database.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +production:\ +  adapter: mysql2\ +  database: api\_production\ +  username: ~~root~~**obs**    +*\#\# The user name in the step of \"[Create OBS +database](#Create_OBS_database "wikilink")\"*\ +  password: ~~opensuse~~**obspassword**    +*\#\# The password in the step of \"[Create OBS +database](#Create_OBS_database "wikilink")\"*\ +  encoding: utf8\ +······\ + \|}\ + +#### Populate API production database + +: \# cd /srv/www/obs/api +: \# RAILS\_ENV=\"production\" rake db:setup +: *\# RAILS\_ENV=\"production\" rake + writeconfiguration* + +\ + +#### Configure API options.yml file (like as follows) + +: \# vi /srv/www/obs/api/config/options.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#use\_xforward: true\ +use\_xforward: true\ +\ +······\ +\#frontend\_port: 443\ +frontend\_port: 80    *\#\# **If +HTTP must be used** for OBS API service **instead of HTTPS**, the port +number for API must be 80.*\ +\#frontend\_protocol: https\ +frontend\_protocol: http\ +······\ + \|}\ + +#### Configure Apache2 + +     **Edit /etc/sysconfig/apache2 +file** + +: \# vi /etc/sysconfig/apache2 +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +APACHE\_MODULES=\"······ passenger rewrite proxy +proxy\_http xforward headers **socache\_shmcb**\"\ +······\ +APACHE\_SERVER\_FLAGS=\"SSL\"    +*\#\# Enable SSL **if it is necessary**.*\ +······\ + \|} \ +    **Generate SSL certificate** ***(only if HTTPS is +used)***\ +: Refer to the \"[Generate SSL certificate +\...](OBS_2.4_All-in-One_Server#gen_ssl_cert "wikilink")\" subsection in +the \"[Configure +Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" +section in the \"[Install All-in-One +Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" +chapter in the \"[OBS 2.4 All-in-One +Server](OBS_2.4_All-in-One_Server "wikilink")\" page.\ +    **Edit httpd.conf file** + +: Refer to the \"[Edit httpd.conf + file](OBS_2.4_All-in-One_Server#httpd_conf "wikilink")\" subsection + in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure virtual hosts for OBS + +: \# vi /etc/apache2/vhosts.d/obs.conf +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| Listen 80\ +*Listen 443*\ +Listen 82\ +······\ +\ +······\ +*\#\# Comment out or remove this block.*\ +\#\\ +\#    ······\ +\#\ +\ +······\ +*\#\# Comment out or remove this block.*\ +\#\\ +\#    ······\ +\#\ +\ +······\ +*\#\# Comment out this block **if HTTPS is NOT +used**.*\ +\#\\ +\#    ······\ +\#\ +\ + \# OBS WEBUI & API without SSL\ +\\ +    ServerName api\ +\ +    DocumentRoot \"/srv/www/obs/api/public\"\ +    ErrorLog /srv/www/obs/api/log/apache\_error\_log\ +    TransferLog /srv/www/obs/api/log/apache\_access\_log\ +\ +    PassengerMinInstances 2\ +    PassengerPreStart http://api\ +\ +    \ +        AllowOverride all\ +        Options -MultiViews\ +        XForward on\ +        Allow from all\ +    \ +\ +\ +\# Build Results\ +\\ +    ServerName rep\ +\ +    \# The resulting repositories\ +    DocumentRoot \"/srv/obs/repos\"\ +\ +    \ +        Options FollowSymLinks\ +    \ +\ +    \ +        Options Indexes FollowSymLinks\ +        Allow from all\ +    \ +\ + \|}\ + +#### Change owner/group of API directories + +: \# chown -R wwwrun:www /srv/www/obs/api + +\ + +#### Set up firewall + +    **Add TCP ports for OBS server** + +: YaST \--\> Security and Users \--\> Firewall \--\> Allowed Services + \--\> Advanced\... \--\> TCP Ports +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| 5152 5252 5352 80 82 +*443*\ + \|} + +: † *\"443\" port should be enabled only if it is + used.*\ + +\ + +#### Register OBS server services + +: \# systemctl enable mysql +: \# chkconfig \--add obsrepserver obssrcserver obsservice + obsscheduler obsdispatcher obspublisher +: \# systemctl enable apache2 +: \# chkconfig \--add obsapidelayed memcached + +\ + +------------------------------------------------------------------------ + +### ***Reboot OBS Server*** + + + +
  • + +Reboot OBS server + + + +\ + +------------------------------------------------------------------------ + +### ***Install Workers*** + +Refer to the \"[**Install +Workers**](OBS_2.4_All-in-One_Server#Install_Workers "wikilink")\" +chapter in the \"[**OBS 2.4 All-in-One +Server**](OBS_2.4_All-in-One_Server "wikilink")\" page.\ +\ + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_2.5_Distributed_Servers.md b/docs/platform/tool/OBS_2.5_Distributed_Servers.md new file mode 100644 index 0000000000..3fda79a692 --- /dev/null +++ b/docs/platform/tool/OBS_2.5_Distributed_Servers.md @@ -0,0 +1,625 @@ +### ***Add zypper repositories*** + +: Refer to the \"[**OBS 2.5 Zypper + Repositories**](OBS_2.5_Zypper_Repositories "wikilink")\" page. + +\ + +------------------------------------------------------------------------ + +### ***Install BACKEND Server*** + +BACKEND server = REPO server + SCHEDULER + DISPATCHER + PUBLISHER + +WARDEN\ +\ + +#### Make HOME directory for OBS (*if necessary*) + +: Refer to the \"[**Make a HOME directory for + OBS**](OBS_2.4_All-in-One_Server#make_obs_home "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Make repository directory + +: Refer to the \"[**Make repository + directory**](OBS_2.4_All-in-One_Server#make_repos_dir "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install BUILD packages + +: Refer to the \"[**Install BUILD + packages**](OBS_2.5_All-in-One_Server#Install_BUILD_packages "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Fix build script bugs + +: Refer to the \"[**Fix build script + bugs**](OBS_2.5_All-in-One_Server#Fix_build_script_bugs "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Install BACKEND packages + +: Refer to the \"[**Install BACKEND + packages**](OBS_2.4_Distributed_Servers#Install_BACKEND_packages "wikilink")\" + section in the \"[**Install BACKEND + Server**](OBS_2.4_Distributed_Servers#Install_BACKEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Install additional packages for dependencies + +: Refer to the \"[**Install additional packages for + dependencies**](OBS_2.5_All-in-One_Server#Install_additional_packages_for_dependencies "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Generate configuration.xml file + +: Refer to the \"[**Generate configuration.xml + file**](OBS_2.5_All-in-One_Server#Generate_configuration.xml_file "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify OBS account + +: Refer to the \"[**Modify OBS + account**](OBS_2.5_All-in-One_Server#Modify_OBS_account "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Set owner of OBS HOME directory (*if necessary*) + +: Refer to the \"[**Set owner of OBS HOME + directory**](OBS_2.4_All-in-One_Server#chown_obs_home "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + + +#### Modify *BSConfig.pm* file + +: \# vi /usr/lib/obs/server/BSConfig.pm +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| my \$frontend = undef; \# FQDN of the +WebUI/API server if it\'s not \$hostname\ + my \$api\_host = +\"**xxx.xxx.xxx.xxx**\";    +*\#\# FQDN, IP address, or short hostname of the API +(FRONTEND) server*\ +my \$rep\_host = \"**yyy.yyy.yyy.yyy**\";    +*\#\# FQDN, IP address, or short hostname of the REPO +(BACKEND) server*\ +my \$src\_host = \"**zzz.zzz.zzz.zzz**\";    +*\#\# FQDN, IP address, or short hostname of the SRC +(STORAGE) server*\ +my \$api\_ip = quotemeta inet\_ntoa(inet\_aton(\$api\_host));\ +my \$rep\_ip = quotemeta inet\_ntoa(inet\_aton(\$rep\_host));\ +my \$src\_ip = quotemeta inet\_ntoa(inet\_aton(\$src\_host));\ +\ +······\ +\ +our \$ipaccess = {\ +   \'127\\..\*\' =\> \'rw\', \# only the localhost can write to the +backend\ +   \"\^\$ip\" =\> \'rw\', \# Permit IP of FQDN\ +    \"\^\$api\_ip\" =\> \'rw\', \# Permit IP of API +server\ +   \"\^\$rep\_ip\" =\> \'rw\', \# Permit IP of REPO server\ +   \"\^\$src\_ip\" =\> \'rw\', \# Permit IP of SRC server\ +    \'.\*\' =\> \'worker\', \# build results can be delivered +from any client in the network\ +};\ +\ +······\ +\ +our \$obsname = \$rep\_host;\ +\#our \$srcserver = \"http://\$hostname:5352\";\ +our \$srcserver = \"http://\$src\_host:5352\";\ + \#our \$reposerver = +\"http://\$hostname:5252\";\ +our \$reposerver = \"http://\$rep\_host:5252\";\ + \#our \$serviceserver = +\"http://\$hostname:5152\";\ +our \$serviceserver = \"http://\$src\_host:5152\";\ +\ +······\ +\ +\#our \$repodownload = +\"http://\$hostname/repositories\";\ +our \$repodownload = \"http://\$rep\_host:82\";\ +\ +······\ +\ +\#our \@reposervers = +(\"http://\$hostname:5252\");\ +our \@reposervers = (\"http://\$rep\_host:5252\");\ +\ +······\ +\ +\#our \$noproxy = \"localhost, 127.0.0.1\";\ +*\#\# Domains, FQDNs, IP addresses, short +hostnames*\ +our \$noproxy = \"localhost, 127.0.0.1, +**pilot.tizen.org, build, frontend, front, fe, api, +webui, backend, be, rep, storage, src, db**\";\ +\ +······\ + \|} \ + +#### Install Apache2 for REPO download + +: Refer to the \"[**Install Apache2 for REPO + download**](OBS_2.4_Distributed_Servers#Install_Apache2_for_REPO_download "wikilink")\" + section in the \"[**Install BACKEND + Server**](OBS_2.4_Distributed_Servers#Install_BACKEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Configure Apache2 for REPO download + +: Refer to the \"[**Configure Apache2 for REPO + download**](OBS_2.4_Distributed_Servers#Configure_Apache2_for_REPO_download "wikilink")\" + section in the \"[**Install BACKEND + Server**](OBS_2.4_Distributed_Servers#Install_BACKEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Set up firewall for BACKEND server + +: Refer to the \"[**Set up firewall for BACKEND + server**](OBS_2.4_Distributed_Servers#Set_up_firewall_for_BACKEND_server "wikilink")\" + section in the \"[**Install BACKEND + Server**](OBS_2.4_Distributed_Servers#Install_BACKEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Register BACKEND services + +: \# chkconfig \--add obsrepserver obsscheduler obsdispatcher + obspublisher obswarden +: \# systemctl enable apache2 + +\ + +------------------------------------------------------------------------ + +### ***Install STORAGE Server*** + +STORAGE server = SOURCE server + SERVICE server + MySQL server\ +\ + +#### Make HOME directory for OBS (*if necessary*) + +: Refer to the \"[**Make a HOME directory for + OBS**](OBS_2.4_All-in-One_Server#make_obs_home "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Make OBS **events** directory + +: \# mkdir -p **/srv/obs/events** + +\ + +#### Install MySQL (MariaDB) + +: Refer to the \"[**Install MySQL + (MariaDB)**](OBS_2.4_All-in-One_Server#Install_MySQL_(MariaDB) "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install SOURCE/SERVICE packages + +: Refer to the \"[**Install SOURCE/SERVICE + packages**](OBS_2.4_Distributed_Servers#Install_SOURCE/SERVICE_packages "wikilink")\" + section in the \"[**Install STORAGE + Server**](OBS_2.4_Distributed_Servers#Install_STORAGE_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Install additional packages for dependencies + +: Refer to the \"[**Install additional packages for + dependencies**](OBS_2.5_All-in-One_Server#Install_additional_packages_for_dependencies "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Modify OBS account + +: Refer to the \"[**Modify OBS + account**](OBS_2.5_All-in-One_Server#Modify_OBS_account "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Set owner of OBS HOME directory (*if necessary*) + +: Refer to the \"[**Set owner of OBS HOME + directory**](OBS_2.4_All-in-One_Server#chown_obs_home "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Create OBS database + +: Refer to the \"[**Create OBS + database**](OBS_2.5_All-in-One_Server#Create_OBS_database "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure OBS services + +: Refer to the \"[**Configure OBS + services**](OBS_2.4_Distributed_Servers#Configure_OBS_services "wikilink")\" + section in the \"[**Install STORAGE + Server**](OBS_2.4_Distributed_Servers#Install_STORAGE_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Modify *BSConfig.pm* file + +: Refer to the \"[**Modify BSConfig.pm file**](#bsconfig "wikilink")\" + section in the \"**[Install BACKEND + Server](#Install_BACKEND_Server "wikilink")**\" chapter. + +\ + +#### Set up firewall for STORAGE server + +: Refer to the \"[**Set up firewall for STORAGE + server**](OBS_2.4_Distributed_Servers#Set_up_firewall_for_STORAGE_server "wikilink")\" + section in the \"[**Install BACKEND + Server**](OBS_2.4_Distributed_Servers#Install_BACKEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Register STORAGE services + +: \# chkconfig \--add mysql obssrcserver obsservice + +\ + +------------------------------------------------------------------------ + +### ***Install FRONTEND Server*** + +FRONTEND server = WebUI server + API server\ +\ + +#### Install Apache2 for FE + +: Refer to the \"[**Install Apache2 for + FE**](OBS_2.4_Distributed_Servers#Install_Apache2_for_FE "wikilink")\" + section in the \"[**Install FRONTEND + Server**](OBS_2.4_Distributed_Servers#Install_FRONTEND_Server "wikilink")\" + chapter in the \"[**OBS 2.4 Distributed + Servers**](OBS_2.4_Distributed_Servers "wikilink")\" page. + +\ + +#### Install PHP5 + +: Refer to the \"[**Install + PHP5**](OBS_2.4_All-in-One_Server#Install_PHP5 "wikilink")\" section + in the \"[**Install All-in-One + Server**](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.4 All-in-One + Server**](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Install FRONTEND packages + +: \# zypper install obs-api +: \# zypper install obs-utils + +\ + +#### Install additional packages for dependencies + +: Refer to the \"[**Install additional packages for + dependencies**](OBS_2.5_All-in-One_Server#Install_additional_packages_for_dependencies "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure API database.yml file + +: \# vi /srv/www/obs/api/config/database.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +production:\ +  adapter: mysql2\ +  database: api\_production\ +  host: +\"**zzz.zzz.zzz.zzz**\"    +*\#\# The hostname of the MySQL server for OBS*\ +  port: \'**3306**\'    +*\#\# The port number of the MySQL service in the MySQL +server*\ +  username: ~~root~~**obs**    +*\#\# The user name in the step of \"[Create OBS +database](OBS_2.5_All-in-One_Server#Create_OBS_database "wikilink")\"*\ +  password: ~~opensuse~~**obspassword**    +*\#\# The password in the step of \"[Create OBS +database](OBS_2.5_All-in-One_Server#Create_OBS_database "wikilink")\"*\ +  encoding: utf8\ +······\ + \|}\ + +#### Populate API production database + +: Refer to the \"[**Populate API production + database**](OBS_2.5_All-in-One_Server#Populate_API_production_database "wikilink")\" + section in the \"[**Install All-in-One + Server**](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[**OBS 2.5 All-in-One + Server**](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure API options.yml file + +: \# vi /srv/www/obs/api/config/options.yml +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#use\_xforward: true\ +use\_xforward: true\ +\ +······\ +\#source\_host: localhost\ +source\_host: +\"**zzz.zzz.zzz.zzz**\"    +*\#\# The hostname or the IP address of the SRC +server*\ +source\_port: 5352\ +\#source\_protocol: https\ +source\_protocol: http\ +\ +······\ +\#frontend\_host: localhost\ +frontend\_host: +\"**xxx.xxx.xxx.xxx**\"    +*\#\# The hostname or the IP address of the API +(FRONTEND) server*\ +\#frontend\_port: 443\ +frontend\_port: 80    *\#\# **If +HTTP must be used** for OBS API service **instead of HTTPS**, the port +number for API must be 80.*\ +\#frontend\_protocol: https\ +frontend\_protocol: http\ +······\ + \|}\ + +#### Configure Apache2 for FE + +    **Edit /etc/sysconfig/apache2 file** + +: Refer to the \"[Edit /etc/sysconfig/apache2 + file](OBS_2.5_All-in-One_Server#setup_syscfg_apache2 "wikilink")\" + subsection in the \"[Configure + Apache2](OBS_2.5_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.5_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.5 All-in-One + Server](OBS_2.5_All-in-One_Server "wikilink")\" page. + +\ +    **Generate SSL certificate** ***(only if HTTPS is +used)*** + +: Refer to the \"[Generate SSL certificate + \...](OBS_2.4_All-in-One_Server#gen_ssl_cert "wikilink")\" + subsection in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ +    **Edit httpd.conf file** + +: Refer to the \"[Edit httpd.conf + file](OBS_2.4_All-in-One_Server#httpd_conf "wikilink")\" subsection + in the \"[Configure + Apache2](OBS_2.4_All-in-One_Server#Configure_Apache2 "wikilink")\" + section in the \"[Install All-in-One + Server](OBS_2.4_All-in-One_Server#Install_All-in-One_Server "wikilink")\" + chapter in the \"[OBS 2.4 All-in-One + Server](OBS_2.4_All-in-One_Server "wikilink")\" page. + +\ + +#### Configure virtual hosts for FE + +: \# vi /etc/apache2/vhosts.d/obs.conf +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| Listen 80\ +*Listen 443*\ +\#Listen 82\ +······\ +\ +······\ +*\#\# Comment out or remove this block.*\ +\#\\ +\#    ······\ +\#\ +\ +······\ +*\#\# Comment out or remove this block.*\ +\#\\ +\#    ······\ +\#\ +\ +······\ +*\#\# Comment out this block **if HTTPS is NOT +used**.*\ +\#\\ +\#    ······\ +\#\ +\ + \# OBS WEBUI & API without SSL\ +\\ +    ServerName api\ +\ +    DocumentRoot \"/srv/www/obs/api/public\"\ +    ErrorLog /srv/www/obs/api/log/apache\_error\_log\ +    TransferLog /srv/www/obs/api/log/apache\_access\_log\ +\ +    PassengerMinInstances 2\ +    PassengerPreStart http://api\ +\ +    \ +        AllowOverride all\ +        Options -MultiViews\ +        XForward on\ +        Allow from all\ +    \ +\ + \|}\ + +#### Change owner/group of API directories + +: \# chown -R wwwrun:www /srv/www/obs/api + +\ + +#### Set up firewall + +    **Add TCP ports for FRONTEND server** + +: YaST \--\> Security and Users \--\> Firewall \--\> Allowed Services + \--\> Advanced\... \--\> TCP Ports +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| 80 *443* \|} + +: † *\"443\" port should be enabled only if it is + used.*\ + +\ + +#### Register FRONTEND services + +: \# chkconfig \--add memcached obsapidelayed +: \# systemctl enable apache2 + +\ + +------------------------------------------------------------------------ + +### ***Reboot OBS Servers*** + + + +
  • + +Reboot BACKEND server + +
  • + +Reboot STORAGE server + +
  • + +Reboot FRONTEND server + + + +\ + +------------------------------------------------------------------------ + +### ***Install Workers*** + +Refer to the \"[**Install +Workers**](OBS_2.4_All-in-One_Server#Install_Workers "wikilink")\" +chapter in the \"[**OBS 2.4 All-in-One +Server**](OBS_2.4_All-in-One_Server "wikilink")\" page.\ +\ + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_2.5_Zypper_Repositories.md b/docs/platform/tool/OBS_2.5_Zypper_Repositories.md new file mode 100644 index 0000000000..e8f009385b --- /dev/null +++ b/docs/platform/tool/OBS_2.5_Zypper_Repositories.md @@ -0,0 +1,13 @@ +### ***Add zypper repositories*** + +: \# zypper ar -f + +: \# zypper ar -Gf -t rpm-md -n \"Tizen Services (openSUSE\_13.1)\" + + tizen-services +: \# zypper ar -Gf -t rpm-md -n \"Tizen Tools (openSUSE\_13.1)\" + + tizen-tools +: \# zypper refresh + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_Installation_and_Setup.md b/docs/platform/tool/OBS_Installation_and_Setup.md new file mode 100644 index 0000000000..034814afb1 --- /dev/null +++ b/docs/platform/tool/OBS_Installation_and_Setup.md @@ -0,0 +1,190 @@ +### ***Before starting OBS installation*** + +#### Let\'s become a super user + +: \$ sudo su + +\ + +#### Check \"name resolution\" of \'hostname\' + +- Each hostname (e.g. \"build.pilot.tizen.org\") must be saved in the + **/etc/HOSTNAME** file like as follows. + +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| build.pilot.tizen.org\ + \|} + +- All hostnames must be saved in the **/etc/hosts** file like as + follows. + +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ + + # OBS Server(s) + 192.168.0.2 build.pilot.tizen.org build frontend front fe api webui + 192.168.0.3 backend.pilot.tizen.org backend be rep + 192.168.0.4 storage.pilot.tizen.org storage src db + +······\ + \|} + +- **NO\_PROXY** should be configured with hostnames like as follows + if it should be used. + +: \# vi /etc/sysconfig/proxy +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| NO\_PROXY=\"localhost, +127.0.0.1, pilot.tizen.org, build, frontend, front, fe, +api, webui, backend, be, rep, storage, src, db\"\ + \|} + +: \# vi /root/.curlrc +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| \--proxy \"http://192.168.0.1:8080\"\ + \--noproxy \"localhost, 127.0.0.1, pilot.tizen.org, +build, frontend, front, fe, api, webui, backend, be, rep, storage, src, +db\" \|}\ + +#### If FQDN is not available (i.e. if only short hostnames are available), + +- Comment out all \"**search**\" statements like as follows. + +: \# vi /etc/resolv.conf +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#search xyz.com\ +······\ + \|} + +- Change \"**NETCONFIG\_DNS\_POLICY**\" like as follows. + +: \# vi /etc/sysconfig/network/config +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ······\ +\#NETCONFIG\_DNS\_POLICY=\"auto\"\ +NETCONFIG\_DNS\_POLICY=\"\"\ +······\ + \|}\ + +------------------------------------------------------------------------ + +### **\'\'Install and Configure OBS**\'\' + +The Open Build Service (OBS) consists of servers and workers.\ +All OBS servers can be installed either in one computer (**all-in-one +server**) or throughout several computers (**distributed servers**).\ +It is recommended for OBS workers to be installed on different computers +from the computers in which OBS servers are installed.\ +\ + +#### OBS 2.4 Installation on openSUSE 12.3 + +- [Zypper Repositories](OBS_2.4_Zypper_Repositories "wikilink") +- [All-in-One Server + Workers](OBS_2.4_All-in-One_Server "wikilink") +- [Distributed Servers + + Workers](OBS_2.4_Distributed_Servers "wikilink") + +\ + +#### OBS 2.5 Installation on openSUSE 13.1 + +- [Zypper Repositories](OBS_2.5_Zypper_Repositories "wikilink") +- [All-in-One Server + Workers](OBS_2.5_All-in-One_Server "wikilink") +- [Distributed Servers + + Workers](OBS_2.5_Distributed_Servers "wikilink") + +\ + +#### Public Key Signing with OBS + +- Start signing infra: + +- [Further OBS Signing + Configurations](Further_OBS_Signing_Configurations "wikilink") + +\ + +------------------------------------------------------------------------ + +=== ***Troubleshooting*** === ***(How to solve issues +during OBS installation)***\ +\ + +#### Firewall setting fails + +  **CAUSE**: ***/etc/services*** file had been deleted. + +: \# SuSEfirewall2 +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| SuSEfirewall2: Setting up rules from +/etc/sysconfig/SuSEfirewall2 \...\ +SuSEfirewall2: using default zone \'ext\' for interface eno1\ +SuSEfirewall2: using default zone \'ext\' for interface eno2\ +SuSEfirewall2: using default zone \'ext\' for interface eno3\ +SuSEfirewall2: using default zone \'ext\' for interface eno4\ + iptables-batch v1.4.21: invalid port/service \`ssh\' +specified\ +Try \`iptables-batch -h\' or \'iptables-batch \--help\' for more +information.\ +SuSEfirewall2: Error: iptables-batch failed, re-running using iptables\ +iptables v1.4.21: invalid port/service \`ssh\' specified\ +Try \`iptables -h\' or \'iptables \--help\' for more information.\ +iptables v1.4.21: invalid port/service \`ssh\' specified\ +Try \`iptables -h\' or \'iptables \--help\' for more information.\ +ip6tables-batch v1.4.21: Port \"dhcpv6-client\" does not resolve to +anything.\ +\ +Try \`ip6tables-batch -h\' or \'ip6tables-batch \--help\' for more +information.\ +SuSEfirewall2: Error: ip6tables-batch failed, re-running using +ip6tables\ +ip6tables v1.4.21: Port \"dhcpv6-client\" does not resolve to anything.\ +\ +Try \`ip6tables -h\' or \'ip6tables \--help\' for more information.\ +ip6tables v1.4.21: invalid port/service \`ssh\' specified\ +Try \`ip6tables -h\' or \'ip6tables \--help\' for more information.\ +ip6tables v1.4.21: invalid port/service \`ssh\' specified\ +Try \`ip6tables -h\' or \'ip6tables \--help\' for more information.\ + SuSEfirewall2: Firewall rules successfully set\ + \|} + +: \# ls -al /etc/services +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| ls: cannot access /etc/services: No such file or +directory \|} + +\ +  **Solution**: reinstall ***netcfg*** package + +: \# zypper install \--force netcfg +: \# SuSEfirewall2 +: {\| width=\"1000px\" border=\"0\" style=\"margin:0; + background:\#f2f2f2; font-family:Consolas,Monaco,Monospace;\" + +\|- \| SuSEfirewall2: Setting up rules from +/etc/sysconfig/SuSEfirewall2 \...\ +SuSEfirewall2: using default zone \'ext\' for interface eno1\ +SuSEfirewall2: using default zone \'ext\' for interface eno2\ +SuSEfirewall2: using default zone \'ext\' for interface eno3\ +SuSEfirewall2: using default zone \'ext\' for interface eno4\ +SuSEfirewall2: Firewall rules successfully set\ + \|} + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_Server_Docker_image.md b/docs/platform/tool/OBS_Server_Docker_image.md new file mode 100644 index 0000000000..8255a46c1f --- /dev/null +++ b/docs/platform/tool/OBS_Server_Docker_image.md @@ -0,0 +1,328 @@ +Tizen Infra : OBS-Server with Docker +==================================== + +Introduction +------------ + +The Open Build Service (OBS) is a generic system to build and distribute +packages from sources in an automatic, consistent and reproducible way. +It makes it possible to release software for a wide range of operating +systems and hardware architectures. (https://en.opensuse.org) + +Version +------- + +> ver 2.4.0.7 ( OBS : 2.4 Docker Image : 0.7) + +Tested on Host OS. +------------------ + +> ===== Host OS : ubuntu 14.04 ===== +> +> docker version : 1.4.1 +> docker version : 1.6.2 +> docker version : 1.7.0 + +> ===== Host OS : opensuse 13.1 ===== +> +> docker version : 1.3.2 +> docker version : 1.6.2 + +HW Information of the OBS Server +-------------------------------- + +> ===== In the default configuration ===== +> +> === Server Info === +> CPU clock : 2.70GHz +> CPU core : 24 +> RAM MEM : 64GB +> Disk Cache : 2GB +> HDD : 1TB + +Pre-installed Packages +---------------------- + +> ===== Image OS : flavio/opensuse-12-3 ===== +> +> vim tar wget telnet supervisor sudo +> obs-server obs-signd obs-utils obs-api git-buildpackage obs-service-gbs +> obs-source_service qemu-linux-user build-initvm-x86_64 build-initvm-i586 obs-event-plugin +> apache2 apache2-mod_xforward rubygem-passenger-apache2 memcached +> php5 php5-gd php5-gettext php5-mbstring php5-mysql +> php5-pear php5-suhosin apache2-mod_php5 php5-bcmath +> php5-bz2 php5-calendar php5-curl php5-ftp php5-gmp +> php5-imap php5-ldap php5-mcrypt php5-odbc php5-openssl +> php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp +> php5-soap php5-sockets php5-sysvsem php5-wddx php5-xmlrpc +> php5-xsl php5-exif php5-fastcgi php5-sysvmsg php5-sysvshm +> npt iputils +> perl-GD +> obs-service-git-buildpackage +> libcurl4-7.42.1 +> librpm-tizen + +Download +-------- + +> URL : +> +> +> $ wget http://cdn.download.tizen.org/docker/obsserver/obsserver_2.4-2.4.0.7-docker-script.tar.gz +> +> --2015-09-09 13:18:02-- http://cdn.download.tizen.org/docker/obsserver/obsserver_2.4-2.4.0.7-docker-script.tar.gz +> Length: 618379115 (590M) [application/x-gzip] +> Saving to: `obsserver_2.4-2.4.0.7-docker-script.tar.gz' +> +> 100%[========================================================================>] 618,379,115 11.2M/s in 58s +> +> 2015-09-09 13:19:00 (10.2 MB/s) - `obsserver_2.4-2.4.0.7-docker-script.tar.gz' saved [618379115/618379115] + +Execution +--------- + +> ===== Download an images and execute. =====\ +> \$ wget \< url \>\ +> \$ ls +> +> obsserver_2.4-2.4.0.7-docker-script.tar.gz +> +> \$ tar -xvf obsserver\_2.4-2.4.0.7-docker-script.tar.gz +> +> \$ cd clientobsserver +> +> \$ ls +> +> config.conf dobsserver.sh env obsserver_2.4-2.4.0.7-docker-image.tar.gz root +> +> #### Description #### +> * config.conf : Metaconfig file of container +> * env : Environment variables of container +> * -docker-image.tar.gz : Docker image +> (“$ ./dobsserver.sh load” will load docker image from *-docker-image.tar.gz ) +> * root : Specific configuration files to be applied on container +> +> \$ sudo ./dobsserver.sh load +> +> \$ docker images +> +> $ docker images +> tizendocker:5000/obsserver 2.4.0.7 +> +> \$ vi env/env.list +> +> #If you want to change the password for the MySQL database, you can change it +> +> #If you are using the proxy in your enviroment, pleaese add below line. +> ftp_proxy=ftp://123.456.789.012 +> http_proxy=http://123.456.789.012 +> https_proxy=https://123.456.789.012 +> socks_proxy=socks://123.456.789.012 +> +> \$ vi config.conf +> +> # Configuration of the dobsserver.sh +> # You can change the hostname. Do not change others. +> export HOSTNAME= #hostname in container +> +> #If you remove the Container, the changed values are deleted, +> # the backup data must be managed volumes. +> export VOLUMES="<host dir or filename>:<container dir or filename> +> +> \$ sudo ./dobsserver.sh start +> +> $ docker ps +> 1dd1fac2912e tizendocker:5000/obsserver:2.4.0.7 "/bin/bash /srv/scri 4 hours ago Up 4 hours +> 0.0.0.0:80->80/tcp, 0.0.0.0:82->82/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:444->444/tcp, 0.0.0.0:5152->5152/tcp, +> 0.0.0.0:5252->5252/tcp, 0.0.0.0:5352->5352/tcp obsserver_2.4 +> +> Finish +> +> If you use a firewall on host OS, you have to allow a port number.(80 +> 81 82 443 444 873 5152 5252 5352) +> +> $sudo ufw allow 80 +> ... + +Connect OBS +----------- + +> web url : http://localhost:80/ or http:// < ip > / +> api url : http://localhost:81/ or http:// < ip >:81 / +> repos url : http://localhost:82/ or http:// < ip >:82 / +> +> # Admin password +> Log in = id : Admin , pw : opensuse + +Setup OBS Service +----------------- + +> If you conncect the download server,jenkins server. +> +> # Attach to a running container +> $ sudo ./dobsserver.sh attach +> +> > vi /usr/lib/obs/server/BSConfig.pm +> # 1) Add lines below +> our $notification_plugin = "notify_jenkins"; +> our $jenkinsserver = "Jenkins_Server_IP:8080"; (ex. our $jenkinsserver = > "http://123.456.789.012:8080";) +> our $jenkinsjob = 'job/obs-event-dispatcher/buildWithParameters'; +> our $jenkinsnamespace = "OBS"; +> our @excl_patterns = ("project:Tizen:.* type:REPO_PUBLISH_STATE", +> "type:BUILD_.*", +> "type:SRCSRV_COMMIT", +> "type:SRCSRV_VERSION_CHANGE"); +> +> our @incl_patterns = ("project:Tizen:.*", +> "project:home:prerelease:.*"); +> # You must modify Jenkins_Server_IP as what you use. +> # Optional : You can modify (add/ remove lists) "our @excl_patterns" & "our > @incl_patterns" +> # : our @excl_patterns -> obs projects which is excluded from snapshot +> # :our @incl_patterns -> obs projects which is triggers jenkins to make snapshot +> +> # 2) Add proxy IP +> our $proxy = "Proxy_IP"; +> ex) our $proxy = "http://123.456.789.012/"; +> +> # 3) Add information about stage server. +> our $stageserver = 'rsync://Download_Server_IP/_live_RW_'; +> ex) our $stageserver = 'rsync://123.456.789.012/_live_RW_'; +> +> # 4) If you are use the proxy in your enviroment +> > vi /etc/sysconfig/proxy +> HTTP_PROXY= +> HTTPS_PROXY= +> FTP_PROXY= +> +> # exit a container +> > exit +> +> # restart a container +> $ sudo ./dobsserver.sh stop +> +> $ sudo ./dobsserver.sh start> + +Setting up for Gerrit accessing +------------------------------- + +> 1. After getting a gerrit account, you need to create an ssh key, +> and add your ssh key to Gerrit to enable the connection to gerrit. +> +> 2. Register your contact info on Gerrit +> Log into Gerrit. +> On Gerrit UI, follow the links below to register your email address +> and update your full name on Gerrit: +> a.Settings --> Contact Information --> Register New Email... +> b.Settings --> Contact Information --> Full Name. +> +> 3. After you register the email, you will receive an email which contains a link. +> Please copy the link to your browser to activate the account. +> Create SSH keys +> +> $ sudo ./dobsserver.sh attach +> $ cd /root +> $ ssh-keygen -f id_rsa -t rsa -N '' +> Generating public/private rsa key pair. +> Generating public/private rsa key pair. +> Your identification has been saved in id_rsa. +> Your public key has been saved in id_rsa.pub. +> The key fingerprint is: +> 3a:34:9c:35:7c:58:b1:81:9e:b9:64:3d:27:f7:3e:60 root@OBSServer +> The key's randomart image is: +> +--[ RSA 2048]----+ +> | .+. | +> | ..o o | +> | .=+o | +> | . o*o+ o | +> | =oS. = . | +> | . o. E . | +> | o . o | +> | . o | +> | . | +> +-----------------+ +> # cat .ssh/id_rsa.pub +> +> 4. after pressing the Enter key at several prompts, an SSH key-pair will be created in /root/.ssh/id_rsa.pub . +> Upload SSH pubkey to Gerrit Click the links below to set up the Gerrit WebUI. +> Settings --> SSH Public Keys --> Add Key... +> Paste your SSH public key there, and then click 'Add'. +> 5. Verify your SSH connection You can verify your Gerrit connection by executing this command: +> Make sure to add the server RSA key fingerprint to the known hosts of jenkins account +> if connect to gerrit server in the first time. +> If your settings are correct, you'll see the message below. If not, check SSH proxy +> and SSH public key on Gerrit. +> $ ssh -p 29418 gerrit_username@gerrit_hostname +> **** Welcome to Gerrit Code Review **** +> 6. $ vi .ssh/config +> Host gerrit_hostname +> Port 29418 +> User gerrit_username +> IdentityFile ~/.ssh/id_rsa +> 7. Config Git for Gerrit Access After the above installation, which will include git, is complete, you can configure git. +> $ git config --global user.name "First_Name Last_Name" +> $ git config --global user.email "account@host" + +Initialize +---------- + +> \#\#\# remove all data\ +> \$ sudo ./dobsserver.sh stop\ +> \$ sudo rm -rf /home/obsserver\_2.4\ +> \$ sudo ./dobsserver.sh rm\ +> \$ sudo ./dobsserver.sh start + +CLI +--- + +> USAGE: ./dobsserver.sh COMMAND +> -e +> Commands: +> start Start a stopped container +> attach Attach to a running container +> stop Stop a running container +> status Status a running container +> rm Remove this containers +> restart stop , start a container +> kill Kill a running container +> logs Fetch the logs of a container +> cp Copy files/folders from a container's filesystem to the host path +> pull Pull an image or a repository from a Docker registry server +> inspect Return low-level information on a containe +> top Lookup the running processes of a container +> save Save an image to a tar archive +> load Load an image from a tar archive +> help help + +Troubleshooting +--------------- + +> -------------------------------------------------------------------------- +> Known issues +> This container is not work at a Docker 1.8.1 version. +> Please use the Docker 1.7.1 version. +> -------------------------------------------------------------------------- + +Dockerfile +---------- + +> If you want to build an image from a Dockerfile, you can find a +> Dockerfile from review.tizen.org. + +License +------- + +> OBS +> +> GNU Licenses (http://openbuildservice.org/help/manuals/obs-reference-guide/apb.html) + +\ +== References == + +> https://wiki.tizen.org/wiki/OBS_Installation_and_Setup + +> https://en.opensuse.org/openSUSE:Build_Service_private_installation + +Back to [Setup of Tizen Infrastructure with Docker](Setup_of_Tizen_Infrastructure_with_Docker "wikilink") +--------------------------------------------------------------------------------------------------------- + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_Worker_Docker_image.md b/docs/platform/tool/OBS_Worker_Docker_image.md new file mode 100644 index 0000000000..2848356c9c --- /dev/null +++ b/docs/platform/tool/OBS_Worker_Docker_image.md @@ -0,0 +1,314 @@ +Tizen Infra : OBS-Worker with Docker +==================================== + +Introduction +------------ + +The obs-workers actually do all the compiling work. +(https://en.opensuse.org) + +Version +------- + +ver 2.4.0.3 ( OBS : 2.4 Docker Image : 0.3) + +Tested on Host OS. +------------------ + +> ==== Host OS : ubuntu 14.04 ==== +> +> docker version : 1.4.1 +> docker version : 1.6.2 +> docker version : 1.7.0 +> +> #### Host OS : opensuse 13.1 +> +> docker version : 1.3.2 +> docker version : 1.6.2 + +HW Information of the OBS Worker +-------------------------------- + +> ==== In my configuration, I use two (2) obs-workers ==== +> +> === Server Info === +> CPU clock : 2.70GHz +> CPU core : 24 +> RAM MEM : 64GB +> Disk Cache : 2GB +> HDD : 1TB +> +> === Desktop Info === +> CPU clock : 3.40GHz +> CPU core : 4 +> RAM MEM : 16GB +> SSD : 512 MB + +Pre-installed Packages +---------------------- + +> ==== Image OS : flavio/opensuse-12-3 ==== +> +> vim tar wget telnet supervisor sudo +> obs-worker +> kvm libvirt libvirt-python qemu virt-manager qemu-linux-user +> build-initvm-x86_64 build-initvm-i586 +> psmisc + +Download +-------- + +> ===== URL ===== +> +> http://cdn.download.tizen.org/docker/obsworker/obsworker_2.4-2.4.0.3-docker-script.tar.gz + +Execution +--------- + +> ==== Download an images and execute. ====\ +> \$ wget \< url \>\ +> \$ ls +> +> obsworker_2.4-2.4.0.3-docker-script.tar.gz +> +> \$ tar -xvf obsworker\_2.4-2.4.0.3-docker-script.tar.gz +> +> \$ cd clientobsworker +> +> \$ ls +> +> config.conf dobsworker.sh env obsworker_2.4-2.4.0.3-docker-image.tar.gz root +> +> #### Description #### +> * config.conf : Metaconfig file of container +> * env : Environment variables of container +> * -docker-image.tar.gz : Docker image +> (“$ ./dobsworker.sh load” will load docker image from *-docker-image.tar.gz ) +> * root : Specific configuration files to be applied on container +> +> #### Load an image from a tar archive. +> +> \$ sudo ./dobsworker.sh load +> +> #### List images. +> +> \$ sudo docker images +> +> $ docker images +> tizendocker:443/obsworker 2.4.0.3 +> +> #### Configuration of the Container +> +> \$ vi config.conf +> +> Configuration a config.conf of the dobsworker.sh +> +> ### In the value of the OBS_WORKER_PORTBASE of the obs-server file must be increased by the number of OBS_WORKER_INSTANCES. +> export PORTS="60000-60003" ## ex) "hostport1 hostport2" or "hostport1:containerport1" or "exposeport1- exposeport2" +> +> ### Assign a name to the container +> export CONTAINER="obsworker" +> +> ### Container host name +> export HOSTNAME="OBSWorker" +> +> ### Add a custom host-to-IP mapping (host:ip) +> export ADD_HOSTS="<obsserver hostname>:<ip>" ## ex)<obsserver hostname1>:<ip1> +> +> #### Configuration of OBS worker +> +> \$ vi \$(pwd)/root/etc/sysconfig/obs-server +> +> # Default setting : 4 instances are created, and 1 job (cpu) is assinged to each instance. +> # You can change OBS worker setting (optimization based on your server environment) +> # (refer to https://wiki.tizen.org/wiki/OBS_2.4_All-in-One_Server) +> ###Set Number of all instances which is used by worker +> # OBS_WORKER_INSTANCES=(Max Port No. - Min Port No.+1) +> # ex) if you use "export PORTS="60000-60007, then OBS_WORKER_INSTANCES=(60007-60000 +1) = 8 +> OBS_WORKER_INSTANCES="4" +> +> # OBS_WORKER_JOBS : number of cpus which is used by each instance +> # Note : (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS ) must not exceed total number of host cpus. +> # ex) total number of host cpus = 32 core, and OBS_WORKER_INSTANCES=12 +> # if OBS_WORKER_JOBS=2, it's ok (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS =24, which is lower than 32) +> # if OBS_WORKER_JOBS=3, woker will not work. (OBS_WORKER_INSTANCES * OBS_WORKER_JOBS =36, which is higher than 32) +> OBS_WORKER_JOBS = 4 +> +> # important ( worker1,worker2 must be different port value.) +> # ex) worker1 server = "60000" then worker2 server = "60020" +> OBS_WORKER_PORTBASE="60000" +> +> # The hostname or the IP address of the OBS server +> OBS_SRC_SERVER="<OBSServer ip>:5352" +> +> # The hostname or the IP address of the OBS server +> OBS_REPO_SERVERS="<OBSServer ip>:5252" +> ... +> #The product of OBS_WORKER_INSTANCES and OBS_WORKER_JOBS should be smaller than the number of CPU cores in each OBS worker node. +> +> If you use a firewall on host OS, you have to allow a obsworker port +> number. +> +> $sudo ufw allow proto tcp to any port 60000:60004 +> +> #### Start OBS worker service +> +> $ sudo ./dobsworker.sh start + +Debugging OBS worker +-------------------- + +If you want to see the build log. + +`$ sudo ./dobsworker.sh attach`\ +`# screen -r -d`\ +`      starting worker d41d8cd98f00b204e9800998ecf8427e build d41d8cd98f00b204e9800998ecf8427e` + +`# how to exit screen => ctrl+A and D`\ +`# how to move 0 screen => ctrl+A and 0` + +Initialize +---------- + +> \#\#\# remove all data\ +> \$ sudo ./dobsworker.sh stop\ +> \$ sudo ./dobsworker.sh rm\ +> \$ sudo ./dobsworker.sh start + +CLI +--- + +> USAGE: ./dobsworker.sh COMMAND +> -e +> Commands: +> install Install lxc-docker-1.4.1 +> start Start a stopped container +> attach Attach to a running container +> stop Stop a running container +> status Status a running container +> rm Remove this containers +> restart stop, start a container +> kill Kill a running container +> logs Fetch the logs of a container +> cp Copy files/folders from a container's filesystem to the host path +> pull Pull an image or a repository from a Docker registry server +> inspect Return low-level information on a containe +> top Lookup the running processes of a container +> save Save an image to a tar archive +> load Load an image from a tar archive +> help help + +Troubleshooting +--------------- + +> -------------------------------------------------------------------------- + +Dockerfile +---------- + +> If you want to build an image from a Dockerfile, you can find a +> Dockerfile from review.tizen.org. + +License +------- + +> OBS +> +> GNU Licenses (http://openbuildservice.org/help/manuals/obs-reference-guide/apb.html) + +\ +== References == + +> https://wiki.tizen.org/wiki/OBS_Installation_and_Setup + +> https://en.opensuse.org/openSUSE:Build_Service_private_installation + +### OBS\_Server: config.conf + + + export HOSTNAME="tizendocker2" + +### OBSWorker(default): config.conf + + export CONTAINER="obsworker_2.4" + + export PORTS="60000-60003" ## ex) "hostport1 hostport2" or "hostport1:containerport1" or "exposeport1-exposeport2" + + export HOSTNAME="OBSWorker" + + export ADD_HOSTS="tizendocker2:168.219.201.100" + +### OBSWorker(default): root/etc/sysconfig/obs-server + + ... + OBS_WORKER_INSTANCES="4" + ... + OBS_SRC_SERVER="168.219.201.100:5352" + ... + OBS_REPO_SERVERS="168.219.201.100:5252" + ... + OBS_WORKER_PORTBASE="60000" + ... + + $ sudo ./dobsworker.sh stop + $ sudo ./dobsworker.sh rm + $ sudo ./dobsworker.sh start + +### OBS\_Worker0: config.conf + + export CONTAINER="obsworker_2.4_0" + + export PORTS="60010-60013" ## ex) "hostport1 hostport2" or "hostport1:containerport1" or "exposeport1-exposeport2" + + export HOSTNAME="OBS_Worker_0" + + export ADD_HOSTS="tizendocker2:168.219.201.100" + +### OBS\_Worker0: root/etc/sysconfig/obs-server + + ... + OBS_WORKER_INSTANCES="4" + ... + OBS_SRC_SERVER="168.219.201.100:5352" + ... + OBS_REPO_SERVERS="168.219.201.100:5252" + ... + OBS_WORKER_PORTBASE="60010" + ... + + $ sudo ./dobsworker.sh stop + $ sudo ./dobsworker.sh rm + $ sudo ./dobsworker.sh start + +### OBS\_Worker1: config.conf + + + + export CONTAINER="obsworker_2.4_1" + + export PORTS="60020-60023" ## ex) "hostport1 hostport2" or "hostport1:containerport1" or "exposeport1-exposeport2" + + export HOSTNAME="OBS_Worker_1" + + export ADD_HOSTS="tizendocker2:168.219.201.100" + +### OBS\_Worker1:root/etc/sysconfig/obs-server + + ... + OBS_WORKER_INSTANCES="4" + ... + OBS_SRC_SERVER="168.219.201.100:5352" + ... + OBS_REPO_SERVERS="168.219.201.100:5252" + ... + OBS_WORKER_PORTBASE="60020" + ... + + $ sudo ./dobsworker.sh stop + $ sudo ./dobsworker.sh rm + $ sudo ./dobsworker.sh start + +Back to [Setup of Tizen Infrastructure with Docker](Setup_of_Tizen_Infrastructure_with_Docker "wikilink") +--------------------------------------------------------------------------------------------------------- + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_binary_source_import.md b/docs/platform/tool/OBS_binary_source_import.md new file mode 100644 index 0000000000..c85bacf97c --- /dev/null +++ b/docs/platform/tool/OBS_binary_source_import.md @@ -0,0 +1,118 @@ +**Binary Import from the web** + +The stable repository (or a snapshot) is imported to the backend +repository server machine. + +- The binaries are copied to a staging area (not directly into + /srv/obs) + +`# mkdir -p /data/imports`\ +`# cd /data/imports` + +Use the wget command: + +`# wget --directory-prefix=/data/imports --mirror --reject index.html* -r -nH --no-parent `[`http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150311.3/repos/target/packages/armv7l/`](http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150311.3/repos/target/packages/armv7l/) + +- Now create the ":full" directory. + +And define directory names(\$PROJECT, \$REPO, \$ARCH) based on the +Project Profile. + +`# mkdir -p /srv/obs/build/$PROJECT/$REPO/$ARCH/:full`\ +`# cd /srv/obs/build/$PROJECT/$REPO/$ARCH/:full` + +- Add binaries to the :full directory of the Project + +`` for i in `find /data/imports/ -name \*.rpm`;  ``\ +`do `\ +``     j=`basename $i` ``\ +``     k=`echo $j |sed -rn 's/(.*)-.*-.*.rpm/\1.rpm/p'` ``\ +`    mv $i /srv/obs/build/$PROJECT/$REPO/$ARCH/:full/$k`\ +`done` + +- Change all user/group privileges under /srv/obs/build/ to "obsrun". + If you leave root as owner of :full, it will still build but the + scheduler will fail (almost silently) to upgrade :full with the + latest built packages. + +`# chown -R obsrun:obsrun /srv/obs/build/$PROJECT`\ +`# rm -r /data/imports`\ +`   ` + +- The back-end is told about the imported packages. This will send an + event to the scheduler which will re-index your new \':full\' + directory and create a file named :full.solv + +`# obs_admin --rescan-repository $PROJECT $REPO $ARCH` + +**Source Import from the web** + +- You need to download all your source RPMs on a local machine and + import them into your project with the command + +`# osc importsrcpkg --help`\ +`importsrcpkg: Import a new package from a src.rpm`\ +\ +`A new package dir will be created inside the project dir`\ +`(if no project is specified and the current working dir is a`\ +`project dir the package will be created in this project). If`\ +`the package does not exist on the server it will be created`\ +`too otherwise the meta data of the existing package will be`\ +`updated (` + + + +and <description />). + +`The src.rpm will be extracted into the package dir. The files`\ +`won't be committed unless you explicitly pass the --commit switch.`\ +\ +`SRPM is the path of the src.rpm in the local filesystem,or an URL.`\ +\ +`Usage:`\ +`   osc importsrcpkg SRPM `\ +\ +`Options:`\ +`   -h, --help          show this help message and exit`\ +`   -c, --commit        commit the new files`\ +`   --delete-old-files  delete existing files from the server`\ +`   -d description, --description=description`\ +`                       set the description of the package`\ +`   -t title, --title=title`\ +`                       set a title`\ +`   -n name, --name=name`\ +`                       specify a package name`\ +`   -p project, --project=project`\ +`                       specify the path to a project` + +- download SRPM + +`# wget --directory-prefix=/source/imports --mirror --reject index.html* -r -nH --no-parent `[`http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150311.3/repos/target/source/`](http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150311.3/repos/target/source/) + +- import SRPM to OBS project(Tizen:2.3) + +Before run this script file, there are only SRPM files in +\'/source/imports\' directory and you have to also create OBS +project(Tizen:2.3). + +`#!/bin/sh`\ +`sudo osc checkout Tizen:2.3`\ +`cd Tizen\:2.3/`\ +`` RPMLIST=`ls /source/imports` ``\ +`for RPMNAME in $RPMLIST`\ +`do`\ +`    sudo osc importsrcpkg /source/imports/$RPMNAME`\ +`done`\ +\ +`` PKGLIST=`ls` ``\ +`for PKGNAME in $PKGLIST`\ +`do`\ +`    sudo osc add ${PKGNAME}/*`\ +`done`\ +\ +`sudo osc ci -m "commit the src"` + +ref: +<https://en.opensuse.org/openSUSE:Build_Service_private_instance_boot_strapping#Use_Repository_Binary_Import> + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_config_and_maintenance.md b/docs/platform/tool/OBS_config_and_maintenance.md new file mode 100644 index 0000000000..2382345fc5 --- /dev/null +++ b/docs/platform/tool/OBS_config_and_maintenance.md @@ -0,0 +1,159 @@ +OBS of otctools is used for packages building. For supported targets, +there are local sets of packages stored, to reduce dependency on remote +build systems in case of networking issues, and in case when remote +repositories or mirrors decide to delete files or stop carrying some +distributions. The local repositories are kept as projects named +Target:Distribution:Version. + +Creating a local Target repository +---------------------------------- + +Common: + +\- create a OBS project named Targets:DISTRO:VERSION + +\- copy project config from build.opensuse.org corresponding project and +save + +\- Fedora note: add variable in project config \"Macros:\" section (near +end), it has been in older releases + +but for some reason has been removed later, but some otctools packages +(at least bmap-tools) depend on it for naming packages + +` Macros:`\ +` %opensuse_bs 1` + +\- create targets in Meta: + +` `<repository name="standard">\ +`   `<arch>`x86_64`</arch>\ +`   `<arch>`i586`</arch>\ +` `</repository> + +Copy binary packages corresponding to release set, without updates. This +is distro-specific. + +` Create /srv/obs/build/Targets:DISTRO:VERSION/standard/ARCH/:full/`\ +` Resulting set of packages for ARCH needs to be copied to :full/ directory,` + +### Ubuntu, Debian style: + +For Ubuntu, there is helper script import-repo.py which parses Packages +list file and copies .deb files from pool. + + #!/usr/bin/env python + + # import-repo.py oneiric + import sys + import os + import urllib + import urllib2 + import bz2 + + mirror_url_base='http://linux-ftp.jf.intel.com/pub/mirrors/' + mirror_prefix='/srv/mirror/pub/mirrors/ubuntu/' + repos=['main/','universe/'] + + def main(distro, ver, arch): + mirror_url=mirror_url_base + str(distro) + cur_path=os.getcwd() + dest=cur_path+r'/cache/'+ver + # if os.path.exists(dest) == False: + # os.makedirs(dest) + + #prepare the director to put the binary. + # tdest=dest+r'/'+arch + # if os.path.exists(tdest) == False: + # os.mkdir(tdest) + + #get the package list of dist + for repo in repos: + tpath=r'/dists/'+str(ver)+r'/'+repo+arch+r'/Packages.bz2' + pkgs_url=mirror_url+tpath + dest=cur_path+tpath + if os.path.exists(dest): + continue + tpath=os.path.split(dest)[0] + if os.path.exists(tpath) == False: + os.makedirs(tpath) + urllib.urlretrieve(pkgs_url,dest) + + dest_path=cur_path+r'/cache/'+str(ver)+r'/'+arch + dest_name='' + for repo in repos: + list_file=cur_path+r'/dists/'+str(ver)+r'/'+repo+arch+r'/Packages.bz2' + # print 'list file is %s' % list_file + f=bz2.BZ2File(list_file) + for line in f: + words = line.split() + if len(words) == 2 and words[0] == 'Filename:': + dest_name = words[1] + file_name= r'./' + str(repo) + os.path.basename(dest_name) + file_url = mirror_url + r'/' + dest_name + print 'cp %s%s %s' % (mirror_prefix, dest_name,file_name) + # print '%s' % (dest_name) + # print 'get %s' % (file_url) + # urllib.urlretrieve(file_url, file_name) + f.close() + + return + + if __name__=='__main__': + if len(sys.argv) != 4: + print 'wrong calling' + #for arch in ['binary-amd64', 'binary-i386']: + print "example: import-repo.py ubuntu oneiric binary-i386" + main(sys.argv[1], sys.argv[2], sys.argv[3]) + + +` Most convenient place for running this is on linux-ftp server, or some other`\ +` host which has copy of original repositories. It is of course possible to`\ +` use version of this script which copies Package list and packages from network.` + +### RPM-style distro: example based on openSUSE 12.3 + +\- Copy all i586.rpm files from release: +distribution/12.3/repo/oss/suse/i586 to i568/:full directory + +\- Copy all x86\_64.rpm files from release: +distribution/12.3/repo/oss/suse/x86\_64 to x86\_64/:full directory + +\- Copy all noarch.rpm files from release: +distribution/12.3/repo/oss/suse/noarch to x86\_64/:full directory + +\- link (hard of sym link) all noarch.rpm files so that they are also +present in i586/:full/ + +### RPM-style distro: example based on Fedora 20 + +\- Copy all i586.rpm files from release repo: to i568/:full directory + +` cd /srv/obs/build/Targets:Fedora:20/standard/i586/:full`\ +` rsync -av linux-ftp:/srv/mirror/pub/mirrors/fedora/linux/releases/20/Fedora/i386/os/Packages/?/* .`\ +` # may need few steps here because rsync complians "arg list too long, split using [0-9] [a-l] [m-p] [q-z]`\ +` rsync -av linux-ftp:/srv/mirror/pub/mirrors/fedora/linux/releases/20/Everything/i386/os/Packages/?/* .` + +\- Copy all x86\_64.rpm files from release repo:to x86\_64/:full +directory + +` cd /srv/obs/build/Targets:Fedora:20/standard/x86_64/:full`\ +` rsync -av linux-ftp:/srv/mirror/pub/mirrors/fedora/linux/releases/20/Fedora/x86_64/os/Packages/?/* .`\ +` # may need few steps here because rsync complians "arg list too long, split using [0-9] [a-l] [m-p] [q-z]`\ +` rsync -av linux-ftp:/srv/mirror/pub/mirrors/fedora/linux/releases/20/Everything/x86_64/os/Packages/?/* .` + +Common: + +\- Set all files in local target repos in :full/ owned by obsrun.obsrun + +` cd /srv/obs/build/Targets:DISTRO:VER/standard/ARCH/`\ +` chown -R obsrun.obsrun :full` + +\- Trigger re-scan of Target dir (example for openSUSE 12.3): + +` obs_admin --rescan-repository Targets:openSUSE:12.3 standard x86_64`\ +` obs_admin --rescan-repository Targets:openSUSE:12.3 standard i586` + +Similar re-trigger is needed when contents of :full gets changed + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OBS_data_image.md b/docs/platform/tool/OBS_data_image.md new file mode 100644 index 0000000000..739e0af5eb --- /dev/null +++ b/docs/platform/tool/OBS_data_image.md @@ -0,0 +1,76 @@ +Tizen Infra : OBS DATA TAR images +--------------------------------- + +### Introduction + +> This file contains the OBS Tizen project and OBS Tizen build data. +> +> ## Description of OBS Data. +> OBS Version : 2.4 +> OBS Admin password : Admin/opensuse +> +> MYSQL_ROOT_PASSWORD=opensuse +> MYSQL_API_DATABASE=api_production +> MYSQL_WEBUI_DATABASE=webui_production +> MYSQL_USER=obs +> MYSQL_PASSWORD=obspassword +> MYSQL_DATA_DIR_DEFAULT=/var/lib/mysql + +### Included Files + +> Folder : /srv/obs/ and /var/lib/mysql/ + +### Download + +> ===== URL ===== +> +> http://download.tizen.org/docker/obsdata/ + +### Execution + +##### You must be removed the old data of your OBS container. + +##### If you\'ve already started a container, you must stop a container. + +> $ cd clientobsserver +> +> $ sudo ./dobsserver.sh stop + +##### remove this container + +> $ sudo ./dobsserver.sh rm + +##### remove the /home/obsserver\_2.4 directory. + +> $ sudo rm -r /home/obsserver_2.4 +> + +##### copy to root directory + +> $ sudo cp obsdata_tizen-2.3-mobile_20150311.3.tar.gz / + +##### change to root directory. + +> $ cd / + +##### Uncompress in your /home/obsserver\_2.4 directory. + +> $ sudo tar xzvpf obsdata_tizen-2.3-mobile_20150311.3.tar.gz + +##### change to clientobsserver directory. + +> $ cd clientobsserver + +##### start this container + +> $ sudo ./dobsserver.sh start + +Done + +You can see that the project is created with the \"Tizen:: 2.3 +mobile\_20150311.3\". + +Back to [Setup of Tizen Infrastructure with Docker](Setup_of_Tizen_Infrastructure_with_Docker "wikilink") +--------------------------------------------------------------------------------------------------------- + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_AutoFDO.md b/docs/platform/tool/OSDev_AutoFDO.md new file mode 100644 index 0000000000..50aa794ca3 --- /dev/null +++ b/docs/platform/tool/OSDev_AutoFDO.md @@ -0,0 +1,42 @@ +AutoFDO uses sampling based profile to drive feedback directed +optimizations. + +AutoFDO uses *perf* to collect sample profiles. A standalone tool is +used to convert the perf.data file into *gcov* format. GCC reads in the +gcov file and interprets the profile into a set of hashmaps. A +standalone pass is added to use the processed profile data to annotate +the basic block counts and estimate branch +probabilities.[1](https://gcc.gnu.org/wiki/AutoFDO) + +The major difference between AutoFDO and FDO (aka PGO) is that AutoFDO +profiles on optimized binary instead of instrumented binary. This makes +it very different in handling cloned functions. + +Applicability +------------- + +Currently data collection is targeted to Intel CPUs with Last Branch +Record hardware registers. +[2](https://gcc.gnu.org/ml/gcc/2015-04/msg00250.html) + +Profile created on x86 can be applied during cross ARM-build though +[3](https://gcc.gnu.org/ml/gcc/2015-04/msg00113.html) There is a +theoretical possibility to use *-use\_lbr=false* flag to record profile +on ARM device and a report that it works for linpack benchmark +[4](https://gcc.gnu.org/ml/gcc/2015-04/msg00267.html) + +Also the simplest way to grab a profile is *ocperf* +[pmu-tools](https://github.com/andikleen/pmu-tools) + +Usage +----- + +Say we have a *test-app* benchmark, so the AutoFDO build will be the +following: + +`gcc -O2 -g test-app.c -o test-app`\ +`ocperf.py record -e br_inst_retired.near_taken:pp -b -o profile.data ./test-app`\ +`create_gcov --binary=test-app --profile=profile.data --gcov=test-app.gcov --gcov_version=0x1`\ +`gcc -O2 -g test-app.c -o test-app -fauto-profile=test-app.gcov` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Bootstrapping.md b/docs/platform/tool/OSDev_Bootstrapping.md new file mode 100644 index 0000000000..44018bba74 --- /dev/null +++ b/docs/platform/tool/OSDev_Bootstrapping.md @@ -0,0 +1,469 @@ +Introduction +============ + +All parts until [\#Deploy to OBS](#Deploy_to_OBS "wikilink") are done +locally on developers PC. The only prerequisite for bootstrapping is +Linux distribution with development kit installed --- you will need +Autotools, GNU Make, CMake, GCC-base toolchain (compiler, binutils, +glibc-devel package and so on). Also Linux kernel +[https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst +binfmt](https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst_binfmt "wikilink") +feature should be enabled. + +### Useful links + +The main things used during bootstrapping are + +1. [Linux From Scratch](http://www.linuxfromscratch.org/lfs/) handbook +2. [GCC + Cross-toolchain](https://gcc.gnu.org/wiki/Building_Cross_Toolchains_with_gcc) + build howto + +Sources +======= + +Sources for bootstrap have been taken from Linaro and patched with Tizen +project specific patches. As we don\'t have a separate file storage for +toolchain, sources can be downloaded right from OBS project. Here is +list of packages used during bootstrap: + +1. [binutils](https://build.tizen.org/package/show/Tizen:Base/binutils) +2. [gcc](https://build.tizen.org/package/show/Tizen:Base/linaro-gcc) +3. [rpm](https://build.tizen.org/package/show/Tizen:Base/rpm) +4. [glibc](https://build.tizen.org/package/show/Tizen:Base/glibc) +5. [qemu](https://build.tizen.org/package/show/Tools:qemu:2.7.x/qemu) + +Bootstrap process +================= + +The bootstrap produces working toolchain which may be used for initial +creation of Tizen environment. At the end of the process you will have a +toolchain and libc, which is enough to start building console tools and +libraries. The compiler bootstrap process is commonly known and is used +from time to time by different Linux distributions maintainers during +ports to new architecture, main difference is using Tizen-specific flags +during packages configuration, for example, aarch64-tizen-linux-gnu +target has been used. During this initial bootstrap sources have been +patched by hands one-by-one accordingly to spec-file patch sequence, +this work has to be done manually until you have working *rpmbuild* tool +which automates this job. It will happen after finishing [\#Build +RPM](#Build_RPM "wikilink") section of this manual. + +Build Cross-compiler +-------------------- + +Common environment variables during build + +`export ARCH=aarch64`\ +`export LINUX_ARCH=arm64`\ +`export CPU=armv8-a`\ +`export TARGET=${ARCH}-tizen-linux-gnu`\ +`export PREFIX=~/rootfs/`\ +`export CROSS_COMPILE=${TARGET}-`\ +`export PATH=$PATH:${PREFIX}/bin`\ +`export TOOLCHAIN_ROOT=$(pwd)/toolchain`\ +`mkdir -p ${PREFIX}/src` + +### Binutils + +`cd path/src/binutils`\ +`mkdir build-dir`\ +`cd build-dir`\ +`../configure \`\ +`  --prefix=${TOOLCHAIN_ROOT} \`\ +`  --with-pkgversion='GNU Binutils; Tizen OS bootstrap / aarch' \`\ +`  --disable-multilib \`\ +`  --target=${TARGET}`\ +`make`\ +`make install` + +### Linux Kernel Headers + +Set up headers for *glibc* + +#### Option 1 + +Download ready kernel headers from package \"linux-glibc-devel\". It can +be found e. g. at build.tizen.org for other architectures, since it\'s +architecture-independent. It contains headers that are installed to +/usr/include. + +Move all headers to /usr/include + +`unrpm linux-glibc-devel*.rpm`\ +`cp -r ./usr/include/* ${TOOLCHAIN_ROOT}/${TARGET}/include` + +#### Option 2 + +Or you can perform headers install from kernel + +`make ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${TOOLCHAIN_ROOT}/${TARGET} headers_install` + +### GCC step 1 + +`cd path/src/gcc`\ +`mkdir build`\ +`cd build`\ +`../configure \`\ +`  --prefix=${TOOLCHAIN_ROOT} \`\ +`  --disable-multilib \`\ +`  --build=${MACHTYPE} \`\ +`  --with-arch=${CPU} \`\ +`  --enable-languages=c,c++ \`\ +`  --target=${TARGET}` + +`make all-gcc`\ +`make install-gcc` + +### Glibc headers + +`cd path/src/glibc` + +`mkdir build`\ +`cd build` + +`CFLAGS="-O2 -g " \`\ +`CC=${TOOLCHAIN_ROOT}/bin/${TARGET}-gcc \`\ +`LD=${TOOLCHAIN_ROOT}/bin/${TARGET}-ld \`\ +`../configure \`\ +`  --build=${MACHTYPE} \`\ +`  --host=${TARGET} \`\ +`  --target=${TARGET} \`\ +`  --prefix=${TOOLCHAIN_ROOT} \`\ +`  --enable-add-ons \`\ +`  --with-headers=${TOOLCHAIN_ROOT}/${TARGET}/include \`\ +`  --disable-multilib \`\ +`  libc_cv_forced_unwind=yes \`\ +`  libc_cv_c_cleanup=yes` + +`make install-bootstrap-headers=yes install-headers`\ +`make csu/subdir_lib`\ +`install csu/crt1.o csu/crti.o csu/crtn.o ${TOOLCHAIN_ROOT}/${TARGET}/lib`\ +`${TOOLCHAIN_ROOT}/bin/${TARGET}-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o ${TOOLCHAIN_ROOT}/lib/libc.so`\ +`touch ${TOOLCHAIN_ROOT}/${TARGET}/include/gnu/stubs.h` + +### libgcc + +`cd path/src/gcc/build`\ +`make all-target-libgcc`\ +`make install-target-libgcc` + +### Glibc + +`cd path/src/glibc/build`\ +`make`\ +`make install` + +### GCC step 2 + +`cd path/src/gcc`\ +`make`\ +`make install` + +Initial Tizen environment build +------------------------------- + +Initial environment is used during Base packages creation: it should +contain at least *rpmbuild* with dependencies and minimal build tools to +make rpmbuild able to create packages. This step results into RPM set, +ready for binary import into OBS project and start build there. After +the rpmbuild starts working there is no more need to patch sources by +hands and set up flags manually as it was in [\#Bootstrap +process](#Bootstrap_process "wikilink"). Subsection [\#Rebuild packages +with rpmbuild](#Rebuild_packages_with_rpmbuild "wikilink") repeats OBS +build environment work on local machine and produces the same output OBS +builserver does: resulting RPMs will be fully compatible with OBS build +environment and can be used by it. + +Build qemu +---------- + +To make aarch64 build work the cpu emulator will be needed. +qemu-linux-user is used inside OBS environment, so it will be used. +Working AArch64 support appeared in qemu 2.0 release, but now it\'s +still being developed, so the best option for bootstrap is to get latest +git version. As OBS works with non-standard qemu binary +\"qemu-arm64-binfmt\" you will still need to apply at least patches +*0011-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch* and +*0016-linux-user-binfmt-support-host-binaries.patch* from Tizen project +to work with OBS binformat configuration. + +`./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --enable-linux-user --disable-system --enable-attr --static --disable-linux-aio --extra-cflags="-Wno-error=type-limits" --target-list=${ARCH}-linux-user --disable-libnfs`\ +`make` + +After that you will get qemu-arm64-binfmt binary, you need no install it +- it should be copied to chroot later. However it\'s good idea to use +this qemu during initial buildroot set up, so now it should be copied to +bin directory and binformat set to use it + +`sudo cp aarch64-linux-user/qemu-arm64-binfmt /usr/bin`\ +`echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-arm64-binfmt:P' > /proc/sys/fs/binfmt_misc/register` + +Now you host machine is able to run aarch64 binaries. + +`cp aarch64-linux-user/qemu-arm64-binfmt /path/to/buildroot/usr/bin` + +And after installing qemu to buildroot you may try to chroot there. + +Target glibc +------------ + +`mkdir -p ${PREFIX}/usr`\ +`cp -r ${TOOLCHAIN_ROOT}/include ${PREFIX}/usr` + +`mkdir target-build`\ +`cd target-build` + +`CFLAGS="-O2 -g " \`\ +`CC=${TOOLCHAIN_ROOT}/bin/${TARGET}-gcc \`\ +`LD=${TOOLCHAIN_ROOT}/bin/${TARGET}-ld \`\ +`../configure \`\ +`  --build=${MACHTYPE} \`\ +`  --host=${TARGET} \`\ +`  --target=${TARGET} \`\ +`  --prefix=/usr \`\ +`  --enable-add-ons \`\ +`  --with-sysroot=${PREFIX} \`\ +`  --disable-multilib \`\ +`  libc_cv_forced_unwind=yes \`\ +`  libc_cv_c_cleanup=yes` + +`make`\ +`make install DESTDIR=${PREFIX}` + +Target binutils +--------------- + +`mkdir target-build`\ +`cd target-build`\ +`CC=${TOOLCHAIN_ROOT}/bin/${TARGET}-gcc \`\ +`LD=${TOOLCHAIN_ROOT}/bin/${TARGET}-ld \`\ +`../configure \`\ +`  --host=${TARGET} \`\ +`  --target=${TARGET} \`\ +`  --prefix=/usr \`\ +`  --with-sysroot=${PREFIX} \`\ +`  --disable-multilib \`\ +`  libc_cv_forced_unwind=yes \`\ +`  libc_cv_c_cleanup=yes`\ +`make install DESTDIR=${PREFIX}` + +Target gcc +---------- + +`mkdir target-build`\ +`cd target-build`\ +`CC=${TOOLCHAIN_ROOT}/bin/${TARGET}-gcc \`\ +`LD=${TOOLCHAIN_ROOT}/bin/${TARGET}-ld \`\ +`../configure \`\ +`  --host=${TARGET} \`\ +`  --target=${TARGET} \`\ +`  --prefix=/usr \`\ +`  --with-sysroot=${PREFIX} \`\ +`  --disable-multilib \`\ +`  libc_cv_forced_unwind=yes \`\ +`  libc_cv_c_cleanup=yes`\ +`make install DESTDIR=${PREFIX}` + +Prerequisites for chrooting +--------------------------- + +Next step is to receive working native toolchain which will be used by +rpmbuild during package build. During this step you need no fully Tizen +compatible packages with configuration equal to one produced by OBS. To +start RPM only package *placeholders* with minimal configurations will +be enough. So if package can be built without using a dependency --- +build it without a dependency. The most minimal configuration will be +fine, these packages will be replaced by normal ones after they are +built using rpmbuild. + +The process is performed using cross-compiler, so the toolchain +environment variables should be set: + +`export PATH=${TOOLCHAIN_ROOT}/bin`\ +`export CC=${TARGET}-gcc`\ +`export CXX=${TARGET}-g++`\ +`export CPP=${TARGET}-cpp`\ +`export LD=${TARGET}-ld`\ +`export AR=${TARGET}-ar`\ +`export NM=${TARGET}-nm`\ +`export RANLIB=${TARGET}-ranlib` + +Then you the process of manual package build is performed, for example +to start with *attr*: + +`curl '`[`https://build.tizen.org/package/rawsourcefile?file=attr-2.4.47.src.tar.gz&package=attr&project=devel%3Aarm_toolchain%3AMobile%3ABase`](https://build.tizen.org/package/rawsourcefile?file=attr-2.4.47.src.tar.gz&package=attr&project=devel%3Aarm_toolchain%3AMobile%3ABase)`' -o attr-2.4.47.tar.gz`\ +`tar xfz attr-2.4.47.tar.gz`\ +`cd attr-2.4.47.tar.gz`\ +`./configure --host=${TARGET} --target=${TARGET} --prefix=/usr`\ +`make`\ +`make install DESTDIR=${PREFIX}` + +In order to speedup build process you may use *make -jN* command, where +*N* is number of threads make will use for build. Note: if you get +message like + +`` Invalid configuration `aarch64-tizen-linux-gnu': machine `aarch64-tizen' not recognized `` + +you may try to use *aarch64-unknown-linux-gnu* host and target type, if +this fails as well try running + +`autoreconf -fi` + +in source path to update GNU Autotools script to support aarch64 +architecture. + +The next step is create a minimal shell for buildroot: + +`mkdir ~/rpmbuild/SOURCES/`\ +`osc co -S Tizen:Base bash`\ +`cd Tizen\:Base/bash`\ +`` for f in `ls _service:*`; do mv $f $(echo $f | sed -e 's/_service:gbs://'); done ``\ +`tar xf bash-3.2.57.tgz`\ +`cd bash-3.2.57`\ +`./configure --host=${TARGET} --target=${TARGET} --prefix=/usr --disable-job-control --enable-static-link --enable-minimal-config`\ +`make`\ +`make install DESTDIR=${PREFIX}` + +This will provide a statically linked minimal shell which makes possible +to chroot inside the your buildroot and check things from inside. Such +test could be performed using + +`mkdir -p ${PREFIX}/dev ${PREFIX}/sys ${PREFIX}/proc ${PREFIX}/tmp ${PREFIX}/root`\ +`for dir in proc sys dev dev/pts dev/shm dev/mqueue proc/sys/fs/binfmt_misc proc/fs/nfsd; do`\ +`   sudo mount -o bind /$dir ${PREFIX}/$dir`\ +`done`\ +`chroot ${PREFIX} /usr/bin/bash` + +If previous steps have been completed successfully you should see a bash +prompt and working *attr* binary. + +Create build environment inside chroot +-------------------------------------- + +Now you\'ll need to get minimal set of tools using + +`cd pkg-name && mkdir build && cd build && ../configure --prefix=/usr --target=${TARGET} --host=${TARGET} && make && make install DESTDIR=${PREFIX}` + +Great place to begin is building *grep*, *sed*, *gawk*, *m4*, +*diffutils*, *texinfo* since they are used for *configure* scripts. The +next steps are: perl, readline, ncurses, texinfo, nspr, nss, zlib, gzip, +xz, bzip2, tar, findutils, autoconf, automake, gettext, libtool, glib, +pkg-config. After you get minimal set using cross-compiler you can try +to boostrap compiler inside your new buildroot. + +Build RPM +--------- + +Next step is building RPM package manager with *rpmbuild* tool to create +suitable packages to deploy binaries into OBS. + +### Prerequisites for RPM + +This is an iterative process starting with getting RPM sources from, +patching it accordingly to spec file from [project +page](https://build.tizen.org/package/show?package=rpm&project=Tizen:Base) +and compilation tries until succeeded. These actions can be performed +without *rpmbuild*, you can just use compilation from tarballs. So get +tarball with RPM, unpack and try to build it. + +1. Try to compile RPM with *./configure* +2. Check if build fails because of missing dependency. E. g. first time + it\'ll fail with with message that *nss* and *nspr* packages could + not be found. +3. Find, build and install missing package (with its own dependencies) + 1. Download *nss* package, *configure && make && make install* + 2. Download *nspr* package, *configure && make && make install* +4. Return to 1. Repeat until you get working RPM. + +During this step you need a minimal working RPM, so it\'s reasonable to +compile all libraries with *\--enable-minimal* flag if one has it. + +Rebuild packages with rpmbuild +------------------------------ + +Now when you get a working *rpmbuild*, you may start building packages +ready for upload to OBS. You create a separate console, chroot inside +resulting system and start using rpmbuild. + +From this step you should not track dependencies manually and configure +packages some specific way - rpmbuild does it by itself. If you don\'t +have a file which is needed to build a certain package, rpmbuild will +show a message. + +`for dir in proc sys dev dev/pts dev/shm dev/mqueue proc/sys/fs/binfmt_misc proc/fs/nfsd; do`\ +`   sudo mount -o bind /$dir ${PREFIX}/$dir`\ +`done`\ +`sudo chroot ${PREFIX} /bin/sh` + +Before you start working with rpm packages in system you should +initialize rpm database + +`rpm --initdb` + +As rpmbuild provides a featured version of package, respectively to one +created during previous step, it\'s a good idea to install package after +it\'s built. This action works as a quick test also. + +So approximate algorithm of package creation + +`cp -r /path/to/obs/sources/acl/ /path/to/chroot/usr/src/packages/SOURCES` + +And then, from chrooted terminal: + +`rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature --target=aarch64-tizen-linux /usr/src/packages/SOURCES/acl/acl.spec`\ +`rpm -i --force /usr/src/packages/RPMS/aarch64/acl*.rpm` + +Environment test +================ + +To test environment a simple deployment test could be performed. + +`rpm --initdb --root=/tmp/testroot /mnt/bootstrapped_rpm_path/*` + +Then try to chroot there: + +`chroot /tmp/testroot /bin/bash` + +and you should get a usable rpmbuild. + +Build native compiler +--------------------- + +Native compiler can be built in a much simpler way than cross compiler, +since it can be built in only 1 stage directly. To do this, you should +perform configure process (like in the stage 2 of section [\#Build +Cross-compiler](#Build_Cross-compiler "wikilink")) except one small +change: to make compiler native, all values of options \"\--target\", +\"\--host\" and \"\--build\" should be the same and should be equal +\"aarch64-tizen-linux\" + +### Binutils + +`mkdir build-dir`\ +`cd build-dir`\ +`EXTRA_TARGETS=${TARGET}`\ +`TARGET_OS=${TARGET}`\ +`../configure 'CFLAGS=-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-error' \`\ +`  --prefix=/usr \`\ +`  '--with-pkgversion=GNU Binutils; Tizen bootstrap / aarch' \`\ +`  --disable-nls \`\ +`  --build=${TARGET} \`\ +`  --target=${TARGET} \`\ +`  --enable-targets=${TARGET}`\ +`make`\ +`make install DESTDIR=${PREFIX}` + +Deploy to OBS +============= + +Deployment process is described on [OSDev/Creating AArch64 +Project](OSDev/Creating_AArch64_Project "wikilink") page. The deployment +process is just importing RPMs created locally onto buildserver using +*Binary import* manual for your version of OBS environment. These RPMs +may be used by any project after import, imported RPMs usage example +exists on +[OSDev/Using\_OBS\#Creating\_own\_development\_project](OSDev/Using_OBS#Creating_own_development_project "wikilink") +page. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Creating_AArch64_Project.md b/docs/platform/tool/OSDev_Creating_AArch64_Project.md new file mode 100644 index 0000000000..cab97f4afa --- /dev/null +++ b/docs/platform/tool/OSDev_Creating_AArch64_Project.md @@ -0,0 +1,81 @@ +This guide describe creation of and AArch64 Tizen project from scratch +on your private [OBS](OBS "wikilink") instance. There are two main parts +of bootstrap process: server-side part and user-side part. Server-side +is done once for single OBS server environment --- this is importing +binary packages with toolchain and toolchain dependencies to a project. +We propose to create a single dedicated project without any sources, +just with these imported binaries which can be used by other project +during build. + +Server-side part +================ + +Prerequisites +------------- + +- Local access to OBS server (not only API/web account but ssh or + terminal access) +- Access to [tizen.org download + repository](http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/) +- Official step-by-step OBS project boostrapping manual from [openSUSE + wiki](https://en.opensuse.org/openSUSE:Build_Service_private_instance) + +Summary +------- + +Process of creating and enabling of new project is described in details +at [OBS wiki +page](https://en.opensuse.org/openSUSE:Build_Service_private_instance). +The official manual suggests several approaches to project creation but +build.tizen.org project was created using [binary +import](https://en.opensuse.org/openSUSE:Build_Service_private_instance_boot_strapping#Use_Repository_Binary_Import) +method, so instructions here will describe it. + +**In order not to damage OBS infrastructure, project bootstrapping +should be done accordingly to official manual for your version of OBS +environment**, this page just shows specific points for Tizen AArch64 +project. + +Importing binary +---------------- + +First of all the process is described in [Binary Import from the +web](https://en.opensuse.org/openSUSE:Build_Service_private_instance_boot_strapping#Binary_Import_from_the_web) +section of manual. + +The only difference from official manual is package download path. + +Prebuilt Tizen AArch64 binaries could be obtained from +*<https://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/>* +so the command you may use: + +`wget --directory-prefix=/data/imports --reject index.html* --mirror --no-parent --no-host-directories --cut-dirs=8 `[`https://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/`](https://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/) + +User-side part +============== + +After binaries are imported and handled by OBS you won\'t need local +server access anymore. Now your OBS enviroment is capable of building +Tizen packages for AArch64 architecture and has toolchain, emulator and +basic libraries set. + +This section can be performed using web interface and OBS API by any +user with \"Administrator\" rights in own project. + +Prerequisites +------------- + +- Own or team project with administrator access rights (or OBS-wide + rights to create such a project) +- Packages sources + +Project creation +---------------- + +As now you have a working AArch64 toolchain, you may just now go on with +[OSDev/Using\_OBS\#Creating own development +project](OSDev/Using_OBS#Creating_own_development_project "wikilink") + +\] + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Flashing_to_device.md b/docs/platform/tool/OSDev_Flashing_to_device.md new file mode 100644 index 0000000000..743b1fd959 --- /dev/null +++ b/docs/platform/tool/OSDev_Flashing_to_device.md @@ -0,0 +1,171 @@ +Process to flash to device +-------------------------- + +- [RD-210](Reference_Device-210 "wikilink") aka lb 2012 +- [RD-PQ](Reference_Device-PQ "wikilink") 2013 +- [Reference\_Device](Reference_Device "wikilink") : + [TM1](TM1 "wikilink") 2015 + +Current Know working Setup +-------------------------- + +- <http://download.tizen.org/releases/2.1/tizen-2.1/images/RD-210/tizen-2.1_20130517.6_RD-210.tar.gz> +- <https://wiki.tizen.org/wiki/Enable_3D_Acceleration_on_Tizen> + +### Downloads + +- Download or build an image such as one from + <http://download.tizen.org/snapshots/1.0/latest/images/> + [1](http://download.tizen.org/snapshots/1.0/latest/images/) which + will be in a \*.tar.gz file + +1. Such as the lb-tizen-1.0\_20120613.10-rs.tar.gz image for lunchbox + +- Download the lthor tool for Linux PCs available online (was at + <http://download.tizen.org/tools/lthor-tool/> ) + +Before the [lthor](lthor "wikilink") binary was pre-compiled in 32-bit +environment, so you need to install some 32-bit libraries in your host, +for example in [Ubuntu](Ubuntu "wikilink") 12.04 : + +#### Ubuntu 12.04 + +Update : Use 64bit binary ie : + +<http://download.tizen.org/tools/archive/13.03/Ubuntu_12.10/amd64/lthor_1.0_amd64.deb> + +1\. Install 32-bit libs + +` sudo apt-get install ia32-libs-multiarch` + +2\. Install libarchive in i386 flavor + +` sudo apt-get install libarchive12:i386` + +3\. \"Fix\" libarchive symlink + +` sudo ln -s /usr/lib/i386-linux-gnu/libarchive.so.12.0.3 /usr/lib/i386-linux-gnu/libarchive.so.2` + +#### Debian + +Similar procedure , read <http://wiki.debian.org/Multiarch/HOWTO> + +` sudo ln -fs libarchive.so.12  /usr/lib/i386-linux-gnu/libarchive.so.2` + +### Flashing the Tizen image + +Step 1. Boot the phone into download mode. + +1. Make sure the phone is powered-off. +2. Press <volume-down> + <power> key simultaneously. +3. Phone will boot-up and download mode image will be displayed on the + phone. + +- Step 2. Connect the phone to Linux PC with USB cable. + +<!-- --> + +- Step 3. Flashing image + +1. Execute lthor in a console on the Linux PC as follows, make sure + you\'re running lthor in 32-bit environment (if flash hang, try + unzip and flash the \*.tar file): + +<!-- --> + + $ sudo ./lthor lb-tizen-1.0_20120613.10-rs.tar.gz + or + $ sudo ./lthor lb-tizen-1.0_20120613.10-rs.tar + +- Step 4. Wait until all files are downloaded on to the phone. + +The phone will be automatically rebooted after successful downloading. + +Reset device with Tizen 1.0 image +--------------------------------- + +**This method is only valid for Tizen reference target devices. Because +it may cause some problems for other devices, we do not recommend to use +it for other devices.** + +### Downloads + +- Download the tizen downloader for Linux PCs available at + download.tizen.org/tools/tizen-downloader/ + [2](http://download.tizen.org/tools/tizen-downloader/) + +The tizen-download binary is pre-compiled in 32-bit environment, so you +need to install some 32-bit libraries in your host, for example in +Ubuntu 12.04: + +#### Ubuntu 12.04 + +1\. Install libcurl3 + +` sudo apt-get install libcurl3` + +### Flashing the Tizen image + +Step 1. Boot the phone into download mode. + +1. Make sure the phone is powered-off. +2. Press <volume-down> + <power> key simultaneously. +3. Phone will boot-up and download mode image will be displayed on the + phone. + +- Step 2. Connect the phone to Linux PC with USB cable. + +<!-- --> + +- Step 3. Flashing image + +1. Execute tizen-download in a console on the Linux PC as follows, make + sure you\'re running tizen-download in 32-bit environment: + +<!-- --> + + $ sudo ./tizen-download -u https://secured-download.tizen.org/references/1.0/ \ + s-boot-mmc.bin u-boot-mmc.bin uImage modules.img platform.img data.img ums.img + +- Step 4. Wait until all files are downloaded on to the phone. + +The phone will be automatically rebooted after successful downloading. + +Tips +---- + +### ssh into target device(USB Debugging Mode) + +Once the phone is flashed and booted up. Choose the usb mode to \"USB +debugging\" by doing this: + +`Settings ->`\ +`Press "All" to show all the settings items ->`\ +`"USB utilities" ->`\ +`Choose "USB debugging"` + +Then the device will export a usbnet device, it\'s addr: 192.168.129.3 + +<b>(In your host)</b> configure your ip address of usb0: + +`# ifconfig usb0 192.168.129.4` + +Then you can ssh into the target device (root, pwd: tizen): + +`# ssh root@192.168.129.3` + +### ssh into target device(Using SDB) + +With Tizen SDK properly installed and \"sdb\" is on your path +environment variable, + +`# sdb -d shell` + +More +---- + +- <http://tizentalk.com/forum/threads/questions-about-the-dev-phone.17/#post-124> +- <https://wiki.tizen.org/wiki/Flash_Tizen_2.2_Image_to_Reference_Device> + +[Category:Tool](Category:Tool "wikilink") +[Category:Hardware](Category:Hardware "wikilink") diff --git a/docs/platform/tool/OSDev_GBS.md b/docs/platform/tool/OSDev_GBS.md new file mode 100644 index 0000000000..756e2950a6 --- /dev/null +++ b/docs/platform/tool/OSDev_GBS.md @@ -0,0 +1,6 @@ +Obsoleted [GBS](GBS "wikilink") page \-\-- please refer to: +<https://source.tizen.org/documentation/reference/git-build-system> + +[Upstream](Upstream "wikilink"): <http://github.com/01org/gbs> + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_GBS_AArch64.md b/docs/platform/tool/OSDev_GBS_AArch64.md new file mode 100644 index 0000000000..4573ff0200 --- /dev/null +++ b/docs/platform/tool/OSDev_GBS_AArch64.md @@ -0,0 +1,52 @@ +Using GBS tool for AArch64 build +================================ + +Please be noticed that project is now stabilizing and may be +inconsistent and fail builds, so please check project config from time +to time until project is declared stable. This page only shows how to +configure GBS tool for AArch64 build, if you want full manual please +refer to [gbs +page](https://source.tizen.org/documentation/reference/git-build-system) + +Configuration +------------- + +To use aarch64 build you need to add AArch64 repositories to your +gbs.conf file and get a project config to use + +### gbs.conf + +`[profile.aarch64]`\ +`buildconf = ${work_dir}/tizen-conf/aarch64_build.conf`\ +`obs = obs.tizen`\ +`repos = repo.tizen_aarch64` + +`[obs.tizen]`\ +`url = `[`https://api.tizen.org`](https://api.tizen.org)\ +`user = xxxx`\ +`passwd = xxxx` + +`[repo.tizen_aarch64]`\ +`url = `[`https://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Tizen_Common/arm64-wayland`](https://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Tizen_Common/arm64-wayland) + +### project config + +As AArch64 project is not officially released yet, project config is not +published at *download.tizen.org* and therefore can\'t be downloaded by +gbs automatically. So user needs to download it and provide it to gbs +tool manually. There are two ways to get project config: + +#### With osc tool + +Import project config using *osc meta* + +`osc meta prjconf devel:arm_toolchain:Mobile:Tizen_Common >  ${work_dir}/tizen-conf/aarch64_build.conf` + +#### Using browser + +Project config is also available through web-interface, so you may open +[Project +config](https://build.tizen.org/project/prjconf?project=devel:arm_toolchain:Mobile:Tizen_Common) +page and copy config from there. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_MIC.md b/docs/platform/tool/OSDev_MIC.md new file mode 100644 index 0000000000..4e0bd9e6ce --- /dev/null +++ b/docs/platform/tool/OSDev_MIC.md @@ -0,0 +1,5 @@ +Obsoleted \-\-- please refer to: +<https://source.tizen.org/documentation/reference/mic-image-creator> or +[MIC](MIC "wikilink") page + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Toolchain_Testing.md b/docs/platform/tool/OSDev_Toolchain_Testing.md new file mode 100644 index 0000000000..0f7be71af0 --- /dev/null +++ b/docs/platform/tool/OSDev_Toolchain_Testing.md @@ -0,0 +1,798 @@ +Glibc +===== + +Build glibc on x86 host (cross-compilation) +------------------------------------------- + +### Download glibc sources + +Use osc utility to download sources from OBS, e.g. +[build.tizen.org](https://build.tizen.org). In case of using +build.tizen.org & Tizen:Base all dependent packages will be downloaded +and cached automatically. Otherwise you\'ll need to download them +manually (refer to [ this +section](#Download_additional_dependencies_manually "wikilink")). + +`cd /path/to/obs/projects`\ +`osc -A `[`https://build.tizen.org`](https://build.tizen.org)` co -S Tizen:Base glibc`\ +`cd Tizen:Base/glibc` + +### Build glibc + +To build build glibc from downloaded sources, simply run: + +`osc build standard armv7l --noservice --noverify --clean glibc.spec` + +Change armv7l to your target architecture. + +#### Omit building & running testsuite + +If you want to run tests separately (on your target device), you may +comment out according lines in the .spec file before running \"osc +build\" command: + +`sed -i -e '/^%check/,/^###/{/^###/b; s/^/#/}' glibc.spec` + +or just run the command with \"\--nochecks\" option, as follows: + +`osc build standard armv7l --noservice --noverify --nochecks --clean glibc.spec` + +### Deploying buildroot on device + +Refer to [ this section](#Prepare_SD_card_for_the_device "wikilink") if +your device has removable SD card. + +Alternativbely, if your device is reachable via network, you may mount +your buildroot created by \"osc build\" as NFS shared folder, e.g.: + +On your host run: + +`mkdir -p /export`\ +`ln -svf /path/to/your/buildroot /export/buildroot`\ +`echo "/export/buildroot *(rw,async,no_subtree_check,no_root_squash)" >> /etc/exports` + +**Note**: make sure you have nfs server package installed (e.g., on +Ubuntu/Debian it would be `nfs-kernel-server`). You may also want to +replace `*` in the last command with network address of your device (as +`*` provides access to an every node in your network). + +You\'ll also need to fix some toolchain-related issues by removing +`qemu-accel` package from inside buildroot. Run (on host also): + +`cd /path/to/your/buildroot`\ +`chroot .`\ +`mount -t proc none /proc` + +Then remove the package: + +`rpm -qa | grep qemu-accel | xargs rpm -e` + +Fix `rpm db`-related errors and exit chroot: + +`rm -rf /var/lib/rpm/__db.00*`\ +`umount /proc`\ +`exit` + +Then on target device run: + +`mount -t nfs host.ip.address:/export/buildroot /mnt`\ +`cd /mnt`\ +`mount -t proc proc proc/`\ +`mount -t sysfs sys sys/`\ +`mount -o bind /dev dev/`\ +`mount -t devpts pts dev/pts/`\ +`chroot .` + +And there you\'re, ready to build & run the testsuite. + +Build testsuite on device +------------------------- + +From chroot environment run: + +`cd /home/abuild/rpmbuild/BUILD/glibc-2.24/cc-base`\ +`make -r PARALLELMFLAGS="-j4" check -k 2>&1 | tee make_check.log` + +Here `-k` option prevents interruption on error, +`-r PARALLELMFLAGS="-j4"` allows to run several threads. + +You can also check only one component (subdirectory): + +`make -C /home/abuild/rpmbuild/BUILD/glibc-2.24/inet objdir=/home/abuild/rpmbuild/BUILD/glibc-2.24/cc-base check -k` + +Options: `-C $absolute_source_dir objdir=$absolute_build_dir`. + +The glibc testsuite contains a number of tests to check that the ABI of +glibc does not change. It compares symbol names and versions and static +variable sizes in generated binaries with those maintained in \*.abilist +in the source. The test runs as part of `make check`. You can also run +those separately via `make check-abi`. + +**Results:** each subdirectory will contain a file *subdir-tests.sum*. +Also you will see the summary result after full testing, for example: + +`Summary of test results:`\ +`        4 FAIL`\ +`        2418 PASS`\ +`        32 UNRESOLVED`\ +`        14 UNSUPPORTED`\ +`        42 XFAIL`\ +`        2 XPASS` + +### Known issues + +#### Clock desync + +In case you see messages like: + +`make: warning: Clock skew detected. Your build may be incomplete.` + +while running \"make\" on target device, make sure your host and target +clocks are syncronized. If not, you may need to adjust your target +timezone to your local one, as follows: + +`ln -svf /usr/share/zoneinfo/your/timezone /etc/localtime` + +#### Warning \"Setting locale failed\" + +If you observe messages like this while building process: + +`perl: warning: Setting locale failed.`\ +`perl: warning: Please check that your locale settings:`\ +`        LANGUAGE = (unset),`\ +`        LC_ALL = (unset),`\ +`        LANG = "en_US.UTF-8"`\ +`    are supported and installed on your system.`\ +`perl: warning: Falling back to the standard locale ("C")` + +there\'s no need to worry: it would generally make no harm. Howewer it +can be suppressed by setting a proper locale: + +`sed -i -e '/en_US.UTF-8/{s/^.*en_US/en_US/}' /etc/locale.gen`\ +`locale-gen`\ +`export LANGUAGE=en_US.UTF-8`\ +`export LANG=en_US.UTF-8`\ +`export LC_ALL=en_US.UTF-8` + +GCC +=== + +Current TODO-list +----------------- + +- Resolve dependencies for linaro-gcc (available now at private SPIN + server) + +<!-- --> + +- Add references for needed packages? (dejagnu etc.) + +<!-- --> + +- Describe OBS build using osc in details? + +<!-- --> + +- Describe OBS build using gbs? + +<!-- --> + +- Describe testing ARM/AARCH64 builds for native platforms? + +<!-- --> + +- Describe popular `RUNTESTFLAGS`? + +<!-- --> + +- Apply patches for linaro-gcc (from build.tizen.org) to successfully + run testsuite + +<!-- --> + +- Verify testing on target device step-by-step + +<!-- --> + +- Combine all patches for linaro-gcc.spec? + +Building linaro-gcc testsuite with gbs +-------------------------------------- + +### Mininal .gbs.conf example + +`   [general]`\ +`   prifile   = profile.tizen.org.devel.base`\ +`   buildconf = ~/wr/gbs/build_conf/devel.toolchains.ref/base/build.conf`\ +`   buildroot = ~/GBS-ROOT/`\ +`   `\ +`   [profile.tizen.org.devel.base]`\ +`   repos     = repo.tizen.org.devel.base, repo.tizen.org.devel.unified`\ +`   `\ +`   # devel:Toolchains:Base`\ +`   [repo.tizen.org.devel.base]`\ +`   url = `[`http://download.tizen.org/live/devel:/Toolchains:/Base/standard/`](http://download.tizen.org/live/devel:/Toolchains:/Base/standard/)\ +`   `\ +`   # devel:Toolchains:Unified`\ +`   [repo.tizen.org.devel.unified]`\ +`   url = `[`http://download.tizen.org/live/devel:/Toolchains:/Unified/standard/`](http://download.tizen.org/live/devel:/Toolchains:/Unified/standard/) + +### Prepare dependences for linaro-gcc + +Prepare all dependences and `linaro-gcc` sources: + +`   mkdir linaro-gcc-test`\ +`   cd linaro-gcc-test`\ +`   `\ +`   git clone `[`ssh://review.tizen.org:29418/platform/upstream/autogen.git`](ssh://review.tizen.org:29418/platform/upstream/autogen.git)` --branch tizen`\ +`   git clone `[`ssh://review.tizen.org:29418/platform/upstream/dejagnu.git`](ssh://review.tizen.org:29418/platform/upstream/dejagnu.git)` --branch tizen`\ +`   git clone `[`ssh://review.tizen.org:29418/platform/upstream/guile.git`](ssh://review.tizen.org:29418/platform/upstream/guile.git)` --branch tizen`\ +`   git clone `[`ssh://review.tizen.org:29418/platform/upstream/libatomic_ops.git`](ssh://review.tizen.org:29418/platform/upstream/libatomic_ops.git)` --branch tizen`\ +`   git clone `[`ssh://review.tizen.org:29418/platform/upstream/libgc.git`](ssh://review.tizen.org:29418/platform/upstream/libgc.git)` --branch tizen`\ +`   `\ +`   ln -sf /path/to/linaro-gcc/` + +### Build with gbs + +`   gbs build --clean -A x86_64 \`\ +`       --profile=profile.tizen.org \`\ +`       --define 'gcc_run_tests 1' \`\ +`       --exclude gcc-armv7l,gcc-aarch64,gcc-armv7hl \`\ +`       --binary-list=libatomic_ops,autogen,libgc,guile,dejagnu,linaro-gcc` + +### Usage example with single script + +`cat test_linaro_gcc`: + +`   #!/usr/bin/env bash`\ +`   `\ +`   set -eux`\ +`   `\ +`   # Default is host $USERNAME`\ +`   USER="${USER:-$USERNAME}"`\ +`   LINARO_GCC="${LINARO_GCC:-~/wr/tizen/linaro-gcc/}"`\ +`   DIR="${DIR:-linaro-gcc-test}"`\ +`   `\ +`   declare -a DEPS=(`\ +`       "autogen"`\ +`       "dejagnu"`\ +`       "guile"`\ +`       "libatomic_ops"`\ +`       "libgc")`\ +`   `\ +`   # 1. Prepare`\ +`   mkdir -p "$DIR"`\ +`   cd "$DIR"`\ +`   `\ +`   # 2. Clone deps`\ +`   for dep in "${DEPS[@]}"; do`\ +`       if [ ! -d "$dep" ]; then`\ +`       git clone `[`ssh://"${USERNAME}"@review.tizen.org:29418/platform/upstream/"${dep}`](ssh://%22$%7BUSERNAME%7D%22@review.tizen.org:29418/platform/upstream/%22$%7Bdep%7D)`".git --branch tizen`\ +`       fi`\ +`   done`\ +`   `\ +`   # 3. Link to linaro-gcc sources`\ +`   [ ! -d linaro-gcc ] && ln -sf "$LINARO_GCC" linaro-gcc`\ +`   `\ +`   # 4. Build`\ +`   gbs build --clean -A x86_64 \`\ +`       --profile=profile.tizen.org \`\ +`       --define 'gcc_run_tests 1' \`\ +`       --exclude gcc-armv7l,gcc-aarch64,gcc-armv7hl \`\ +`       --binary-list=libatomic_ops,autogen,libgc,guile,dejagnu,linaro-gcc` + +Example usage: + +`   USER=mkashkarov LINARO_GCC=~/wr/tizen/linaro-gcc ./test_linaro-gcc` + +Get linaro-gcc and needed packages to run testsuite +--------------------------------------------------- + +### Using osc command line tool + +`   # Path to buildroot used by osc`\ +`   export GCC_BUILD_ROOT="/var/tmp/build-root/standard-x86_64/"`\ +`   # Path to linaro-gcc directory used for build`\ +`   export GCC_DIR="${GCC_BUILD_ROOT}/home/abuild/rpmbuild/BUILD/gcc-6.2.1/"`\ +`   # Path to linaro-gcc build directory`\ +`   export GCC_BUILD_DIR="$GCC_DIR/obj/"`\ +`   # Path to ./contrib subfolder with scripts`\ +`   export GCC_CONTRIB_DIR="$GCC_DIR/contrib/"`\ +`   # Path to save manually downloaded binaries needed to run linaro-gcc testsuite`\ +`   export DOWNLOAD_BINARIES="/path/to/store/binaries/"` + +#### Download linaro-gcc package + +Use [osc](https://wiki.tizen.org/OSDev/Using_OBS) to download linaro-gcc +package from [build.tizen.org](https://build.tizen.org) or other `OBS` +system. + +For example: + +`   cd /your/path/to/obs/projects/`\ +`   osc -A `[`https://build.tizen.org`](https://build.tizen.org)` co -S devel:Toolchains:Base:ref linaro-gcc`\ +`   cd devel:Toolchains:Base:ref/linaro-gcc` + +#### Download additional dependencies manually + +If you run the following build command + +`   osc build standard armv7l --no-service --no-verify --clean linaro-gcc.spec --define='run_tests 1'` + +And get this output: + +`   buildinfo is broken... it says:`\ +`   unresolvable: nothing provides dejagnu, nothing provides expect, nothing provides gdb` + +Then you need to install additional packages for building testsuite. +(<span class="timestamp-wrapper"><span class="timestamp">\<2018-08-29 +Wed\></span></span>: List of needed packages to install) + + ---------------- ------------------------------------------------------------------------------------- ---------- + Package Link Private? + + autogen <https://10.113.136.201/package/show/devel:Toolchains:standalone/autogen> \|+ + dejagnu <https://10.113.136.201/package/show/devel:Toolchains:standalone/dejagnu> \|+ + gmp <https://10.113.136.201/package/show/devel:Toolchains:standalone/gmp> \|+ + guile <https://10.113.136.201/package/show/devel:Toolchains:standalone/guile> \|+ + libatomic\_ops <https://10.113.136.201/package/show/devel:Toolchains:standalone/libatomic_ops> \|+ + libgc <https://10.113.136.201/package/show/devel:Toolchains:standalone/libgc> \|+ + expat <https://build.tizen.org/package/show/devel:Toolchains:Base:ref/expat> + libffi <https://build.tizen.org/package/show/devel:Toolchains:Base:ref/libffi> + openssl <https://build.tizen.org/package/show/devel:Toolchains:Base:ref/openssl> + python <https://build.tizen.org/package/show/devel:Toolchains:Base:ref/python> + expect <https://build.tizen.org/package/show/devel:Toolchains:Unified:ref/expect> + gdb <https://build.tizen.org/package/show/devel:Toolchains:Unified:ref/gdb> + tcl <https://build.tizen.org/package/show/devel:Toolchains:Unified:ref/tcl> + ---------------- ------------------------------------------------------------------------------------- ---------- + +##### Download needed binaries manually + +Download all the binaries that are needed to perform `linaro-gcc` +testing (change `armv7l` to needed target): + +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone autogen       standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone dejagnu       standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone gmp           standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone guile         standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone libatomic_ops standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:standalone libgc         standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Base:ref expat           standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Base:ref libffi          standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Base:ref openssl         standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Base:ref python          standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Unified:ref expect       standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Unified:ref gdb          standard armv7l -d ${DOWNLOAD_BINARIES}`\ +`   osc -A `[`https://s014`](https://s014)` getbinaries devel:Toolchains:Unified:ref tcl          standard armv7l -d ${DOWNLOAD_BINARIES}` + +Build linaro-gcc testsuite +-------------------------- + +This will test various components of `GCC`, such as compiler front ends +and runtime libraries. While running the testsuite, `DejaGnu` might emit +some harmless messages resembling +`WARNING: Couldn't find the global config file.` or +`WARNING: Couldn't find tool init file` that can be ignored. + +### Build on host (x86\_64/i586) platform + +#### Testing native compiler + +Build `x86_64/i585` `linaro-gcc` with testsuite enabled: + +`   osc build standard x86_64 --no-service --no-verify --clean \`\ +`   --define 'run_tests 1' linaro-gcc.spec -p ${DOWNLOAD_BINARIES}` + +#### Testing cross-compiler + +You should specify target board for cross compiler. In case if you want +to test `armv7l`: + +`   cd ${GCC_BUILD_DIR}/build`\ +`   make check RUNTESTFLAGS=--target_board=arm-sim` + +### Build on device (armv7l/aarch64) platform + +You need to interrup `linaro-gcc` build right after `make ..` command +and before cleaning up object files at the end of the build to copy full +buildroot on the device and continue process there. + +#### Build linaro-gcc + +Run the build and wait till process exit after `make`: + +`   osc build standard armv7l --no-service --clean --no-verify \`\ +`   --root=${GCC_BUILD_ROOT} --define "run_tests 1" --define "exit_on_make_finish 1" \`\ +`   -p ${DOWNLOAD_BINARIES}` + +Like this: + +`   [  746s] make[4]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/armv7l-tizen-linux-gnueabi/libsanitizer'`\ +`   [  746s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/armv7l-tizen-linux-gnueabi/libsanitizer'`\ +`   [  746s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/armv7l-tizen-linux-gnueabi/libsanitizer'`\ +`   [  746s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj'`\ +`   [  746s] + exit 1`\ +`   [  746s] error: Bad exit status from /var/tmp/rpm-tmp.ULdtx9 (%build)`\ +`   [  746s]`\ +`   [  746s]`\ +`   [  746s] RPM build errors:`\ +`   [  746s]     Bad exit status from /var/tmp/rpm-tmp.ULdtx9 (%build)` + +#### Prepare SD card for the device + +You need about `4Gb` free space for the buildroot, about `4Gb` for the +swap and additional space duiring `gcc` build, so totally about `16Gb` +free space will be enough. You can save additional space by removing +`/home/abuild/rpmbuild/SOURCES/*` (inside chroot) and decreasing `make` +parallel jobs when build on device (do `make -j1 ..`, for example). + +**NOTE**: `[target]sh-3.2# ..` means that you need to do commands on the +target device: + +`   sdb root on`\ +`   sdb shell`\ +`   [target]sh-3.2# uname -a`\ +`   Linux localhost 3.10.65 #1-Tizen SMP PREEMPT Mon Jul 16 02:47:16 UTC 2018 armv7l GNU/Linux` + +Use SD card formatted to `ext4` (`fat32` does not support symbolic +links). To format SD card to `ext4`: + +`   [target]sh-3.2# mkfs.ext4 /dev/mmcblk1p1` + +Add the following line to `/etc/fstab` and reboot: + +`   [target]sh-3.2# mount -o remount,rw /`\ +`   [target]sh-3.2# echo "/dev/mmcblk1p1  /opt/media/SDCardA1     ext4    defaults,noatime        0       3" >> /etc/fstab` + +Or you can mount manually every time device is loaded: + +`   [target]sh-3.2# mount /dev/mmcblk1p1 /opt/media/SDCardA1` + +Now you should have SD card mounted at `/opt/media/SDCardA1/`. + +#### Copy buildroot to device + +Archive build root used by `osc build...`: + +`   cd ${GCC_BUILD_ROOT}`\ +`   sudo tar cvfz gcc_buildroot.tar.gz .` + +Adn then copy the archive to device: + +`   sdb push gcc_buildroot.tar.gz /opt/media/SDCardA1` + +#### Configure environment on the device + +Connect to the device shell: + +`   sdb root on`\ +`   sdb shell` + +Change fs to `read-write`: + +`   [target]sh-3.2# mount -o remount,rw /` + +Extract buildroot: + +`   [target]sh-3.2# cd /opt/media/SDCardA1`\ +`   # Avoid "make: warning:  Clock skew detected.  Your build may be incomplete."`\ +`   # Insert date that is not in the past right now`\ +`   [target]sh-3.2# date -s "2018-08-30 11:55"`\ +`   [target]sh-3.2# mkdir -p gcc_buildroot`\ +`   [target]sh-3.2# tar xvzf gcc_buildroot.tar.gz --owner root --group root --no-same-owner -C gcc_buildroot` + +Mount the devices: + +`   [target]sh-3.2# cd gcc_buildroot`\ +`   [target]sh-3.2# mount -v --bind /dev ./dev`\ +`   [target]sh-3.2# mount -vt devpts devpts ./dev/pts`\ +`   [target]sh-3.2# mount -vt tmpfs shm ./dev/shm`\ +`   [target]sh-3.2# mount -vt proc proc ./proc`\ +`   [target]sh-3.2# mount -vt sysfs sysfs ./sys` + +Get inside buildroot: + +`   sh-3.2# pwd`\ +`   /opt/media/SDCardA1/gcc_buildroot`\ +`   [target]sh-3.2# chroot .` + +Create swap file + +`   # 4GB /swapfile`\ +`   [target-chroot]sh-3.2# dd if=/dev/zero of=/swapfile bs=64M count=64`\ +`   [target-chroot]sh-3.2# mkswap /swapfile`\ +`   [target-chroot]sh-3.2# swapon /swapfile`\ +`   # Verify`\ +`   [target-chroot]sh-3.2# swapon --show`\ +`   NAME      TYPE SIZE USED PRIO`\ +`   /swapfile file   4G   0B   -1` + +Fix link to `liblto_plugin.so`: + +`   [target-chroot]sh-3.2# cd /usr/lib/gcc/armv7l-tizen-linux-gnueabi/6.2.1/`\ +`   [target-chroot]sh-3.2# ln -sf liblto_plugin.so.0.0.0 liblto_plugin.so` + +Prevent error messages related to `rpm db`: + +`   [target-chroot]sh-3.2# rm -rf /var/lib/rpm/__db.00*` + +Adjust `OOM` score settings: + +`   [target-chroot]sh-3.2# echo -17 > /proc/$$/oom_adj`\ +`   [target-chroot]sh-3.2# echo -1000 > /proc/$$/oom_score_adj` + +#### Build testsuite on device + +##### Build manually + +`   [target-chroot]sh-3.2# cd /home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/`\ +`   [target-chroot]sh-3.2# make check -k -j2 2>&1 | tee make_check.log` + +##### Build using rpmbuild + +Modify `rpm` macroses: + +`   [target-chroot]sh-3.2# export HOME=/home/abuild`\ +`   [target-chroot]sh-3.2# echo '%_topdir %{getenv:HOME}/rpmbuild' >> /usr/lib/rpm/macros` + +Run `rpmbuild` started with `%build` section and turn off removing +`obj/` dir and `configure/make` steps: + +`   cd %{HOME}/rpmbuild`\ +`   rpmbuild --nodeps --noclean --short-circuit -bc --define '_srcdefattr (-,root,root)' \`\ +`   --nosignature --target=armv7l-tizen-linux --define '_build_create_debug 1' \`\ +`   --define 'run_tests_on_device 1' --define '_smp_mflags -j2' ${HOME}/rpmbuild/SOURCES/linaro-gcc.spec \`\ +`   2>&1 | tee build_testsuite_log.txt` + +APPENDIX A: Run the testsuite manually on selected tests +-------------------------------------------------------- + +In order to run sets of tests selectively, there are targets +`make check-gcc` and language specific `make check-c`, `make check-c++`, +`make check-fortran`, `make check-ada`, `make check-objc`, +`make check-obj-c++`, `make check-lto` in the gcc subdirectory of the +object directory. You can also just run `make check` in a subdirectory +of the object directory. + +A more selective way to just run all gcc execute tests in the testsuite +is to use + +`   make check-gcc RUNTESTFLAGS="execute.exp other-options"` + +The file-matching expression following `filename.exp` is treated as a +series of whitespace-delimited glob expressions so that multiple +patterns may be passed, although any whitespace must either be escaped +or surrounded by single quotes if multiple expressions are desired. For +example, + +`   make check-g++ RUNTESTFLAGS="old-deja.exp=9805*\ virtual2.c other-options" make`\ +`   check-g++ RUNTESTFLAGS="'old-deja.exp=9805* virtual2.c' other-options"` + +The `*.exp` files are located in the testsuite directories of the `GCC` +source, the most important ones being `compile.exp`, `execute.exp`, +`dg.exp` and `old-deja.exp`. To get a list of the possible `*.exp` +files, pipe the output of `make check` into a file and look at the +`Running … .exp` lines. Passing options and running multiple testsuites + +You can pass multiple options to the testsuite using the +`--target_board` option of `DejaGNU`, either passed as part of +`RUNTESTFLAGS`, or directly to runtest if you prefer to work outside the +makefiles. For example, + +`   make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"` + +will run the standard `g++` testsuites (`unix` is the target name for a +standard native testsuite situation), passing `-O3 -fmerge-constants` to +the compiler on every test, i.e., slashes separate options. + +You can run the testsuites multiple times using combinations of options +with a syntax similar to the brace expansion of popular shells: + +`   …"--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}"` + +(Note the empty option caused by the trailing comma in the final group.) +The following will run each testsuite eight times using the `arm-sim` +target, as if you had specified all possible combinations yourself: + +`   --target_board='arm-sim/-mhard-float/-O1 \ arm-sim/-mhard-float/-O2 \`\ +`           arm-sim/-mhard-float/-O3 \ arm-sim/-mhard-float \`\ +`           arm-sim/-msoft-float/-O1 \ arm-sim/-msoft-float/-O2 \`\ +`           arm-sim/-msoft-float/-O3 \ arm-sim/-msoft-float'` + +They can be combined as many times as you wish, in arbitrary ways. This +list: + +`   …"--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}"` + +will generate four combinations, all involving `-Wextra`. + +The disadvantage to this method is that the testsuites are run in +serial, which is a waste on multiprocessor systems. For users with +`GNU Make` and a shell which performs brace expansion, you can run the +testsuites in parallel by having the shell perform the combinations and +make do the parallel runs. Instead of using `--target_board`, use a +special makefile target: + +`   make -jN check-testsuite//test-target/option1/option2/…` + +For example, + +`   make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}` + +will run three concurrent `make-gcc` testsuites, eventually testing all +ten combinations as described above. Note that this is currently only +supported in the gcc subdirectory. (To see how this works, try typing +echo before the example given here.) + +APPENDIX B: How to interpret test results? +------------------------------------------ + +The result of running the testsuite are various `*.sum` and `*.log` +files in the testsuite subdirectories. The `*.log` files contain a +detailed log of the compiler invocations and the corresponding results, +the `*.sum` files summarize the results. These summaries contain status +codes for all tests: + + -------------- -------------------------------------------- + Mark Status + + PASS: the test passed as expected + XPASS: the test unexpectedly passed + FAIL: the test unexpectedly failed + XFAIL: the test failed as expected + UNSUPPORTED: the test is not supported on this platform + ERROR: the testsuite detected an error + WARNING: the testsuite detected a possible problem + -------------- -------------------------------------------- + +APPENDIX C: Collect testsute results +------------------------------------ + +To collect testsuite results, you need to store all `*.log/*.sum` files +produced by testsute: + +`   cd ${GCC_BUILD_DIR}`\ +`   export TEST_RESULTS="${GCC_DIR}/testresults/"`\ +`   # Create a folder to store .sum/.log result files`\ +`   mkdir -p ${TEST_RESULTS}`\ +`   cp $(find . -name "*.sum") ${TEST_RESULTS}`\ +`   cp --parents $(find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ) ${TEST_RESULTS}`\ +`   chmod 644 $(find ${TEST_RESULTS} -type f)` + +And now you should have something like this in the `${TEST_RESULTS}` +directory: + +`   ├── obj`\ +`   │   ├── gcc`\ +`   │   │   └── testsuite`\ +`   │   │       ├── g++`\ +`   │   │       │   ├── g++.log`\ +`   │   │       │   ├── g++.sum`\ +`   │   │       ├── gfortran`\ +`   │   │       │   ├── gfortran.log`\ +`   │   │       │   ├── gfortran.sum`\ +`   │   ├── gmp`\ +`   │   │   └── tests`\ +`   │   │       ├── cxx`\ +`   │   │       │   └── test-suite.log`\ +`   │   │       ├── misc`\ +`   │   │       │   ├── test-suite.log`\ +`   │   │       │   ├── t-locale.log`\ +`   │   │       │   ├── t-printf.log`\ +`   │   │       │   └── t-scanf.log`\ +`   │   │       ├── mpf`\ +`   │   │       │   ├── reuse.log`\ +`   │   │       │   ├── t-add.log`\ +`   │   │       │   ├── t-cmp_d.log`\ +`   │   │       │   ├── t-cmp_si.log`\ +`   │   │       │   ├── t-conv.log`\ +`   ....` + +APPENDIX D: Compare 2 testsuite results +--------------------------------------- + +To compare difference between 2 testsuite results you can use bash +script `compare_tests` from `${GCC_DIR}/contrib` folder: + +Usage: + +`   ${GCC_CONTRIB_DIR}/compare_tests /testresults/old_result /testresults/new_result` + +Example output: + +`   # Comparing directories`\ +`   ## Dir1=testresults/old_result: 14 sum files`\ +`   ## Dir2=testresults/new_result: 14 sum files`\ +`   `\ +`   # Extra sum files in Dir1=testresults/old_result`\ +`   < testresults/old_result/obj/i586-tizen-linux-gnu/libatomic/testsuite/libatomic.sum`\ +`   < testresults/old_result/obj/i586-tizen-linux-gnu/libgomp/testsuite/libgomp.sum`\ +`   < testresults/old_result/obj/i586-tizen-linux-gnu/libitm/testsuite/libitm.sum`\ +`   < testresults/old_result/obj/i586-tizen-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum`\ +`   `\ +`   # Extra sum files in Dir2=testresults/new_result`\ +`   > testresults/new_result/obj/x86_64-tizen-linux-gnu/libatomic/testsuite/libatomic.sum`\ +`   > testresults/new_result/obj/x86_64-tizen-linux-gnu/libgomp/testsuite/libgomp.sum`\ +`   > testresults/new_result/obj/x86_64-tizen-linux-gnu/libitm/testsuite/libitm.sum`\ +`   > testresults/new_result/obj/x86_64-tizen-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum`\ +`   `\ +`   # Comparing 10 common sum files`\ +`   ## /bin/sh ./contrib/compare_tests  /tmp/gxx-sum1.24630 /tmp/gxx-sum2.24630`\ +`   Tests that now fail, but worked before:`\ +`   `\ +`   21_strings/basic_string/allocator/char/move.cc execution test`\ +`   21_strings/basic_string/allocator/char/move_assign.cc execution test`\ +`   21_strings/basic_string/allocator/wchar_t/move.cc execution test`\ +`   21_strings/basic_string/allocator/wchar_t/move_assign.cc execution test`\ +`   21_strings/basic_string/requirements/exception/basic.cc execution test`\ +`   23_containers/vector/bool/modifiers/insert/31370.cc execution test`\ +`   27_io/basic_ostringstream/cons/move.cc execution test`\ +`   27_io/basic_stringstream/cons/move.cc execution test`\ +`   `\ +`   Tests that now work, but didn't before:`\ +`   `\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O0  (test for excess errors)`\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O0  (test for excess errors)`\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O1  (test for excess errors)`\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O1  (test for excess errors)`\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O2  (test for excess errors)`\ +`   c-c++-common/asan/allocator_oom_test-1.c   -O2  (test for excess errors)`\ +`   `\ +`   New tests that FAIL:`\ +`   `\ +`   c-c++-common/isan/overflow-add.c   -O3 -g  output pattern test`\ +`   c-c++-common/isan/overflow-add.c   -O3 -g  output pattern test`\ +`   c-c++-common/isan/overflow-add.c   -Os  output pattern test`\ +`   c-c++-common/isan/overflow-add.c   -Os  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O0  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O0  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O1  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O1  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O2  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O2  output pattern test`\ +`   c-c++-common/isan/overflow-mul.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  output pattern test`\ +`   `\ +`   New tests that PASS:`\ +`   `\ +`   c-c++-common/asan/no-asan-stack.c   -O0   scan-assembler-not 0x41b58ab3|0x41B58AB3|1102416563`\ +`   c-c++-common/asan/no-asan-stack.c   -O0   scan-assembler-not 0x41b58ab3|0x41B58AB3|1102416563`\ +`   c-c++-common/asan/no-asan-stack.c   -O0   scan-assembler-not 0x41b58ab3|0x41B58AB3|1102416563`\ +`   c-c++-common/asan/no-asan-stack.c   -O0   scan-assembler-not 0x41b58ab3|0x41B58AB3|1102416563`\ +`   `\ +`   Old tests that passed, that have disappeared: (Eeek!)`\ +`   `\ +`   23_containers/map/modifiers/erase/dr130-linkage-check.cc (test for excess errors)`\ +`   23_containers/map/modifiers/erase/dr130-linkage-check.cc execution test`\ +`   23_containers/multimap/modifiers/erase/dr130-linkage-check.cc (test for excess errors)`\ +`   23_containers/multimap/modifiers/erase/dr130-linkage-check.cc execution test`\ +`   23_containers/multiset/modifiers/erase/dr130-linkage-check.cc (test for excess errors)`\ +`   23_containers/multiset/modifiers/erase/dr130-linkage-check.cc execution test`\ +`   23_containers/set/modifiers/erase/dr130-linkage-check.cc (test for excess errors)`\ +`   23_containers/set/modifiers/erase/dr130-linkage-check.cc execution test`\ +`   `\ +`   ## Differences found:`\ +`   # 1 differences in 10 common sum files found` + +APPENDIX E: <WIP> Configure target device with 1 script +------------------------------------------------------- + +`   #!/usr/bin/env bash`\ +`   `\ +`   set -eux`\ +`   `\ +``    # Modify sdb path if `sdb` is not visible ``\ +`   sdb_root_on() {`\ +`       # TODO: additional checks?`\ +`       ~/Downloads/sdb_2.2.31_ubuntu-64/data/tools/sdb root on`\ +`   }`\ +`   `\ +`   sdb_shell() {`\ +`       ~/Downloads/sdb_2.2.31_ubuntu-64/data/tools/sdb shell ${@}`\ +`   }`\ +`   `\ +`   sdb_root_on`\ +`   `\ +`   # Sanity check`\ +`   sdb_shell uname -a || exit 1` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Using_MIC_(tips_and_tricks).md b/docs/platform/tool/OSDev_Using_MIC_(tips_and_tricks).md new file mode 100644 index 0000000000..560cd099e5 --- /dev/null +++ b/docs/platform/tool/OSDev_Using_MIC_(tips_and_tricks).md @@ -0,0 +1,75 @@ +Concept of binary repository +---------------------------- + +[MIC](MIC "wikilink") image creator can create image from so-called +**binary repository**, which can be stored at Web or even on your own +PC. + +The **binary repository** is the directory that has the following +structure: + +![](Repos-structure.jpg "Repos-structure.jpg"){width="1100" +height="700"} + +The XML files contain metadata necessary for work with the repository. + +Creating local repository that can be used with MIC +--------------------------------------------------- + +First you need to have mic and createrepo to be installed on your PC. If +not, follow the guide described on this page: [Installing development +tools](https://source.tizen.org/ru/documentation/developer-guide/installing-development-tools?langredirect=1) + +\"createrepo\" is the utility that generates the metadata necessary for +a RPM package repository: primary.xml, other.xml and so on. To install +it, run the following command: + +`sudo apt-get install createrepo` + +Create the directory where you will store your local repository: + +`mkdir /home/user/my-repo`\ +`cd /home/user/my-repo` + +Create one directory for each architecture that will present in the +repository: + +`mkdir aarch64`\ +`mkdir noarch` + +Download RPM packages from the repository published by OBS server: + +`cd aarch64`\ +`wget -r -l1 --no-parent -nd -nv -A "*.rpm" `[`http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/aarch64/`](http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/aarch64/)\ +`wget -r -l1 --no-parent -nd -nv -A "*.rpm" `[`http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Main/aarch/aarch64/`](http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Main/aarch/aarch64/)\ +`cd noarch`\ +`wget -r -l1 --no-parent -nd -nv -A "*.rpm" `[`http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/noarch/`](http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Base/aarch/noarch/)\ +`wget -r -l1 --no-parent -nd -nv -A "*.rpm" `[`http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Main/aarch/noarch/`](http://download.tizen.org/live/devel:/arm_toolchain:/Mobile:/Main/aarch/noarch/) + +Download files **group.xml** and **patterns.xml** from some official +Tizen repository and save them into special **repodata** directory: + +`cd /home/user/my-repo`\ +`mkdir repodata`\ +`cd repodata`\ +`wget -r -l1 --no-parent -nd -nv -A "group.xml" `[`http://download.tizen.org/releases/daily/tizen/mobile/latest/repos/mobile/ia32/packages/repodata/`](http://download.tizen.org/releases/daily/tizen/mobile/latest/repos/mobile/ia32/packages/repodata/)\ +`wget -r -l1 --no-parent -nd -nv -A "patterns.xml" `[`http://download.tizen.org/releases/daily/tizen/mobile/latest/repos/mobile/ia32/packages/repodata/`](http://download.tizen.org/releases/daily/tizen/mobile/latest/repos/mobile/ia32/packages/repodata/) + +Run the generation of repository by **createrepo** utility: + +`createrepo -g /home/user/my-repo/repodata/group.xml --database --unique-md-filenames /home/user/my-repo` + +Add file **patterns.xml** under the control of the repository: + +`modifyrepo /home/user/my-repo/repodata/patterns.xml /home/user/my-repo/repodata` + +After that you can use directory **\~/my-repo** as the local MIC +repository via **\*.ks** files using the following line: + +`repo --name=mobile --baseurl=`[`file:///home/user/my-repo`](file:///home/user/my-repo)` --save --ssl_verify=no` + +And then you may run mic for firmware creation + +`sudo mic -i create loop -A aarch64 /home/user/my-repo/repodata/fw.ks --shrink --runtime native` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Using_OBS.md b/docs/platform/tool/OSDev_Using_OBS.md new file mode 100644 index 0000000000..39bc879786 --- /dev/null +++ b/docs/platform/tool/OSDev_Using_OBS.md @@ -0,0 +1,113 @@ +Using OBS to build AArch64 Tizen application +-------------------------------------------- + +This manual describes work with [Official Tizen +OBS](https://build.tizen.org) + +At the moment porting Tizen onto AArch64 architecture is in progress but +base set of packages needed for build is nearly complete. This set is +placed in +[devel:arm\_toolchain:Mobile:Base](https://build.tizen.org/project/show?project=devel%3Aarm_toolchain%3AMobile%3ABase) +project and could be connected to any project developer wants to use. + +osc tool is commonly used to interact with [OBS](OBS "wikilink") +servers, you can install it using your OS package manager. First of all +you will need Tizen tool repository enabled like it described in +[Developer +Guide](https://source.tizen.org/documentation/developer-guide/installing-development-tools). +And then you may just install osc tool + +`# Ubuntu example`\ +`$ sudo apt-get update`\ +`$ sudo apt-get install osc` + +Current status +-------------- + +Now we have a working toolchain and development tools in +[devel:arm\_toolchain:Mobile:Base +project](https://build.tizen.org/project/show?project=devel%3Aarm_toolchain%3AMobile%3ABase) +which you may use to build your software and almost the whole +Tizen:Common in [devel:arm\_toolchain:Mobile:Main +project](https://build.tizen.org/project/show?project=devel%3Aarm_toolchain%3AMobile%3AMain). + +There are still some problems with a few packages listed at +[OSDev/AArch64\_porting](OSDev/AArch64_porting "wikilink") status page. + +The firmware can be built using *mic* tool and booted up using ARM64 +simulator like ARM FastModels. + +Creating own development project +-------------------------------- + +This manual describes project creation at *build.tizen.org* OBS. If you +want to set up your dedicated instance, please read +[OSDev/Creating\_AArch64\_Project](OSDev/Creating_AArch64_Project "wikilink") +page. + +If you want to use current AArch64 toolchain you may create your own +(home or team) project in OBS. Two things are needed to do that: +tizen.org account and OBS access permission. + +Then there are three steps to use binaries. + +:\# Add *aarch64* architecture to your project: either through web +interface \"Repositories\" section or by adding tags to Meta info +directly. + +:\# Edit project Meta at +*<https://build.tizen.org/project/meta?project=PRJ>* and add link to +devel:arm\_toolchain:Mobile:Main with +*<path project="devel:arm_toolchain:Mobile:Base" repository="aarch"/>* +line. You may see example at +[devel:arm\_toolchain:Mobile:Main](https://build.tizen.org/project/meta?project=devel:arm_toolchain:Mobile:Main) +Meta page. + +:\# Add project config and tune your project for your needs. Example of +project config for Tizen AArch64 can be seen at +[devel:arm\_toolchain:Mobile:Main](https://build.tizen.org/project/prjconf?project=devel:arm_toolchain:Mobile:Main). + +:\# Switch on build for aarch64 in *Repositories* section of your +project + +After changes are performed Project Meta page should have something like +this: + +<repository name="AArch">\ +<path project="devel:arm_toolchain:Mobile:Main" repository="aarch"/>\ +<arch>`aarch64`</arch>\ +</repository> + +After these actions OBS should start building your packages for AArch64 +using prebuilt toolchain. + +At the moment this toolchain should be enough for building daemons or +console applications. + +Now you may upload a package you want to build using osc tool. For +example if you want to build your own bash package you may copy it from +Tizen:Mobile and build for AArch64 in your project + +`$ osc copypac Tizen:Mobile bash YourTeam:YourProject bash` + +And the you may look at build process in web interface. + +For local build using osc: + +`$ osc co YourTeam:YourProject bash`\ +`$ cd YourTeam:YourProject/bash`\ +`$ osc build AArch aarch64` + +If you want to create new package you may use + +`$ osc mkpac pkg`\ +`$ cd pkg`\ +`$ # placing sources and .spec file:`\ +`$ cp /home/developer/pkg/{pkg-1.0.tar.gz,pkg.spec} .`\ +`$ osc ar`\ +`$ osc commit -m 'Initial commit'`\ +`$ osc rebuild` + +And then wait until build finishes. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_Using_obs_service_gbs_for_local_build.md b/docs/platform/tool/OSDev_Using_obs_service_gbs_for_local_build.md new file mode 100644 index 0000000000..4196ac56ae --- /dev/null +++ b/docs/platform/tool/OSDev_Using_obs_service_gbs_for_local_build.md @@ -0,0 +1,117 @@ +This guide describes using sources and building packages using +[OBS](OBS "wikilink") source service *gbs*. + +Installing prerequisites +======================== + +By default *osc* cannot checkout sources referenced through *gbs* +service. For it to work following packages have to be installed: + +- [obs-service-gbs](https://github.com/01org/obs-service-gbs) + +`git clone `[`https://github.com/01org/obs-service-gbs.git`](https://github.com/01org/obs-service-gbs.git)\ +`cd obs-service-gbs`\ +`python setup.py build`\ +`sudo python setup.py install` + +- [obs-service-gbp](https://github.com/01org/obs-service-git-buildpackage) + +`git clone `[`https://github.com/01org/obs-service-git-buildpackage.git`](https://github.com/01org/obs-service-git-buildpackage.git)\ +`cd obs-service-git-buildpackage`\ +`python setup.py build`\ +`sudo python setup.py install` + +Configuring services +==================== + +To make services work without root privileges, cache directories have to +be changed. Edit files /etc/obs/services/gbs and +/etc/obs/services/git-buildpackage. Uncomment string containing +repo-cache-dir and change it to place where your user have rights to +write to (/var/tmp for example): + +`repo-cache-dir = /var/tmp/git-buildpackage-repos/` + +This string can be the same in both files. + +Checking out sources and building +================================= + +Now you can run command in package directory + +`osc service run` + +to prepare sources for building and normally run + +`osc build $REPO $ARCH` + +to build package. + +Known issues +============ + +Multiple .spec files in repo +---------------------------- + +If you have following error: + +`Multiple build description files found:` + +build can be fixed by adding one of .spec files as additional parameter +to command line: + +`osc build $REPO $ARCH $name.spec` + +Upstream branch problem +----------------------- + +Following error: + +`error: Start commit '*' not an ancestor of end commit '*'`\ +`error: Generating upstream tarball and/or generating patches failed. GBS tried this as you have upstream branch in you git tree. Fix the problem by either:`\ +`  1. Update your upstream branch and/or fix the spec file. Also, check the upstream tag format.`\ +`  2. Remove or rename the upstream branch (change the package to native)`\ +`See `[`https://source.tizen.org/documentation/reference/git-build-system/upstream-package`](https://source.tizen.org/documentation/reference/git-build-system/upstream-package)` for more details.`\ +`source_service:error: GBS export failed: `<gbs>`Failed to export packaging files from git tree` + +caused by upstream branch in git source tree can be fixes by applying +patch to *obs\_service\_gbs*. In file *command.py* in string containing +*no\_patch\_export* change *None* to *1*: + +`...`\ +`'source_rpm': None,`\ +*`'no_patch_export':`` ``1,`*\ +`'upstream_branch': None,`\ +`...` + +Then rebuild and install *obs\_service\_gbs* (step [\#Installing +prerequisites](#Installing_prerequisites "wikilink")) + +Configuring ssh +--------------- + +Errors, caused by ssh: + +`source_service:error: RepoCache: Failed to fetch from remote: Error running git fetch: ssh: connect to host review.tizen.org port 22: Connection timed out`\ +`fatal: Could not read from remote repository.`\ +\ +`Please make sure you have the correct access rights`\ +`and the repository exists.` + +or + +`source_service:error: RepoCache: Failed to fetch from remote: Error running git fetch: Permission denied (publickey).`\ +`fatal: Could not read from remote repository.`\ +\ +`Please make sure you have the correct access rights`\ +`and the repository exists.` + +can be fixed by changing /etc/ssh/ssh\_config file. Add following lines +before **Host \***: + +`Host review.tizen.org`\ +` IdentityFile /path/to/your/ssh/key`\ +` Port 29418`\ +` User $username` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_cmake.md b/docs/platform/tool/OSDev_cmake.md new file mode 100644 index 0000000000..392133fde7 --- /dev/null +++ b/docs/platform/tool/OSDev_cmake.md @@ -0,0 +1,28 @@ +CMake has been updated in Tizen 5 to +[3.9](https://cmake.org/cmake/help/v3.9/) (previous: 2.8.x), and some +policies were updated. + +If your CMake-based application build fails for Tizen 5.5 please check +build log for CMake warning messages. It\'s better to rewrite script for +new version of CMake, but as a temporary solution you might try to use + +`CMAKE_POLICY(SET CMPXXXX OLD)` + +Where XXXX is policy number and restore old behavior. This is not very +reliable, but might work. + +Most interesting policies with behavior changes +----------------------------------------------- + +- [CMP0046](https://cmake.org/cmake/help/v3.0/policy/CMP0046.html): + Error on non-existent dependency in add\_dependencies. This may + break code with non-existent dependencies. +- [CMP0053](https://cmake.org/cmake/help/v3.1/policy/CMP0053.html): + Simplify variable reference and escape sequence evaluation. This may + break existing code with variables (e.g. some dependency-tracking + scripts) +- [CMP0054](https://cmake.org/cmake/help/v3.1/policy/CMP0053.html): + Only interpret if() arguments as variables or keywords when + unquoted. This may break some old-style if() blocks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/OSDev_qemu-accel.md b/docs/platform/tool/OSDev_qemu-accel.md new file mode 100644 index 0000000000..cd15886505 --- /dev/null +++ b/docs/platform/tool/OSDev_qemu-accel.md @@ -0,0 +1,183 @@ +qemu-accel +---------- + +`qemu-accel` is a build-acceleration system used in Tizen. + +Reason +------ + +Tizen is built for many platforms, including non-x86 `armv7l` and +`aarch64` ones, but still OBS servers and most of developers\' +workstations and `x86_64`, so appropriate `qemu-user` is used to execute +binaries in buildroots. + +But running all the build under `qemu-user` is not reasonable since +it\'s an interpreter and gives huge performance overhead. To reduce the +overhead the cross-compiler and build tools are used. + +Implementation +-------------- + +The straightforward solution to implement this approach is to replace +native binaries in buildroot with `x86_64` cross-tools, this approach +has been used in early versions of Tizen (lots of `*-x86-arm` packages), +but it causes a mix of libraries in buildroot, requires lots of efforts +for maintenance and improvement. + +Existing `qemu-accel` approach is based on Linux Kernel Support for +miscellaneous Binary Formats +[1](https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html): +the cross-toolchain, tools, and libraries they depend on, are placed +into special `/emul` directory and patched using `patchelf` tool to +support new location, and additional wrapper tool is registered as a +binary format interpreter for Tizen architectures. + +The entry point is an interpreter binary named `qemu-binfmt`, which +checks if there is a replacement for executed binary tool in `/emul` and +runs it instead of native tool in that case. + +If you have any issues with acceleration system you can just remove the +`/emul` directory from buildroot and all the tools will be executed in +native mode. + +### Sample workflow + +Suppose user runs compiler binary: + +`/home/abuild $ /usr/bin/gcc test.c` + +Kernel checks what the `/usr/bin/gcc` is, founds that it\'s an `armv7l` +binary and looks though the registered interpreters. Since +`qemu-arm-binfmt` is registered as interpreter, the following command is +executed: + +`/usr/bin/qemu-arm-binfmt /usr/bin/gcc test.c` + +The interpreter checks `/emul` and founds that there is +`/emul/usr/bin/gcc` there, so command evaluates to + +`/emul/usr/bin/gcc test.c` + +Now suppose the binary executed is not supported by `qemu-accel`: + +`/home/abuild $ ./configure . . .`\ +`/home/abuild $ # Script compiles and runs test`\ +`/home/abuild $ gcc conftest.c -o conftest && ./conftest` + +The `qemu-arm-binfmt` can\'t find the `conftest` binary in `/emul` +therefore it evaluates into + +`/usr/bin/qemu-arm /home/abuild/conftest` + +and the binary is executed in interpreted mode. + +### Supported tools + +List of accelerated binaries can be found in `qemu-accel` git at +review.tizen.org +[2](https://review.tizen.org/gerrit/gitweb?p=platform/upstream/qemu-accel.git;a=blob;f=packaging/qemu-accel.spec.in;hb=refs/heads/tizen_base#l126) + +Currently the whole toolchain is accelerated, most of `coreutils` (ls, +mv, cat, and so on), tools which are widely used in build (compressors, +script interpreters) and package management tools (rpm with +dependencies). + +Clang and Python acceleration are supported as well, but placed in +separate packages (`clang-accel` and `python-accel` respectively) to +reduce size of `qemu-accel` which is installed into every buildroot. If +your application uses `clang` compiler or runs heavy scripts in python +(some build systems, like gyp and SCons, use it), you might consider +adding corresponding section to your `.spec`: + +`# Accelerate python`\ +`%ifarch armv7l`\ +`BuildRequires: python-accel-armv7l-cross-arm`\ +`%endif # arm7l`\ +`%ifarch aarch64`\ +`BuildRequires: python-accel-aarch64-cross-aarch64`\ +`%endif # aarch64` + +for python, or + +`# Accelerate clang`\ +`%ifarch armv7l`\ +`BuildRequires: clang-accel-armv7l-cross-arm`\ +`%endif # arm7l`\ +`%ifarch aarch64`\ +`BuildRequires: clang-accel-aarch64-cross-aarch64`\ +`%endif # aarch64` + +for Clang compiler. + +Troubleshooting +--------------- + +Unfortunately, some OSes use binary format interpreters for own purposes +which leads to interpreters registered by default which conflict with +Tizen `qemu-binfmt` and lead to errors. + +*Example error 1*: + +`[ 131s] configure: error: C compiler cannot create executables`\ +`[ 451s] /usr/lib/gcc/armv7l-tizen-linux-gnueabi/6.2.1/../../../../armv7l-tizen-linux-gnueabi/bin/ld:`\ +`[ 451s] /usr/lib/gcc/armv7l-tizen-linux-gnueabi/6.2.1/liblto_plugin.so: error`\ +`[ 451s] loading plugin:`\ +`[ 451s] /usr/lib/gcc/armv7l-tizen-linux-gnueabi/6.2.1/liblto_plugin.so: wrong ELF`\ +`[ 451s] class: ELFCLASS64` + +*Example error 2*: \[ 149s\] meson.build:1:0: ERROR: Unable to determine +dynamic linker. + +*Root cause*: `qemu-arm` was registered by OS instead of `qemu-binfmt`, +the native `armv7l` binary of GCC has been executed, but found the LTO +plugin prepared for `x86_64` compiler and failed. + +*Solution*: switch a default handlers off. + +### Switching off default binfmt\_misc handlers + +#### For newbie + +Just reboot, If you are a newbie on Ubuntu distribution If you reboot +your Ubuntu machine, This issue will be automatically fixed because the +/proc/sys/fs/binfmt\_misc/\* files are re-initialized whenever rebooting +the Ubuntu machine. + +#### For developers + +**Method 1:** If you are using Ubuntu 18.04, Please run the below +statements. + +`sudo /usr/sbin/update-binfmts --disable`\ +`sudo systemctl disable binfmt-support.service` + +**Method 2:** Or, you can fix the issue by manipulating the +**/proc/sys/fs/binfmt\_misc/qemu-arm** manually. + +Currently registered handlers can be seen using the following command: + +`ls /proc/sys/fs/binfmt_misc/` + +the right output should only show 5 files: + +`arch64 arm armeb register status` + +If your output shows more than it, you have to unregister the wrong +handlers by echoing value -1 to the control files. + +For example, The below command unregisters the `qemu-arm` interpreter. + +`/home/user $ echo -1 | sudo tee /proc/sys/fs/binfmt_misc/qemu-arm ` + +**Method 3:** Let\'s remove all bin-fmt files. Since the below statement +removes all files, the GBS command sets up an interpreter again while +establishing a build stage with QEMU. + +`find /proc/sys/fs/binfmt_misc/ -not -name status -not -name register -type f -exec sh -c "echo -1 | sudo tee {}" \;` + +And, In case that you build multiple packages all together, you need to +specify \"-name qemu-\*\" + +`find /proc/sys/fs/binfmt_misc/ -name qemu-* -type f -exec sh -c "echo -1 | sudo tee {}" \;` + +[Category:Platform](Category:Platform "wikilink") diff --git a/docs/platform/tool/Original-mic-appliance-doc.md b/docs/platform/tool/Original-mic-appliance-doc.md new file mode 100644 index 0000000000..f1d8b36252 --- /dev/null +++ b/docs/platform/tool/Original-mic-appliance-doc.md @@ -0,0 +1,192 @@ +Overview +-------- + +[MIC](MIC "wikilink") appliance is a preconfigured KVM image, which runs +mic on the boot. This document describes configuration and deployment of +the appliance. + +Creation +-------- + +### root password is \'appliance\' + +### 1. Qemu snapshot mode + +### 2. Input and output. + +To provide .ks file to the appliance and to get images out of it Plan9 +network share is used. Note, that both host and guest kernels should +have Plan9 file system support. + +On the host side local directory ./mic is shared to the appliance by +providing -virtfs +local,id=test\_dev,path=mic,security\_model=mapped,mount\_tag=share +command line parameters to qemu. Inside appliance this share is mounted +to /media on boot by adding this line to /etc/fstab: + + share /media 9p rw,relatime,dirsync,trans=virtio,version=9p2000.L,posixacl,cache=loose 0 0 + +(JF: currently, this line has been commented out in working appliance) + +See \"Qemu wiki\":<http://wiki.qemu.org/Documentation/9psetup> for more +details about Plan9 folder sharing. + +### 3. Mic startup file + +cat /etc/init.d/mic + + + $ cat /etc/init.d/mic + + #!/bin/sh + ### BEGIN INIT INFO + # Provides: mic + # Required-Start: $network $syslog + # Required-Stop: $network $syslog + # Default-Start: 3 5 + # Default-Stop: 0 1 2 6 + # Description: Image creator service + ### END INIT INFO + + echo + echo '========= Mic appliance =========' + + mount -t 9p -o trans=virtio share /media -oversion=9p2000.L + if [ -f /media/out/*.ks ] ; then + ks=`ls /media/out/*.ks | head -1` + ks=`basename $ks` + log=`echo $ks | sed 's/\.ks$/.log/'` + echo "Found $ks. Running mic" + cat /media/out/$ks + echo + mv /media/out/$ks /media/ + extra=`cat /media/out/command 2>/dev/null;:` + rm -rf /media/{out,cache,tmp} + mkdir /media/{out,cache,tmp} + cp /media/$ks /media/out/$ks + time mic cr auto $extra /media/out/$ks && echo 'success' > /media/status + echo s > /proc/sysrq-trigger + echo u > /proc/sysrq-trigger + echo o > /proc/sysrq-trigger + else + echo '.ks file not found. Nothing to do for mic' + fi + umount /media + exit 0 + +Added iptables rules into mic appliance to redirect download.tizen.org +-\> download.vlan200.tizen.org for mic to be able to build images: + +added /etc/sysconfig/network/if-up.d/iptables script + + #! /bin/sh + iptables-restore < /etc/iptables.rules + exit 0 + chmod +x /etc/sysconfig/network/if-up.d/iptables + +Added rule to /etc/iptables.rules: + + # redirect download.tizen.org -> download.vlan200.tizen.org + *nat + -A OUTPUT -d 198.145.20.32/32 -p tcp -m multiport --dports 80,443 -j DNAT --to-destination 10.0.200.29 + COMMIT + +Booting +------- + +ssh worker sudo su - jenkins qemu-system-x86\_64 -machine +accel=kvm:xen:tcg -name opensuse -M pc -m 8096 -smp 2 -vga none -drive +file=mic-appliance -nographic + +Upgrading the mic-appliance +--------------------------- + +After booting the mic-appliance: + +### 1. Login the mic-appliance by the root user and the password is appliance . + +### 2. Upgrade the mic + + $ zypper mr -d repo-oss repo-update + Update baseurl of tools.repo to "http://download.tizen.org/tools/archive/$archive_id" + $ zypper refresh + $ zypper up mic + $ zypper up mic-native + $ zypper mr -e repo-oss repo-update + +### 3.If you can\'t upgrade the mic because of the proxy , you can do like this: + + export http_proxy = HOSTNAME + export https_proxy = HOSTNAME + +Deployment on tizen.org infrastructure +-------------------------------------- + +- reconfigure appliance on some worker, by booting/changing/shutting + it down. Note, that snapshot mode should be turned off +- tar -jcSvf mic-appliance.tar.bz2 mic-appliance +- copy it to master: + +<!-- --> + + $ ssh robot + robot:~> sudo bash + cd /var/lib/jenkins/imager-setup + scp -i ../.ssh/robot_tizen_workers_2013_11_25_SN001 jenkins@w09.vlan200.tizen.org:/var/lib/jenkins/mic-appliance.tar.bz2 . + +- propagate to the rest of workers by checking \'deploy on save now\' + checkbox in \'Slave setups\' configuration on + <https://build.tizen.org/robot/configure> and clicking \'Save\' + button. Note, that this operation is heavy and time consuming as it + requires transfer of quite big tarball to 17 workers and unpack it + there. It takes about 15 minutes and browser reported 504 Server + Error couple of times. This is harmless and should be ignored. +- test image creation by building image-creator job: + <https://build.tizen.org/robot/job/image-creator/build?delay=0sec> + +Resizing appliance +------------------ + +Mic is very disk-space consuming piece of software and Tizen images are +growing in size. For these reasons sometimes appliance images should be +resized. Here is how to do that: + +- resize image: truncate \--size 10G mic-appliance +- create loop device with it: losetup /dev/loop0 ./mic-appliance +- re-create root partition with new size: + +<!-- --> + + parted /dev/loop0 + (parted) unit kb + (parted) print + Model: Loopback device (loopback) + Disk /dev/loop0: 10737418kB + Sector size (logical/physical): 512B/512B + Partition Table: msdos + + Number Start End Size Type File system Flags + 1 1049kB 534774kB 533725kB primary linux-swap(v1) type=83 + 2 534774kB 6442451kB 5907677kB primary ext4 boot, type=83 + (parted) rm 2 + (parted) mkpart primary 534774 10737418 + (parted) toggle 2 boot + (parted) p + Model: Loopback device (loopback) + Disk /dev/loop0: 10.7GB + Sector size (logical/physical): 512B/512B + Partition Table: msdos + + Number Start End Size Type File system Flags + 1 1049kB 535MB 534MB primary linux-swap(v1) type=83 + 2 535MB 10.7GB 10.2GB primary ext4 boot, type=83 + + (parted) q + +- populate partitions through device mapper using kpartx: kpartx -a -v + /dev/loop0 +- check file system on new partition: e2fsck -f /dev/mapper/loop0p2 +- resize file system: resize2fs /dev/mapper/loop0p2 +- detach image from loop: losetup -d /dev/loop0 + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Overview.md b/docs/platform/tool/Overview.md new file mode 100644 index 0000000000..a0bcf72e7f --- /dev/null +++ b/docs/platform/tool/Overview.md @@ -0,0 +1,5 @@ +Main Tizen tools are : + +- [GBS](GBS "wikilink") : Developer build system +- [MIC](MIC "wikilink") : Image creation +- [OBS](OBS "wikilink") : Integrator build system diff --git a/docs/platform/tool/Package-version.md b/docs/platform/tool/Package-version.md new file mode 100644 index 0000000000..6ddc3fdd8f --- /dev/null +++ b/docs/platform/tool/Package-version.md @@ -0,0 +1,133 @@ +Package versioning +------------------ + +Purpose of this page is to collect versioning practices, used in +different projects and come up with equal package versioning policy. +After that policy should be put into +[Development\_and\_release\_process](Jenkins-development-workflow-ppt "wikilink") +and become a requirement for all our projects. + +### git-buildpackage, xdelta, pristine-tar + +RPM packaging + +Currently, the upstream version number is used directly and OBS handles +setting the Release tag. + +This has a clear drawback: the package version numbers are not in sync +between Tools:Devel, Tools:Pre-release and Tools projects in OBS. + +Debian packaging + +The packages are changed to \"non-native\" by changing the version +number in debian/changelog - i.e. appending a \"revision\" field to the +version number. + +E.g. if the original entry from upstream has \"git-buildpackage (0.6.6) +unstable; urgency=low\", this will be first in devel branch changed to +something like: + +` git-buildpackage (0.6.6-tizen20131107) UNRELEASED; urgency=low` + +Then, before doing a release the changelog is updated (along with the +version number) to something like: + +` git-buildpackage (0.6.6-tizen20131127) unstable; urgency=low` + +### mic, gbs, depanneur + +RPM packaging + +- version bump rules + +<!-- --> + +- rc release + +`   Version:        0.19`\ +`   Release:        0.rc1.`<CI_CNT>`.`<B_CNT> + +- official release + +`   Version:        0.19`\ +`   Release:        1` + +Debian packaging + +- rc release + +`   gbs(0.19~rc1) UNRELEASED; urgency=low` + +Note: We need use \'\~\' instead of \'-\' during rc release, because +gbp-service will consider \'-\' as an none native package during +packaging to OBS. MIC and GBS need follow this rule. + +- official release + +`   gbs(0.19) stable; urgency=low` + +### Services project. jenkins-\[scripts, jobs, plugins\] packages + +Note, that this project doesn\'t use Debian packages as OpenSUSE is the +only target distro at the moment. + +RPM versions + +Devel branch: +------------- + +Version in devel branch is <version>-0.dev.<CI_CNT>.<B_CNT> for OpenSUSE +and <version>-0.dev for the rest of rpm distros Here is what we have in +the spec to achieve this: + +` Version:        0.15`\ +` %if 0%{?opensuse_bs}`\ +` Release:        0.dev.`<CI_CNT>`.`<B_CNT>\ +` %else`\ +` Release:        0`\ +` %endif` + +release- branches +----------------- + +Version in release branches is <version>-1.<CI_CNT>.<B_CNT> for OpenSUSE +and <version>-1 for the rest of rpm distros Here is what we have in the +spec to achieve this: Version: 0.14 + +` %if 0%{?opensuse_bs}`\ +` Release:        1.`<CI_CNT>`.`<B_CNT>\ +` %else`\ +` Release:        1`\ +` %endif` + +Workflow + +`1.Version is set to `<version>`-0.dev.`<CI_CNT>`.`<B_CNT>` in devel`\ +`2.release-`<number>` branch is created when code in devel is feature complete and ready for the release or work for the next release is about to start in devel.`\ +`3.Immediately after release branch is created`\ +`  1.Version in devel is incremented to <version+1>-0.dev.`<CI_CNT>`.`<B_CNT>\ +`  2.Version in release branch is changed to `<version>`-1.`<CI_CNT>`.`<B_CNT>`, so it's always higher than `<version>`-0.dev.`<CI_CNT>`.`<B_CNT>\ +`4.Bugfix releases go to the same release branch. Bugfix number is added to the version, for example version 1.2-1.`<CI_CNT>`.`<B_CNT>` becomes 1.2.1-1.`<CI_CNT>`.`<B_CNT>` for the first bugfix release, 1.2.2-1.`<CI_CNT>`.`<B_CNT>` for the second bugfix release and so on.`\ +`5.When release is done it's tagged and master branch reseted to the tag, so master branch always points to the latest released code` + +OBS source services: obs-service-git-buildpackage, obs-service-gbs + +NOTE! these projects are only built for openSUSE. + +The Release tag is dependent on the release status. From spec file, in +development phase: + +` # Set to 0 if "normal release" `\ +` %define pre_release 0pre1`\ +` Version:        0.4`\ +` %if 0%{?opensuse_bs} && "%{pre_release}" != "0" `\ +` Release:        %{pre_release}.`<CI_CNT>`.`<B_CNT>\ +` %else`\ +` Release:        %{pre_release}`\ +` %endif` + +When doing a release %pre\_release is changed from 0preX to 0. Thus, the +package (full) version is changed from e.g. 0.4-0pre1.3.2 to 0.4-4.1 +when building in OBS + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Package_Dependency_of_Gbs.md b/docs/platform/tool/Package_Dependency_of_Gbs.md new file mode 100644 index 0000000000..569b3c2556 --- /dev/null +++ b/docs/platform/tool/Package_Dependency_of_Gbs.md @@ -0,0 +1,196 @@ +Introduction +------------ + +This document provides information about the package dependency of GBS, +including the following: + +- How many packages related for [GBS](GBS "wikilink")? +- What\'s the dependency of them? +- Which packages are developed by us, and which are from upstream? + +Packages Related For GBS +------------------------ + +This section describes the packages related for GBS, including the +following: + +- How to find the packages related for GBS? +- Package list for GBS + +### How To Find The Packages Related For GBS + +The automated testing for installing and upgrading GBS is performed +regularly in Jenkins, the packages related for GBS can be found in the +test result. + +Take Ubuntu\_13.10-x86\_64 system for example. To find the packages +related, refer to \`HTML Report\`\_. + +### Package List For GBS + +Open the HTML report in Jenkins. Find the dependency table. The packages +related for GBS is shown. + +A package list example for Ubuntu\_13.10-x86\_64 system is shown below. + +`+--------------+--------------------------------------+`\ +`|Package Number|Package Name                          |`\ +`+==============+======================================+`\ +`|     1        | gbs                                  |`\ +`+--------------+--------------------------------------+`\ +`|     2        | depanneur                            |`\ +`+--------------+--------------------------------------+`\ +`|     3        | git-buildpackage                     |`\ +`+--------------+--------------------------------------+`\ +`|     4        | build                                |`\ +`+--------------+--------------------------------------+`\ +`|     5        | qemu-arm-static                      |`\ +`+--------------+--------------------------------------+`\ +`|     6        | osc                                  |`\ +`+--------------+--------------------------------------+`\ +`|     7        | createrepo                           |`\ +`+--------------+--------------------------------------+`\ +`|     8        | pristine-tar                         |`\ +`+--------------+--------------------------------------+`\ +`|     9        | librpm-tizen                         |`\ +`+--------------+--------------------------------------+`\ +`|    10        | deltarpm                             |`\ +`+--------------+--------------------------------------+`\ +`|    11        | pbzip2                               |`\ +`+--------------+--------------------------------------+`\ +`|    12        | libcrypt-ssleay-perl                 |`\ +`+--------------+--------------------------------------+` + +Packages Dependency Of GBS +-------------------------- + +This section describes packages dependency of GBS, including the +follwing: + +- How to check the dependency of the packages? +- How to analyze the provide information? +- How many types of packages dependency? +- Packages dependency of GBS. + +### How To Check The Dependency Of The Packages + +The following two methods can be used to check the packages dependency. + +1\. To check the dependency of the packages, packaging technical should +be used. In debian based system, use command 'dpkg -s \< package name \> +In RPM based system, use command 'rpm -q --requires \< package name \>'. + +`  An example is shown below:`\ +`       $ dpkg -s gbs`\ +`       Depends: python (>= 2.6), python-support (>= 0.90.0), python-pycurl,`\ +`       sudo, osc (>= 0.139.0), git-buildpackage-rpm (>= 0.6.8`\ +`       -tizen20140521), gbs-api (= 0.22), gbs-export (= 0.22), gbs-`\ +`       remotebuild (= 0.22), depanneur (>= 0.13)` + +2\. Download the projects related GBS, find the dependency in the SPEC +file for RPM based system or in the CONTROL file for debian based +system. + +`  An example for RPM based system is shown below:`\ +`      $ git clone `<Project_Path>\ +`      $ vi `<Project_Name>`/packaging/project_name.spec` + +`  An example for debian based system is shown below:`\ +`       $ git clone `<Project_Path>\ +`       $ vi `<Project_Name>`/debian/control` + +Between the two methods, we recommend Method 2. + +### How To Analyze The Provide Information + +An example about \`build\` package for RPM based system is shown below. + +`   $ cat build/packaging/build.spec`\ +`   Name:           build`\ +`   Requires:       bash`\ +`   Requires:       perl`\ +`   Requires:       binutils`\ +`   Requires:       tar`\ +`   Requires:       perl(LWP::Protocol::https)`\ +`   Requires:       perl(LWP::UserAgent)`\ +`   Requires:       perl(Crypt::SSLeay)`\ +`   Requires:       perl(XML::Parser)`\ +`   Requires:       perl(Archive::Tar)`\ +`   Requires:       tizen-qemu-arm-static >= 2013.12.12`\ +`   Requires:       perl-Crypt-SSLeay >= 0.64-tizen20130308`\ +`   %if 0%{?fedora_version} || 0%{?suse_version} == 1220`\ +`   || 0%{?centos_version}`\ +`   Requires:       rpm-build`\ +`   %endif`\ +`   Requires:       rpm`\ +`   %if 0%{?suse_version} > 1120 || ! 0%{?suse_version}`\ +`   %package mkbaselibs`\ +`   %package mkdrpms`\ +`   %package initvm-%{initvm_arch}`\ +`   Requires:       build`\ +`   Provides:       tizen-build-initvm-%{initvm_arch} = 20140612` + +In the spec file above, the \`Requires\` information shows which +packages are required by \`build\` package. + +Pay attention to the \`%package\` information. All these information +shows the sub-packages provided by \`build\` package. + +### How Many Types Of Packages Dependency + +An example about \`depanneur\` package for debian based system is shown +below: + +`  $ cat depanneur/debian/control`\ +`    Depends: ${perl:Depends},`\ +`    build (>= 2013.11.12-tizen20140227),`\ +`    libyaml-perl,`\ +`    createrepo (>= 0.9.8),`\ +`    libjson-perl,`\ +`    libhtml-template-perl` + +There are three types of packages dependency above. + +- Packages \`libyaml-perl\`, \`libjson-perl\` and + \`libhtml-template-perl\`, whose names are shown as only + \`package-name\`. + +` The first type of package can be ignore when analyzing package dependency, as these packages are often stable and not require special versions.` + +- Package \`createrepo (\>= 0.9.8)\`, whose names are shown as + \`package-name\` + \`package-version\`. + +` The second type of package should pay attention to its version, as the special version is required.` + +- Package \`build (\>= 2013.11.12-tizen20140227)\`, whose names are + shown as \`package-name\` + \`package-version\` + \`tizen-version\`. + +` Great importance should be attached to the last type of packages. `\ +` These packages often have been development by us or added new features for Tizen. `\ +` The special based package version and the special tizen version are required.` + +### Packages Dependency Of GBS + +- Packages dependency of GBS build. + +` `![` ``600px`](Packages-Dependency-Of-GBS-Build.png "fig: 600px") + +- Packages dependency of GBS remote build. + +` `![` ``600px`](Packages-Dependency-Of-GBS-Remotebuild.png "fig: 600px") + +- Packages dependency of GBS export. + +` `![` ``600px`](Packages-Dependency-Of-GBS-Export.png "fig: 600px") + +The Ddependency Graph +--------------------- + +This section shows a single graph of packages dependency of GBS. In the +graph, green blocks show the packages developed by us red blocks show +the packages not developed by us, and other white blocks show packages +not developed but modified by us from upstream. + +` `![` ``600px`](Packages-Dependency-Of-GBS.png "fig: 600px") + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Package_Dependency_of_MIC.md b/docs/platform/tool/Package_Dependency_of_MIC.md new file mode 100644 index 0000000000..ca9c0222fb --- /dev/null +++ b/docs/platform/tool/Package_Dependency_of_MIC.md @@ -0,0 +1,154 @@ +Introduction +------------ + +This document provides information about package dependency of +[MIC](MIC "wikilink"), including the following: + +- Packages related MIC +- Package dependency of MIC +- The dependency graph + +Packages Related MIC +-------------------- + +This section provides information about packages related MIC. + +### Package List Table + + No. Package + ----- ------------------- + 1. mic + 2. mic-native + 3. libzypp + 4. qemu-arm-static + 5. qemu-user-static + 6. satsolver-tools + 7. python-zypp + 8. python-zypp-tizen + 9. isomd5sum + 10. syslinux + +Table 1 Package List of MIC + +### Package Relationships + +1\. Packages related \`mic\` + +`   ::` + +`       $ dpkg -s mic` + +`         Package: mic`\ +`         Depends: python, python-support (>= 0.90.0), rpm, python-rpm, python-urlgrabber, cpio, bzip2, gzip` + +2\. Packages related \`mic-native\` + +`   ::` + +`       $ dpkg -s mic-native` + +`         Package: mic-native`\ +`         Source: mic`\ +`         Depends: python, util-linux, coreutils, psmisc, e2fsprogs (>= 1.41), dosfstools, isomd5sum, genisoimage, dmsetup, kpartx, parted, squashfs-tools (>= 4.0), yum (>= 3.2), syslinux (>= 2:4.05), extlinux (>= 2:4.05), python-zypp-tizen, python-m2crypto, mic`\ +`         Recommends: qemu-arm-static | qemu-user-static, binfmt-support, btrfs-tools, udisks | hal` + +3\. Packages related \`python-zypp-tizen\` + +`   ::` + +`       $ dpkg -s python-zypp-tizen` + +`         Package: python-zypp-tizen`\ +`         Source: libzypp-bindings`\ +`         Replaces: python-zypp`\ +`         Depends: libzypp` + +4\. Packages related \`libzypp\` + +`   ::` + +`       $ dpkg -s libzypp` + +`         Package: libzypp`\ +`         Provides: tizen-libzypp-20131212`\ +`         Depends: satsolver-tools (>= 0.17.0), uuid-runtime, e2fsprogs, gnupg2, libcurl3, librpm0 | librpm1 | librpm2 | librpm3` + +5\. Packages related \`satsolver-tools\` + +`   ::` + +`       $ dpkg -s satsolver-tools` + +`         Package: satsolver-tools`\ +`         Source: satsolver`\ +`         Depends: gzip, bzip2, coreutils` + +6\. Packages related \`qemu-arm-static\` + +`   ::` + +`       $ dpkg -s qemu-arm-static` + +`         Package: qemu-arm-static`\ +`         Replaces: qemu-user-static`\ +`         Provides: tizen-qemu-arm-static-2013.12.12`\ +`         Depends: bzip2, uuid-dev, zlib1g-dev, zlib1g, texi2html, libc6` + +7\. Package related \`isomu5sum\` + +`   ::` + +`       $ dpkg -s isomu5sum` + +`         Package: isomd5sum`\ +`         Depends: libc6 (>= 2.14), libpopt0 (>= 1.14)` + +8\. Package related \`syslinux\` + +`   ::` + +`       $ dpkg -s syslinux` + +`         Package: syslinux`\ +`         Replaces: syslinux-common`\ +`         Depends: libc6 (>= 2.8), libuuid1 (>= 2.16), syslinux-common (=3:4.05+dfsg-6+deb8u1)`\ +`         Recommends: mtools`\ +`         Suggests: dosfstools, os-prober`\ +`         Breaks: syslinux-common (<< 3:4.05+dfsg-6+deb8u1)` + +### Package Relationship Table + + No. Name Depends Gerrit + ----- ------------------- ------------------------------------------------------------------------------- ------------------------ + 1 mic-native mic, pyton-zypp-tizen, qemu-arm-static, qemu-user-static, isomd5sum, syslinux tools/mic + 2 mic tools/mic + 3 python-zypp-tizen libzypp tools/libzypp-bindings + 4 libzypp satsolver-tools tools/libzypp + 5 satsolver-tools tools/libsatsolver + 6 qemu-arm-static tools/qemu-arm-static + 7 isomd5sum tools/isomd5sum + 8 syslinux tools/syslinux + +Table 2 Package Relationship of MIC + +Note +---- + +- The packages mentioned above only refer to the packages which are + provided in the gerrit. +- \`python-zypp\` is replaced by \`python-zypp-tizen\`. +- \`qemu-user-static\` is replaced by \`qemu-arm-static\`. +- \`syslinux\` is a higher version on opensuse. For example, Opensuse + has +- \`syslinux 4.04\`, while Tools provide \`syslinux 4.05\`. +- \`isomd5sum\` is not available on opensuse, \`qemu-arm-static\` is + not on Fedora. +- \`libzypp\` and \`libzypp-bindings\` and \`libsatsolver\` is off + except Opensuse. + +The dependency graph +-------------------- + +<File:Package> Dependency of MIC.png\|Package Dependency of MIC + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Package_Maintenance_Guide.md b/docs/platform/tool/Package_Maintenance_Guide.md new file mode 100644 index 0000000000..6f88fd342d --- /dev/null +++ b/docs/platform/tool/Package_Maintenance_Guide.md @@ -0,0 +1,343 @@ +Maintaining Tools Packages in Git +--------------------------------- + +### General + +All Tizen Tools packages are to be maintained in Git (tizen.org), +utilizing the git-buildpackage tool. This provides, among other things: + +- proper version control / history tracking of all packages +- consistent packaging and maintenance model of all packages + +` easy to contribute to any package`\ +` Git and OBS are always kept in sync` + +- clear separation of upstream and Tizen changes (for non-native + packages) +- proper packaging of Deb packages, without hacks + +The OBS build infrastructure utilizes git-buildpackage +obs-source-service for exporting the packaging files automatically and +directly from Git. Mapping of Git branches to OBS projects is: + +- master -\> Tools +- devel -\> Tools:Devel +- release\* -\> Tools:Pre-release +- test-<BRANCH> -\> home:tester:Tools-<PACKAGE>-test-<BRANCH>, where + BRANCH is one of master, devel or release + +The difference to the current scheme is not radically different, except +for NO changes to packages (package sources) should be done directly in +OBS. All changes are made in Git. Jenkins monitors Git and updates the +package in OBS automatically when some references are changed. Also, +native and non-native packages should be maintained in different ways, +similarly to Tizen 3.0. + +### Converting packages to support git-buildpackage and obs-service-git-buildpackage + +Short summary for requirements: + +- Git repository in tizen.org Gerrit +- Jenkins job in tizen.org monitoring the corresponding Gerrit project + (either a per-package job or the default job configured to track the + repo) +- git-buildpackage configuration (.gbp.conf) for the package + +1\. Git repository + +If the package does not yet have one, ask Eduard Bartosh to create it. +The repository name should match the name of the upstream repository +(non-native) or package name (native). + +All tools packages should be under tools/ namespace in tizen.org Gerrit, +New git repositories should be created directly under tools/. We will +start moving existing repositories there soon. + +2\. Jenkins job + +2.1 3rd party and other \"simple\" packages There is now a default +jenkins job (Tools-Tester-Default) that is supposed to handle all +packages that do not need to track python unit test or coverage results. +That is especially all non-native (3rd party) packages in tiezn.org, +e.g. build, devscripts etc. For all of these packages the only +requirement is that the default job (Tools-Tester-Default) is configured +to monitor their Gerrit project. + +2.2 Individual per-package jobs Only needed if you want to track python +unit test and/or coverage results, or, for some other reason to easily +monitor the package build history in Jenkins. + +Basic Jenkins configuration is very easy, see the default job as an +example: JENKINS\_HOST/ci/job/Tools-Tester-Default/ + +In job configuration, you need to have at least: + +- Gerrit trigger -\> Dynamic trigger configuration configured + correctly. + +` you need to track the correct gerrit project, e.g. 'python-coverage'`\ +` you need to track all relevant branches (i.e. 'master', 'devel', 'release*' and 'test-*')` + +- Build -\> Execute shell configured for the package (package name and + git repo URL set correctly with \'-u\'), e.g.: + +` /usr/bin/otc-tools-tester-run-test-kvm.sh python-coverage Tools -u HOSTNAME/python-coverage.git` + +3\. Git and configuring git-buildpackage In order for git-buildpackage to +know how your package is maintained you need to create a .gbp.conf file +in the root directory of the source code tree. And, commit it into Git. + +Remember that you need to have separate Git branches for each OBS +project, i.e. devel, release and master branches. You can have multiple +release branches, but a change to any of those will be submitted to OBS +Tools:Pre-release project. + +3.1 Native packages This is very straightforward. You don\'t necessarily +need to change anything in the package. You only need to have one branch +(per OBS project) and necessarily no .gbp.conf. + +You need to remove all Makefile etc. hacks from packaging, though. All +packaging files need to be exportable directly from Git without running +any generation/mangling scripts. You can test exporting RPM packaging +simply by running: + +` $ git-buildpackage-rpm --git-ignore-branch --git-builder=osc --git-export-only --git-export-dir=`<export-dir> + +Examples of native packages: + +- tizen.org/obs-service-git-buildpackage + +3.2 Non-native packages Non-native packages must be maintained similarly +to non-native packages in Tizen-3.0. That is: + +- have separate upstream branch for upstream sources +- upstream tags for upstream releases +- patch-generation enabled + +` However, git-buildpackage is more flexible than gbs in supporting different maintenance models so you need to explicitly configure it for each package.` + +An example of .gbp.conf: + +` [DEFAULT]`\ +` # Set upstream tag format to v`<VERSION>\ +` upstream-tag = v%(version)s`\ +` # Enable patch generation`\ +` patch-export = True`\ +` # Don't generate patches out of changes to these files`\ +` patch-export-ignore-path = (.gbp.conf|.gbs.conf|packaging/.*|debian/.*|.gitignore)`\ +` # Directory for RPM packaging files`\ +` packaging-dir = packaging`\ +` # If there are multiple spec files and gbp cannot guess correctly`\ +` spec-file = packaging/mypackage.spec` + +You can test exporting the packaging files with git-buildpackage-rpm +similarly to native packages above. + +Examples of already converted packages: + +- HOSTNAME/devscripts (RPM-only) +- HOSTNAME/librpm-tizen (RPM + Debian) +- HOSTNAME/python-coverage (RPM-only) +- HOSTNAME/xdelta1 (RPM-only) + +3.3 Debian packaging The OBS source service will automatically export +debian packaging files, too, if it finds debian/ directory in the source +tree. It utilizes the git-buildpackage (the non-rpm variant) and +dpkg-source tools to generate the debian packaging files. Thus, you need +to have proper Debian packaging (under debian/) if you want to build +your package for Deb-based distributions, i.e. Ubuntu in our case. + +For non-native packages, you need to use the 1.0 Debian source package +format. For non-native Debian (1.0) packages no individual patches are +generated. Instead, a monolithic diff between the upstream tag and the +branch head is generated. + +NOTE!: You need to remove all debian packaging files from the (rpm) +packaging/ directory! E.g. packaging/my-pkg.dsc. This is needed in order +to not confuse OBS. + +NOTE-2!: You need to \"declare\" the package as non-native by having the +version field in debian/changelog following the format +<VERSION>-<REVISION>, e.g.: + +` git-buildpackage (0.6.3-tizen20130822) unstable; urgency=low` + +`   * Version bump to 0.6.3` + +You can test exporting the Debian sources with git-buildpackage with: + +` $ git-buildpackage --git-ignore-branch --git-no-hooks --git-export-dir=`<export-dir>` --git-purge --git-builder=dpkg-source -b .` + +3.4 Testing in OBS You can test your package by using the test-devel +branch. See that the package builds and tests pass by checking the +results from the tester Jenkins job. + +After you\'re satisfied, you can deploy the new packaging by just +pushing to the devel branch. Package in Tools:Devel will be +automatically updated (if Jenkins is correctly configured). + +Maintaining packages with git-buildpackage +------------------------------------------ + +### General + +This documentation contains some otctools specifics. The official +git-buildpackage documentation can be found here: + +- Debian tools: + <http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html> +- RPM tools: <http://marquiz.github.io/git-buildpackage-rpm/> + +### Building packages + +RPM: git-buildpackage-rpm Your package needs to be buildable with +git-buildpackage-rpm without virtually any command line options because +the source service is used (it calls git-buildpackage-rpm with basically +\--git-ignore-branch only). Thus, you just possibly need to do some +per-package configuration in .gbp.conf (e.g. upstream tag format, +packaging directory, pristine-tar on/off etc). After that building +locally is easy: + +` $ git-buildpackage-rpm --git-ignore-branch` + +By default, git-buildpackage-rpm refuses to build if you\'re not on the +main packaging/release branch (master by default), to avoid this you +need to use the \--git-ignore-branch option. You possibly want to set +this in your global config file (\~/.gbp.conf). Also, by default +git-buildpackage-rpm refuses to build if there are uncommitted changes - +see the \--ignore-new and \--ignore-untracked options. + +For more details on the multitude of options please try: + +` $ git-buildpackage-rpm --help` + +Deb: git-buildpackage Building the Debian package with git-buildpackage +is basically similar to git-buildpackage-rpm: you need to have correct +package-specific configuration. Of course, you probably need to run it +inside a Debian-based Linux distribution if you want to test building +binary packages. In an RPM-based distribution you should be able to test +building the Deb source package if you just have the Debian devscripts +installed: + +` $ git-buildpackage --git-ignore-branch --git-no-hooks --git-export-dir=../deb-build-area --git-purge --git-builder=dpkg-source -b .` + +### Maintaining changelog(s) + +Currently, there are separate tools for maintaining rpm and deb +changelogs. Hopefully, somewhere in the future, these could be combined +into one consolidated tool that would handle both at the same time. + +RPM: git-rpm-ch git-rpm-ch is designed for updating the rpm changelog. +It can handle both separate .changes file or update the changelog +directly in the .spec file, but, we\'re interested in the former option +only. Currently, it doesn\'t handle changelog files in the \"openSUSE +format\" that osc produces. + +git-rpm-ch tries to guess the range of commits which to include in the +new changelog section. You can use the \--since option to define the +exact start point. + +One useful option is \--changelog-revision which defines the revision +field in the changelog header. It is a python format string which may +have the following keys: + +- \"%(upstreamversion)s\" the upstream version (Version: tag from the + .spec file) +- \"%(release)s\" rpm release/patchlevel (Release: tag from the .spec + file) +- \"%(epoch)s\" rpm epoch (Epoch: tag from the .spec file) +- \"%(version)s\" the full rpm package version +- \"%(vendor)s\" the distribution vendor from gbp configuration +- \"%(tagname)s\" what git-describe gives you + +` Using "%(tagname)s" is very nice because it makes git-rpm-ch always guess correctly.` + +You can use the \--tag option to create release tags (a.k.a. packaging +tag in gbp terms). This will commit the changelog update (and all other +changes added to git index) and tag it. You can configure the packaging +tag format with \--packaging-tag. This is nice in because you will get +the correct tag name in the rpm changelog, too (assuming you use +\"\--changelog-revisio=%(tagname)s\"). If you need to re-tag (i.e. +overwrite the old tag because you changed something) later, you can use +git-buildpackage-rpm \--git-tag \--git-tag-only \--git-retag. + +gbp-rpm-ch also detects some meta-tags from the commit messages: + +- \"Gbp-Rpm-Ch: <command>\" -- available commands: + +`   "Ignore" ignore this commit from the changelog`\ +`   "Full" use the full commit message instead of the header only`\ +`   "Short" only use the header of this commit (for overriding the --full command line option)` + +- {Close\|Closes\|Fix\|Fixes}: <bts_reference> + +` automatically picks these bug-tracking-system references to the commit message` + +See \"git-rpm-ch \--help\" for more details about the multitude of +different options. + +Deb: git-dchgit-dch is fairly similar to git-rpm-ch. Many of its options +are tightly tied with the Debian debchange tool. Some notable +differences are to git-rpm-ch are: + +- you should use \'\--release\' when releasing a new version +- by default, git-dch only spawns an editor if you use \'\--release\' +- no \--tag option + +git-dch also detects some meta tags: \"Git-Dch: {Ignore\|Full\|Short}\" +\"Closes: <bts_reference>\" An example workflow for joint RPM-Deb +packaging + +` $ # Edit source code`\ +` ...`\ +` $ # Build and test locally`\ +` $ git-buildpackage-rpm`\ +` ...`\ +` $ # Update Debian changelog and stage the changes`\ +` $ git-dch --release --since=HEAD~10`\ +` $ git add debian/changelog`\ +` $ # Update RPM changelog, commit and tag in one go`\ +` $ git-rpm-ch --since=HEAD~10 --tag`\ +` $ # Push change for review/testing`\ +` $ # When merged, push the release tag, too` + +### Example config files + +\~/.gbp.conf (global configuration) + +` [DEFAULT]`\ +` # Don't fail if the current branch does not match the main packaging branch`\ +` ignore-branch = True` + +.gbp.conf (package-specific configuration) + +` [DEFAULT]`\ +` # Vendor/Distro name`\ +` vendor = Tizen`\ +` `\ +` # Upstream tag (use "real" upstream release tags directly)`\ +` upstream-tag = debian/%(version)s` + +` # Don't use pristine-tar`\ +` pristine-tar = False` + +` # Tag format for releases`\ +` packaging-tag = tizen/%(upstreamversion)s-%(nowtime)s` + +` # Subdir for RPM packaging data`\ +` packaging-dir = packaging` + +` # Auto-generate patches against upstream`\ +` patch-export = True` + +` # Don't generate patches from changes in packaging or gbp config`\ +` patch-export-ignore-path = (.gbp.conf|packaging/.*|debian/.*)` + +` [git-rpm-ch]`\ +` # Use a separate changelog file`\ +` changelog-file=CHANGES` + +` # Format for the revision field in RPM changelog`\ +` changelog-revision = %(tagname)s` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Platform_Development_Using_IDE.md b/docs/platform/tool/Platform_Development_Using_IDE.md new file mode 100644 index 0000000000..b3a159df28 --- /dev/null +++ b/docs/platform/tool/Platform_Development_Using_IDE.md @@ -0,0 +1,251 @@ +Tizen IDE +--------- + +<big>Tizen IDE</big> is released with all SDK versions. Platform +developers across the community can take advantage of using <big>Tizen +IDE</big> as complete tool for Platform Development. The following +method is for the Ubuntu Linux Version of Tizen IDE. Using <big>Tizen +IDE</big>, one can do following (but is not limited to): + +- Compile Platform Modules directly from Tizen IDE by selecting + appropriate architecture & rootstrap. +- Browse and clone all existing git repos using IDE. +- Update rootstrap automatically from IDE. +- Minimize usage of terminal window by enabling Platform Development + using IDE. +- Perform all git operations from IDE itself (add, merge, push, create + branch... and so on). +- Perform debugging of modules inside IDE after building and updating + rootstrap. + +At present, Tizen 2.2.1 version is the current version in public and can +be downloaded from +[<https://developer.tizen.org/downloads/tizen-sdk>](https://developer.tizen.org/downloads/tizen-sdk). + +Installation +------------ + +### Supported OS Versions + +Here are the excerpts from www.tizen.org regarding supported OS versions +for installing Tizen SDK. + +- Ubuntu® 12.04 or 12.10 (32- or 64-bit) +- Microsoft Windows® XP (32-bit) Service Pack 2 or later +- Microsoft Windows® 7 (32- or 64-bit) +- Apple Mac OS® X 10.7 Lion (64-bit) +- Apple Mac OS® X 10.8 Mountain Lion (64-bit) + +The following method explains the installation procedure in <big>Ubuntu® +12.04 LTS</big> version. The installation method should be the same in +other supported versions as well. + +### Prerequisites + +- Make sure all typical installations are in place. Refer to this + guide for details: + [developer-guide](https://source.tizen.org/documentation/developer-guide) +- Make sure latest GBS version is installed in the system. Otherwise + execute the following commands: + +: + + : `sudo apt-get update` + : `sudo apt-get install gbs` + +- Install the following two required packages using the commands + below: + +: + + : `sudo apt-get install ruby` + : `sudo apt-get install expect` + +### IDE Installation + +While installing IDE, in \"Configure\" tab, select \"Custom\" option, +then select: + +- Platform Development option & +- Platforms option + +Not all components inside \"Platforms\" option are selected by default. +Select the complete \"Platforms\" option for enabling IDE for platform +development. Once installed successfully, one new category "Tizen +Platform Project" appears in the project wizard. + +Configurations +-------------- + +### Network Configuration + +To enable git operation, you need to set proxy information, if the +working PC is behind the proxy server. To setup the proxy go to Window +Menu \>\> Preferences \>\> General \>\> Network Configuration. Select +\"Active Provider\" as Manual. Set the HTTP & HTTPS proxy. Do not enter +anything under <big>SOCKS</big>. By default it is selected, it should be +empty without any proxy information. + +### Site Configurations + +After setting up the network in IDE, you need to set the git server +information. To set git server information, go to Window Menu \>\> +Preferences \>\> Tizen SDK \>\> Platform \>\> Site Configurations. Click +\"Add\" and enter \"Name\". The field \"Git Base URI\" should be in the +form of `"`[`ssh://`](ssh://)<your-id>`@review.tizen.org:29418"`. The +\"Location\" field should be set with +`"`[`https://review.tizen.org/git/`](https://review.tizen.org/git/)`"`. +The \"Location\" field URI must point to the page where all git repo +information is kept on the server. Tizen IDE downloads the git repo list +into Tizen IDE for cloning. Press \"Ok\" and then click \"Update\" and +wait. In this step,all git repo information will populate into Tizen +IDE. + +All git repos available of configured server at \"File Menu \>\> New +\>\> Tizen Platform Project \>\> Git\" page. + +Creating a Project +------------------ + +### Cloning a Project + +Once the update is successful, go to New » Tizen Platform Project menu +option. If there is failure in the update, recheck Network Connection +and Site configurations. To develop "EFL Application" or to create \"New +Project\", click "Template". Otherwise, open the \"Git\" tab. Select a +project from the left pane. Give the project name, click \"Finish\". + +The selected project is cloned from git. Repeat this step to clone more +projects from git. + +### Changing the Snapshot Path + +Post installation, IDE needs to point correct snapshots as per +requirement. Select \"Tizen Platform\" perspective in IDE. Open Windows +» Show View » Rootstrap View, if \"Rootstrap View\" window is not +present. Right-click on any profile Emulator or Device in Rootstrap view +to highlight \"Manage Packages\". Snapshot information is kept in +\"Manage Packages\". Snapshot information can be edited and pointed to +correct snapshot. + +For <big>Tizen 3.0</big> (armv7l) development, new rootstrap can be +created using RD-PQ snapshot +[[`http://download.tizen.org/snapshots/tizen/rd-pq/latest/`](http://download.tizen.org/snapshots/tizen/rd-pq/latest/)](http://download.tizen.org/snapshots/tizen/rd-pq/latest/) +as follows. This is just one example. Any working snapshot can be used +for generating rootstrap. + +Click on the + (plus) sign on the right top of the Rootstrap View. Give +name of this RootStrap view Paste +[`http://download.tizen.org/snapshots/tizen/rd-pq/latest/`](http://download.tizen.org/snapshots/tizen/rd-pq/latest/) +in \"Snapshot URL\" text box and click \"Search\". It will automatically +fill the \"Architecture\" based on Snapshot URL. Select the \"Generate +Immediately\" check box and press OK. It will download packages and +create the rootstrap. + +### Package Manager + +In Package Manager, you can Add, Modify, Remove snapshot paths. Also, +other operations with packages like Refresh, Upgrade, Install, +Uninstall, etc., can be performed. In Package Manager, installed +versions of all packages, as well as new version available on the +server, are displayed in a table. + +### GBS Options Setting + +To set the required GBS options, go to \"Window Menu \>\> Preferences +\>\> C/C++ Build \>\> Tizen Settings\". Various GBS options can be +selected or removed, as per project need. + +### Git Operations + +To access the git operation menu, right-click on project and select +\"Team\". All git operations like Switch to (branch), Commit, Pull, +Merge, Push, etc., can be invoked from here. + +Branch name is appended to the package project name for easy +identification as follows: \>appfw \[appfw <big>tizen</big>\] To switch +to a different branch, right-click on Project -\> Team -\> Switch To -\> +New branch -\> Source ref: Select appropriate branch from the list. A +new branch can also be created from here. + +### Compilation + +Once the desired snapshot path is selected, the Package Manager can be +closed. To select the required rootstrap, right-click on it and +\"Select\". Alternatively, while selecting the \"Active Build +Configuration\" of a project, the appropriate rootstrap automatically +gets selected. If there are two or more rootstraps for a particular +architecture, the appropriate rootstrap needs to be selected by +right-clicking over it. + +To build a project, first right-click on the project in the Project +Explorer and select \"Active Build Configuration\". It will download all +the required packages from server & build after that. Then right-click +and select \"Build Project\". + +### Debugging + +There are inherent difference between debugging application and module. +Application debugging can be performed just by launching it in debug +mode. But for debugging module, first it needs to select source +application to start debugging. + +#### Steps to debug application in emulator environment + +1. Clone the required application in Tizen IDE and change to the + required branch. +2. Select the appropriate rootstrap from the \"RootStrap View\" window + for the emulator. +3. Build the project with proper Active Configuration. +4. Set the required breakpoints in the code. +5. Launch the application by right-clicking on the project and + selecting <big>Debug As \>\> Tizen Platform Project</big>. It will + open \"Launch Configuration\" window. Press \"Next\". +6. In this step it updates the rootstrap with the current compiled + version of application. +7. Click \"Remote Browse\" and select the appropriate binary of the + application under a remote bin directory. +8. It launches the application and changes IDE to \"Debug Perspective\" + for debugging. +9. Set breakpoint will be hit, if it is in the execution path. + +#### Steps to debug application in target environment + +The above steps can be performed to debug applications in Target +Environment, except: + +1. Select the device rootstrap. +2. Select the proper \"Active Build Configuration\" +3. Target should be connected to the PC, with the appropriate settings. + +#### Steps to debug a platform module in the emulator/target environment + +1. Clone a platform module and change to the appropriate branch. +2. Select the appropriate rootstrap from RootStrap View window for + emulator/target. +3. Build the project with the proper Active Configuration. +4. Set the required breakpoints in code. +5. For target debugging, make sure it is connected to the development + PC. +6. Launch by right-clicking on project select <big>Debug As \>\> Tizen + Platform Project</big>. It will open the \"Launch Configuration\" + window. +7. Select the proper \"Tizen Application Project\" from the drop-down + menu and press \"Next\". +8. The rootstrap updates with the current compiled version of the + module. +9. Click \"Remote Browse\" and select the appropriate binary of + application under remote bin directory, which actually use the + platform module. +10. This launches the application and changes IDE to \"Debug + Perspective\" for debugging. +11. Set the breakpoint to be hit, if it is in execution path or + otherwise traverse to the breakpoint. + +Tizen IDE is customized to enable all kinds of developments related to +Tizen. Using IDE, one can develop all kinds of supported applications, +as well as develop platform modules. To get more information, read the +official documentation at [Platform Development with the +IDE](https://developer.tizen.org/dev-guide/2.2.1/org.tizen.platform.development/html/platform_dev_process/platform_dev_process.htm) + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Porting_Guide.md b/docs/platform/tool/Porting_Guide.md new file mode 100644 index 0000000000..da08228b97 --- /dev/null +++ b/docs/platform/tool/Porting_Guide.md @@ -0,0 +1,50 @@ +Introduction +============ + +Tizen Architecture +================== + +Development Environment Setup +============================= + +To set up the Tizen OS development environment and to obtain information +regarding development, see [Setup your +environment](https://source.tizen.org/documentation/developer-guide/environment-setup) +and [Installing development +tools](https://source.tizen.org/documentation/developer-guide/installing-development-tools). + +Getting Source Code&Build +========================= + +Tizen Bootup Overview +===================== + +BSP Customization +================= + +Kernel Fundamentals +=================== + +System +====== + +Graphics and UI +=============== + +Multimedia +========== + +Connectivity +============ + +Location +======== + +Telephony +========= + +Application +=========== + +Appendix +======== diff --git a/docs/platform/tool/Porting_Guide_Development_Environment_Setup.md b/docs/platform/tool/Porting_Guide_Development_Environment_Setup.md new file mode 100644 index 0000000000..cf8e41932f --- /dev/null +++ b/docs/platform/tool/Porting_Guide_Development_Environment_Setup.md @@ -0,0 +1,115 @@ +This section provides a brief overview about setting up your development +environment on your host system, such as your Ubuntu\* system. The below +figure briefly describes the Tizen development environment setup. + +![](Sdk.png "Sdk.png") + +Follow the steps below to set up the development environment on your +Ubuntu system. + +Tizen OS Development Setup +-------------------------- + +Please refer to the following links to set up the Tizen OS Development +environment and to obtain infomation regarding development. + +<https://source.tizen.org/os-development> + +1. Work Flow + + : This section explains GIT/Gerrit based source code management + and review process, package creation using Open Build + Service(OBS), and code submission methods, including development + and upstream branches. + +2. Developer Guide + + : This section describes registration and information on a + development environment setup for GIT/Gerrit, SSH, GIT Build + system, Image creator, and install tools. It includes the code + and package submission using GIT and OBS buildsystem and the + complete development flow. + +3. Git Build System + + : The GBS(Git-Build-System) is a custom command line tool that + supports Tizen package development. This section explains about + auto-generating tarballs based on git repositories, performing + local and report builds, and OBS code submission. This section + also has procedure to monitor remote build log and status. + +4. MIC Image Creator + + : This tools is used to create images for Tizen. This section + provides detailed explainations of image creation, conversion + and chrooting into image procedure. + +As is explained in the above URLs, Tizen development requires Open(SuSE) +Build system and the required components. In the following sections, we +will briefly introduce various such build requirements. + +Introduction to OBS +------------------- + +The Open Build Service (OBS) is an open and complete distribution +development platform that provides a transparent infrastructure for +development of Linux distributions, used by openSUSE, MeeGo, and other +distributions. (Supporting also Fedora, Debian, Ubuntu, RedHat, and +other Linux distributions). OBS provides the developers an easy way of +using web-based and command based interface to achieve development +activities. OBS maintains a consistent build environment, which each +developer can rely on for various Linux distributions. For more +information on OBS, you can refer to this link: + +<https://build.tizen.org/> + +OBS can be set up locally or we can refer any available OBS services. +<http://doc.opensuse.org/products/draft/OBS/obs-best-practices_draft/cha.obs.best-practices.localsetup.html> +is one of the links that talks about setting up OBS server locally. To +make use of any available OBS servers, user credentials are required. +Each OBS implemetiation can have more customized tools to achieve the +build servies. You can find information on Tizen OBS and its customized +build tool, named git-build-System(GBS), in this link + +<https://source.tizen.org/os-development/git-build-system/> + +OBS Light +--------- + +OBS Light is an OBS base development process, but which is lighter to +use. It creates an encapsulation of OBS and presents a lighter face of +OBS. + +### OBS Light server Appliance + +This is a ready-to-use OBS for MeeGo and Tizen. openSUSE Build +Service(OBS) 2.3.0-1.6. The openSUSE Build Service appliance contains +the complete OBS stack, including a Worker, the Backend, API, Webclient, +and osc, the command line client. FakeOBS is an added utility, through +which we can achieve private OBS Builds. + +### OBS Light Client Appliance + +OBS Client Appliance consists of a command line (obslight) and a +graphical user interface GUI (obslightgui). OBS Client includes MIC to +create a bootable image. + +<http://en.opensuse.org/openSUSE:OBS_Light_Manual> +<http://en.opensuse.org/openSUSE:OBS_Light_Fakeobs> +<http://susestudio.com/a/e0uuBG/obs-obs-server-obs-light> +<http://en.opensuse.org/openSUSE:OBS_Light_Installation> + +Installation of SDK +------------------- + +The Tizen SDK is a comprehensive set of tools for developing Tizen web +applications. It consists of Web IDE, Emulator, tool chain, sample code, +and documentation. The beta release of the Tizen SDK runs on Windows\*, +as well as Ubuntu. Tizen Web applications may be developed without +relying on an official Tizen IDE, as long as the application complies +with Tizen packaging rules. Use the link below to download the Tizen +SDK. + +<https://developer.tizen.org/sdk> + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Porting_Guide_Getting_Source_Code&Build.md b/docs/platform/tool/Porting_Guide_Getting_Source_Code&Build.md new file mode 100644 index 0000000000..a349f7f37a --- /dev/null +++ b/docs/platform/tool/Porting_Guide_Getting_Source_Code&Build.md @@ -0,0 +1,126 @@ +Follow this guide to download the full source code for your Tizen +platform and kernel. + +- **git clone** + +1. Download the `xml` file and extract each <git_path>. +2. Clone each git project using the + `git clone `[`ssh://`](ssh://)<Username>`@review.tizen.org:29418/`<git_path> + command. + +: **Example** + +<!-- --> + + $ wget https://download.tizen.org/releases/weekly/tizen/mobile/tizen-mobile_20160727.5/builddata/manifest/tizen-mobile_20160727.5_arm-wayland.xml + $ for i in `cat tizen-mobile_20160727.5_arm-wayland.xml | grep "path" | awk -F "\"" '{print $4}'`; do mkdir -p $i; cd $i/..; git clone ssh://<Username>@review.tizen.org:29418/$i; cd -; done + +- **repo init\' and \'repo sync** + +1. Initialize the repository using the + `repo init -u `[`ssh://`](ssh://)<Username>`@review.tizen.org:29418/scm/manifest -b `<branch_name>` -m `<profile>`.xml` + command. +2. Replace the project\'s `.xml` file inside the `$workspace/.repo/` + directory with the manifest file in the `$srcrpm_snapshot`. +3. Use the `repo sync` to sync the repository. + +: **Example** + +<!-- --> + + $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m mobile.xml + $ wget --directory-prefix=$workspace/.repo/manifests/mobile/ https://download.tizen.org/releases/weekly/tizen/mobile/tizen-mobile_20160727.5/builddata/manifest/tizen-mobile_20160727.5_arm-wayland.xml + $ mv $workspace/.repo/manifests/mobile/tizen-mobile_20160727.5_arm-wayland.xml projects.xml + $ repo sync + +When there is en error in the `repo sync` command, first of all check +whether the git project name inside the `projects.xml` file exists in +`review.tizen.org`.\ +For more information, see [Cloning the Tizen +source](https://source.tizen.org/documentation/developer-guide/getting-started-guide/cloning-tizen-source).\ +\ +See the following links for more information: + +- Source code Management on Tizen releases: + +: GIT/Gerrit: <https://review.tizen.org/gerrit> + +- Tizen Build setup + +: [OBS](OBS "wikilink"): <https://build.tizen.org/> + +- Tizen Bug Tracking system + +: Jira: <https://bugs.tizen.org/jira> + +- Download URL: <http://download.tizen.org/> + +Platform Build +-------------- + +- To learn how to add something to Tizen, see [Developer + Guide](https://source.tizen.org/documentation/developer-guide). + +<!-- --> + +- To build the source code by using git build system, see [Git Build + System](https://source.tizen.org/documentation/reference/git-build-system). + +Kernel Build +------------ + +To build the Tizen kernel for the TM1 board: + +1. Install and setup cross compile tools on your system if the target + and host are different (such as x86).\ + : You can use the Linaro toolchain binaries or the Ubuntu package of + them and have your environment setup for the cross tools (such as + export `CROSS_COMPILE=....`). +2. Prepare the kernel source code for TM1 from + `profile/mobile/platform/kernel/linux-3.10-sc7730`. + + : `git: `[`https://review.tizen.org/git/?p=profile/mobile/platform/kernel/linux-3.10-sc7730.git`](https://review.tizen.org/git/?p=profile/mobile/platform/kernel/linux-3.10-sc7730.git) + : `branch: accepted/tizen_mobile` + +3. If your kernel source has been used to create binaries for other + architecture, start by cleaning them up. + + : `$ make distclean` + +4. Setup the `.config` file for TM1. + + : `$ make ARCH=arm tizen_tm1_defconfig` + +5. After reconfiguring your needs (such as `make ARCH=arm menuconfig`) + or using the stock configuration (no modifications), build it. + + : `$ make ARCH=arm zImage` + : `$ make ARCH=arm dtbs` + +6. Create `devicetree` and `zImage` merged image with image tools. + + : `$ scripts/sprd_dtbtool.sh -o arch/arm/boot/merged-dtb -p scripts/dtc/ -v arch/arm/boot/dts/` + : `$ scripts/sprd_mkdzimage.sh -o arch/arm/boot/dzImage -k arch/arm/boot/zImage -d arch/arm/boot/merged-dtb` + +7. Build and make kernel module image as well. Note that you may need + to do sudo first to let `sudo -n` work in the script. + + : `$ sudo ls` + : `$ scripts/mkmodimg.sh` + +8. Make a `.tar` archive from `dzImage` and `modules.img`. + + : You can make your own `.tar` file from the 2 files. + : `$ tar cf FILENAME_YOU_WANT.tar -C arch/arm/boot dzImage -C ../../../usr/tmp-mod modules.img` + +9. Send the `.tar` image to the target using `lthor`. + + : `$ lthor FILENAME_YOU_WANT.tar` + +Image Build +----------- + +- To create the image by using MIC, see [MIC Image + Creator](https://source.tizen.org/documentation/reference/mic-image-creator). + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Preparing_Pre-Built_Binaries_for_Local_Full_Build.md b/docs/platform/tool/Preparing_Pre-Built_Binaries_for_Local_Full_Build.md new file mode 100644 index 0000000000..c2a9c6410e --- /dev/null +++ b/docs/platform/tool/Preparing_Pre-Built_Binaries_for_Local_Full_Build.md @@ -0,0 +1,229 @@ +Introduction +------------ + +This document describes how to prepare pre-built binaries for local full +build,including the following: + +- Create a super set of pre-built binaries +- Filter base packages +- Perform full build by using the filtered binaries +- Remove and add dependency packages +- Update pre-built binaries with latest repo + +Tizen [IVI](IVI "wikilink") is taken as example in this document. + +Creating a Super Set of Pre-built Binaries +------------------------------------------ + +To create a super set of pre-built binaries, perform the following +precedure: + +1\. Modify .gbs.conf under \~/tizen\_ivi\_src as follows: + +`       [general]`\ +`       tmpdir=/var/tmp/`\ +`       profile = profile.tizen3.0_ivi`\ +`       work_dir=.`\ +`       [repo.tizen3.0_ivi]`\ +`       url=HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1`\ +`       [profile.tizen3.0_ivi]`\ +`       repos=repo.tizen3.0_ivi`\ +`       buildconf=${work_dir}/scm/meta/build-config/build.conf` + +2\. Clean cache and run build by executing the following commands: + +`       sudo rm -rf ~/GBS-ROOT/local/cache`\ +`       cd ~/tizen_ivi_src/platform/upstream`\ +`       gbs build -A i586 --threads=4 --clean-once --clean-repos --exclude=libtool,gettext` + +Upon successful \*\*gbs build\*\*, the original package binaries will be +stored into \~/GBS-ROOT/local/cache/<hash_ID>, waiting for further +filter to become useful set of pre-built binaries. + +Filtering Base Packages +----------------------- + +To filter base packages, perform the following procedure: + +1\. Move binaries to another directory by executing the following +commands: + +`       mkdir -p ~/tizen_ivi_src/pre-built-set/base/`\ +`       mv ~/GBS-ROOT/local/cache/*rpm ~/tizen_ivi_src/pre-built-set/base/` + +2\. Filter the base binaries by using the references below: + +- For failed packages (caused by downloading or other reasons), remove + related binaries in the cache. In this case, we need to move the + related binaries from base to another dir because the rpm is not + neccessary. In the end, these failed packages should be fixed by + developers and they don\'t belong to pre-built. + +`       mkdir -p ~/tizen_ivi_src/pre-built-set/extra/`\ +`       mv ~/tizen_ivi_src/pre-built-set/base/xxx.rpm ~/tizen_ivi_src/pre-built-set/extra/` + +- Based on experience, exclude the following packages from cache: + +`     ail, alarm, app-core, app-checker, app-svc, aul, automotive-message-*, dbus-glib,`\ +`     bundle, capi-*, docbook, ecore, evas, eeze, elf-*, gst-plugins, gstreamer, pkgmgr,`\ +`     privacy-manager, python-*, perl-*, sensor, vconf, xdgmime, xmlcharent etc.` + +- Packages in a circle must be kept in cache or there will be + expansion errors. + +<!-- --> + +- There is another case as follows: + +`     package A run time requires B, but the build order of package B is later than A, in this case, we should remove binary of package B directly.`\ +`     Check the build log under ~/GBS-ROOT/local/repos/tizen3.0_ivi/i586/logs/success/`\ +`     grep -r downloading *`\ +`     A-1-0/log.txt:[    5s] [1/1] downloading `[`http://download.tizen.org/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages/i686/B-1-1.i686.rpm`](http://download.tizen.org/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages/i686/B-1-1.i686.rpm)` ...`\ +`     the build order:`\ +`     ...`\ +`     info: *** [1/897] building A-1-0 i586 tizen3.0_ivi (worker: 0) ***`\ +`     info: finished building A`\ +`     ...`\ +`     info: *** [10/897] building B-1-1 i586 tizen3.0_ivi (worker: 2) ***`\ +`     info: finished building B`\ +`     ...`\ +`     In this case, remove B-1-1.i586.rpm in cache` + +Performing Full Build by Using the Filtered Binaries +---------------------------------------------------- + +To perform full build by using the filtered binaries, perform the +following procedure: + +1\. Clean cache and repos by executing the following commands: + +`       sudo rm -rf ~/GBS-ROOT/local/cache`\ +`       rm -rf ~/GBS-ROOT/local/repos` + +2\. Remove remote repositories in .gbs.conf to leave just local pre-built +local repo, an example is shown below: + +`       [general]`\ +`       tmpdir=/var/tmp/`\ +`       profile = profile.tizen3.0_ivi`\ +`       work_dir=.`\ +`       [repo.tizen3.0_x86]`\ +`       url=${work_dir}/pre-built-set`\ +`       [profile.tizen3.0_ivi]`\ +`       repos=repo.tizen3.0_x86`\ +`       buildconf=${work_dir}/scm/meta/build-config/build.conf` + +3\. Build all packages by executing the following commands: + +`       cd ~/tizen_ivi_src`\ +`       gbs build -A i586 --threads=4 --clean-once --exclude=libtool,gettext` + +Removing and Adding Dependency Packages +--------------------------------------- + +The logistics of this section is as follows: + +`   check whether expansion error occurs`\ +`   if yes`\ +``        Add binaries to pre-built by following `Appendix_How to find dependency ``\ +``        relationship for any package from repo` ``\ +`   else`\ +`       Go back to step-2 and step-3 recursively until you get a minimal pre-built`\ +`       set.` + +For example: + +`   qt5:`\ +`     nothing provides pkgconfig(aul)` + +Then find the package that provides pkgconfig (aul) + +`   grep -e "pkgconfig(aul)" .repo.cache| grep P:`\ +`   P:aul-devel.i686-1397286673/1397286678/0: aul-devel = 0.0.286-2.291 aul-devel(x86-32) = 0.0.286-2.291 pkgconfig(aul) = 0.1.0`\ +`   P:aul-devel.i686-1397286694/1397286699/0: aul-devel = 0.0.286-2.10 aul-devel(x86-32) = 0.0.286-2.10 pkgconfig(aul) = 0.1.0` + +So put aul-devel binary into pre-built + +Updating Pre-Built Binaries with Latest Repo +-------------------------------------------- + +We can use a script named update\_pre-built.py +(bj/gbs-testing/update\_prebuilt.py), which can automatically upgrade +the binaries in pre-built to the higher version with a latest repo, to +maitain pre-built binaries. + +`   python update_pre-built.py -R HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages/`\ +`   -L ~/tizen_ivi_src/pre-built/toolchain-x86` + +Upon successful execution of this script, the old binaries will be +replaced by the new binaries. If there is a repodata dir, make sure to +run \`createrepo \--update\` to update this pre-built directory. + +`   createrepo --update ~/tizen_ivi_src/pre-built/toolchain-x86` + +Appendix +-------- + +### How to find dependency relationship for any package from repo + +Run gbs build with any package, press Ctr-c at the start of build. Repo +is which you want to build with. + +`   gbs build -A i586 -R HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/ --skip-conf-repos --buildroot=~/MILSTONE`\ +`   info: generate repositories ...`\ +`   info: build conf has been downloaded at:`\ +`         /var/tmp/tizen.conf`\ +`   info: start building packages from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77 (git)`\ +`   2014-05-20 13:54 +0800`\ +`   info: prepare sources...`\ +`   info: start export source from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77/fake ...`\ +`   info: Creating (native) source archive fake-1.0.tbz2 from 'HEAD'`\ +`   info: package files have been exported to:`\ +`   /home/MILSTONE/local/sources/tizen/fake-1.0-1`\ +`   info: retrieving repo metadata...`\ +`   info: parsing package data...`\ +`   info: building repo metadata ...`\ +`   info: package dependency resolving ...`\ +`   info: next pass:`\ +`   fake`\ +`   info: *** [1/1] building fake-1.0-1 i586 tizen (worker: 0) ***`\ +`   VM_IMAGE: , VM_SWAP:`\ +`   --repository /home/MILSTONE/local/repos/tizen/i586/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/emul/ia32/packages`\ +`   logging output to /home/MILSTONE/local/BUILD-ROOTS/scratch.i586.0/.build.log...`\ +`   [    0s] Memory limit set to 21777108KB`\ +`   [    0s] Using BUILD_ROOT=/home/MILSTONE/local/BUILD-ROOTS/scratch.i586.0`\ +`   [    0s] Using BUILD_ARCH=i686:i586:i486:i386:noarch`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] started "build fake.spec" at Tue May 20 05:54:35 UTC 2014.`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] processing specfile /home/MILSTONE/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /home/MILSTONE/local/cache --repository /home/MILSTONE/local/repos/tizen/i586/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/emul/ia32/packages /home/MILSTONE/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] initializing /home/MILSTONE/local/BUILD-ROOTS/scratch.i586.0/.srcfiles.cache ...`\ +`   [    0s] /usr/lib/build/createrpmdeps /home/MILSTONE/local/repos/tizen/i586/RPMS`\ +`   [    0s] /usr/lib/build/createrepomddeps --cachedir=/home/MILSTONE/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages`\ +`   [    1s] /usr/lib/build/createrepomddeps --cachedir=/home/MILSTONE/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/emul/ia32/packages`\ +`   ^C^C captured`\ +`   warning: build failed, Leaving the logs in /home/MILSTONE/local/repos/tizen/i586/logs/fail/fake-1.0-1/log.txt` + +Then open \~/MILSTONE/local/order/.repo.cache, it can provide all +information about every package from repo like: + +`   P:mic-bootstrap-x86-arm.i586-1397164816/1397165006/0: mic-bootstrap-x86-arm = 1.0-13.20 mic-bootstrap-x86-arm(x86-32) = 1.0-13.20`\ +`   R:mic-bootstrap-x86-arm.i586-1397164816/1397165006/0: /bin/sh`\ +`   I:mic-bootstrap-x86-arm.i586-1397164816/1397165006/0: mic-bootstrap-x86-arm-1.0-13.20 1397164816`\ +`   F:gdb-locale.noarch-1387595787/1387595811/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages/noarch/gdb-locale-7.5.1-10.1.noarch.rpm`\ +`   P:gdb-locale.noarch-1387595787/1387595811/0: gdb-lang-all = 7.5.1 gdb-locale = 7.5.1-10.1`\ +`   R:gdb-locale.noarch-1387595787/1387595811/0: gdb = 7.5.1`\ +`   I:gdb-locale.noarch-1387595787/1387595811/0: gdb-locale-7.5.1-10.1 1387595787`\ +`   F:zypper-locale.noarch-1387597203/1387597217/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/ivi/tizen_20140422.1/repos/ivi/ia32/packages/noarch/zypper-locale-1.8.14-12.1.noarch.rpm` + +The meaning of these prefix characters are: + +- P what this package provides +- R what this package requires +- F where to find this package +- I Identifier of package + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/RELEASE_NOTES_MIC.md b/docs/platform/tool/RELEASE_NOTES_MIC.md new file mode 100644 index 0000000000..e0c94d3f30 --- /dev/null +++ b/docs/platform/tool/RELEASE_NOTES_MIC.md @@ -0,0 +1,39 @@ +MIC Image Creator 0.20 Release Notes +------------------------------------ + +Released Jule 08 2013 + +This release note documents the changes included in the +[MIC](MIC "wikilink") 0.20 release. And the release contains new +features, enhancements and bug fixes. + +### New Features & Ehancements + +`* new distribution support: CentOS 6`\ +`* drop image creation if checked packages not present in image`\ +`* introduce 'installerfw' command in kickstart to customize configuration`\ +`* improve output message of post scripts` + +### Bug Fixes + +`* fix rpm not support 'VCS' tag traceback` + +### Resource + +`* SITE: `[`https://www.tizen.org/`](https://www.tizen.org/)\ +`* REPO: `[`https://download.tizen.org/tools/`](https://download.tizen.org/tools/)\ +`* DOCS: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`* CODE: `[`https://github.com/01org/mic`](https://github.com/01org/mic)\ +`* BUGS: `[`https://bugs.tizen.org/jira`](https://bugs.tizen.org/jira)\ +`* HELP: general@lists.tizen.org` + +### Report Bugs + +when you found a bug, you can file this bug in our official bug tracker: +<https://bugs.tizen.org/jira> also you are welcome to file the issue at +our github repository: <https://github.com/01org/mic> + +Thank you for using MIC and for taking the time to send us your +feedback! + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/RELEASE_NOTES_MIC_TEMPLATE.md b/docs/platform/tool/RELEASE_NOTES_MIC_TEMPLATE.md new file mode 100644 index 0000000000..e0c94d3f30 --- /dev/null +++ b/docs/platform/tool/RELEASE_NOTES_MIC_TEMPLATE.md @@ -0,0 +1,39 @@ +MIC Image Creator 0.20 Release Notes +------------------------------------ + +Released Jule 08 2013 + +This release note documents the changes included in the +[MIC](MIC "wikilink") 0.20 release. And the release contains new +features, enhancements and bug fixes. + +### New Features & Ehancements + +`* new distribution support: CentOS 6`\ +`* drop image creation if checked packages not present in image`\ +`* introduce 'installerfw' command in kickstart to customize configuration`\ +`* improve output message of post scripts` + +### Bug Fixes + +`* fix rpm not support 'VCS' tag traceback` + +### Resource + +`* SITE: `[`https://www.tizen.org/`](https://www.tizen.org/)\ +`* REPO: `[`https://download.tizen.org/tools/`](https://download.tizen.org/tools/)\ +`* DOCS: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`* CODE: `[`https://github.com/01org/mic`](https://github.com/01org/mic)\ +`* BUGS: `[`https://bugs.tizen.org/jira`](https://bugs.tizen.org/jira)\ +`* HELP: general@lists.tizen.org` + +### Report Bugs + +when you found a bug, you can file this bug in our official bug tracker: +<https://bugs.tizen.org/jira> also you are welcome to file the issue at +our github repository: <https://github.com/01org/mic> + +Thank you for using MIC and for taking the time to send us your +feedback! + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Release_Process.md b/docs/platform/tool/Release_Process.md new file mode 100644 index 0000000000..22f60059f5 --- /dev/null +++ b/docs/platform/tool/Release_Process.md @@ -0,0 +1,281 @@ +Introduction + +Intruction +---------- + +This document describe basic process for Tizen Tools Release. + +Currently, this document only apply for +[GBS](GBS "wikilink")/[MIC](MIC "wikilink"). jenkin-job/IRIS can be +added in the future. + +This document cover release process, start point is release branch for +for pre-release version has been created, and the final point is new +tools have been deployed on server and latest repo has been published to +external download.tizen.org/tools. + +This document will cover the following content: + +` - Roles Defination`\ +` - Pre-Release testing & development`\ +` - Internal Release & Testing`\ +` - Pre-deployment Testing`\ +` - Deployment`\ +` - Publish to external repository server`\ +` - Sync internal code to external github and tizen.org`\ +` - Send announcement to mailling list` + +The drivers of the whole release process are the maintainer of GBS/MIC, +that means they should control & assign different AR to different people +on different stages. + +Roles Defination +---------------- + +: Developer: Tools developer, responsible for features development and + bug fix +: Maintainer: Responsible for defining roadmap, control release + process.Developer take this maintainer role in our case. +: Tester: Responsible for doing feature/bug/system/pre-depolyment + testing +: Admin: Responsible for accepting deployment tickets and deploying + tools on backend server + +Pre-release testing & development +--------------------------------- + +0\. Discuss next release contents (Roadmap) with Admin: which tickets +will before included in this release, reach agreement before taking +further actions.Do a final check before taking in use ppfarm, in case +the review happened at the beginning of the development cycle, to ensure +that no changes to the initial plan went untracked. + +1\. Maintainer create \'release\*\' branch and bump to RC release + +: + + : + +` $ git checkout devel`\ +` $ update packaging/${mic,gbs}.spec and debian/changelog to bump to rc1`\ +` $ submit to gerrit`\ +` $ git push origin HEAD:refs/heads/release-{version} # create release branch` + +2\. Maintainer notify tester to do pre-release testing + +`  Details Input:`\ +`  1) Which tools repo should be tested?`\ +`  2) Which types of testing should be done? eg: upgrade/install/full system testing.`\ +`  3) How long time test should be taken?`\ +`  4) Email to tester to do testing, if no response in five minutes,push F2F directly` + +3\. Tester test tools in corresponding live repo: + +`  Details Output:`\ +`  1) Reply testing request email. Communicate with developer about the testing time, make sure test report can be finished in time;`\ +`  2) Finish Test report in Jenkins testing job`\ +`  3) Basic summary of testing report, it's better to give basic analysis and root cause it.`\ +`  4) Send email to developer/Maintainer, if no response from maintainer, push developer F2F directly` + +4\. Developer/Maintainer Review test report: + +`  1) If some issues found, submit hotfix and bump to new RC version`\ +`        goto 2;`\ +`  2) If no issue found, bump to official version after the following`\ +`      checking:`\ +`      ::`\ +`         New version information`\ +`         New release notes content verification` + +Internal Release +---------------- + +1\. Maintainer update \'master\' branch using \'release-\*\' branch and +create tag + +`  $ git checkout release-${version}`\ +`  $ git tag ${version} -m "release for ${version}"`\ +`  $ git push --tags origin`\ +`  $ git push origin releaes-${version}:refs/heads/master -f --tags` + +2\. Maintainer trigger + +``   `https:// ``<jenkins>`` /job/Tools-release/` job to publish Tools live repo to internal staging repo:  ``[`https://`](https://)<internal>`/staging/tools/.` + +`  The following testing should base on this staging repo` + +3\. Developer notify tester to do internal release testing + +`  Details Input:`\ +``   1) Which types of testing should be done? upgrade/install/full system testing. For gbs `local full build testing` is needed ``\ +`  2) How long time test should be taken?`\ +`  3) Email to tester to do testing, if no response in five mins, push F2F directly` + +4\. Tester test tools in corresponding internal staging repo: + +`  1) Reply testing request email. Communicate with developer about then testing time, make sure test report can be finished in time`\ +`  2) Finish Test report in Jenkins testing job`\ +`  3) Basic summary of testing report, it's better to give basic analysis and root cause it`\ +`  4) Send email to developer/Maintainer, if no response, push developer F2F directly` + +5\. Developer/Maintainer Review test report: + +`  1) If some source issues found, bump to new release version and continue to fix it in 'release-*' branch, then goto pre-release testing`\ +`  2) if some 3rd part dependency issue found, fix them in Tools project directly then goto 2` + +6\. Maintainer ensures that all the new code is compliant with Intel + +`  Publishing policies:`\ +`  1) licenses are in place and compatible`\ +`  2) if new components are present, they have been approved by Legal PDT`\ +`  3) new code has been checked with the scanning tool and all problems are`\ +`    fixed` + +7\. Maintainer creates external archive repo using staging repo + +Pre-Deployment Testing +---------------------- + +All pre-deployment testing are based on external archive repo. + +### GBS + +Pre-deployment testing should be done in ppfarm test environment. + +Tester need following these steps: + +1\. Sync code from tizen.org \`Tizen:IVI\` project to ppfarm OBS. + +`  1)Login build-pptest host, run:`\ +`    #!/bin/bash`\ +``     for pkg in `osc -A  ``[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)``  ls tizen.org:Tizen:IVI`; ``\ +`    do`\ +`      osc -A `[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)` copypac tizen.org:Tizen:IVI $pkg  Tizen:IVI`\ +`      sleep 1`\ +`      osc -A `[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)` service remoterun Tizen:IVI $pkg`\ +`    done`\ +`   `\ +`   2)Re-copypac broken packages:`\ +``      for pkg in `osc -A  ``[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)``  prjresults -c -s B Tizen:IVI | cut -d\; -f1`; ``\ +`     do`\ +`       osc -A `[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)` copypac tizen.org:Tizen:IVI $pkg Tizen:IVI`\ +`       sleep 1`\ +`       osc -A `[`https://build-pptest.fi.intel.com:444`](https://build-pptest.fi.intel.com:444)` service remoterun Tizen:IVI $pkg`\ +`     done` + +2\. Monitor GBS-Test:Tizen:IVI project and wait it build succeeded. + +3\. Check the following jenkins job. + +GBS-Test:Tizen:IVI project build will trigger the following jobs: + +` - create-snapshot`\ +` - image-creator`\ +` - image-tester` + +GBS Tester need find the build report at image-tester job. + +### MIC + +MIC is deployed as a mic-appliance, so pre-deployment test should be +done as an appliance + +1\. Build a mic-appliance with the latest release(Instructions required - +PUT THE PACKER SCRIPTS AND TEMPLATE UNDER MIC PROJECT) + +2\. Upload new mic-appliance to otctools server. Use jenkins job +(https://<jenkins>/job/MIC-appliance-release/),choose download.otctools +and provide a URL. (JENKINS JOB not available yet on tizen) + +3\. Test on ppfarm. Provide the mic-appliance location URL on +download.otctools to ppfarm jenkins, and ask Maintainer to trigger test. + +4\. Use the same jenkins job as step4 (choose download.tizen.org as +destination) to sync the new mic-appliance to tizen.org. + +Deployment +---------- + +1\. Maintainer creates/updates deployment ticket, assigns it to reviewer. + +`  The ticket must include:`\ +`  1) deployment instructions (repos, user ids, ets)`\ +`  2) simple means for Admin to confirm that the deployment appears successful`\ +`  3) rollback instructions, to follow in case the deployment fails`\ +`    (refer only to data/packages from repos - no local data backup)`\ +`    In case the deployment affects also data/configurations stored somewhere,`\ +`    these too must be included in the rollback.` + +2\. Prepare \"Release notes\" for testing results verification + +`  Release Notes must contain:`\ +`  1) Content description (bugs & features delivered)`\ +`     For each bugfix and feature included in the release, the corresponding`\ +`     tracker must be adequately updated:`\ +`     - description of the bug/feature`\ +`     - means of verification and expected results`\ +`     - results effectively obtained from testing`\ +`  2) Statement that the code is compliant with Intel legal requirements`\ +`     - link to scanning results for new code`\ +`     - statement that new components (if any) are approved by Legal PDT,`\ +`      if needed - this includes also using 3rd party code with different license.`\ +`  3) Links to build & verification chain:`\ +`     OBS -> jenkins image(s) creation and validation` + +3\. Notify reviewer that deployment ticket release notes are ready for +review. + +4\. After release note review, reviewer transfer the ticket to Admin. +Different test report must be listed in email. + +`  1) GBS`\ +`    - gbs local full build report`\ +`    - ppfarm 'image-tester' job report`\ +`    - gbs install&&upgrade report`\ +`    - itest cases report`\ +`    -  deploy ticket link` + +`  2) MIC`\ +`    - ppfarm pre-deployment 'image-tester' job report`\ +`    - mic install&&upgrade report`\ +`    - itest cases report`\ +`    - deploy ticket link` + +5\. Admin deployment tools follow corresponding tickets. + +6\. Maintainer check the final results and close the tickets finally. + +7\. Update Tools-Announcement: + +`  `[`https://wiki.tizen.org/wiki/GBS#Tools_Announcement`](https://wiki.tizen.org/wiki/GBS#Tools_Announcement) + +Publish release +--------------- + +1\. Developer/Maintainer monitor status of deployment ticket + +2\. If ticket has been closed, that means deployment work has been done + +3\. Developer/Maintainer trigger release jenkins job to publish repo to +external latest-release folder + +Sync latest code to external github +----------------------------------- + +### github + +`  $ cd path/to/{gbs,mic}`\ +`  $ git push github:01org/{gbs,mic} release-xx:release-0.xx --tags`\ +`  $ git push github:01org/{gbs,mic} master:master` + +Sync latest code to external github +----------------------------------- + +Once repo has been published, Super maintainer responsible for sending +annoucement to the following mailing list: + +`  - general@lists.tizen.org`\ +`  - dev@lists.tizen.org`\ +`  - operations@lists.tizendev.org` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/SDK_How_To_Use_Tizen_SDK_CLI_Tools.md b/docs/platform/tool/SDK_How_To_Use_Tizen_SDK_CLI_Tools.md new file mode 100644 index 0000000000..c56343d3a1 --- /dev/null +++ b/docs/platform/tool/SDK_How_To_Use_Tizen_SDK_CLI_Tools.md @@ -0,0 +1,283 @@ +The Tizen Software Development Kit ([SDK](SDK "wikilink")) is a +comprehensive set of tools for developing Web applications, native +applications, and the platform component for Tizen. The SDK contains an +install manager, IDE, tools, documents, samples, and a platform image. + +Introduction +------------ + +The CLI (command line interface) provides functional tools for +developing Tizen Web applications and native applications without the +Tizen SDK IDE. It includes the entire developing process from creating +to running and debugging the project. If you only want to install CLI +and emulator, you can install a Minimal SDK, emulator and a platform +image. + +Install Tizen Minimal SDK, Emulator and a Platform Image +-------------------------------------------------------- + +If you have never installed Tizen SDK before, please refer to +[Installing Tizen +SDK](https://developer.tizen.org/downloads/sdk/installing-tizen-sdk)\] + +- Choose a Minimal SDK \"Minimal\". Select \"Web app tools\" and + \"Native app tools\" + +![](Minimal-SDK1.png "Minimal-SDK1.png") + +<li> + +If you want to install Tizen Emulator, then you need to switch to +\"Custom\". Select \"Common tools\" -\> \"Emulator\" and \"Platforms\" +-\> \"Tizen 2.1\" -\> \"Platform Image\" + +</li> + +![](Minimal-SDK2.png "Minimal-SDK2.png") + +</ul> + +How To Use Web CLI +------------------ + +The CLI is located in the \$<TIZEN_SDK_HOME>/tools/ directory. For +developing the application using the CLI, set path to the CLI directory +using the following command: + +`$ export PATH=$PATH:/home/username/tizen-sdk/tools/ide/bin` + +Note that replace the username to a real username. webtizen is an +encapsulation of web-list, web-gen, web-signing, web-packaging, +web-install, web-run, web-debug and web-uninstall. You can also use them +independently. + +- Generate a new web project. + +<!-- --> + +- Generate a web project by default. + +\$ webtizen -g \--name WebSample \--path \~/workspace/ + +<li> + +Search a template web project. + +</li> + +`$ web-template --search tizen`\ +`tizenwebuifw-singlepage - Tizen Web UI Framework - Single Page.`\ +`tizenwebuifw-navigation - Tizen Web UI Framework - Navigation.`\ +`tizen-basic - Tizen basic Application.`\ +`tizenwebuifw-masterdetail - Tizen Web UI Framework - MasterDetail.`\ +`tizenwebuifw-common-resources - Tizen Web UI Framework - common resources.`\ +`tizenwebuifw-multipage - Tizen Web UI Framework - Mutil Page.` + +There are some samples in the directory +\~/tizen-sdk/tools/ide/realm/template/ + +</ul> +<li> + +Create a signature. + +</li> + +- Create a certificate firstly. + +\$ cd \~/tizen-sdk/tools/certificate-generator/ + +`$ ./certificate-generator.sh` + +Input some necessary messages such as password and name as below. + +![](Minimal-SDK-Certificate.png "Minimal-SDK-Certificate.png") + +Then a \*.p12 file will be created in the current directory. + +<li> + +Modify the key path in template profiles.xml. + +</li> + +`$ vi ~/tizen-sdk/tools/ide/sample/profiles.xml` + +Modify the key path to the key you just created. Note that replace the +username to a real username. + +<?xml version="1.0" encoding="UTF-8"?> + +<profiles>\ +`        `<profile name="test">\ +`                `<profileitem author="true" identifier="%a:%f:%w:%h:%t" key="/home/username/tizen-sdk/tools/certificate-generator/sign.p12" + ca="/home/username/tizen-sdk/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer"/>\ +`                `<profileitem author="false" identifier="%a:%f:%w:%h:%t" key="/home/username/tizen-sdk/tools/certificate-generator/sign.p12" + ca="/home/username/tizen-sdk/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer"/>\ +`        `</profile>\ +</profiles> + +<li> + +Create a signature for the web project. + +</li> + +`$ cd ~/workspace/WebSample/`\ +`$ webtizen -s --nocheck -p test:/home/username/tizen-sdk/tools/ide/sample/profiles.xml` + +Note that replace the username to a real username. + +Input author password and Distributor password which are the same with +the password of the key you created before. + +A signature file signature1.xml will be created. + +Note: If you have created project with Tizen 2.1.0 SDK IDE, there are +.project file and .setting folder in each project.To create a correct +signature by CLI, you need to remove them manually or using \"-e\" +option to exclude them. + +</ul> +<li> + +Package files into a widget. + +</li> + +`$ webtizen -p --nocheck WebSample.wgt ../WebSample/` + +<li> + +Install the widget into the target. + +</li> + +`$ webtizen -i -w WebSample.wgt` + +If you connect two or more targets, you need to add the parameter \"-d +serial number\", such as \"-d Medfieldxxx\" or \"-d emulator-26100\". + +<li> + +List web applicaton info installed by user. + +</li> + +`$ webtizen -l ` + +\"Package ID\" and \"App ID\" will be listed. + +<li> + +Launch the app on the target + +</li> + +`$ webtizen -r -i tSkijLbOmo.WebSample(App ID)` + +<li> + +Debug the app. + +</li> + +`$ webtizen -d -i tSkijLbOmo.WebSample(App ID)` + +Note that debug dialog cannot be shown up with connecting IA device. + +<li> + +web-uninstall can uninstall the widget. + +</li> + +`$ webtizen -u -i tSkijLbOmo(Package ID)` + +</ul> + +How To Use Native CLI +--------------------- + +- Create a native project. + +\$ native-gen project -n NativeSample -s form + +`Creating a project: NativeSample...`\ +`A project was created successfully in /home/username/workspace/NativeSample`\ +`To build a project, run native-make in /home/username/workspace/NativeSample/CommandLineBuild.` + +Because Native CLI only can be used in the directory +{Project}/CommandLineBuild/, you need to create a project by native-gen +with the same as your project\'s like below, then copy the +CommandLineBuild folder to your own project. + +`$ native-gen project -n Calculator -s form` + +<li> + +Compile the project. + +</li> + +`$ cd NativeSample/CommandLineBuild/`\ +`$ native-make  -a i386 -t LLVM-3.1` + +If you want to add the parameters --n --v, please use as this -n \"Tizen +Emulator 2.1\" -v \"Tizen 2.1\". + +A \*.exe file is compiled out named NativeSample.exe + +<li> + +Package the project with signature. + +</li> + +`$ native-packaging -ak /home/username/tizen-sdk/tools/certificate-generator/sign.p12 -ap 1234 ` + +Note that replace the username to a real username. + +A \*.tpk file is packaged. + +<li> + +Install the tpk onto target. + +</li> + +`$ native-install -p B4k8jHVcdG-1.0.0-i386.tpk`\ +`B4k8jHVcdG-1.0.0-i386.tpk        3249 KB/s (176309 bytes in 0.052s)`\ +`path is /opt/usr/apps/tmp/B4k8jHVcdG-1.0.0-i386.tpk`\ +`__return_cb req_id[1] pkg_type[tpk] pkgid[B4k8jHVcdG] key[start] val[install]`\ +`__return_cb req_id[1] pkg_type[tpk] pkgid[B4k8jHVcdG] key[install_percent] val[0]`\ +`__return_cb req_id[1] pkg_type[tpk] pkgid[B4k8jHVcdG] key[install_percent] val[60]`\ +`__return_cb req_id[1] pkg_type[tpk] pkgid[B4k8jHVcdG] key[install_percent] val[100]`\ +`__return_cb req_id[1] pkg_type[tpk] pkgid[B4k8jHVcdG] key[end] val[ok]`\ +`spend time for pkgcmd is [5559]ms` + +If you connect two or more targets, you need to add the parameter \"-s +serial number\", such as \"-s Medfieldxxx\" or \"-s emulator-26100\". + +<li> + +Launch the app on the target. + +</li> + +`$ native-run -p B4k8jHVcdG (Package ID)` + +<li> + +Debug the app. + +</li> + +`$ native-debug -p B4k8jHVcdG`\ +`(gdb)` + +</ul> + +[Category:Development](Category:Development "wikilink") +[Category:SDK](Category:SDK "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/SDWire.md b/docs/platform/tool/SDWire.md new file mode 100644 index 0000000000..04c42b4b9f --- /dev/null +++ b/docs/platform/tool/SDWire.md @@ -0,0 +1,125 @@ +![SDWire](SDWire.png "SDWire"){width="700"} + +Overview +======== + +**SDWire** is a small board with 2 features: + +- SD card reader +- SD card MUX + +There is only one micro USB socket for connecting to host PC. Both USB +mass storage and MUX control are served through the same USB connection. + +The PCB board is designed in such way that it fits into micro SD card +slots. Thanks to this, there is no need for special cables with micro SD +adapter and connection to SD slot on a device is very short. + +Hardware design +=============== + +Design of this board is based on [SD MUX](SD_MUX "wikilink"). SDWire +does not have power switch or USB switch but has built in USB SD card +reader. SD card multiplexer itself is exactly the same in both devices. + +There are four LEDs on the board: + +- red - power presence from USB +- blue - USB reader activity +- blue - card connected to TS +- green - card connected to DUT + +All LEDs are present on both sides of the board to make them visible no +matter which side of the board will be facing you. + +LED positions are showed in the image below. + +![](SDWire-leds.png "SDWire-leds.png") + +The PCB board has to be 0.8 mm thick to make it possible to put it into +standard micro SD card socket. + +Version 1.4 +----------- + +In this version, SDWire is equipped with EEPROM connected to USB2640 IC. +It enables user to change serial number of this IC. This in turn makes +it possible to distinguish one SDWires from another. This is very useful +in automated systems where more than one SDWire is used in one USB host. +Without this EEPROM each device has the same serial number which does +not allow to tell which USB card reader is connected to which device. +Using simple UDEV rules and unique serial numbers solves the problem. + +Software +======== + +There are two USB interfaces (physically one connection): + +- USB mass storage - which support is built in every modern operating + system. +- control interface - which allows to control SD MUX functionality. + This interface is handled with exactly the same software + (sd-mux-ctrl) which is used for SD MUX. Go to [SD MUX + software](SD_MUX#Software "wikilink") for details. + +Version 1.4 +----------- + +In this version we can use EEPROM memory to distinguish SDWire devices +form each other. But before that the unique serial number has to be set. +The only known method is to use USBDM software form Microchip company. +It is Windows software that can be downloaded from here: +<http://ww1.microchip.com/downloads/en//softwarelibrary/usbdm%20tool/usbdm.zip> + +Update of the serial number is quite a straightforward process. Just +install the tool and run it. Connect SDWire and when you see its +information on the \"Info\" tab, switch to \"Branding\" tab, change +\"Serial Number String\" to whatever you want and fits requirements and +then click \"Update Now\" button. After few seconds tab \"Info\" should +automatically become active and the new serial number should appear. + +Note: On Windows 10 it might be a little bit hard to find the tool +location after installation. If yes then try to find it in following or +similar location: C:\\ProgramData\\Microsoft\\Windows\\Start +Menu\\Programs\\USBDM\\USBDM.exe + +Files +===== + +- Main board schematic: + ![](SDWire-v1.4-sch.pdf "fig:SDWire-v1.4-sch.pdf") +- Main board PCB fabrication files: + [SDWire-fabrication-v1.4.zip](https://git.tizen.org/cgit/tools/testlab/sd-mux/plain/doc/hardware/SDWire/SDWire-fabrication-v1.4.zip) +- Main assembly files: + [SDWire-assembly-v1.4.zip](https://git.tizen.org/cgit/tools/testlab/sd-mux/plain/doc/hardware/SDWire/SDWire-assembly-v1.4.zip) +- The hardware and software sources: [SD-MUX on + Tizen](https://git.tizen.org/cgit/tools/testlab/sd-mux/) + +Known problems +============== + +First revision of the device was built on a 2-layer PCB. In most cases +it worked fine but there were devices that couldn\'t write to micro SD +card - a lot of I/O errors would happen. On-board USB SD card reader +worked flawlessly in both reading and writing modes. The problem was +related to external devices into which SDWire was inserted. In order to +overcome the problem the PCB was redesigned and 4 layer stack was used. +Now devices that couldn\'t write to SD card can do it without a problem. +However I didn\'t test SDWire with all existing readers, devices or +micro SD cards. + +**Note**: SDWire is a device that uses analog multiplexer to switch SD +signals either to integrated reader or external device. It means that +the signals are slightly degraded and this can cause some compatibility +problems between SD card and external device. All depends on quality of +card, device, clock speed, signal levels, etc. You have take into +consideration that kind of problems. + +Above problem applies to SD-MUX and MuxPi as well. However, it can be +usually solved by changing micro SD card to one which works fine with +multiplexer and the device. + +[Category:Tool](Category:Tool "wikilink") +[Category:Testlab](Category:Testlab "wikilink") +[Category:Hardware](Category:Hardware "wikilink") +[Category:Common](Category:Common "wikilink") diff --git a/docs/platform/tool/SD_MUX.md b/docs/platform/tool/SD_MUX.md new file mode 100644 index 0000000000..b94d42c3e4 --- /dev/null +++ b/docs/platform/tool/SD_MUX.md @@ -0,0 +1,236 @@ +![SD-MUX](Sdmux-v1.png "SD-MUX"){width="700"} + +Overview +======== + +**SD MUX** stands for Secure Digital Multiplexer. This is a custom board +designed to aid operation of [test lab device](Laboratory "wikilink"). +The device was meant to be a simple switch for SD memory cards. It was +to switch the card either to DUT (Device Under Test) or to TS (Test +Server). The main purpose of that was possibility to write image to SD +card and then boot tested device from this card without any manual +activity. Tested devices usually have micro SD card slot and test server +need to have micro SD card reader (usually connected over USB). So the +memory card must be connected once to the slot of a DUT and once to the +reader of a TS. To achieve such goal we could see three possible +solutions: + +- A kind of robot taking out the the card out of USB reader and + putting it into device\'s slot, and in reverse +- SD memory card emulator +- SD card multiplexer able to connect the card to one of two devices + at the same time + +**The first solution (the robot)** seems to be good project for CNC +maniacs but not for this task. It is hard to build such contraption, +hard to program it and hard to maintain. Unquestionable advantage of +such approach is that only one such robot is enough for the whole test +lab. + +**Second solution (emulator)** would have been very good one if it had +existed. At the time we were facing the problem there was no any +emulator market and probably still isn\'t. Killer feature of emulator is +that there is no way to wear it out like physical ones. As history shows +SD cards wear out quite fast. After few hundreds flashes they become +worn out. But the problem of SD emulator is that requires a lot of fast +memory, usually RAM, and this inconvenience rules out this approach. + +**And finally third solution (multiplexer)** seems to be the obvious +choice. In comparison to robot and emulator it is easy to design and +build it, and it is quite cheap. + +Hardware design +=============== + +SD-MUX was designed entirely in [KiCad](http://kicad-pcb.org/) a free +tool for hardware design. Project files are published on Tizen git +server. It is open-hardware device and everyone is welcome to comment +and make contributions to this project. + +Main board +---------- + +Currently, version 2nd of sd-mux is in use. The differences between 1st +and 2nd are: + +- First version had full SD card slot while second revision has micro + SD slot which let to reduce the size of PCB. +- First version didn\'t have switch on USB-A ports. Second version is + able turn on and off power which helps TS to discover + (dis)connecting micro SD card reader. +- Dimensions of first revision were 150x50mm while of the second one + are 114x50mm. + +Below pictures show the first and the second version of SD-MUX. +![Alt=Akuku Panie Kruku\|The first version of SD-MUX +board](sd-mux-v1.jpg "fig:Alt=Akuku Panie Kruku|The first version of SD-MUX board") +![Alt=Akuku Panie Kruku\|The second version of SD-MUX +board](sd-mux-v2.jpg "fig:Alt=Akuku Panie Kruku|The second version of SD-MUX board") + +Cable +----- + +Micro SD card slot of tested devices and USB card reader are connected +to SD-MUX board through a flat cable. The cable is soldered to dedicated +micro sd adapter on one side and crimped to 2x4 IDC connector on the +oder side. ![Alt=Akuku Panie Kruku\|Micro SD adapter \<-\> SD-MUX +cable](cable.jpg "fig:Alt=Akuku Panie Kruku|Micro SD adapter <-> SD-MUX cable") +The adapter is made of thin (0.8mm), one-sided PCB coated with gold. It +has exact shape of micro sd card. ![Alt=Akuku Panie Kruku\|Micro SD +adapter](adapter.jpg "fig:Alt=Akuku Panie Kruku|Micro SD adapter") Two +pieces of such cable are used per one SD-MUX board. One of them connects +SD-MUX to tested device and the second one connects SD-MUX to micro sd +usb card reader. + +DyPer +----- + +DyPer (DYNamic jumPER) is a simple low-current switch which may be +controlled via SD-MUX. This is another electromagnetic relay (for the +same reasons as in SD-MUX) which may be used for connecting two signals. +These signals might be configuration pins, normally connected using +standard jumper, or reset input of device or any other low current +signals. Such functionality might be needed for example on board which +cannot be rebooted only by switching its power supply. Example of such +board is Artik development board. This feature is made as an add-on for +SD-MUX board. SD-MUX is not prepared for add-ons so it has not any +dedicated connector or mechanical slots thus DyPer must be glued to +SD-MUX and its wires must be directly soldered to FTDI chip of SD-MUX. +DyPer is very simple circuit and it does not require any pcb. Currently +we use only two such devices so we didn\'t need to make pcbs. It +consistsof four elements: relay, N-MOS transistor, diode and pull-up +resistor. All of them are soldered together without any PCB. ![Dyper +schematic](Dyper-sch.png "fig:Dyper schematic") One channel is able to +connect two independent signals at the same time. Both of these signals +are controlled by one steering signal. Such approach might be helpful +when two unrelated jumpers must be switched on. It doesn\'t happen very +frequently but it happens. One complete DyPer may be used to switch two +pairs of such signals and each pair may be controlled independently as +there are two independent steering signals per each channel. + +FAQ +--- + +Q: Why did you use electromagnetic relay? + +A: Electromagnetic relay is used for ensuring that there is no any +relation between steering and operating signals. Semiconductor relays +have such relations and we didn\'t want to depend on it as we didn\'t +know what kind of power supply would be used for particular device +board. + +Q: Why did you use such large relay? + +A: We did want to use bistable relays as they don\'t get power for coil +when are in stable state. Also we did want relays with two coils as it +is much easier to steer the relay with one coil. Putting these +conditions together the answer is very prosaic. We bought what we could +:) Of all accessible (in stores those days) relays only this one met the +requirements. + +Software +======== + +SD-MUX has dedicated software which is a simple tool meant to control +the hardware. Source code of the tool is published on [tizen +git](https://git.tizen.org/cgit/tools/testlab/sd-mux/) server. + +This is simple to use, command-line utility software written in C and +based on open-source libFTDI library. It has dedicated [ manual +page](SD_MUX/manpage "wikilink") and bash completion script. + +First use +--------- + +If SD-MUX comes preconfigured then there is no need to perform action in +this section. To check whether the device is configured or not just run: + +`sudo  sd-mux-ctrl --list` + +If the device is connected and configured then it will be shown in the +output. It means it can be used without any configuration right now. + +Otherwise if the device is connected and not shown in the list then the +first configuration has to be done before it can be used. A valid serial +number, device type, VENDOR ID and PRODUCT ID of the device must be set. + +Devices of SD-MUX family are built with FTDI chips so their initial +VENDOR and PRODUCT IDs has to be used to identify them. First of all +disconnect all FTDI devices from USB host machine. Then connect one of +your new SD-MUXes and execute: + +`sudo sd-mux-ctrl --list --vendor=0x0403 --product=0x6001` + +Use demsg or lsusb output to get vendor and product numbers because +product number might differ for different devices from SD-MUX family. +Currently PRODUCT ID is 0x6001 (SD-MUX, SDWire) or 0x6015 (USB-MUX) NOTE +that at this moment there must not be connected any other device with +such vendor ID and product ID 6001 (0403:6001) ex. FTDI USB\<-\>UART +converters! Otherwise one will not be able to tell which device is the +one he is interested in. + +Above command will give all devices with ID 0403:6001 and there should +be only one such device. Again, pay attention not to connect anything +else with such ID. At this point one can set new serial number. At the +same time, sd-mux-ctrl will set vendor ID to the new one (0x04e8 - +Samsung ID). Product ID will be set to 0x6001. + +`sudo sd-mux-ctrl --device-serial=AL018T40 --vendor=0x0403 --product=0x6001 --device-type=sd-mux --set-serial=odroid_u3_1` + +Where AL018T40 is the serial number read from result of \--list command +and odroid\_u3\_1 is the new serial number. From this moment \--vendor +or \--product option must not be used when \"talking\" to the device. Of +course \--vendor=0x04e8 might be used but there is no use to do that +because 0x04e8 is the default value. From now on the device is ready to +operate along with the software as a part of automated laboratory. + +Everyday use +------------ + +Typical scenario is: + +1. Disconnect power supply from device under test +2. Disconnect micro SD card from DUT and connect it to TS +3. Disconnect USB port from DUT and connect it to micro SD card reader +4. Flash SD card with new image +5. Disconnect SD card from TS and connect it to DUT +6. Connect USB port to USB OTG on DUT board to establish SDB connection +7. Connect power supply to DUT +8. If needed do extra power supply tick (for example needed by Odroid + U3 devices) +9. Wait for coming up of the tested device (SDB connection active) and + if it hasn\'t happened, repeat the whole procedure. + +Steps 1 & 2 & 3 can be done with one command. Steps 5 & 6 & 7 can be +done with one command. + +Above procedure (steps 1 - 7) can be done as follows: + +`sudo sd-mux-ctrl --device-serial=odroid_u3_1 --ts`\ +`... - do the flashing things`\ +`sudo sd-mux-ctrl --device-serial=odroid_u3_1 --dut` + +And potential extra reset by power switch: + +`sudo sd-mux-ctrl --device-serial=odroid_u3_1 --tick` + +Files +===== + +<span style="color:red">NOTE! Don\'t build the device. It has design +flaw in SD card power switching circuitry. It can power up DUT even if +TS side is selected. Also TS is powered if DUT side is the active one. +Proper fix is applied to SDWire and MuxPi but not yet in SD-MUX.</span> + +- Main board schematic: ![](Sdmux.pdf "fig:Sdmux.pdf") +- Main board fabrication files: + [sd-mux-fabrication-v2\_1.zip](https://git.tizen.org/cgit/tools/testlab/sd-mux/plain/doc/hardware/fabrication/sd-mux-fabrication-v2_1.zip) +- Micro SD card adapter fabrication files: + [usd-adapter-v1.zip](https://git.tizen.org/cgit/tools/testlab/sd-mux/plain/doc/hardware/fabrication/usd-adapter-fabrication-v1.zip) +- The hardware and software sources: [SD-MUX on + Tizen](https://git.tizen.org/cgit/tools/testlab/sd-mux/) + +[Category:Tool](Category:Tool "wikilink") +[Category:Testlab](Category:Testlab "wikilink") +[Category:Hardware](Category:Hardware "wikilink") +[Category:Common](Category:Common "wikilink") diff --git a/docs/platform/tool/SLAV.md b/docs/platform/tool/SLAV.md new file mode 100644 index 0000000000..6265669a25 --- /dev/null +++ b/docs/platform/tool/SLAV.md @@ -0,0 +1,117 @@ +Overview +======== + +The initial motivation behind this project was to aid team of release +engineers in automated testing on different hardware specifications, +different operating system versions, etc. [Tizen Image Testing +System](https://wiki.tizen.org/Laboratory) was developed to achieve +this. The laboratory has resolved the initial problem, but it wasn\'t +extensible and could be used only by release engineers. SLAV was +designed to aid during whole life-cycle of operating system development. + +Starting from hardware part of the project- MuxPi was designed to be +extensible. Currently following add-ons were created: + +- Microphone + Speaker - to allow voice interaction with target device + (e.g. use-case is testing voice assistant) +- IrDA - to allow test automation of TV (many modern TVs will go into + specific modes only when specific data is sent via IrDA) +- Plotter - mechanical touchscreen interactions (e.g. use-case is + testing secure applications, like banking, where some data cannot be + sent via SW events- like PIN code) + +SLAV elements +------------- + +SLAV stack topology: + +![image](Slav_topology.jpg "image"){width="640"} + +[Read more about **MuxPi**](https://wiki.tizen.org/MuxPi) + +**Boruta** is the device farm manager: + +- maintains list of registered MuxPi devices with capabilities of + connected devices +- provides status of MuxPi target devices +- manages requests for test devices access with attention to: + - priorities + - time schedulign + - requested capabilities and interfaces +- provides API for + - requesting and acquiring direct access to test devices + - listing devices, their capabilities and states + - booking targets for specific time +- controls access and time windows for working with target + +**Weles** is a simple, generic test framework using Boruta for accessing +devices. + +- maintains list of test requests +- uses Boruta for accessing test devices +- uses muxPi boards for: + - flashing test devices + - booting test devices + - running tests +- collects test results and artifacts +- provides API for: + - scheduling tests + - monitoring tests status + - gathering results and artifacts +- uses LAVA compatible test description files + +Whole test is described by a single yaml file in a format compatible +with Linaro LAVA specification. + +The file defines: + +- required capabilities of the target +- timeouts +- priority +- images and partition layout for preparing test device +- interface for accessing target +- credentials, input sequences +- test cases to be run defined as a list of: +- commands for controller +- commands for target +- files to be pushed to target +- artifacts to be collected from a target + +**Perun** is the release engineering test system designed to verify +prerelease and snapshot binary images on different types of test devices +using Weles test framework: + +- monitors publication and downloads prerelease and snapshot binary + images + - compares prerelease images with snapshot images and decides if + they should be tested + - delegates tests to Weles + - collects and interprets test results + - publishes tests results for binary images + +Links +----- + +**Wiki:** + +<https://wiki.tizen.org/MuxPi> + +<https://wiki.tizen.org/SDWire> + +<https://wiki.tizen.org/SD_MUX> + +**Repositories:** + +<https://review.tizen.org/gerrit/#/admin/projects/tools/muxpi-overlay> + +<https://review.tizen.org/gerrit/#/admin/projects/tools/muxpi> + +<https://review.tizen.org/gerrit/#/admin/projects/tools/boruta> + +<https://review.tizen.org/gerrit/#/admin/projects/tools/weles> + +<https://review.tizen.org/gerrit/#/admin/projects/tools/perun> + +<https://review.tizen.org/gerrit/#/admin/projects/tools/slav> + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/SWAP.md b/docs/platform/tool/SWAP.md new file mode 100644 index 0000000000..a3a3501bd4 --- /dev/null +++ b/docs/platform/tool/SWAP.md @@ -0,0 +1,176 @@ +Introduction to SWAP +-------------------- + +**SWAP** is a Tizen dynamic binary instrumentation tool, it allows +developers to trace and profile their applications. The tool supports a +number of Tizen devices and emulators and is supplied as a part of their +firmware. To check if your device contains **SWAP**, you can check is +swap-manager package installed:\ +`$ rpm -q swap-manager`\ +If the output looks like the following then **SWAP** is installed:\ +`swap-manager-3.0-7.6.i686`\ +So, if your device or emulator contains **SWAP**, you can start using +it.\ +**SWAP** is located on the target device, it is responsible for +gathering run time data about the developer\'s application. When it +works it is connected with a host side tool and communicates with it in +a format described at **SWAP** protocol (you can see it at +<swap-manager>`/docs/`). **SWAP** host side tool controls **SWAP** +execution, provides it with a profiling session options and receives +gathered data. There are two **SWAP** host-side tools:\ +\* [**Dynamic +Analyzer**](https://developer.tizen.org/development/tizen-studio/native-tools/debugging-your-app/dynamic-analyzer) +GUI and CLI tools provided with Tizen Studio; + +- **SWAP Python console tool**,  which is provided with the + **swap-manager** + ([git](git://git.tizen.org/platform/core/system/swap-manager)). + +**SWAP** contains several useful features for developers: + +- Function profiling. This feature allows the developer to trace + functions of interest of his application. It is based on uprobe + mechanism. The developer specifies which functions in which binary + files he wants to trace and when control flow reaches one, the event + related information is collected: function address, timestamp, + arguments etc. is generated. +- Profiling of OpenGL and system APIs related to memory management, + file operations, network and threading. This feature provides the + developer information about application\'s system resources usage. +- [Leak Sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html). + This feature generates report about memory leaks in the application. +- Context switch profiling. This feature adds data about context + switching to the trace. +- Sampling. Used for point of process execution sampling with the + specified period. + +### SWAP high-level design + +![SWAP high-level design](Hdesign.png "fig:SWAP high-level design") +**SWAP** consists of the several parts: user-space daemon, kernel +modules and SWAP library. + +- SWAP kernel modules provides + [kprobe](https://www.kernel.org/doc/Documentation/kprobes.txt) and + [uprobe](https://www.kernel.org/doc/Documentation/trace/uprobetracer.txt) + functionality and sampling feature. +- SWAP probe library is loaded at the target process memory area, used + for profiling system APIs and LSan analytic without using the + expensive uprobe mechanism. +- The daemon is used for communication between SWAP and host side. It + is also responsible for executing and killing applications, + transferring data between kernel- and user-space, communication with + the SWAP library instances at the target application\'s memory areas + and sending gathered data to host side. + +To use **SWAP** the developer needs **SWAP Python tool** on his +host-side. The developer specifies application for instrumentation, runs +**SWAP Python tool** and gets a gathered binary trace as a result of the +tool\'s work. The developer can use **Trace Parser**, which is also +provided within **swap-manager** sources, to convert binary trace to +more readable and understandable formats. + +SWAP Tool User Guide +-------------------- + +**SWAP tool** consists of two parts: **SWAP Python tool** itself and +**Trace Parser**. (the latest user guide can always be found at +<swap-manager>`/src/cli/swap_cli/docs/` and +<swap-manager>`/src/cli/trace_parser/docs/`).\ +**SWAP Python tool** is a python library which implements **SWAP tool** +host-side. It is used for interacting with **SWAP** daemon, located on +target, you can use it if your device contains an installed version of +**SWAP**. **SWAP Python tool** can be used as a part of another +application or, using its example as a reference, as a standalone tool.\ +**Trace Parser** is a part of **SWAP tool**. It is used for parsing +binary trace, gathered by System Wide Analyzer Performance (**SWAP**) +and outputting it in a specified format. **Trace Parser** supports +several output types: + +- text output; +- trace as a python source file output; +- JSON formatted output; +- CSV formatted output. + +### Getting the tool + +**SWAP tool** is provided as a part of **swap-manager**. To get **SWAP +Python tool** please do the following: + +- clone **swap-manager** sources and checkout to *tizen* branch:\ + +``\ +`$ git clone git://git.tizen.org/platform/core/system/swap-manager`\ +`$ cd swap-manager && git checkout tizen`\ + +### Build + +To run **SWAP Python tool** example, the user should do the following +steps: + +1. Install target application with debug flag. Applications installed + without debug flag are restricted for profiling due to security + reasons; +2. Edit `emulator.py` according to the user\'s target: + 1. set proper connection type for the field type in `connection` + dictionary; + 2. if the type is ssh, set `ip` and `port` values; + 3. add information about connection type: + - if connection is established via `sdb`, set `emulator`, + `device` or `serial` value for `target` field of `type_info` + dictionary; + - if connection is established via `ssh`, set SSH connection + parameters for `params` field and SSH username for + `username` field of type\_info dictionary; +3. Edit `example_conf.py` according to the target application data: + 1. set target application type to field `type` of `app_info` + dictionary that is contained in `app` dictionary. Now only + `NATIVE` applications are supported due to security reasons; + 2. set Tizen application ID to field `id` of `app_info` dictionary; + 3. add data about features desirable to use: + - if the user wants to use Sampling feature, add `sampling` + dictionary to the file and add `period` field in it with the + desirable period of sampling; + - if the user wants to use any of Memory profiling, File + profiling, Network profiling, Thread profiling, OpenGL + profiling, Context switch profiling, Leak Sanitizer + features, add `features` list somewhere in the file and add + here + `'memory', 'file', 'network', 'thread', 'opengl', 'context_switch', 'lsan'` + values accordingly. For always profiling version of the + features, add `for_all` for these features; + 4. add necessary user probes for the binaries of interest. To add + probe on the binary do the following: + 1. add a key-value pair to function\_inst dictionary that is + contained in app dictionary. The key should be a string with + a full path to the binary, the value should be a list; + 2. add tuple to the list; + 3. add name or address of the function of interest to the tuple + as the first value. Name should be a string, address should + be an integer; + 4. add string that represents function arguments to the tuple + as the second value. For the information about possible + values, please refer to the Config files + description section; + 5. add string with a character that represents return value of + the function to the tuple as the third value. For the + information about possible values, please refer to + the Config files description section; +4. Change directory to the `cli` directory and execute `example.py`: + $ cd <swap-manager>/src/cli/ && python -m example.example + +5. All artifacts of the profiling session will be placed at the + specified `output_dir` on stop. The default <output_dir> is + `/tmp/outdir/`. As a result of the following command, trace in + human-readable format will appear in <output_dir>`/trace.txt` file: + +<!-- --> + + $ cd <output_dir> + $ <swap-manager>/src/cli/trace_parser/bin/swap_parser -i trace.bin -o trace.txt -s session_data.json -a api_map_list -t text + +For an advanced API description and additional usage examples, please +refer to the [SWAP Python tool API +description](SWAP_Python_tool_API "wikilink") page. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/SWAP_Python_tool_API.md b/docs/platform/tool/SWAP_Python_tool_API.md new file mode 100644 index 0000000000..fc7eff8084 --- /dev/null +++ b/docs/platform/tool/SWAP_Python_tool_API.md @@ -0,0 +1,793 @@ +This page represents **SWAP Python tools** API description. + +Python tool API description +--------------------------- + +### Config files description + +**SWAP Pyton tool** sources contain an example of tool configuration +files, located at <swap-manager>`/src/cli/example/`. The folder contains +several config files: + ++-----------------------------------+-----------------------------------+ +| File | Content description | ++===================================+===================================+ +| emulator.py | # Provides target device/emul | +| | ator configuration. | +| | | +| | api_version = '1.0' | +| | # Used to verify compatibilit | +| | y of different config files; | +| | | +| | connection = { | +| | # Dictionary, containing data | +| | about the connection with the ta | +| | rget; | +| | | +| | 'ip': "127.0.0.1", | +| | # target IP address; | +| | | +| | 'type': "sdb", | +| | # target connection type. Pos | +| | sible values: | +| | # ssh - for SSH connection; | +| | # sdb - for SDB connection; | +| | # alone - for standalone prof | +| | iling; | +| | | +| | 'type_info': { | +| | 'target': 'emulator', | +| | }, | +| | # information about selected | +| | connection type, differs for diff | +| | erent type: | +| | # for sdb: | +| | # target - target type, emula | +| | tor, device and serial are suppor | +| | ted; | +| | # for ssh: | +| | # params - SSH connection par | +| | ameters; | +| | # username - SSH username. | +| | } | ++-----------------------------------+-----------------------------------+ +| example\_conf.py | # Provides application's prof | +| | iling session configuration. | +| | | +| | api_version = '1.0' | +| | # Used to verify compatibilit | +| | y of different config files; | +| | | +| | sampling = { | +| | # Turns on SWAP sampling feat | +| | ure and contains its options; | +| | | +| | "period": 50, | +| | # Period of sampling; | +| | } | +| | | +| | | +| | | +| | features = [ | +| | # Features, that doesn't requ | +| | ire additional options, are turne | +| | d on by including to this list. A | +| | vailable features are: | +| | 'memory', # memo | +| | ry API profiling feature for targ | +| | et binaries; | +| | 'file', # file | +| | API profiling feature for target | +| | binaries; | +| | 'network', # netw | +| | ork API profiling feature for tar | +| | get binaries; | +| | 'thread', # thre | +| | ad API profiling feature for targ | +| | et binaries; | +| | 'opengl', # Open | +| | GL API profiling feature; | +| | 'memory_for_all', # memo | +| | ry API profiling for all process | +| | binaries; | +| | 'file_for_all', # file | +| | API profiling for all process bi | +| | naries; | +| | 'network_for_all', # netw | +| | ork API profiling for all process | +| | binaries; | +| | 'context_switch', # cont | +| | ext switch profiling; | +| | 'lsan' # Leak | +| | Sanitizer feature; | +| | ] | +| | | +| | app = { | +| | # Dictionary that contains ap | +| | plication profiling data and opti | +| | ons; | +| | | +| | 'app_info': { | +| | # Dictionary that specifies a | +| | pplication for profiling; | +| | | +| | 'type': 'NATIVE', | +| | # Application type, possible | +| | values are: | +| | # NATIVE - for Tizen native a | +| | pplications; | +| | # COMMON - for console applic | +| | ations (isn't supported by SWAP); | +| | # RUNNING - for already runni | +| | ng applications (isn't supported | +| | by SWAP); | +| | # WEB - for Tizen web applica | +| | tions (doesn't supported now); | +| | | +| | 'id': 'org.example.fi | +| | lemanager', | +| | # The second parameter depend | +| | s on the type value: | +| | # for NATIVE: | +| | # id - Tizen native applicati | +| | on ID; | +| | # for COMMON: | +| | # path - path where applicati | +| | on binary is located; | +| | # for RUNNING: | +| | # pid - PID of the target pro | +| | cess. There is a special case for | +| | 'pid': -1 - this causes system-w | +| | ide instrumentation for all proce | +| | sses; | +| | # id - Tizen ID of the target | +| | application; | +| | # path - path where applicati | +| | on binary is located; | +| | # for WEB: | +| | # id - Tizen web application | +| | ID. | +| | | +| | }, | +| | 'function_inst': { | +| | # Dictionary that contains in | +| | formation about binary instrument | +| | ation probes; | +| | | +| | '/opt/usr/globalapps/ | +| | org.example.filemanager/bin/filem | +| | anager': [ | +| | # Each key of a dictionary is | +| | a path to binary for profiling; | +| | | +| | ('main', 'xxxx', | +| | 'd'), | +| | ], | +| | # Each value is an array for | +| | the key binary that contains tupl | +| | es of the following format: | +| | # function name in '' or addr | +| | ess; | +| | # string that describes argum | +| | ents of a target function, one ch | +| | aracter for each argument. The fo | +| | llowing values are accepted: | +| | # b - for bool value; | +| | # c - for char value; | +| | # f - for float value; | +| | # d - for int value; | +| | # x - for long value; | +| | # p - for pointer value; | +| | # w - for double value; | +| | # s - for C-string; | +| | # character that describes re | +| | turned value. Accepted all charac | +| | ters for arguments and more: | +| | # v and n - for function retu | +| | rns void | ++-----------------------------------+-----------------------------------+ + +### Python API and usage description + +**SWAP Python tool** example also contains tools API usage example in +`example.py` file: + ++-----------------------------------+-----------------------------------+ +| File | Content description | ++===================================+===================================+ +| example.py | #!/usr/bin/python2 | +| | | +| | import time | +| | from swap_cli import swap | +| | # To use SWAP Python tool swa | +| | p module should be imported from | +| | swap_cli folder. | +| | | +| | def simple_cb(data): | +| | pass | +| | | +| | # load configs | +| | c = swap.Client('example/emul | +| | ator.py') | +| | c.load_config(['example/examp | +| | le_conf.py']) | +| | # SWAP Python tool interface | +| | is provided via Client class obje | +| | ct. Client class object construct | +| | or takes path to the target confi | +| | g as an argument, so the user sho | +| | uld have one Client for each targ | +| | et. To provide profiling session | +| | configuration, load_config() meth | +| | od is used, it takes profiling se | +| | ssion config file as an argument. | +| | | +| | c.set_event_cb('MSG_PROCESS_I | +| | NFO', simple_cb) | +| | # After necessary configurati | +| | ons are loaded, some additional p | +| | reparations can be done, for exam | +| | ple, in this example callback is | +| | set on MSG_PROCESS_INFO - it will | +| | be called when MSG_PROCESS_INFO | +| | will be received. | +| | | +| | # instrumentation | +| | c.start('/tmp/outdir') | +| | # Profiling is started by sta | +| | rt() method, it takes output fold | +| | er path as an argument. In an out | +| | put folder, you can find trace an | +| | d another additional data (LSan r | +| | eports) after profiling. | +| | | +| | time.sleep(60) | +| | c.stop() | +| | # Profiling is finished by ca | +| | lling stop() method. | ++-----------------------------------+-----------------------------------+ + +The whole **SWAP Python tool** API is described below: + ++-----------------+-----------------+-----------------+-----------------+ +| API name | Arguments | Return value | Description | ++=================+=================+=================+=================+ +| class Clien | `target_conf`\ | object of | The class | +| t | string path to | `Client class` | provides all | +| | a file, that | | **SWAP Python | +| (constructo | contains target | | tool** | +| r) (target conf | device/emulator | | functionality, | +| ) | config (see | | which is | +| | above | | implemented as | +| | description of | | methods of the | +| | `emulator.py` | | class.\ | +| | for details) | | The class | +| | | | constructor | +| | | | takes target | +| | | | configuration | +| | | | file path as an | +| | | | argument, so, | +| | | | if several | +| | | | different | +| | | | targets are | +| | | | used for | +| | | | profiling, | +| | | | several | +| | | | `Client` class | +| | | | objects should | +| | | | be created. | +| | | | Configuration | +| | | | file | +| | | | description and | +| | | | details can be | +| | | | found above as | +| | | | a description | +| | | | of | +| | | | `emulator.py`. | ++-----------------+-----------------+-----------------+-----------------+ +| get_version | None | string that | Returns **SWAP | +| () | | matches **SWAP | Python tool** | +| | | Python tool** | version. | +| | | version | | ++-----------------+-----------------+-----------------+-----------------+ +| load_config | `path`\ | None | This function | +| (path) | string, path to | | is used to load | +| | a file that | | application\'s | +| | contains | | profiling data, | +| | profiling | | i.e. which | +| | session | | application is | +| | configuration | | a target one, | +| | (see above | | which features | +| | description of | | should be used. | +| | `example_conf.p | | `example_conf.p | +| | y` | | y` | +| | for details) | | can be used as | +| | | | an example of | +| | | | this | +| | | | configuration | +| | | | file, its | +| | | | description | +| | | | above covers | +| | | | all of the | +| | | | possible | +| | | | meanings. | ++-----------------+-----------------+-----------------+-----------------+ +| set_event_c | `event`\ | None | This function | +| allback(event, | string, that | | allows | +| callback) | matches message | | registering | +| | name\ | | user-defined | +| | `callback`\ | | callback on any | +| | pointer to a | | received SWAP | +| | function that | | message. Event | +| | will be called | | name depends on | +| | when event | | a protocol that | +| | message is | | is being used | +| | received | | and can be | +| | | | received from | +| | | | protocol | +| | | | description. | +| | | | For example, | +| | | | protocol 4.2 | +| | | | supports the | +| | | | following event | +| | | | names: | +| | | | | +| | | | - MSG\_PROCES | +| | | | S\_INFO | +| | | | - MSG\_TERMIN | +| | | | ATE | +| | | | - MSG\_ERROR | +| | | | - MSG\_SAMPLE | +| | | | - MSG\_SYSTEM | +| | | | - MSG\_FUNCTI | +| | | | ON\_ENTRY | +| | | | - MSG\_FUNCTI | +| | | | ON\_EXIT | +| | | | - MSG\_SYSCAL | +| | | | L\_ENTRY | +| | | | - MSG\_SYSCAL | +| | | | L\_EXIT | +| | | | - MSG\_FILE\_ | +| | | | FUNCTION\_ENTRY | +| | | | - MSG\_FILE\_ | +| | | | FUNCTION\_EXIT | +| | | | - MSG\_PROCES | +| | | | S\_STATUS\_INFO | +| | | | - MSG\_CONTEX | +| | | | T\_SWITCH\_ENTR | +| | | | Y | +| | | | - MSG\_CONTEX | +| | | | T\_SWITCH\_EXIT | +| | | | - MSG\_PROCES | +| | | | S\_MAP | +| | | | - MSG\_PROCES | +| | | | S\_UNMAP | +| | | | - MSG\_WEB\_S | +| | | | AMPLING | +| | | | - MSG\_APP\_S | +| | | | ETUP\_STAGE | +| | | | - MSG\_WEB\_A | +| | | | PP\_SETUP\_STAG | +| | | | E | +| | | | - MSG\_FBI | +| | | | - MSG\_UI\_HI | +| | | | ERARCHY | +| | | | - MSG\_PROBE\ | +| | | | _MEMORY | +| | | | - MSG\_PROBE\ | +| | | | _UIEVENT | +| | | | - MSG\_PROBE\ | +| | | | _RESOURCE | +| | | | - MSG\_PROBE\ | +| | | | _LIFECYCLE | +| | | | - MSG\_PROBE\ | +| | | | _SCREENSHOT | +| | | | - MSG\_PROBE\ | +| | | | _THREAD | +| | | | - MSG\_PROBE\ | +| | | | _SYNC | +| | | | - MSG\_PROBE\ | +| | | | _NETWORK | +| | | | - MSG\_PROBE\ | +| | | | _GL | +| | | | - MSG\_LSAN | +| | | | | +| | | | To get | +| | | | description | +| | | | which message | +| | | | stands for | +| | | | which event, | +| | | | please refer to | +| | | | the protocol | +| | | | description.\ | +| | | | `callback` is a | +| | | | pointer to the | +| | | | callback | +| | | | function which | +| | | | should be | +| | | | called when | +| | | | `event` message | +| | | | is received. | +| | | | The callback | +| | | | function should | +| | | | have the | +| | | | following | +| | | | signature:\ | +| | | | `callback(data) | +| | | | `\ | +| | | | where `data` is | +| | | | message | +| | | | payload. | +| | | | Payload has a | +| | | | protocol- and | +| | | | message-specifi | +| | | | c | +| | | | format, so, | +| | | | please refer to | +| | | | the protocol | +| | | | description for | +| | | | details. | ++-----------------+-----------------+-----------------+-----------------+ +| start(outdi | `outdir`\ | None | It establishes | +| r) | string with | | connection | +| | path to an | | between **SWAP | +| | output | | Python tool** | +| | directory where | | on host and | +| | trace, LSan | | **SWAP** on | +| | reports, | | target and | +| | necessary | | starts | +| | target info | | profiling | +| | etc. will be | | target | +| | located. The | | application. | +| | directory will | | After workflow | +| | be created if | | has returned | +| | it doesn\'t | | from `start()` | +| | exist. | | **SWAP** is | +| | | | supposed to be | +| | | | executed on | +| | | | target. Trace | +| | | | is saved to | +| | | | <outdir>`/trace | +| | | | .bin file`. | ++-----------------+-----------------+-----------------+-----------------+ +| is_alive() | None | bool - True if | Function checks | +| | | **SWAP** has | if connection | +| | | returned | with target | +| | | response, False | **SWAP** works | +| | | otherwise | and if **SWAP** | +| | | | responds on | +| | | | host\'s | +| | | | requests. | ++-----------------+-----------------+-----------------+-----------------+ +| stop() | None | None | Stops tracing, | +| | | | closes | +| | | | connection with | +| | | | the target | +| | | | **SWAP**. | ++-----------------+-----------------+-----------------+-----------------+ + +Trace Parser API description +---------------------------- + +Besides **SWAP** trace, **Trace Parser** also requires some additional +data about gathered trace: trace protocol version, target +device/emulator info about CPU cores count and count of energy devices +located on target (its top energy consumers, like LCD, CPU, WiFI and so +on). Optionally, API map list can be added from the target: it provides +additional data about gathered API functions.\ +User can specify trace data manually or, which is most preferable, take +it from output directory of **SWAP tool** with the trace. File named +`session_data.json` contains all the necessary data for tracing.\ +API map list file can also be found at the output of **SWAP tool**, +it\'s named `api_map_list`. + +### Protocol versions + +**Trace Parser** supports the following protocol versions: + +- 3.0 +- 4.0 +- 4.1 +- 4.2 + +Protocol version should be chosen the same as one on the target where +the trace was gathered. For detailed information and protocol +description, please refer to Protocol Description located at +`swap-manager/docs/protocol.rst` or at **swap-manager** README file.\ +If the user hasn\'t specified any protocol version, **4.2** protocol +version will be used as default. + +### Output types + +**Trace Parser** supports the following output types: + + Type Short Description + -------- ------- ---------------------------------------- + text t Output in human-readable text format + python p Output is formatted like python module + json j Output in JSON format + csv c Output in comma-separated value format + +The user can specify the type by its name (*Type column*) or short name +(*Short column*). + +#### Text output format + + msg_id = 0x1 //message ID number in hex format + seq_num = 0 //message sequence number + sec = 1510680912 //second when event has occurred + usec = 436919901 //microsecond when event has occurred + payload_len = 8617 //length of message specific data + ... // Rest is message specific information + ============================= // Such line separates messages + +#### Python output format + + trace_info = { # Contains data about parsed trace + 'protocol_version': 42 # Trace's protocol version + } + trace obj = [ # Array that contains all trace messages. Each message is a dictionary + { + 'msg_id': 0x1, # Message ID number in hex + 'seq_num': 0, # Message sequence number + 'sec': 1510680912, # Second when event has occurred + 'usec': 436919901, # Microsecond when event has occurred + 'payload_len': 8617, # Length of message specific data + ..., # Message specific data + }, + ... # Other messages + ] + +#### JSON output format + + { + "trace_info" : { # Contains data about parsed trace + "protocol_version" : 42 # Trace's protocol version + }, + "trace_obj" : [ # Contains all trace messages + { + "msg_id" : 1, # Message ID number + "seq_num': 0, # Message sequence number + "sec": 1510680912, # Second when event has occurred + "usec": 436919901, # Microsecond when event has occurred + "payload_len": 8617, # Length of message specific data + ... # Message specific data + }, + ... # Other messages + ] + +#### CSV output format + + Message ID Sequence number Second Microsecond Length Message specific data + ------------ ----------------- ------------- ------------- -------- ----------------------- + 0x1, 0, 1510680912, 436919901, 8617, \... + +### Arguments description + +**Trace Parser** supports the following command-line arguments: + + Argument Options Description + ------------------ ----------------------- ------------------------------------------------------------------------------------------------------------------------------- + \--help, -h Print usage + \--input, -i input file path Path to trace file. If not specified, trace is taken from `stdio`. **Optional** + \--output, -o output file path Path to output file. If not specified, data outputted to `stdout`. **Optional** + \--session, -s session data file Path to `session_data.json` file. If not specified, target data is taken from command line arguments or default. **Optional** + \--api\_map, -a API map list file Path to `api_map_list` file. **Optional** + \--cpu\_num, -c CPUs number Number of CPUs at the target device. If not specified, is taken from `session_data.json` or default. **Optional** + \--devs\_num, -d energy devices number Number of energy devices on target. If not specified, is taken from `session_data.json` or default. **Optional** + \--version, -v protocol version Protocol version. If not specified, is taken from `session_data.json` or default. **Optional** + \--type, -t output type Output format + +You can run **Trace Parser** by running the following command in a +directory, which contains `swap_parser` executable and `libspp.so` +library. For example, with `session_data.json` and `api_map_list` +specified: + + $ ./swap_parser -i trace.bin -o trace.txt -s session_data.json -a api_map_list -t text + +This command will read `trace.bin`, parse it into text format and output +to `trace.txt`. The same command, if target info data is specified +manually: + + $ ./swap_parser -i trace.bin -o trace.txt -c 4 -d 5 -v 4.2 -a api_map_list -t text + +If user wants to use default data, it will be like the following: + + $ ./swap_parser -i trace.bin -o trace.txt -t text + +Or the minimum command, that expects trace at `stdin` and outputs it to +`stdout`: + + $ ./swap_parser -t text + +For **Development and support** guide see attached ![Trace Parser +maintain readme](MAINTAIN.pdf "fig:Trace Parser maintain readme"). + +Advanced usage examples +----------------------- + +All the examples below expects that the preparation work has been +already done and that current directory is <swap-manager>`/src/cli/`. + +### Function profiling on emulator, storing data in human-readable format + +- Creating target configuration file, saved as `target_conf.py`: + +<!-- --> + + api_version = '1.0' + + connection = { + 'ip': "127.0.0.1", + + 'type': "sdb", + 'type_info': { + 'target': 'emulator', + }, + } + +- Creating profiling session configuration file, saved as + `session_conf.py`: + +<!-- --> + + api_version = '1.0' + + env = { + 'apps_path': "/opt/usr/globalapps/", + } + + features = [ + ] + + app = { + 'app_info': { + 'type': 'NATIVE', 'id': 'org.example.filemanager', + }, + + 'function_inst': { + '/opt/usr/globalapps/org.example.filemanager/bin/filemanager': [ + ('main', 'xxxx', 'd'), + ], + '/lib/libc.so.6': [ + ('malloc', 'd', 'p'), + ], + }, + } + +- Creating execution script, saved as `run_script.py`: + +<!-- --> + + #!/usr/bin/python2 + + import time + from swap_cli import swap + + # load configs + c = swap.Client('target_conf.py') + c.load_config(['session_conf.py']) + + # instrumentation + c.start('/tmp/outdir') + time.sleep(60) + c.stop() + +- Execute run\_script.py and wait till it finished; +- Parse binary trace to human-readable format: + +<!-- --> + + $ trace_parser/bin/swap_parser -i /tmp/outdir/trace.bin -o /tmp/parsed_trace.txt -t t -s /tmp/outdir/session_info.json + +- Now parsed trace is stored at `/tmp/parsed_trace.txt`. + +### Memory profiling on device, storing data in Python module format + +- Modifying created `target_conf.py`: + +<!-- --> + + api_version = '1.0' + + connection = { + 'ip': "127.0.0.1", + + 'type': "sdb", + 'type_info': { + 'target': 'device', + }, + } + +- Modifying created `session_conf.py`: + +<!-- --> + + api_version = '1.0' + + env = { + 'apps_path': "/opt/usr/globalapps/", + } + + features = [ + 'memory' + ] + + app = { + 'app_info': { + 'type': 'NATIVE', 'id': 'org.example.filemanager', + }, + } + +- Execute `run_script.py` and wait till it finished; +- Parse binary trace to Python module format: + +<!-- --> + + $ trace_parser/bin/swap_parser -i /tmp/outdir/trace.bin -o /tmp/parsed_trace.py -t p -s /tmp/outdir/session_info.json + +- Now parsed trace is located at `/tmp/parsed_trace.py`, it can be + imported at any Python script with the code like, depending on the + Python script location: + +<!-- --> + + import parsed_trace + +### Counting malloc()\'s for the application on device + +- Modifying `session_conf.py`: + +<!-- --> + + api_version = '1.0' + + env = { + 'apps_path': "/opt/usr/globalapps/", + } + + features = [ + ] + + app = { + 'app_info': { + 'type': 'NATIVE', 'id': 'org.example.filemanager', + }, + + 'function_inst': { + '/lib/libc.so.6': [ + ('malloc', 'd', 'p'), + ], + }, + } + +- Modifying execution script `run_script.py`: + +<!-- --> + + #!/usr/bin/python2 + + import time + from swap_cli import swap + + malloc_cnt = 0 + + def malloc_cb(data): + malloc_cnt += 1 + + # load configs + c = swap.Client('target_conf.py') + c.load_config(['session_conf.py']) + c.set_event_cb('MSG_FUNCTION_ENTRY', malloc_cb) + + # instrumentation + c.start('/tmp/outdir') + time.sleep(60) + c.stop() + + print "Malloc count = " + malloc_cnt + +- Execute `run_script.py` and wait till it finished +- At the end, `malloc()`\'s count is printed in `stdout`. + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Store.md b/docs/platform/tool/Store.md new file mode 100644 index 0000000000..3aa8435560 --- /dev/null +++ b/docs/platform/tool/Store.md @@ -0,0 +1,24 @@ +Use this page to report experiences with publishing +[Applications](Applications "wikilink") to Tizen Store. + +Out of ideas check [Apps](Apps "wikilink") page too + +#### Mobile + +For Support \> My Q&A in the Tizen Seller Office. + +- <http://tizenstore.com/> + +#### Wearable + +- <https://seller.samsungapps.com/> + +#### Resources + +- <http://www.tizenincentive.com/> +- <https://samsung.tizenforum.com/news/samsung-electronics-announces-'tizen-developer-incentive-program-2017'/> +- <http://www.slideshare.net/rzrfreefr/tizen-storez120150228rzr> +- <http://www.tizenexperts.com/2016/11/tizen-mobile-app-incentive-program-devs-cash/> +- <http://www.slideshare.net/badaindonesia/tizen-application-validation> + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_3.0_GBS_Local_Fullbuild_Guide_for_TM1.md b/docs/platform/tool/Tizen_3.0_GBS_Local_Fullbuild_Guide_for_TM1.md new file mode 100644 index 0000000000..ce213a6dcc --- /dev/null +++ b/docs/platform/tool/Tizen_3.0_GBS_Local_Fullbuild_Guide_for_TM1.md @@ -0,0 +1,915 @@ +Introduction +============ + +This document is to describe how to build Tizen 3.0 profile using GBS +fullbuild and create Tizen images using MIC for TM1 reference phone.\ +\* TM1 specification: <https://wiki.tizen.org/wiki/TM1> + +- Full source: <http://review.tizen.org> +- Branch: tizen +- Profile: mobile, common +- Linux distribution: Ubuntu 14.04.3 X64 LTS +- Repository: + <http://download.tizen.org/snapshots/tizen/%7Bbase%7Cmobile>} + +As a prerequisite, You must install GBS and MIC software by reading +\\How to install GBS and MIC is well described in official Tizen +documentation. + +- GBS: + <https://source.tizen.org/documentation/reference/git-build-system>, +- MIC image creator: + <https://source.tizen.org/documentation/reference/mic-image-creator>\ + \ + +How to build Tizen:mobile with arm-wayland repository for TM1 device +will be described to give you an example.\ +How to create Tizen images using mic with RPMs created by GBS Local Full +Build will be described in last chapter. + +**Example** + + invain@u1404:/work/infra$ gbs --version + gbs 0.24.1 + invain@u1404:/work/infra$ mic --version + mic 0.27.1 + invain@u1404:/work/infra$ cat /etc/lsb-release + DISTRIB_ID=Ubuntu + DISTRIB_RELEASE=14.04 + DISTRIB_CODENAME=trusty + DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS" + +There are two ways to construct full source tree of Tizen 3.0 as +follows. In this page, We only depict how to build Tizen 3.0 full source +for TM1. + +- Use \'\*.src.rpm\' +- Use \'repo init\' and \'repo sync\' + +Download full source using repo +=============================== + +Setup parameters +---------------- + +Below describes the meaning of the each environment variable. + +- workspace : overall workspace\ +- buildroot: GBS build will be run and build result (RPMs and logs) + will be located in this buildroot\ +- snapshot\_date: snapshot date that is available in the official + repository. +- snapshot\_base: snapshot url where pre-built rpms are published\ +- snapshot\_mobile: snapshot url where \*.src.rpm (which you want to + build) are published\ +- repo\_base: path where pre-built rpms are downloaded\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ buildroot=$workspace/GBS-ROOT/ + $ snapshot_date=20160803.1 + $ snapshot_base=http://download.tizen.org/snapshots/tizen/base/tizen-base_${snapshot_date}/ + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + + $ mkdir -p $workspace + $ $ cd $workspace + +\ + +Getting full source with repo command +------------------------------------- + +- To initialize repositories, Run repo init -u + <ssh://><user_name>\@review.tizen.org:29418/scm/manifest -b <branch> + -m <profile>.xml\ +- Replace projects.xml file inside \$workspace/.repo/ with manifest + file in \$snapshot\_mobile\ +- To download latest repository, Run repo sync\ + +**Example** + + $ cd $workspace + $ vi ~/.ssh/config + Host review.tizen.org + User <your_name> + Identityfile ~/.ssh/tizen_rsa + HostName review.tizen.org + Port 29418 + $ + $ ssh -p 29418 <your_user_name>@review.tizen.org + + **** Welcome to Gerrit Code Review **** + Hi Your Name, you have successfully connected over SSH. + + Unfortunately, interactive shells are disabled. + To clone a hosted Git repository, use: + git clone ssh://<your_user_name>@review.tizen.org:29418/REPOSITORY_NAME.git + + $ repo init -u ssh://<your_user_name>@review.tizen.org:29418/scm/manifest -b tizen -m mobile.xml + $ pushd ./.repo/manifests/mobile/ + $ wget $snapshot_mobile/builddata/manifest/tizen-mobile_${snapshot_date}_arm-wayland.xml + $ mv projects.xml projects.xml.original + $ mv tizen-mobile_${snapshot_date}_arm-wayland.xml projects.xml + $ popd + $ time repo sync -j<CPU_NUMBER> + + . . . . . . OMISSSION . . . . . . + * [new tag] v4.1.6 -> v4.1.6 + * [new tag] v4.1.7 -> v4.1.7 + * [new tag] v4.1.8 -> v4.1.8 + * [new tag] v4.1.9 -> v4.1.9 + Fetching projects: 100% (624/624), done. + Checking out files: 100% (294637/294637), done. files: 4% (12474/294637) + Checking out files: 100% (43880/43880), done. + Checking out files: 100% (50027/50027), done.ut files: 31% (15715/50027) + Checking out files: 100% (45937/45937), done.ut files: 36% (16588/45937) + Checking out files: 100% (46180/46180), done.ut files: 42% (19602/46180) + Syncing work tree: 100% (624/624), done. + + real 49m51.088s + user 16m59.840s + sys 4m46.556s + invain@db400:/work/infra/gbs_fullbuild_mobile$ + +- If \"repo sync\" command completes successfully, you can have to see + the below files and folders. + +**Example** + + nvain@u1404:/work/infra/gbs_fullbuild_mobile$ ls -al + total 44 + drwxrwxr-x 10 invain invain 4096 8\uc6d4 6 13:00 . + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:24 .. + -r--r--r-- 1 invain invain 471 8\uc6d4 6 13:00 .gbs.conf + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 09:43 .repo + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:58 apps + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 12:59 platform + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:59 pre-built + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:59 profile + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 scm + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 sdk + drwxrwxr-x 6 invain invain 4096 8\uc6d4 6 13:00 tools + invain@u1404:/work/infra/gbs_fullbuild_mobile$ + invain@u1404:/work/infra/gbs_fullbuild_mobile$ + invain@u1404:/work/infra/gbs_fullbuild_mobile$ du -sh ./.repo/ + 14G ./.repo/ + invain@u1404:/work/infra/gbs_fullbuild_mobile$ + invain@u1404:/work/infra/gbs_fullbuild_mobile$ + invain@u1404:/work/infra/gbs_fullbuild_mobile$ du -sh ./* + 45M ./apps + 9.9G ./platform + 196M ./pre-built + 943M ./profile + 208K ./scm + 696K ./sdk + 996K ./tools + +\ +\* **TroubleShooting**: When there is en error in \'repo sync\', check +whether or not git project name of \'projects.xml\' exists in +<http://review.tizen.org>. If you face **\"error: Exited sync due to +fetch errors\"** message, try to run \"repo sync -f\" command. If you +face the error message repeatedly, you can find the reason of the issue +by running \"repo sync -f 2\>repo-sync-error.txt +1\>repo-sync-output.txt\" command in order to modify correctly the +folder name of the projects. + +**Example** + + # Find incorrect project paths + $ repo sync -f 2>repo-sync-error.txt 1>repo-sync-output.txt + $ cat ./repo-sync-error.txt | grep error + # Then, modify correctly a project path in the projects.xml file after checking the latest project path on http://review.tizen.org. + $ vim .repo/manifests/mobile/projects.xml + platform/framework/base/tizen-locale --> platform/core/base/tizen-locale + + +If you want to modify the incorrect project paths automatically, we +recommend that you try to use check\_manifest.py script file that is +located in the ./\$workspace/.repo/manifests/Check\_manfiest/ folder. + +**Example** + + cd /work/infra/gbs_fullbuild_mobile_20160817.1-1 + time repo init -u https://pbs:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m common.xml + cat ./repo/manifests/README + vi ./.repo/manifests/Check_manfiest/check_manifest.py + 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --help + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p common --url common-latest --update + cat tizen_mobile_revision_diff.csv + + +\ + +Building full source using gbs +============================== + +Get build.conf from official website +------------------------------------ + +- Download xxxx-build.conf.gz from \$ + snapshot\_mobile/repos/arm-wayland/packages/repodata/ to + \$workspace/scm/meta/build-config\ +- Run \"unzip xxxx-build.conf.gz\"\ +- Replace xxxx-build.conf.gz with + \$workspace/scm/meta/build-config/build.conf\ + +**Example** + + $ cd $workspace + $ curl $snapshot_mobile/repos/arm-wayland/packages/repodata/xxx-build.conf.gz|gunzip > ./scm/meta/build-config/build.conf + +\ + +Configure .gbs.conf file +------------------------ + +- Note that buildroot and buildconf variable must be existed in + \$workspace/.gbs.conf for full build. If \$workspace/.gbs.conf is + not existed, gbs try to find \~/.gbs.conf file.\ + +**Example** + + $ vi $workspace/.gbs.conf + + [general] + tmpdir=/var/tmp/ + profile = profile.tizen3.0_mobile + work_dir=. + fallback_to_native=true + + [repo.tizen3.0_x86] + url=${work_dir}/pre-built/toolchain-x86/ + + [repo.tizen3.0_arm] + url=${work_dir}/pre-built/toolchain-arm/ + + [repo.tizen3.0_base] <==== Here!!! Append this line. + url=${work_dir}/pre-built/toolchain-arm/ <==== Here!!! Append this line. + + [repo.tizen3.0_arm64] + url=${work_dir}/pre-built/toolchain-arm64/ + + [profile.tizen3.0_mobile] + repos=repo.tizen3.0_x86,repo.tizen3.0_arm,repo.tizen3.0_base <==== Here!!! Append this line. + buildconf=${work_dir}/scm/meta/build-config/build.conf + buildroot=./GBS-ROOT/ <==== Here!!! Append this line. (*Caution: Don't use ${work_dir} for buildroot) + exclude_packages=libtool,gettext,texinfo + +\ + +Build full source with gbs command +---------------------------------- + +- Run \"gbs build\" command in \$workspace folder with appropriate + build options.\ +- Refer to + <https://source.tizen.org/ko/documentation/developer-guide/getting-started-guide/building-packages-locally-gbs> + in order to set the list of packages to be excluded or to break + dependency circle. +- While \"gbs build\" command is running, The **depanneur** tool goes + through local Git trees and evaluates packaging meta-data to + determine packages needed and the build order. Please, refer to + <https://wiki.tizen.org/wiki/Working_Mechanism_of_Depanneur> for + more details on **depanneur**. + +**Example** + + $ cd $workspace + $ accel_pkgs="bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,\ + gawk,gmp,gzip,libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,\ + ncurses-libs,nodejs,nspr,nss-softokn-freebl,nss,openssl,patch,popt,rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc" + $ time sudo gbs build -A armv7l --threads=4 --clean-once --exclude=${accel_pkgs},filesystem,aul,libmm-sound,libtool -B ./GBS-ROOT + +- For you convenience, you can specify the package list using + \"exclude\_packages\" variable in order to be excluded for building + as follows. Not that multiple packages can be separated by comma(,) + +**Example** + + $ vi $workspace/.gbs.conf + [profile.tizen3.0_mobile] + exclude_packages=bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,gawk,gmp,gzip,\ + libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss- softokn-freebl,nss,openssl,patch,popt,\ + rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc,filesystem,aul,libmm-sound,libtool + +- Sometimes, you have to utilize the below flags of \"gbs build\" + command to find a reason of a unexpected issue. + +**Example** + + $ time sudo gbs build -A armv7l --threads=4 --clean-once -B ./GBS-ROOT + + $ gbs build -A armv7l # build all packages under current dir for armv7l + $ gbs build -A armv7l --overwrite # rebuild the packages + $ gbs build -A armv7l --include-all # build packages including un-commit changes + $ gbs build -A armv7l --incremental # incremental build + $ gbs build -A armv7l --noinit # build with offline mode + $ gbs build -A armv7l --clean # clean build by deleting the old build root + $ gbs build -A armv7l --clean --clean-repos #clean build by deleting the old build root and old repository + $ gbs build -A armv7l <gitdir> # build all packages under <gitdir> + +- **TroubleShooting**: **qemu: Unsupported syscall: 311** + +While building all packages, the 311 numbered system call(e.g., **qemu: +Unsupported syscall: 311** ) warning message is displayed because +QEMU\'s linux-user emulation layer doesn\'t currently support any of the +compatible key control system calls. Fortunately, It is not harmful to +build Tizen packages.\ + +- **TroubleShooting**: \"**Permission Denied at /usr/bin/depanneur + line 2017**\" error message + +If \"gbs build -A armv7l \...\" command generates the below error +message from second time with the same command (e.g., gbs build \....), +It results from the root privilege for QEMU\'s chroot. + +**Example** + + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) .applications: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) apps_rw: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/ssl/) private: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/) root: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/var/cache/) ldconfig: Permission Denied + at /usr/bin/depanneur line 2017. + +Please, remove ./GBS-ROOT/ folder. OR \"gbs build\" command with sudo. + +**Example** + + sudo rm -rf ./GBS-ROOT/ + +- **TroubleShooting**: \"**nothing provides pkgconfig(\...)**\" error + message + +It is not mandatory. However,If you face \"**nothing provides +pkgconfig(\...)**\" error message at build-time, you have to follow up +the below recipe that prepares Pre-built RPMs of Base to solve the issue +. + +**Solution**: Using local folder as a base repository (Recommended): +Download all the RPMs in \$snapshot\_base/repos/arm/packages/ to +\$repo\_base. Check all the RPMs are well downloaded in \$repo\_base.\ +**Example** + + $ wget --directory-prefix=$repo_base --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $snapshot_base/repos/arm/packages/ + $ createrepo --update $repo_base + $ createrepo --update pre-built/toolchain-arm + $ createrepo --update pre-built/toolchain-x86 + +- **TroubleShooting**: the build error of tizen-debug: **nothing + provides glibc-debuginfo = 2.20** + +The tizen-debug package requires glibc-debuginfo package to support +debugging operations(e.g. .debug\_frame section) via valgrind. The +glibc-debuginfo package is located in debug folder of download.tizen.org +website. So, you have to append the below repository additonally to +build tizen-debug package normally. **Example** + + http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/debug/ + +\ + +- **TroubleShooting**: error: Start commit \'upstream/x.x.x\' **not an + ancestor of end commit \'HEAD**\' + +Sometime, While running \"gbs build\" command, you can meet the below +error messages as a \"Export Error Packages\" issue. Please, refer to +the +<https://wiki.tizen.org/wiki/Analyzing_GBS_Local_Full_Build_Errors#Upstream_Tag_Issue> +for more details. + +**Example**: error messages + + . . . Upper Omission . . . + 1941 info: start export source from: /work/infra/gbs_fullbuild_mobile3/platform/upstream/newfs-msdos ... + 1942 info: tracking branch: tizen-gerrit/upstream -> upstream + 1943 info: tracking branch: tizen-gerrit/pristine-tar -> pristine-tar + 1944 warning: Deprecated option '--git-export-only', please use '--no-build' instead! + 1945 info: Generating patches from git (upstream/1.0.0..HEAD) + 1946 error: Start commit 'upstream/1.0.0' not an ancestor of end commit 'HEAD' + 1947 error: Generating upstream tarball and/or generating patches failed. GBS tried this as you have upstream branch in you git tree. Fix the problem by either: + 1948 1. Update your upstream branch and/or fix the spec file. Also, check the upstream tag format. + 1949 2. Remove or rename the upstream branch (change the package to native) + 1950 See https://source.tizen.org/documentation/reference/git-build-system/upstream-package for more details. + 1951 error: <gbs>Failed to export packaging files from git tree + . . . Below Omission . . . + +You have to ask an appropriate package developers in order to fix the +incorrect tagging issue. Actually, this issue is generated by the +package developers that do not correctly observe [the \"Updating +Packages\" +manual](https://wiki.tizen.org/wiki/Updating_packages#3._Use_tarball) + +**Example** : How to fix the issue + + $ git checkout tizen + $ gbs submit -m "update to x.x.x" + +Creating image using MIC +======================== + +Mobile Image Creator (MIC) is used to create images for Tizen software +platform. + +Setup parameters +---------------- + +- workspace : overall workspace for mic\ +- mic\_workspace: path for MIC workspace\ +- mic\_images: path where images are created\ +- mic\_ks\_files: path where \*.ks files are downloaded\ +- mic\_logs: path where mic log files are saved\ +- snapshot\_date: snapshot date that is available in the official + repository.\ +- snapshot\_mobile which is used in GBS Local Fullbuild\ +- repo\_base: path which is used in GBS Local Fullbuild\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ mic_workspace=$workspace/mic_workspace + $ mic_images=$mic_workspace/images + $ mic_ks_files=$mic_workspace/builddata/image-configs + $ mic_logs=$mic_workspace/builddata/logs + $ snapshot_date=20160803.1 + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_$snapshot_date/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + $ mkdir -p $mic_workspace $mic_images $mic_ks_files $mic_logs + +\ + +Download \*.ks file +------------------- + +- Download \*.ks file (kickstart file) what you want from + \$snapshot\_mobile/images\ + +`* `[`http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snaptshot_date}_mobile-wayland-armv7l-tm1.ks`](http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_$%7Bsnaptshot_date%7D_mobile-wayland-armv7l-tm1.ks) + +**Example** + + $ wget --directory-prefix=$mic_ks_files $snapshot_mobile/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snapshot_date}_mobile-boot-armv7l-tm1.ks + +How to customize \*.ks file +--------------------------- + +- We have to modify baseurl of \'repo\' in \*.ks file in order to use + \*.RPMs which are built by GBS Local Full-build,\ +- Add \'\--priority=99\' to profile related repo to download + mic-bootstrap.\ +- Add \'local\' repo in \*.ks file whose baseurl is path of GBS + full-build results \*.RPMs\ +- Replace baseurl of \'base\' repo in \*.ks file from remote\_url to + \$repo\_base\ +- Create repo and repodata from \$repo\_base to be used in \*.ks file\ + +**Example** + + $ vi ./tizen-mobile_20160805.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #original ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no + repo --name=base_arm --baseurl=http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/ --ssl_verify=no + + $ vi ./tizen-mobile_20160805.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #modified ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no --priority=99 + repo --name=base_arm --baseurl=file:///work/infra/gbs_fullbuild_mobile/pre-built/toolchain-arm --priority=1 + repo --name=local_mobile --baseurl=file:///work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/repos/tizen3.0_mobile/armv7l --priority=1 + +\ + +Generating image file using mic +------------------------------- + +- To create Tizen images, execute the following commands:\ +- Refer to the Tizen:IVI case + (https://source.tizen.org/ko/documentation/developer-guide/all-one-instructions/creating-tizen-ivi-images-based-on-specific-snapshot-one-page?langredirect=1)\ + +<!-- --> + + $ mkdir $workspace + $ sudo mic cr auto $mic_ks_files/tizen-mobile_${snapshot_date}_mobile-target-TM1-armv7l-tm1.ks --logfile=$mic_logs/_mobile-target-TM1-armv7l-tm1 -o $mic_images + ( $ sudo mic cr auto tizen_mobile-target-TM1-armv7l-tm1.ks --tmpfs) + +Tip & Techniques +================ + +Filtering Base Packages +----------------------- + +To filter base packages, perform the following procedure: + +1\. Move binaries to another directory by executing the following +commands: + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/base/`\ +`       mv ~/GBS-ROOT/local/cache/*rpm ~/tizen_mobile_src/pre-built-set/base/` + +2\. Filter the base binaries by using the references below: + +- For failed packages (caused by downloading or other reasons), remove + related binaries in the cache. In this case, we need to move the + related binaries from base to another dir because the rpm is not + neccessary. In the end, these failed packages should be fixed by + developers and they don\'t belong to pre-built. + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/extra/`\ +`       mv ~/tizen_mobile_src/pre-built-set/base/xxx.rpm ~/tizen_mobile_src/pre-built-set/extra/` + +- Based on experience, exclude the following packages from cache: + +`     ail, alarm, app-core, app-checker, app-svc, aul, automotive-message-*, dbus-glib,`\ +`     bundle, capi-*, docbook, ecore, evas, eeze, elf-*, gst-plugins, gstreamer, pkgmgr,`\ +`     privacy-manager, python-*, perl-*, sensor, vconf, xdgmime, xmlcharent etc.` + +- Packages in a circle must be kept in cache or there will be + expansion errors. + +<!-- --> + +- There is another case as follows: + +`     package A run time requires B, but the build order of package B is later than A, in this case, we should remove binary of package B directly.`\ +`     Check the build log under ~/GBS-ROOT/local/repos/tizen3.0_mobile/armv7l/logs/success/`\ +`     grep -r downloading *`\ +`     A-1-0/log.txt:[    5s] [1/1] downloading `[`http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm`](http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm)` ...`\ +`     the build order:`\ +`     ...`\ +`     info: *** [1/897] building A-1-0 armv7l tizen3.0_mobile (worker: 0) ***`\ +`     info: finished building A`\ +`     ...`\ +`     info: *** [10/897] building B-1-1 armv7l tizen3.0_mobile (worker: 2) ***`\ +`     info: finished building B`\ +`     ...`\ +`     In this case, remove B-1-1.armv7l.rpm in cache` + +Removing and Adding Dependency Packages +--------------------------------------- + +The logistics of this section is as follows: + +`   check whether expansion error occurs`\ +`   if yes`\ +``        Add binaries to pre-built by following `Appendix_How to find dependency relationship for any package from repo` ``\ +`   else`\ +`       Go back to step-2 and step-3 recursively until you get a minimal pre-built`\ +`       set.` + +For example: + +`   bluetooth-share:`\ +`     nothing provides pkgconfig(aul)` + +Then find the package that provides pkgconfig (aul) + +`   pushd ./GBS-ROOT/local/order/`\ +`   grep -e "pkgconfig(aul)" .repo.cache| grep P:`\ +`   P:aul-devel.i686-1397286673/1397286678/0: aul-devel = 0.0.286-2.291 aul-devel(x86-32) = 0.0.286-2.291 pkgconfig(aul) = 0.1.0`\ +`   P:aul-devel.i686-1397286694/1397286699/0: aul-devel = 0.0.286-2.10 aul-devel(x86-32) = 0.0.286-2.10 pkgconfig(aul) = 0.1.0`\ +`   popd` + +So put **aul-devel** binary into pre-built + +Updating Pre-Built Binaries with Latest Repo +-------------------------------------------- + +To prepare pre-built binaries, execute the following commands: + +`  $ cd ~/tizen_mobile_src/pre-built/toolchain-arm`\ +`  $ ./tools/update_prebuilt.py -L . -R `[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20160803.1/repos/arm/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20160803.1/repos/arm/packages/) + +Upon successful execution of this script, the old binaries will be +replaced by the new binaries. If there is a repodata dir, make sure to +run \`createrepo \--update\` to update this pre-built directory. + +`   $createrepo --update ./repos_mobile`\ +`   $ ls ./repos_mobile/repodata/`\ +`   2fbd464035e46f900abeb4d84039d4afb1b3489420c9b633073faae470fa6b7d-primary.xml.gz`\ +`   4931aad22ff6a92ae94024c6db65a52687a0ff20ed5560fc01558b4fe8b45f32-primary.sqlite.bz2`\ +`   6bc611a44d146ae2171a53a3f2f5733e58998f4bd85b2e27a9d438fb44adf903-other.sqlite.bz2`\ +`   6cc425f57f8a218ba78cbd190b1e3391068e62927876ed627f270ee60561b5f5-filelists.sqlite.bz2`\ +`   713f5170c01e01b652f211baec23444e6aef7fdd699c867a32424d2f0ca962fc-filelists.xml.gz`\ +`   d9224b4b38b9d6c2b18ef3dce0002ac0ff511dcc21177d9578eb83bceb423157-other.xml.gz`\ +`   repomd.xml` + +How to find dependency relationship for any package from repo +------------------------------------------------------------- + +Run gbs build with any package, press Ctr-c at the start of build. Repo +is which you want to build with. + +`   gbs build -A armv7 -R /pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/ --skip-conf-repos --buildroot=~/GBS-ROOT`\ +`   info: generate repositories ...`\ +`   info: build conf has been downloaded at:`\ +`         /var/tmp/tizen.conf`\ +`   info: start building packages from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77 (git)`\ +`   2014-05-20 13:54 +0800`\ +`   info: prepare sources...`\ +`   info: start export source from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77/fake ...`\ +`   info: Creating (native) source archive fake-1.0.tbz2 from 'HEAD'`\ +`   info: package files have been exported to:`\ +`   /home/GBS-ROOT/local/sources/tizen/fake-1.0-1`\ +`   info: retrieving repo metadata...`\ +`   info: parsing package data...`\ +`   info: building repo metadata ...`\ +`   info: package dependency resolving ...`\ +`   info: next pass:`\ +`   fake`\ +`   info: *** [1/1] building fake-1.0-1 armv7l tizen (worker: 0) ***`\ +`   VM_IMAGE: , VM_SWAP:`\ +`   --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   logging output to /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.build.log...`\ +`   [    0s] Memory limit set to 21777108KB`\ +`   [    0s] Using BUILD_ROOT=/home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +`   [    0s] Using BUILD_ARCH=i686:armv7l:i486:i386:noarch`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] started "build fake.spec" at Tue May 20 05:54:35 UTC 2014.`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] processing specfile /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /home/GBS-ROOT/local/cache --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] initializing /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.srcfiles.cache ...`\ +`   [    0s] /usr/lib/build/createrpmdeps /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS`\ +`   [    0s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages`\ +`   [    1s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   ^C^C captured`\ +`   warning: build failed, Leaving the logs in /home/GBS-ROOT/local/repos/tizen/armv7l/logs/fail/fake-1.0-1/log.txt` + +Then open \~/GBS-ROOT/local/order/.repo.cache, it can provide all +information about every package from repo like: + +`   P:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm = 1.0-13.20 mic-bootstrap-x86-arm(x86-32) = 1.0-13.20`\ +`   R:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: /bin/sh`\ +`   I:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm-1.0-13.20 1397164816`\ +`   F:gdb-locale.noarch-1387595787/1387595811/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/gdb-locale-7.5.1-10.1.noarch.rpm`\ +`   P:gdb-locale.noarch-1387595787/1387595811/0: gdb-lang-all = 7.5.1 gdb-locale = 7.5.1-10.1`\ +`   R:gdb-locale.noarch-1387595787/1387595811/0: gdb = 7.5.1`\ +`   I:gdb-locale.noarch-1387595787/1387595811/0: gdb-locale-7.5.1-10.1 1387595787`\ +`   F:zypper-locale.noarch-1387597203/1387597217/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/zypper-locale-1.8.14-12.1.noarch.rpm` + +The meaning of these prefix characters are: + +- P what this package provides +- R what this package requires +- F where to find this package +- I Identifier of package + +Full Build Script (FBS) +======================= + +If you understand the above sections enough, you can easily repeat the +build procedure for your convenience. The Full Build Script (FBS) is a +simple script to understand how both full-build and partial-build are +executed by gbs. It helps that the developers can do both full-build and +partial-build easy-to-use without the need to read step-by-step +instruction. + +Full build +---------- + +**Example: to build full-source locally** + +1\. In case of the **repo sync \...** command, The script does not +perfectly handle the incorrect projects.xml.\ +2. In case of the **gbs build \...** command, The normal operation of +the script is dependent on the correctness of the fetched snapshot +packages and that of the git repositories. 3. If you meet gbs issues, +please report your issue at Tizen mailling list. + +- Mailman - <https://lists.tizen.org/listinfo/dev> +- Jira - <https://bugs.tizen.org/jira/projects/DEVT> + +\$ vi ./fbs.sh + + + + #!/usr/bin/env bash + # @Title: Full Build Script (FBS) + # @License: Apache + # @Date: Jan-11-2017 + # @Contacts: leemgs@gmail.com + # @Prequisites: cat, grep, wc, curl, time, repo, mkdir, wget, createrepo, rm, gunzip, gbs, tee, python-pip + # ($ sudo apt-get install coreutils gbs createrepo python-pip wget curl grep time gzip lynx-cur lynx ) + # @Host PC: + # 1. Ubuntu 14.04.5 LTS X64, Linux kernel 3.13.0-98-generic, GCC 4.8.4, Glibc 2.19 + # 2. Ubuntu 16.04.1 LTS X64, Linux kernel 4.4.0-42-generic, GCC 5.4.0, Glibc 2.23 + # @Description: This script is to build full source with just one 'enter' key + # It is Full Build Script (FBS) is a simple script to help personal developers that deploy Tizen platform + # on their embedded devices as well as Tizen reference devices. + # @Todo: a. Error handling function , b. Enabling check_manifest.py, c. Bottle-neck profiling + # + #-------------------------------- Configuration area: Please, modify with appropriate content -------------------- + # Define input arguments. There are five profiles currently in Tizen 3.0 + # __profie={common | mobile | ivi | tv | wearable | ...}, + # __target={arm-wayland | target-TM1 | ...}, + # __rpmrepo_date_base={20160819.1 | 20160819.2 | latest} // We don't recommend that you use "latest" because it is not stable. + # __rpmrepo_date_profile={20160823.1 | 20160823.1 | latest} // We don't recommend that you use "latest" because it is not stable. + + # 1) snapshot: lifespan of sanpshot is 3 months. + function define_snapshot { + __rpmrepo_date_base=20170210.1 + __rpmrepo_date_profile=20170210.1 + __rpmrepo_path=snapshots + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 2) release(daily): lifespan of release(daily) is 3 months . + function define_release_daily { + __rpmrepo_date_base=20161016.1 + __rpmrepo_date_profile=20161020.2 + __rpmrepo_path=releases/daily + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 3) release(weekly): lifespan of release(weekly) is 2 years . + function define_release_weekly { + __rpmrepo_date_base=20161016.1 + __rpmrepo_date_profile=20161020.2 + __rpmrepo_path=releases/weekly + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 4) release(official,m1/m2/m3): lifespan of release(official,m1/m2/m3) is 10 years. + function define_release_official { + __rpmrepo_date_base=20170104.1 + __rpmrepo_date_profile=20170111.1 + __rpmrepo_path=releases/milestone + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/3.0.m2/3.0.m2-base/tizen-3.0.m2-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/3.0.m2/3.0.m2-${__profile}/tizen-3.0.m2-${__profile}_${__rpmrepo_date_profile} + } + + # Select one among the four RPM repositories. + define_release_official + __cpu_number=`cat /proc/cpuinfo | grep "model name" | wc -l` + + #-------------------------------- Execution area: Please, don't modify the script from here ---------------------- + + function error_display { + if [ $? != 0 ]; then echo -e "$1"; exit 1 ;fi + } + + #### STEP 1/4: Sync the repository from https://git.tizen.org ####################################### + + # TBI (To Be Implemented) + function fix_incorrect_project_path_automatic { + cat ./.repo/manifests/README + ./.repo/manifests/Check_manfiest/check_manifest.py --help + error_display "\n\n* FBS:[1/4] Error Occurred while running check_manifest.py script" + # How to add user id and password for https authentification of https://review.tizen.org + # sudo apt-get install python-pip + # sudo pip install pygerrit + # vi ./.repo/manifests/Check_manfiest/check_manifest.py + # 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p ${__profile} --url ${__profile}-latest --update + # cat tizen_mobile_revision_diff.csv + } + + # Custom area: modify git repository address correctly in case of an wrong web addresses. + function fix_incorrect_project_path_manual { + sed -i -e 's/framework\/base\/tizen-locale/core\/base\/tizen-locale/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-direct/native\/ug-wifi-direct/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-nfc-efl/native\/ug-nfc-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-efl/native\/ug-wifi-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/bluetooth-share-ui/native\/bluetooth-share-ui/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-mobile-ap/native\/ug-mobile-ap/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-bluetooth-efl/native\/ug-bluetooth-efl/g' ./.repo/manifests/${__profile}/projects.xml + } + + function repo_init { + cd $__workspace + # time repo init -u ssh://${__tizen_id}@review.tizen.org:29418/scm/manifest -b tizen -m ${__profile}.xml + # time repo init -u https://${__tizen_id}:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m ${__profile}.xml + time repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m ${__profile}.xml + error_display "\n\n* FBS:[1/4] Error Occurred while running 'repo init' command" + curl $__rpmrepo_profile_url/builddata/manifest/tizen-${__profile}_${__rpmrepo_date_profile}_arm-wayland.xml > ./.repo/manifests/${__profile}/projects.xml + error_display "\n\n* FBS:[1/4] Error Occurred while downloading projects.xml with curl" + # todo: fix_incorrect_project_path_automatic + # todo: fix_incorrect_project_path_manual + } + + function repo_sync { + time repo sync -j${__cpu_number} 2>repo-sync-error.txt + if [[ $? != 0 ]]; then + echo -e "\n\n* FBS:[1/4] Error Occurred while downloading Source with repo sync" + echo -e " Please, modify correctly the below incorrect project paths after openning ./.repo/manifests/${__profile}/projects.xml.\n\n" + cat repo-sync-error.txt | grep "error: Cannot fetch" + exit 1 + fi + } + + function download_git_repo { + repo_init + repo_sync + } + + #### STEP 2/4: Download the pre-built RPM packages from http://download.tizen.org ################### + function download_prebuilt_rpms { + mkdir ./repos_base_packages + mkdir ./repos_base_debug + mkdir ./repos_${__profile}_packages + mkdir ./repos_${__profile}_debug + wget --directory-prefix=repos_base_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/packages/ + wget --directory-prefix=repos_base_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/debug/ + wget --directory-prefix=repos_${__profile}_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/packages/ + wget --directory-prefix=repos_${__profile}_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/debug/ + createrepo --update ./repos_base_packages + createrepo --update ./repos_base_debug + createrepo --update ./repos_${__profile}_packages + createrepo --update ./repos_${__profile}_debug + build_conf_file=`curl -l ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/ | grep -o "href=.*build\.conf\.gz\"" | sed -e 's/href="//g; s/"//g' ` + curl ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/${build_conf_file} | gunzip > ./scm/meta/build-config/build.conf + error_display "\n\n* FBS:[2/4] Error Occurred while downloading build.conf with curl" + } + + #### STEP 3/4: Run full-build ######################################################################## + function run_full_build { + rm -f ~/.gbs.conf + rm -f ./.gbs.conf + __local_repository_url="-R ./repos_base_packages/ -R ./repos_base_debug/ -R ./repos_${__profile}_packages/ -R ./repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ./GBS-ROOT ${__local_repository_url} -D ./scm/meta/build-config/build.conf | tee fbs-${__rpmrepo_date_profile}.txt + error_display "\n\n* FBS:[3/4] Error Occurred while building packages with gbs build" + } + #### STEP 4/4: View the report ####################################################################### + function view_report { + __report_file=${__workspace}/GBS-ROOT/local/repos/tizen/armv7l/index.html + if [ ! -f ${__report_file} ];then + echo -e "\n [Error] ${__report_file} is not generated." + else + lynx ${__report_file} + error_display "\n\n* FBS:[4/4] Error Occurred while reading the report file" + fi + } + + #### Main function ################################################################################### + # repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m <PROFILE>.xml + # repo sync + # gbs build --arch armv7l --threads <#CPU> --clean-once --include-all + # firefox /GBS-ROOT/local/repos/tizen/<ARCH>/index.html + # + download_git_repo # STEP 1/4 + download_prebuilt_rpms # STEP 2/4 + run_full_build # STEP 3/4 + view_report # STEP 4/4 + +**Screenshot** + +The below screenshot shows the console-based report result after +completing \"Tizen3.0:Common local full-build\" with full build script +on Ubuntu 16.04.1 X64 PC. If you want to see the report with GUI +interface, you may run \"firefox +./GBS-ROOT/local/repos/tizen/armv7l/index.html\" command. + +![FBS (Skeleton) +Screenshot](gbs-full-build-20161013-horizontal.png "FBS (Skeleton) Screenshot"){width="500"} + +Partial build +------------- + +**Example: to build one package (e.g. tizen-release package)** + +- The below example is to describe how to build a package in case that + the developer try to enhance existing packages after doing + full-build. + +<!-- --> + + $ cd $__workspace + $ cd ./platform/upstream/tizen-release + $ vi ./partial-build.sh + + #!/bin/bash + __work_space=/work/infra/gbs_fullbuild_common_20161108.1 + __profile=common + __cpu_number=1 + __local_repository_url="-R ${__work_space}/repos_base_packages/ -R ${__work_space}/repos_base_debug/ -R ${__work_space}/repos_${__profile}_packages/ -R ${__work_space}/repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ${__work_space}/GBS-ROOT ${__local_repository_url} -D ${__work_space}/scm/meta/build-config/build.conf + +Contributing your experience +============================ + +If you find additional tips and techniques to compile Tizen 3.0 full +source locally, Please, update this wiki page as a volunteer. + +[Category:Platform](Category:Platform "wikilink") +[Category:Tizen-3](Category:Tizen-3 "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_3.0_Porting_Guide.md b/docs/platform/tool/Tizen_3.0_Porting_Guide.md new file mode 100644 index 0000000000..45d4fd37a7 --- /dev/null +++ b/docs/platform/tool/Tizen_3.0_Porting_Guide.md @@ -0,0 +1,811 @@ +Introduction +============ + +Tizen Architecture +================== + +Development Environment Setup +============================= + +To set up the Tizen OS Development environment and to obtain information +regarding development, see the following links: + +- [Setup your + environment](https://source.tizen.org/documentation/developer-guide/environment-setup) +- [Installing development + tools](https://source.tizen.org/documentation/developer-guide/installing-development-tools) + +Getting the Source Code and Build +================================= + +Tizen Bootup Overview +===================== + +BSP Customization +================= + +Kernel Fundamentals +=================== + +System +====== + +Graphics and UI +=============== + +Multimedia +========== + +Connectivity +============ + +Location +======== + +Telephony +========= + +\ +This document covers detailed Telephony architecture including the +various components of Telephony and workflow through Telephony +framework. The document also provides porting guidelines for vendors to +ease the OAL interface development for their hardware. + +Tizen Telephony features + +- Telecommunication functionalities, such as call, SS, SMS, SIM, + network, and packet service +- Plug-in Architecture + +Definitions + +- Core object + - Bundle of functions and supportive database information + designated to specific module, such as call, SS, SIM, network, + which processes requests, responses, and notifications. + - Core objects form the executable component of a Telephony module + (call, SS, SIM, network) +- HAL + - HAL, Hardware Abstraction Layer, abstracts the actual hardware + used and ensures that similar functionality is provided by + various hardware (modems) of the same modem vendor. + - All hardware specific changes are controlled and processed by + HALs. + - The modem driver can be required depending on the modem chipset. +- Hooks + - Hooks provide a mechanism to tap requests, responses, and + notifications of other Telephony modules. + - Hooking is a transparent mechanism and does not affect the + normal processing of requests, responses, and notifications. + +Tizen Telephony Architecture +---------------------------- + +Tizen Telephony supports the plugin architecture, which provides +flexibility to include various types of predefined plugins into the +system with little change. + +![](telephony-arch.png "telephony-arch.png"){width="700"} + +The 3 major components of Tizen Telephony are the libraries, plugins, +and server. + +Telephony Libraries +------------------- + +Telephony API (TAPI) library + +The TAPI library (or simply TAPI) is a standardized interface provided +to applications to interact with Tizen Telephony. It is provided as a +`libtapi` package. The TAPI executes in the application's context, and +it provides sync and async APIs. The following figure shows the +`libtapi` internal composition. + +![](Libtapi.PNG "Libtapi.PNG"){width="500"} + +Applications can interface to Telephony features, such as call, SMS, and +network, through the respective module APIs exposed in the `libtapi` +library. Telephony also provides an additional library, `capi-telephony` +for third party applications. + +Core Telephony library + +The Core Telephony library (or `libtcore`) provides an API framework for +Tizen Telephony to inter-work. It is provided as `libtcore` package. The +following figure shows the internal composition overview of the +`libtcore`. + +![](Telephony03.png "Telephony03.png"){width="500"} + +With `libtcore`, you can: + +- Create, destroy, and maintain various server components, such as + server, communicator, HAL, plugin, and core object. +- Maintain storage, queue mechanism, and general utilities. +- Support CMUX (creation/destruction/processing). +- Parse AT. + +Telephony Plugins +----------------- + +There are 4 kinds of plugins: + +- Communicator plugins + - Interfaces TAPI and Telephony Server. + - For example, DBUS communicator (`DBUS_TAPI`) is provided by + default. + +: ![](Telephony04.png "fig:Telephony04.png"){width="200"} + +- Modem plugins + - Core functional units providing the Telephony functionality. + - Maintain and manage the Telephony states. + - Maintain and manage the databases related to Telephony. + +: ![](Telephony05.png "fig:Telephony05.png"){width="300"} + +- Modem interface plugins + - Interfaces the telephony server to the communication processor. + - Hardware specific plugins which define hardware capabilities and + usage + - Modem interface plugin is also called HAL. + +: ![](Telephony06.png "fig:Telephony06.png"){width="200"} + +- Free Style plugins + - Provide completely independent functionality irrespective of + hardware (communication processor). + - For example plugins, such as packetservice, storage, and + indicator. + +: ![](Telephony07.png "fig:Telephony07.png"){width="300"} + +The following figure provides an overview of all the Telephony plugins +together. + +![](Telephony08.png "Telephony08.png"){width="500"} + +Telephony Server +---------------- + +Tizen Telephony runs as a Telephony server daemon called +`telephony-daemon`. + +The Telephony server executes as a `g-main` loop from the `glib` +library. + +![](Telephony09.png "Telephony09.png"){width="800"} + +\ +\ + +Porting OAL Interface +--------------------- + +OEM vendors can port available plugins within Telephony as needed. It is +not mandatory that all the plugins to be ported to support a specific +hardware. + +This section provides guidance to OEM vendors to develop various +Telephony plugins. + +### Plugin Descriptors + +Any telephony plugin is required to provide a descriptor structure +described in the following example. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_plugin_define_de | Structure referred by Telephony | +| sc { | server to load, initialize, and | +| gchar *name; | unload the plugin. This structure | +| enum tcore_plugin_priorit | defines: | +| y priority; | | +| int version; | 1. Name of the plugin | +| gboolean(*load)(); | 2. Initializing priority of the | +| gboolean(*init)(TcorePlug | plugin | +| in *); | 3. Plugin version | +| void (*unload)(TcorePlugi | 4. Plugin \'load\' function | +| n *); | reference | +| }; | 5. Plugin \'init\' function | +| | reference | +| | 6. Plugin \'unload\' function | +| | reference | ++-----------------------------------+-----------------------------------+ + +The descriptor structure of each plugin must be named as +`plugin_define_desc`. The server obtains the address of this symbol in +order to provide control to the plugin to execute its defined +functionality. + +The order of initialization among various Telephony plugins is defined +based on the plugin's priority. + +OEMs need to specifically implement the modem and modem interface +plugins to support their hardware. + +### Call Service Operations + +The implementation of the functions described in the following example +is required to provide call services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_call_operations | The structure referred by the | +| { | Telephony server to provide call | +| TReturn (*dial)(CoreObjec | services. This structure defines: | +| t *o, UserRequest *ur); | | +| TReturn (*answer)(CoreObj | 1. Call \'dial\' function | +| ect *o, UserRequest *ur); | reference | +| TReturn (*end)(CoreObject | 2. Call \'answer\' function | +| *o, UserRequest *ur); | reference | +| TReturn (*hold)(CoreObjec | 3. Call \'end\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*active)(CoreObj | 4. Call \'hold\' function | +| ect *o, UserRequest *ur); | reference | +| TReturn (*swap)(CoreObjec | 5. Call \'active\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*join)(CoreObjec | 6. Call \'swap\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*split)(CoreObje | 7. Call \'join\' function | +| ct *o, UserRequest *ur); | reference | +| }; | 8. Call \'split\' function | +| | reference | ++-----------------------------------+-----------------------------------+ + +### SMS Service Operations + +The implementation of the functions described in the following example +is required to provide SMS services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_sms_operations { | Structure referred by the | +| TReturn (*send_umts_msg)( | Telephony server to provide | +| CoreObject *o, UserRequest *ur); | SMS-related services. This | +| TReturn (*send_cdma_msg)( | structure defines: | +| CoreObject *o, UserRequest *ur); | | +| TReturn (*read_msg)(CoreO | 1. SMS \'send\' function | +| bject *o, UserRequest *ur); | reference | +| TReturn (*save_msg)(CoreO | 2. SMS \'read\' function | +| bject *o, UserRequest *ur); | reference | +| TReturn (*delete_msg)(Cor | 3. SMS \'save\' function | +| eObject *o, UserRequest *ur); | reference | +| TReturn (*get_sca)(CoreOb | 4. SMS \'delete\' function | +| ject *o, UserRequest *ur); | reference | +| TReturn (*set_sca)(CoreOb | 5. SMS \'get sca\' function | +| ject *o, UserRequest *ur); | reference | +| TReturn (*get_sms_params) | 6. SMS \'set sca\' function | +| (CoreObject *o, UserRequest *ur); | reference | +| TReturn (*set_sms_params) | 7. SMS \'get sms params\' | +| (CoreObject *o, UserRequest *ur); | function reference | +| }; | 8. SMS \'set sms params\' | +| | function reference | ++-----------------------------------+-----------------------------------+ + +### Network Service Operations + +The implemenation of the functions described in the following example is +required to provide network services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_network_operatio | Structure referred by the | +| ns { | Telephony server to provide | +| TReturn (*search)(CoreObj | network services. This structure | +| ect *o, UserRequest *ur); | defines: | +| TReturn (*set_plmn_select | | +| ion_mode)(CoreObject *o, UserRequ | 1. Network \'search\' function | +| est *ur); | reference | +| TReturn (*get_plmn_select | 2. Network \'set plmn selection | +| ion_mode)(CoreObject *o, UserRequ | mode\' function reference | +| est *ur); | 3. Network \'get plmn selection | +| TReturn (*set_service_dom | mode\' function reference | +| ain)(CoreObject *o, UserRequest * | 4. Network \'set service | +| ur); | domain\' function reference | +| TReturn (*get_service_dom | 5. Network \'get service | +| ain)(CoreObject *o, UserRequest * | domain\' function reference | +| ur); | 6. Network \'set band\' function | +| TReturn (*set_band)(CoreO | reference | +| bject *o, UserRequest *ur); | 7. Network \'get band\' function | +| TReturn (*get_band)(CoreO | reference | +| bject *o, UserRequest *ur); | | +| }; | | ++-----------------------------------+-----------------------------------+ + +### HAL operations + +The implementation of the functions described in the following example +is required to provide HAL operations. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_hal_operations { | Structure referred by Telephony | +| TReturn (*power)(TcoreHal | server to provide HAL operations. | +| *hal, gboolean flag); | This structure defines: | +| TReturn (*send)(TcoreHal | | +| *hal, unsigned int data_len, void | 1. HAL \'power\' function | +| *data); | reference | +| TReturn (*setup_netif)(Co | 2. HAL \'send\' function | +| reObject *co, | reference | +| Tc | 3. HAL \'setup network | +| oreHalSetupNetifCallback func, vo | interface\' function | +| id *user_data, | reference | +| un | | +| signed int cid, gboolean enable); | | +| }; | | ++-----------------------------------+-----------------------------------+ + +Sample implementations of the modem and modem interface plugins is +available in the [Appendix](Tizen_3.0_Porting_Guide#Appendix "wikilink") +section. + +Configuration +------------- + +There are no specific configurations required for Telephony except for +conforming to the installation paths of various Telephony plugins. + +All Telephony plugins need to be installed in the following folders: + +- Modem Plugins: `%{_libdir}/telephony/plugins/modems/` +- Other Plugins: `%{_libdir}/telephony/plugins/` + +References +---------- + +Tizen source website <http://review.tizen.org/git/> + +Telephony packages + +- Telephony daemon + +: `platform/core/telephony/telephony-daemon.git` + +- Telephony core library + +: `platform/core/telephony/libtcore.git` + +- TAPI + +: `platform/core/telephony/libtapi.git` + +- Telephony API for a third party application + +: `platform/core/api/telephony.git` + +- Communicator (`DBUS_TAPI`) + +: `platform/core/telephony/tel-plugin-dbus_tapi.git` + +- Free Style plugin (indicator) + +: `platform/core/telephony/tel-plugin-indicator.git` + +- Free Style plugin (packetservice) + +: `platform/core/telephony/tel-plugin-packetservice.git` + +- Free Style plugin (nitz) + +: `platform/core/telephony/tel-plugin-nitz.git` + +- Free Style plugin (Database) + +: `platform/core/telephony/tel-plugin-vconf.git` + +- Free Style plugin (VCONF) + +: `platform/core/telephony/tel-plugin-database.git` + +- Modem plugin (device) + +: `platform/core/telephony/tel-plugin-imc.git` + +- Modem Interface plugin (device) + +: `platform/core/telephony/tel-plugin-imcmodem.git` + +- Modem plugin (emulator) + +: `platform/core/telephony/tel-plugin-atmodem.git` + +- Modem Interface plugin (emulator) + +: `platform/core/telephony/tel-plugin-vmodem.git` + +Appendix +-------- + +#### Sample Implementation for the Modem Interface Plugin + + /* HAL Operations */ + static struct tcore_hal_operations hal_ops = { + .power = hal_power, + .send = hal_send, + .setup_netif = hal_setup_netif, + }; + + static + gboolean on_load() + { + dbg(" Load!!!"); + + return TRUE; + } + + static + gboolean on_init(TcorePlugin *plugin) + { + TcoreHal *hal; + PluginData *user_data; + struct custom_data *data; + + dbg(" Init!!!"); + + if (plugin == NULL) { + err(" PLug-in is NULL"); + + return FALSE; + } + + /* User data for Modem Interface plugin */ + user_data = g_try_new0(PluginData, 1); + if (user_data == NULL) { + err(" Failed to allocate memory for Plugin data"); + + return FALSE; + } + + /* Register to eerver */ + user_data->modem = tcore_server_register_modem(tcore_plugin_ref_server(plugin), plugin); + if (user_data->modem == NULL) { + err(" Registration Failed"); + g_free(user_data); + + return FALSE; + } + dbg(" Registered from Server"); + + + data = g_try_new0(struct custom_data, 1); + if (data == NULL) { + err(" Failed to allocate memory for Custom data"); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + + /* Open DPRAM device */ + data->vdpram_fd = vdpram_open(); + if (data->vdpram_fd < 0) { + /* Free custom data */ + g_free(data); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + /* Create and initialize HAL */ + hal = tcore_hal_new(plugin, "vmodem", &hal_ops, TCORE_HAL_MODE_AT); + if (hal == NULL) { + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + + /* Free custom data */ + g_free(data); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free Plugin data */ + g_free(user_data); + + return FALSE; + } + user_data->hal = hal; + + /* Link custom data to HAL user data */ + tcore_hal_link_user_data(hal, data); + + /* Set HAL as Modem Interface plugin's user data */ + tcore_plugin_link_user_data(plugin, user_data); + + /* Register to Watch list */ + data->watch_id_vdpram = __register_gio_watch(hal, data->vdpram_fd, on_recv_vdpram_message); + dbg(" fd: [%d] Watch ID: [%d]", data->vdpram_fd, data->watch_id_vdpram); + + /* Power ON VDPRAM device */ + if (_modem_power(hal, TRUE) == TCORE_RETURN_SUCCESS) { + dbg(" Power ON - [SUCCESS]"); + } else { + err(" Power ON - [FAIL]"); + goto EXIT; + } + + /* Check CP Power ON */ + g_timeout_add_full(G_PRIORITY_HIGH, SERVER_INIT_WAIT_TIMEOUT, __load_modem_plugin, hal, 0); + + dbg("[VMMODEM] Exit"); + + return TRUE; + + EXIT: + /* Deregister from Watch list */ + __deregister_gio_watch(data->watch_id_vdpram); + + /* Free HAL */ + tcore_hal_free(hal); + + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + + /* Free custom data */ + g_free(data); + + /* Unregister from Server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + + static void + on_unload(TcorePlugin *plugin) + { + TcoreHal *hal; + struct custom_data *data; + PluginData *user_data; + + dbg(" Unload!!!"); + + if (plugin == NULL) + return; + + user_data = tcore_plugin_ref_user_data(plugin); + if (user_data == NULL) + return; + + hal = user_data->hal; + + data = tcore_hal_ref_user_data(hal); + if (data == NULL) + return; + + /* Deregister from Watch list */ + __deregister_gio_watch(data->watch_id_vdpram); + dbg(" Deregistered Watch ID"); + + /* Free HAL */ + tcore_hal_free(hal); + dbg(" Freed HAL"); + + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + dbg(" Closed VDPRAM device"); + + /* Free custom data */ + g_free(data); + + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + dbg(" Unregistered from Server"); + + dbg(" Unloaded MODEM"); + g_free(user_data); + } + + /* VMODEM Descriptor Structure */ + EXPORT_API struct tcore_plugin_define_desc plugin_define_desc = { + .name = "VMODEM", + .priority = TCORE_PLUGIN_PRIORITY_HIGH, + .version = 1, + .load = on_load, + .init = on_init, + .unload = on_unload + }; + +#### Sample Implementation for the Modem Plugin + + static + gboolean on_load() + { + dbg("LOAD!!!"); + + return TRUE; + } + + static + gboolean on_init(TcorePlugin *p) + { + TcoreHal *h; + + dbg("INIT!!!"); + + if (!p) { + err("Plug-in is NULL"); + + return FALSE; + } + + h = tcore_server_find_hal(tcore_plugin_ref_server(p), "vmodem"); + if (!h) { + err("HAL is NULL"); + + return FALSE; + } + + tcore_hal_add_send_hook(h, on_hal_send, p); + tcore_hal_add_recv_callback(h, on_hal_recv, p); + + /* Initialize Modules */ + s_modem_init(p, h); + s_network_init(p, h); + s_sim_init(p, h); + s_ps_init(p, h); + s_call_init(p, h); + s_ss_init(p, h); + s_sms_init(p, h); + tcore_hal_set_power(h, TRUE); + + /* Send "CPAS" command to invoke POWER UP NOTI */ + s_modem_send_poweron(p); + + dbg("Init - Successful"); + + return TRUE; + } + + static void + on_unload(TcorePlugin *p) + { + TcoreHal *h; + + dbg("UNLOAD!!!"); + + if (!p) { + err("Plug-in is NULL"); + + return; + } + + h = tcore_server_find_hal(tcore_plugin_ref_server(p), "vmodem"); + if (h) { + tcore_hal_remove_send_hook(h, on_hal_send); + tcore_hal_remove_recv_callback(h, on_hal_recv); + } + + /* Deinitialize the modules */ + s_modem_exit(p); + s_network_exit(p); + s_sim_exit(p); + s_ps_exit(p); + s_call_exit(p); + s_ss_exit(p); + s_sms_exit(p); + } + + /* ATMODEM plug-in descriptor */ + struct tcore_plugin_define_desc plugin_define_desc = { + .name = "ATMODEM", + .priority = TCORE_PLUGIN_PRIORITY_MID, + .version = 1, + .load = on_load, + .init = on_init, + .unload = on_unload + }; + +#### Workflow + +1. Initialization sequence + 1. The server loads the modem interface plugin. + 2. The modem interface plugin registers to the server. + 3. The server enumerates the modem interface plugin. + 4. Create the physical HAL. + 5. The modem interface plugin queries the modem state. + 6. If the modem is online, the CMUX (internal) channels are + established. + 7. The logical HAL is created for each CMUX channel and assigned + for a core object type. These are updated to the mapping table. + 8. Change the physical HAL mode to `TRANSPARENT` (disables the + queue). + 9. The modem interface plugin requests server to load the modem + plugin (corresponding to its architecture). + 10. The server loads modem plugin. + 11. The modem plugin initializes the sub-modules and creates the + core objects (based on the core object types defined in the + mapping table by the modem interface plugin). + 12. The modem plugin notifies the server of the `PLUGIN_ADDED` + event. + 13. The modem notifies the communicator of the `PLUGIN_ADDED` event. + 14. The communicator creates interfaces for the sub-modules present + (based on the core objects created). + + : The following figure shows the telephony loading sequence. + : ![](telephony10.png "fig:telephony10.png"){width="700"} + +2. Request processing sequence + 1. The application request is sent to the communicator through + TAPI. + 2. The communicator creates a user request based on the incoming + request. + 3. The user request is dispatch to communicator. + 4. The communicator dispatches user request to server. + 5. The server finds the plugin based on the modem name. + 6. The server extracts the core object type based on the request + command from plugin's core objects list. + 7. The server dispatches the user request to the core object. + 8. The core object dispatches the user request to dispatch a + function based on the request command. + 9. Pending request is formed, added to the queue, and sent to the + logical HAL assigned for the core object. + 10. The logical HAL dispatches the request data to a CMUX channel + dedicated to it. + 11. CMUX encodes the request data and dispatches it to the physical + HAL. + 12. The physical HAL sends the request data to the modem. + + : The following figure shows the telephony request processing + sequence. + : ![](telephony11.png "fig:telephony11.png"){width="700"} + +3. Response processing sequence + 1. Response data sent by the modem is received by the physical HAL. + 2. The physical HAL dispatches the response data to CMUX. + 3. CMUX decodes the received response data and dispatches the + corresponding logical HAL based on the CMUX channel. + 4. The logical HAL dispatches the decoded response data to the + corresponding core object. + 5. The core object processes the received response data and + extracts the user request from the pending queue and sends the + response data corresponding to the user request. + 6. The user request extracts the communicator. + 7. The received response data is sent to the corresponding + communicator. + 8. The communicator sends the response data to TAPI which + communicates the response to application. + + : The following figure shows the telephony response processing + sequence. + : ![](telephony12.png "fig:telephony12.png"){width="700"} + +4. Indication processing sequence + 1. Notification data sent by the modem is received by the physical + HAL. + 2. The physical HAL dispatches the notification data to CMUX. + 3. CMUX decodes the received notification data and dispatches the + corresponding logical HAL based on the CMUX channel registered + for the notification. + 4. The logical HAL dispatches the decoded notification data to the + corresponding core object that registered for the notification. + 5. The core object processes the received notification data and + dispatches to the server. + 6. The server dispatches the notification data to corresponding + communicator. + 7. The communicator sends the notification data to TAPI, which + communicates the same to the application. + + : The following figure shows the telephony indication processing + sequence. + : ![](telephony13.png "fig:telephony13.png"){width="700"} + +Application +=========== + +Appendix +======== diff --git a/docs/platform/tool/Tizen_4.0_GBS_Local_Fullbuild_Guide_for_TM1.md b/docs/platform/tool/Tizen_4.0_GBS_Local_Fullbuild_Guide_for_TM1.md new file mode 100644 index 0000000000..30bcd20bcd --- /dev/null +++ b/docs/platform/tool/Tizen_4.0_GBS_Local_Fullbuild_Guide_for_TM1.md @@ -0,0 +1,915 @@ +Introduction +============ + +This document is to describe how to build Tizen 4.0 profile using GBS +fullbuild and create Tizen images using MIC for TM1 reference phone.\ +\* TM1 specification: <https://wiki.tizen.org/wiki/TM1> + +- Full source: <http://review.tizen.org> +- Branch: tizen +- Profile: mobile +- Linux distribution: Ubuntu 16.04.3 X64 LTS +- Repository: + <http://download.tizen.org/snapshots/tizen/%7Bbase%7Cmobile>} + +As a prerequisite, You must install GBS and MIC software by reading +\\How to install GBS and MIC is well described in official Tizen +documentation. + +- GBS: + <https://source.tizen.org/documentation/reference/git-build-system>, +- MIC image creator: + <https://source.tizen.org/documentation/reference/mic-image-creator>\ + \ + +How to build Tizen:mobile with arm-wayland repository for TM1 device +will be described to give you an example.\ +How to create Tizen images using mic with RPMs created by GBS Local Full +Build will be described in last chapter. + +**Example** + + invain@u1604:/work/infra$ gbs --version + gbs 0.24.1 + invain@u1604:/work/infra$ mic --version + mic 0.27.1 + invain@u1604:/work/infra$ cat /etc/lsb-release + DISTRIB_ID=Ubuntu + DISTRIB_RELEASE=16.04 + DISTRIB_CODENAME=trusty + DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS" + +There are two ways to construct full source tree of Tizen 4.0 as +follows. In this page, We only depict how to build Tizen 4.0 full source +for TM1. + +- Use \'\*.src.rpm\' +- Use \'repo init\' and \'repo sync\' + +Download full source using repo +=============================== + +Setup parameters +---------------- + +Below describes the meaning of the each environment variable. + +- workspace : overall workspace\ +- buildroot: GBS build will be run and build result (RPMs and logs) + will be located in this buildroot\ +- snapshot\_date: snapshot date that is available in the official + repository. +- snapshot\_base: snapshot url where pre-built rpms are published\ +- snapshot\_mobile: snapshot url where \*.src.rpm (which you want to + build) are published\ +- repo\_base: path where pre-built rpms are downloaded\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ buildroot=$workspace/GBS-ROOT/ + $ snapshot_date=20160803.1 + $ snapshot_base=http://download.tizen.org/snapshots/tizen/base/tizen-base_${snapshot_date}/ + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + + $ mkdir -p $workspace + $ $ cd $workspace + +\ + +Getting full source with repo command +------------------------------------- + +- To initialize repositories, Run repo init -u + <ssh://><user_name>\@review.tizen.org:29418/scm/manifest -b <branch> + -m <profile>.xml\ +- Replace projects.xml file inside \$workspace/.repo/ with manifest + file in \$snapshot\_mobile\ +- To download latest repository, Run repo sync\ + +**Example** + + $ cd $workspace + $ vi ~/.ssh/config + Host review.tizen.org + User <your_name> + Identityfile ~/.ssh/tizen_rsa + HostName review.tizen.org + Port 29418 + $ + $ ssh -p 29418 <your_user_name>@review.tizen.org + + **** Welcome to Gerrit Code Review **** + Hi Your Name, you have successfully connected over SSH. + + Unfortunately, interactive shells are disabled. + To clone a hosted Git repository, use: + git clone ssh://<your_user_name>@review.tizen.org:29418/REPOSITORY_NAME.git + + $ repo init -u ssh://<your_user_name>@review.tizen.org:29418/scm/manifest -b tizen -m mobile.xml + $ pushd ./.repo/manifests/mobile/ + $ wget $snapshot_mobile/builddata/manifest/tizen-mobile_${snapshot_date}_arm-wayland.xml + $ mv projects.xml projects.xml.original + $ mv tizen-mobile_${snapshot_date}_arm-wayland.xml projects.xml + $ popd + $ time repo sync -j<CPU_NUMBER> + + . . . . . . OMISSSION . . . . . . + * [new tag] v4.1.6 -> v4.1.6 + * [new tag] v4.1.7 -> v4.1.7 + * [new tag] v4.1.8 -> v4.1.8 + * [new tag] v4.1.9 -> v4.1.9 + Fetching projects: 100% (624/624), done. + Checking out files: 100% (294637/294637), done. files: 4% (12474/294637) + Checking out files: 100% (43880/43880), done. + Checking out files: 100% (50027/50027), done.ut files: 31% (15715/50027) + Checking out files: 100% (45937/45937), done.ut files: 36% (16588/45937) + Checking out files: 100% (46180/46180), done.ut files: 42% (19602/46180) + Syncing work tree: 100% (624/624), done. + + real 49m51.088s + user 16m59.840s + sys 4m46.556s + invain@db400:/work/infra/gbs_fullbuild_mobile$ + +- If \"repo sync\" command completes successfully, you can have to see + the below files and folders. + +**Example** + + nvain@u1604:/work/infra/gbs_fullbuild_mobile$ ls -al + total 44 + drwxrwxr-x 10 invain invain 4096 8\uc6d4 6 13:00 . + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:24 .. + -r--r--r-- 1 invain invain 471 8\uc6d4 6 13:00 .gbs.conf + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 09:43 .repo + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:58 apps + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 12:59 platform + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:59 pre-built + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:59 profile + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 scm + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 sdk + drwxrwxr-x 6 invain invain 4096 8\uc6d4 6 13:00 tools + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ du -sh ./.repo/ + 14G ./.repo/ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ du -sh ./* + 45M ./apps + 9.9G ./platform + 196M ./pre-built + 943M ./profile + 208K ./scm + 696K ./sdk + 996K ./tools + +\ +\* **TroubleShooting**: When there is en error in \'repo sync\', check +whether or not git project name of \'projects.xml\' exists in +<http://review.tizen.org>. If you face **\"error: Exited sync due to +fetch errors\"** message, try to run \"repo sync -f\" command. If you +face the error message repeatedly, you can find the reason of the issue +by running \"repo sync -f 2\>repo-sync-error.txt +1\>repo-sync-output.txt\" command in order to modify correctly the +folder name of the projects. + +**Example** + + # Find incorrect project paths + $ repo sync -f 2>repo-sync-error.txt 1>repo-sync-output.txt + $ cat ./repo-sync-error.txt | grep error + # Then, modify correctly a project path in the projects.xml file after checking the latest project path on http://review.tizen.org. + $ vim .repo/manifests/mobile/projects.xml + platform/framework/base/tizen-locale --> platform/core/base/tizen-locale + + +If you want to modify the incorrect project paths automatically, we +recommend that you try to use check\_manifest.py script file that is +located in the ./\$workspace/.repo/manifests/Check\_manfiest/ folder. + +**Example** + + cd /work/infra/gbs_fullbuild_mobile_20160817.1-1 + time repo init -u https://pbs:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m common.xml + cat ./repo/manifests/README + vi ./.repo/manifests/Check_manfiest/check_manifest.py + 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --help + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p common --url common-latest --update + cat tizen_mobile_revision_diff.csv + + +\ + +Building full source using gbs +============================== + +Get build.conf from official website +------------------------------------ + +- Download xxxx-build.conf.gz from \$ + snapshot\_mobile/repos/arm-wayland/packages/repodata/ to + \$workspace/scm/meta/build-config\ +- Run \"unzip xxxx-build.conf.gz\"\ +- Replace xxxx-build.conf.gz with + \$workspace/scm/meta/build-config/build.conf\ + +**Example** + + $ cd $workspace + $ curl $snapshot_mobile/repos/arm-wayland/packages/repodata/xxx-build.conf.gz|gunzip > ./scm/meta/build-config/build.conf + +\ + +Configure .gbs.conf file +------------------------ + +- Note that buildroot and buildconf variable must be existed in + \$workspace/.gbs.conf for full build. If \$workspace/.gbs.conf is + not existed, gbs try to find \~/.gbs.conf file.\ + +**Example** + + $ vi $workspace/.gbs.conf + + [general] + tmpdir=/var/tmp/ + profile = profile.tizen4.0_mobile + work_dir=. + fallback_to_native=true + + [repo.tizen4.0_x86] + url=${work_dir}/pre-built/toolchain-x86/ + + [repo.tizen4.0_arm] + url=${work_dir}/pre-built/toolchain-arm/ + + [repo.tizen4.0_base] <==== Here!!! Append this line. + url=${work_dir}/pre-built/toolchain-arm/ <==== Here!!! Append this line. + + [repo.tizen4.0_arm64] + url=${work_dir}/pre-built/toolchain-arm64/ + + [profile.tizen4.0_mobile] + repos=repo.tizen4.0_x86,repo.tizen4.0_arm,repo.tizen4.0_base <==== Here!!! Append this line. + buildconf=${work_dir}/scm/meta/build-config/build.conf + buildroot=./GBS-ROOT/ <==== Here!!! Append this line. (*Caution: Don't use ${work_dir} for buildroot) + exclude_packages=libtool,gettext,texinfo + +\ + +Build full source with gbs command +---------------------------------- + +- Run \"gbs build\" command in \$workspace folder with appropriate + build options.\ +- Refer to + <https://source.tizen.org/ko/documentation/developer-guide/getting-started-guide/building-packages-locally-gbs> + in order to set the list of packages to be excluded or to break + dependency circle. +- While \"gbs build\" command is running, The **depanneur** tool goes + through local Git trees and evaluates packaging meta-data to + determine packages needed and the build order. Please, refer to + <https://wiki.tizen.org/wiki/Working_Mechanism_of_Depanneur> for + more details on **depanneur**. + +**Example** + + $ cd $workspace + $ accel_pkgs="bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,\ + gawk,gmp,gzip,libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,\ + ncurses-libs,nodejs,nspr,nss-softokn-freebl,nss,openssl,patch,popt,rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc" + $ time sudo gbs build -A armv7l --threads=4 --clean-once --exclude=${accel_pkgs},filesystem,aul,libmm-sound,libtool -B ./GBS-ROOT + +- For you convenience, you can specify the package list using + \"exclude\_packages\" variable in order to be excluded for building + as follows. Not that multiple packages can be separated by comma(,) + +**Example** + + $ vi $workspace/.gbs.conf + [profile.tizen4.0_mobile] + exclude_packages=bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,gawk,gmp,gzip,\ + libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss- softokn-freebl,nss,openssl,patch,popt,\ + rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc,filesystem,aul,libmm-sound,libtool + +- Sometimes, you have to utilize the below flags of \"gbs build\" + command to find a reason of a unexpected issue. + +**Example** + + $ time sudo gbs build -A armv7l --threads=4 --clean-once -B ./GBS-ROOT + + $ gbs build -A armv7l # build all packages under current dir for armv7l + $ gbs build -A armv7l --overwrite # rebuild the packages + $ gbs build -A armv7l --include-all # build packages including un-commit changes + $ gbs build -A armv7l --incremental # incremental build + $ gbs build -A armv7l --noinit # build with offline mode + $ gbs build -A armv7l --clean # clean build by deleting the old build root + $ gbs build -A armv7l --clean --clean-repos #clean build by deleting the old build root and old repository + $ gbs build -A armv7l <gitdir> # build all packages under <gitdir> + +- **TroubleShooting**: **qemu: Unsupported syscall: 311** + +While building all packages, the 311 numbered system call(e.g., **qemu: +Unsupported syscall: 311** ) warning message is displayed because +QEMU\'s linux-user emulation layer doesn\'t currently support any of the +compatible key control system calls. Fortunately, It is not harmful to +build Tizen packages.\ + +- **TroubleShooting**: \"**Permission Denied at /usr/bin/depanneur + line 2017**\" error message + +If \"gbs build -A armv7l \...\" command generates the below error +message from second time with the same command (e.g., gbs build \....), +It results from the root privilege for QEMU\'s chroot. + +**Example** + + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) .applications: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) apps_rw: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/ssl/) private: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/) root: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/var/cache/) ldconfig: Permission Denied + at /usr/bin/depanneur line 2017. + +Please, remove ./GBS-ROOT/ folder. OR \"gbs build\" command with sudo. + +**Example** + + sudo rm -rf ./GBS-ROOT/ + +- **TroubleShooting**: \"**nothing provides pkgconfig(\...)**\" error + message + +It is not mandatory. However,If you face \"**nothing provides +pkgconfig(\...)**\" error message at build-time, you have to follow up +the below recipe that prepares Pre-built RPMs of Base to solve the issue +. + +**Solution**: Using local folder as a base repository (Recommended): +Download all the RPMs in \$snapshot\_base/repos/arm/packages/ to +\$repo\_base. Check all the RPMs are well downloaded in \$repo\_base.\ +**Example** + + $ wget --directory-prefix=$repo_base --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $snapshot_base/repos/arm/packages/ + $ createrepo --update $repo_base + $ createrepo --update pre-built/toolchain-arm + $ createrepo --update pre-built/toolchain-x86 + +- **TroubleShooting**: the build error of tizen-debug: **nothing + provides glibc-debuginfo = 2.20** + +The tizen-debug package requires glibc-debuginfo package to support +debugging operations(e.g. .debug\_frame section) via valgrind. The +glibc-debuginfo package is located in debug folder of download.tizen.org +website. So, you have to append the below repository additonally to +build tizen-debug package normally. **Example** + + http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/debug/ + +\ + +- **TroubleShooting**: error: Start commit \'upstream/x.x.x\' **not an + ancestor of end commit \'HEAD**\' + +Sometime, While running \"gbs build\" command, you can meet the below +error messages as a \"Export Error Packages\" issue. Please, refer to +the +<https://wiki.tizen.org/wiki/Analyzing_GBS_Local_Full_Build_Errors#Upstream_Tag_Issue> +for more details. + +**Example**: error messages + + . . . Upper Omission . . . + 1941 info: start export source from: /work/infra/gbs_fullbuild_mobile3/platform/upstream/newfs-msdos ... + 1942 info: tracking branch: tizen-gerrit/upstream -> upstream + 1943 info: tracking branch: tizen-gerrit/pristine-tar -> pristine-tar + 1944 warning: Deprecated option '--git-export-only', please use '--no-build' instead! + 1945 info: Generating patches from git (upstream/1.0.0..HEAD) + 1946 error: Start commit 'upstream/1.0.0' not an ancestor of end commit 'HEAD' + 1947 error: Generating upstream tarball and/or generating patches failed. GBS tried this as you have upstream branch in you git tree. Fix the problem by either: + 1948 1. Update your upstream branch and/or fix the spec file. Also, check the upstream tag format. + 1949 2. Remove or rename the upstream branch (change the package to native) + 1950 See https://source.tizen.org/documentation/reference/git-build-system/upstream-package for more details. + 1951 error: <gbs>Failed to export packaging files from git tree + . . . Below Omission . . . + +You have to ask an appropriate package developers in order to fix the +incorrect tagging issue. Actually, this issue is generated by the +package developers that do not correctly observe [the \"Updating +Packages\" +manual](https://wiki.tizen.org/wiki/Updating_packages#3._Use_tarball) + +**Example** : How to fix the issue + + $ git checkout tizen + $ gbs submit -m "update to x.x.x" + +Creating image using MIC +======================== + +Mobile Image Creator (MIC) is used to create images for Tizen software +platform. + +Setup parameters +---------------- + +- workspace : overall workspace for mic\ +- mic\_workspace: path for MIC workspace\ +- mic\_images: path where images are created\ +- mic\_ks\_files: path where \*.ks files are downloaded\ +- mic\_logs: path where mic log files are saved\ +- snapshot\_date: snapshot date that is available in the official + repository.\ +- snapshot\_mobile which is used in GBS Local Fullbuild\ +- repo\_base: path which is used in GBS Local Fullbuild\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ mic_workspace=$workspace/mic_workspace + $ mic_images=$mic_workspace/images + $ mic_ks_files=$mic_workspace/builddata/image-configs + $ mic_logs=$mic_workspace/builddata/logs + $ snapshot_date=20160803.1 + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_$snapshot_date/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + $ mkdir -p $mic_workspace $mic_images $mic_ks_files $mic_logs + +\ + +Download \*.ks file +------------------- + +- Download \*.ks file (kickstart file) what you want from + \$snapshot\_mobile/images\ + +`* `[`http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snaptshot_date}_mobile-wayland-armv7l-tm1.ks`](http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_$%7Bsnaptshot_date%7D_mobile-wayland-armv7l-tm1.ks) + +**Example** + + $ wget --directory-prefix=$mic_ks_files $snapshot_mobile/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snapshot_date}_mobile-boot-armv7l-tm1.ks + +How to customize \*.ks file +--------------------------- + +- We have to modify baseurl of \'repo\' in \*.ks file in order to use + \*.RPMs which are built by GBS Local Full-build,\ +- Add \'\--priority=99\' to profile related repo to download + mic-bootstrap.\ +- Add \'local\' repo in \*.ks file whose baseurl is path of GBS + full-build results \*.RPMs\ +- Replace baseurl of \'base\' repo in \*.ks file from remote\_url to + \$repo\_base\ +- Create repo and repodata from \$repo\_base to be used in \*.ks file\ + +**Example** + + $ vi ./tizen-mobile_20160805.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #original ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no + repo --name=base_arm --baseurl=http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/ --ssl_verify=no + + $ vi ./tizen-mobile_20160805.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #modified ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no --priority=99 + repo --name=base_arm --baseurl=file:///work/infra/gbs_fullbuild_mobile/pre-built/toolchain-arm --priority=1 + repo --name=local_mobile --baseurl=file:///work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/repos/tizen4.0_mobile/armv7l --priority=1 + +\ + +Generating image file using mic +------------------------------- + +- To create Tizen images, execute the following commands:\ +- Refer to the Tizen:IVI case + (https://source.tizen.org/ko/documentation/developer-guide/all-one-instructions/creating-tizen-ivi-images-based-on-specific-snapshot-one-page?langredirect=1)\ + +<!-- --> + + $ mkdir $workspace + $ sudo mic cr auto $mic_ks_files/tizen-mobile_${snapshot_date}_mobile-target-TM1-armv7l-tm1.ks --logfile=$mic_logs/_mobile-target-TM1-armv7l-tm1 -o $mic_images + ( $ sudo mic cr auto tizen_mobile-target-TM1-armv7l-tm1.ks --tmpfs) + +Tip & Techniques +================ + +Filtering Base Packages +----------------------- + +To filter base packages, perform the following procedure: + +1\. Move binaries to another directory by executing the following +commands: + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/base/`\ +`       mv ~/GBS-ROOT/local/cache/*rpm ~/tizen_mobile_src/pre-built-set/base/` + +2\. Filter the base binaries by using the references below: + +- For failed packages (caused by downloading or other reasons), remove + related binaries in the cache. In this case, we need to move the + related binaries from base to another dir because the rpm is not + neccessary. In the end, these failed packages should be fixed by + developers and they don\'t belong to pre-built. + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/extra/`\ +`       mv ~/tizen_mobile_src/pre-built-set/base/xxx.rpm ~/tizen_mobile_src/pre-built-set/extra/` + +- Based on experience, exclude the following packages from cache: + +`     ail, alarm, app-core, app-checker, app-svc, aul, automotive-message-*, dbus-glib,`\ +`     bundle, capi-*, docbook, ecore, evas, eeze, elf-*, gst-plugins, gstreamer, pkgmgr,`\ +`     privacy-manager, python-*, perl-*, sensor, vconf, xdgmime, xmlcharent etc.` + +- Packages in a circle must be kept in cache or there will be + expansion errors. + +<!-- --> + +- There is another case as follows: + +`     package A run time requires B, but the build order of package B is later than A, in this case, we should remove binary of package B directly.`\ +`     Check the build log under ~/GBS-ROOT/local/repos/tizen4.0_mobile/armv7l/logs/success/`\ +`     grep -r downloading *`\ +`     A-1-0/log.txt:[    5s] [1/1] downloading `[`http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm`](http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm)` ...`\ +`     the build order:`\ +`     ...`\ +`     info: *** [1/897] building A-1-0 armv7l tizen4.0_mobile (worker: 0) ***`\ +`     info: finished building A`\ +`     ...`\ +`     info: *** [10/897] building B-1-1 armv7l tizen4.0_mobile (worker: 2) ***`\ +`     info: finished building B`\ +`     ...`\ +`     In this case, remove B-1-1.armv7l.rpm in cache` + +Removing and Adding Dependency Packages +--------------------------------------- + +The logistics of this section is as follows: + +`   check whether expansion error occurs`\ +`   if yes`\ +``        Add binaries to pre-built by following `Appendix_How to find dependency relationship for any package from repo` ``\ +`   else`\ +`       Go back to step-2 and step-3 recursively until you get a minimal pre-built`\ +`       set.` + +For example: + +`   bluetooth-share:`\ +`     nothing provides pkgconfig(aul)` + +Then find the package that provides pkgconfig (aul) + +`   pushd ./GBS-ROOT/local/order/`\ +`   grep -e "pkgconfig(aul)" .repo.cache| grep P:`\ +`   P:aul-devel.i686-1397286673/1397286678/0: aul-devel = 0.0.286-2.291 aul-devel(x86-32) = 0.0.286-2.291 pkgconfig(aul) = 0.1.0`\ +`   P:aul-devel.i686-1397286694/1397286699/0: aul-devel = 0.0.286-2.10 aul-devel(x86-32) = 0.0.286-2.10 pkgconfig(aul) = 0.1.0`\ +`   popd` + +So put **aul-devel** binary into pre-built + +Updating Pre-Built Binaries with Latest Repo +-------------------------------------------- + +To prepare pre-built binaries, execute the following commands: + +`  $ cd ~/tizen_mobile_src/pre-built/toolchain-arm`\ +`  $ ./tools/update_prebuilt.py -L . -R `[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20160803.1/repos/arm/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20160803.1/repos/arm/packages/) + +Upon successful execution of this script, the old binaries will be +replaced by the new binaries. If there is a repodata dir, make sure to +run \`createrepo \--update\` to update this pre-built directory. + +`   $createrepo --update ./repos_mobile`\ +`   $ ls ./repos_mobile/repodata/`\ +`   2fbd464035e46f900abeb4d84039d4afb1b3489420c9b633073faae470fa6b7d-primary.xml.gz`\ +`   4931aad22ff6a92ae94024c6db65a52687a0ff20ed5560fc01558b4fe8b45f32-primary.sqlite.bz2`\ +`   6bc611a44d146ae2171a53a3f2f5733e58998f4bd85b2e27a9d438fb44adf903-other.sqlite.bz2`\ +`   6cc425f57f8a218ba78cbd190b1e3391068e62927876ed627f270ee60561b5f5-filelists.sqlite.bz2`\ +`   713f5170c01e01b652f211baec23444e6aef7fdd699c867a32424d2f0ca962fc-filelists.xml.gz`\ +`   d9224b4b38b9d6c2b18ef3dce0002ac0ff511dcc21177d9578eb83bceb423157-other.xml.gz`\ +`   repomd.xml` + +How to find dependency relationship for any package from repo +------------------------------------------------------------- + +Run gbs build with any package, press Ctr-c at the start of build. Repo +is which you want to build with. + +`   gbs build -A armv7 -R /pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/ --skip-conf-repos --buildroot=~/GBS-ROOT`\ +`   info: generate repositories ...`\ +`   info: build conf has been downloaded at:`\ +`         /var/tmp/tizen.conf`\ +`   info: start building packages from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77 (git)`\ +`   2014-05-20 13:54 +0800`\ +`   info: prepare sources...`\ +`   info: start export source from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77/fake ...`\ +`   info: Creating (native) source archive fake-1.0.tbz2 from 'HEAD'`\ +`   info: package files have been exported to:`\ +`   /home/GBS-ROOT/local/sources/tizen/fake-1.0-1`\ +`   info: retrieving repo metadata...`\ +`   info: parsing package data...`\ +`   info: building repo metadata ...`\ +`   info: package dependency resolving ...`\ +`   info: next pass:`\ +`   fake`\ +`   info: *** [1/1] building fake-1.0-1 armv7l tizen (worker: 0) ***`\ +`   VM_IMAGE: , VM_SWAP:`\ +`   --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   logging output to /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.build.log...`\ +`   [    0s] Memory limit set to 21777108KB`\ +`   [    0s] Using BUILD_ROOT=/home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +`   [    0s] Using BUILD_ARCH=i686:armv7l:i486:i386:noarch`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] started "build fake.spec" at Tue May 20 05:54:35 UTC 2014.`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] processing specfile /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /home/GBS-ROOT/local/cache --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] initializing /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.srcfiles.cache ...`\ +`   [    0s] /usr/lib/build/createrpmdeps /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS`\ +`   [    0s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages`\ +`   [    1s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   ^C^C captured`\ +`   warning: build failed, Leaving the logs in /home/GBS-ROOT/local/repos/tizen/armv7l/logs/fail/fake-1.0-1/log.txt` + +Then open \~/GBS-ROOT/local/order/.repo.cache, it can provide all +information about every package from repo like: + +`   P:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm = 1.0-13.20 mic-bootstrap-x86-arm(x86-32) = 1.0-13.20`\ +`   R:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: /bin/sh`\ +`   I:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm-1.0-13.20 1397164816`\ +`   F:gdb-locale.noarch-1387595787/1387595811/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/gdb-locale-7.5.1-10.1.noarch.rpm`\ +`   P:gdb-locale.noarch-1387595787/1387595811/0: gdb-lang-all = 7.5.1 gdb-locale = 7.5.1-10.1`\ +`   R:gdb-locale.noarch-1387595787/1387595811/0: gdb = 7.5.1`\ +`   I:gdb-locale.noarch-1387595787/1387595811/0: gdb-locale-7.5.1-10.1 1387595787`\ +`   F:zypper-locale.noarch-1387597203/1387597217/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/zypper-locale-1.8.14-12.1.noarch.rpm` + +The meaning of these prefix characters are: + +- P what this package provides +- R what this package requires +- F where to find this package +- I Identifier of package + +Full Build Script (FBS) +======================= + +If you understand the above sections enough, you can easily repeat the +build procedure for your convenience. The Full Build Script (FBS) is a +simple script to understand how both full-build and partial-build are +executed by gbs. It helps that the developers can do both full-build and +partial-build easy-to-use without the need to read step-by-step +instruction. + +Full build +---------- + +**Example: to build full-source locally** + +1\. In case of the **repo sync \...** command, The script does not +perfectly handle the incorrect projects.xml.\ +2. In case of the **gbs build \...** command, The normal operation of +the script is dependent on the correctness of the fetched snapshot +packages and that of the git repositories. 3. If you meet gbs issues, +please report your issue at Tizen mailling list. + +- Mailman - <https://lists.tizen.org/listinfo/dev> +- Jira - <https://bugs.tizen.org/jira/projects/DEVT> + +\$ vi ./fbs.sh + + + + #!/usr/bin/env bash + # @Title: Full Build Script (FBS) + # @License: Apache + # @Date: Jan-11-2017 + # @Contacts: leemgs@gmail.com + # @Prequisites: cat, grep, wc, curl, time, repo, mkdir, wget, createrepo, rm, gunzip, gbs, tee, python-pip + # ($ sudo apt-get install coreutils gbs createrepo python-pip wget curl grep time gzip lynx-cur lynx ) + # @Host PC: + # 1. Ubuntu 16.04.5 LTS X64, Linux kernel 3.14.0-98-generic, GCC 4.8.4, Glibc 2.19 + # 2. Ubuntu 16.04.1 LTS X64, Linux kernel 4.4.0-42-generic, GCC 5.4.0, Glibc 2.23 + # @Description: This script is to build full source with just one 'enter' key + # It is Full Build Script (FBS) is a simple script to help personal developers that deploy Tizen platform + # on their embedded devices as well as Tizen reference devices. + # @Todo: a. Error handling function , b. Enabling check_manifest.py, c. Bottle-neck profiling + # + #-------------------------------- Configuration area: Please, modify with appropriate content -------------------- + # Define input arguments. There are five profiles currently in Tizen 4.0 + # __profie={common | mobile | ivi | tv | wearable | ...}, + # __target={arm-wayland | target-TM1 | ...}, + # __rpmrepo_date_base={20160819.1 | 20160819.2 | latest} // We don't recommend that you use "latest" because it is not stable. + # __rpmrepo_date_profile={20160823.1 | 20160823.1 | latest} // We don't recommend that you use "latest" because it is not stable. + + # 1) snapshot: lifespan of sanpshot is 3 months. + function define_snapshot { + __rpmrepo_date_base=20170210.1 + __rpmrepo_date_profile=20170210.1 + __rpmrepo_path=snapshots + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 2) release(daily): lifespan of release(daily) is 3 months . + function define_release_daily { + __rpmrepo_date_base=20161016.1 + __rpmrepo_date_profile=20161020.2 + __rpmrepo_path=releases/daily + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 3) release(weekly): lifespan of release(weekly) is 2 years . + function define_release_weekly { + __rpmrepo_date_base=20161016.1 + __rpmrepo_date_profile=20161020.2 + __rpmrepo_path=releases/weekly + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 4) release(official,m1/m2/m3): lifespan of release(official,m1/m2/m3) is 10 years. + function define_release_official { + __rpmrepo_date_base=20170104.1 + __rpmrepo_date_profile=20170111.1 + __rpmrepo_path=releases/milestone + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/4.0.m2/4.0.m2-base/tizen-4.0.m2-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/4.0.m2/4.0.m2-${__profile}/tizen-4.0.m2-${__profile}_${__rpmrepo_date_profile} + } + + # Select one among the four RPM repositories. + define_release_official + __cpu_number=`cat /proc/cpuinfo | grep "model name" | wc -l` + + #-------------------------------- Execution area: Please, don't modify the script from here ---------------------- + + function error_display { + if [ $? != 0 ]; then echo -e "$1"; exit 1 ;fi + } + + #### STEP 1/4: Sync the repository from https://git.tizen.org ####################################### + + # TBI (To Be Implemented) + function fix_incorrect_project_path_automatic { + cat ./.repo/manifests/README + ./.repo/manifests/Check_manfiest/check_manifest.py --help + error_display "\n\n* FBS:[1/4] Error Occurred while running check_manifest.py script" + # How to add user id and password for https authentification of https://review.tizen.org + # sudo apt-get install python-pip + # sudo pip install pygerrit + # vi ./.repo/manifests/Check_manfiest/check_manifest.py + # 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p ${__profile} --url ${__profile}-latest --update + # cat tizen_mobile_revision_diff.csv + } + + # Custom area: modify git repository address correctly in case of an wrong web addresses. + function fix_incorrect_project_path_manual { + sed -i -e 's/framework\/base\/tizen-locale/core\/base\/tizen-locale/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-direct/native\/ug-wifi-direct/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-nfc-efl/native\/ug-nfc-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-efl/native\/ug-wifi-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/bluetooth-share-ui/native\/bluetooth-share-ui/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-mobile-ap/native\/ug-mobile-ap/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-bluetooth-efl/native\/ug-bluetooth-efl/g' ./.repo/manifests/${__profile}/projects.xml + } + + function repo_init { + cd $__workspace + # time repo init -u ssh://${__tizen_id}@review.tizen.org:29418/scm/manifest -b tizen -m ${__profile}.xml + # time repo init -u https://${__tizen_id}:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m ${__profile}.xml + time repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m ${__profile}.xml + error_display "\n\n* FBS:[1/4] Error Occurred while running 'repo init' command" + curl $__rpmrepo_profile_url/builddata/manifest/tizen-${__profile}_${__rpmrepo_date_profile}_arm-wayland.xml > ./.repo/manifests/${__profile}/projects.xml + error_display "\n\n* FBS:[1/4] Error Occurred while downloading projects.xml with curl" + # todo: fix_incorrect_project_path_automatic + # todo: fix_incorrect_project_path_manual + } + + function repo_sync { + time repo sync -j${__cpu_number} 2>repo-sync-error.txt + if [[ $? != 0 ]]; then + echo -e "\n\n* FBS:[1/4] Error Occurred while downloading Source with repo sync" + echo -e " Please, modify correctly the below incorrect project paths after openning ./.repo/manifests/${__profile}/projects.xml.\n\n" + cat repo-sync-error.txt | grep "error: Cannot fetch" + exit 1 + fi + } + + function download_git_repo { + repo_init + repo_sync + } + + #### STEP 2/4: Download the pre-built RPM packages from http://download.tizen.org ################### + function download_prebuilt_rpms { + mkdir ./repos_base_packages + mkdir ./repos_base_debug + mkdir ./repos_${__profile}_packages + mkdir ./repos_${__profile}_debug + wget --directory-prefix=repos_base_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/packages/ + wget --directory-prefix=repos_base_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/debug/ + wget --directory-prefix=repos_${__profile}_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/packages/ + wget --directory-prefix=repos_${__profile}_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/debug/ + createrepo --update ./repos_base_packages + createrepo --update ./repos_base_debug + createrepo --update ./repos_${__profile}_packages + createrepo --update ./repos_${__profile}_debug + build_conf_file=`curl -l ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/ | grep -o "href=.*build\.conf\.gz\"" | sed -e 's/href="//g; s/"//g' ` + curl ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/${build_conf_file} | gunzip > ./scm/meta/build-config/build.conf + error_display "\n\n* FBS:[2/4] Error Occurred while downloading build.conf with curl" + } + + #### STEP 3/4: Run full-build ######################################################################## + function run_full_build { + rm -f ~/.gbs.conf + rm -f ./.gbs.conf + __local_repository_url="-R ./repos_base_packages/ -R ./repos_base_debug/ -R ./repos_${__profile}_packages/ -R ./repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ./GBS-ROOT ${__local_repository_url} -D ./scm/meta/build-config/build.conf | tee fbs-${__rpmrepo_date_profile}.txt + error_display "\n\n* FBS:[3/4] Error Occurred while building packages with gbs build" + } + #### STEP 4/4: View the report ####################################################################### + function view_report { + __report_file=${__workspace}/GBS-ROOT/local/repos/tizen/armv7l/index.html + if [ ! -f ${__report_file} ];then + echo -e "\n [Error] ${__report_file} is not generated." + else + lynx ${__report_file} + error_display "\n\n* FBS:[4/4] Error Occurred while reading the report file" + fi + } + + #### Main function ################################################################################### + # repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m <PROFILE>.xml + # repo sync + # gbs build --arch armv7l --threads <#CPU> --clean-once --include-all + # firefox /GBS-ROOT/local/repos/tizen/<ARCH>/index.html + # + download_git_repo # STEP 1/4 + download_prebuilt_rpms # STEP 2/4 + run_full_build # STEP 3/4 + view_report # STEP 4/4 + +**Screenshot** + +The below screenshot shows the console-based report result after +completing \"Tizen4.0:Common local full-build\" with full build script +on Ubuntu 16.04.1 X64 PC. If you want to see the report with GUI +interface, you may run \"firefox +./GBS-ROOT/local/repos/tizen/armv7l/index.html\" command. + +![FBS (Skeleton) +Screenshot](gbs-full-build-20161013-horizontal.png "FBS (Skeleton) Screenshot"){width="500"} + +Partial build +------------- + +**Example: to build one package (e.g. tizen-release package)** + +- The below example is to describe how to build a package in case that + the developer try to enhance existing packages after doing + full-build. + +<!-- --> + + $ cd $__workspace + $ cd ./platform/upstream/tizen-release + $ vi ./partial-build.sh + + #!/bin/bash + __work_space=/work/infra/gbs_fullbuild_common_20161108.1 + __profile=common + __cpu_number=1 + __local_repository_url="-R ${__work_space}/repos_base_packages/ -R ${__work_space}/repos_base_debug/ -R ${__work_space}/repos_${__profile}_packages/ -R ${__work_space}/repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ${__work_space}/GBS-ROOT ${__local_repository_url} -D ${__work_space}/scm/meta/build-config/build.conf + +Contributing your experience +============================ + +If you find additional tips and techniques to compile Tizen 4.0 full +source locally, Please, update this wiki page as a volunteer. + +[Category:Platform](Category:Platform "wikilink") +[Category:Tizen-3](Category:Tizen-3 "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_5.0_GBS_Local_Fullbuild_Guide_for_TM1.md b/docs/platform/tool/Tizen_5.0_GBS_Local_Fullbuild_Guide_for_TM1.md new file mode 100644 index 0000000000..5ca80ecf76 --- /dev/null +++ b/docs/platform/tool/Tizen_5.0_GBS_Local_Fullbuild_Guide_for_TM1.md @@ -0,0 +1,915 @@ +Introduction +============ + +This document is to describe how to build Tizen 5.0 profile using GBS +fullbuild and create Tizen images using MIC for TM1 reference phone.\ +\* TM1 specification: <https://wiki.tizen.org/wiki/TM1> + +- Full source: <http://review.tizen.org> +- Branch: tizen +- Target: TM1 (Z3) +- Linux distribution: Ubuntu 16.04.3 X64 LTS +- Repository: + <http://download.tizen.org/snapshots/tizen/%7Bbase%7Cmobile>} + +As a prerequisite, You must install GBS and MIC software by reading +\\How to install GBS and MIC is well described in official Tizen +documentation. + +- GBS: + <https://source.tizen.org/documentation/reference/git-build-system>, +- MIC image creator: + <https://source.tizen.org/documentation/reference/mic-image-creator>\ + \ + +How to build Tizen:mobile with arm-wayland repository for TM1 device +will be described to give you an example.\ +How to create Tizen images using mic with RPMs created by GBS Local Full +Build will be described in last chapter. + +**Example** + + invain@u1604:/work/infra$ gbs --version + gbs 0.24.1 + invain@u1604:/work/infra$ mic --version + mic 0.27.1 + invain@u1604:/work/infra$ cat /etc/lsb-release + DISTRIB_ID=Ubuntu + DISTRIB_RELEASE=16.04 + DISTRIB_CODENAME=trusty + DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS" + +There are two ways to construct full source tree of Tizen 5.0 as +follows. In this page, We only depict how to build Tizen 5.0 full source +for TM1. + +- Use \'\*.src.rpm\' +- Use \'repo init\' and \'repo sync\' + +Download full source using repo +=============================== + +Setup parameters +---------------- + +Below describes the meaning of the each environment variable. + +- workspace : overall workspace\ +- buildroot: GBS build will be run and build result (RPMs and logs) + will be located in this buildroot\ +- snapshot\_date: snapshot date that is available in the official + repository. +- snapshot\_base: snapshot url where pre-built rpms are published\ +- snapshot\_mobile: snapshot url where \*.src.rpm (which you want to + build) are published\ +- repo\_base: path where pre-built rpms are downloaded\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ buildroot=$workspace/GBS-ROOT/ + $ snapshot_date=20180103.1 + $ snapshot_base=http://download.tizen.org/snapshots/tizen/base/tizen-base_${snapshot_date}/ + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + + $ mkdir -p $workspace + $ $ cd $workspace + +\ + +Getting full source with repo command +------------------------------------- + +- To initialize repositories, Run repo init -u + <ssh://><user_name>\@review.tizen.org:29418/scm/manifest -b <branch> + -m <profile>.xml\ +- Replace projects.xml file inside \$workspace/.repo/ with manifest + file in \$snapshot\_mobile\ +- To download latest repository, Run repo sync\ + +**Example** + + $ cd $workspace + $ vi ~/.ssh/config + Host review.tizen.org + User <your_name> + Identityfile ~/.ssh/tizen_rsa + HostName review.tizen.org + Port 29418 + $ + $ ssh -p 29418 <your_user_name>@review.tizen.org + + **** Welcome to Gerrit Code Review **** + Hi Your Name, you have successfully connected over SSH. + + Unfortunately, interactive shells are disabled. + To clone a hosted Git repository, use: + git clone ssh://<your_user_name>@review.tizen.org:29418/REPOSITORY_NAME.git + + $ repo init -u ssh://<your_user_name>@review.tizen.org:29418/scm/manifest -b tizen -m mobile.xml + $ pushd ./.repo/manifests/mobile/ + $ wget $snapshot_mobile/builddata/manifest/tizen-mobile_${snapshot_date}_arm-wayland.xml + $ mv projects.xml projects.xml.original + $ mv tizen-mobile_${snapshot_date}_arm-wayland.xml projects.xml + $ popd + $ time repo sync -j<CPU_NUMBER> + + . . . . . . OMISSSION . . . . . . + * [new tag] v4.1.6 -> v4.1.6 + * [new tag] v4.1.7 -> v4.1.7 + * [new tag] v4.1.8 -> v4.1.8 + * [new tag] v4.1.9 -> v4.1.9 + Fetching projects: 100% (624/624), done. + Checking out files: 100% (294637/294637), done. files: 4% (12474/294637) + Checking out files: 100% (43880/43880), done. + Checking out files: 100% (50027/50027), done.ut files: 31% (15715/50027) + Checking out files: 100% (45937/45937), done.ut files: 36% (16588/45937) + Checking out files: 100% (46180/46180), done.ut files: 42% (19602/46180) + Syncing work tree: 100% (624/624), done. + + real 49m51.088s + user 16m59.840s + sys 4m46.556s + invain@db400:/work/infra/gbs_fullbuild_mobile$ + +- If \"repo sync\" command completes successfully, you can have to see + the below files and folders. + +**Example** + + nvain@u1604:/work/infra/gbs_fullbuild_mobile$ ls -al + total 44 + drwxrwxr-x 10 invain invain 4096 8\uc6d4 6 13:00 . + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:24 .. + -r--r--r-- 1 invain invain 471 8\uc6d4 6 13:00 .gbs.conf + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 09:43 .repo + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:58 apps + drwxrwxr-x 7 invain invain 4096 8\uc6d4 6 12:59 platform + drwxrwxr-x 4 invain invain 4096 8\uc6d4 6 12:59 pre-built + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 12:59 profile + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 scm + drwxrwxr-x 3 invain invain 4096 8\uc6d4 6 13:00 sdk + drwxrwxr-x 6 invain invain 4096 8\uc6d4 6 13:00 tools + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ du -sh ./.repo/ + 14G ./.repo/ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ + invain@u1604:/work/infra/gbs_fullbuild_mobile$ du -sh ./* + 45M ./apps + 9.9G ./platform + 196M ./pre-built + 943M ./profile + 208K ./scm + 696K ./sdk + 996K ./tools + +\ +\* **TroubleShooting**: When there is en error in \'repo sync\', check +whether or not git project name of \'projects.xml\' exists in +<http://review.tizen.org>. If you face **\"error: Exited sync due to +fetch errors\"** message, try to run \"repo sync -f\" command. If you +face the error message repeatedly, you can find the reason of the issue +by running \"repo sync -f 2\>repo-sync-error.txt +1\>repo-sync-output.txt\" command in order to modify correctly the +folder name of the projects. + +**Example** + + # Find incorrect project paths + $ repo sync -f 2>repo-sync-error.txt 1>repo-sync-output.txt + $ cat ./repo-sync-error.txt | grep error + # Then, modify correctly a project path in the projects.xml file after checking the latest project path on http://review.tizen.org. + $ vim .repo/manifests/mobile/projects.xml + platform/framework/base/tizen-locale --> platform/core/base/tizen-locale + + +If you want to modify the incorrect project paths automatically, we +recommend that you try to use check\_manifest.py script file that is +located in the ./\$workspace/.repo/manifests/Check\_manfiest/ folder. + +**Example** + + cd /work/infra/gbs_fullbuild_mobile_20180117.1-1 + time repo init -u https://pbs:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m common.xml + cat ./repo/manifests/README + vi ./.repo/manifests/Check_manfiest/check_manifest.py + 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --help + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p common --url common-latest --update + cat tizen_mobile_revision_diff.csv + + +\ + +Building full source using gbs +============================== + +Get build.conf from official website +------------------------------------ + +- Download xxxx-build.conf.gz from \$ + snapshot\_mobile/repos/arm-wayland/packages/repodata/ to + \$workspace/scm/meta/build-config\ +- Run \"unzip xxxx-build.conf.gz\"\ +- Replace xxxx-build.conf.gz with + \$workspace/scm/meta/build-config/build.conf\ + +**Example** + + $ cd $workspace + $ curl $snapshot_mobile/repos/arm-wayland/packages/repodata/xxx-build.conf.gz|gunzip > ./scm/meta/build-config/build.conf + +\ + +Configure .gbs.conf file +------------------------ + +- Note that buildroot and buildconf variable must be existed in + \$workspace/.gbs.conf for full build. If \$workspace/.gbs.conf is + not existed, gbs try to find \~/.gbs.conf file.\ + +**Example** + + $ vi $workspace/.gbs.conf + + [general] + tmpdir=/var/tmp/ + profile = profile.tizen5.0_mobile + work_dir=. + fallback_to_native=true + + [repo.tizen5.0_x86] + url=${work_dir}/pre-built/toolchain-x86/ + + [repo.tizen5.0_arm] + url=${work_dir}/pre-built/toolchain-arm/ + + [repo.tizen5.0_base] <==== Here!!! Append this line. + url=${work_dir}/pre-built/toolchain-arm/ <==== Here!!! Append this line. + + [repo.tizen5.0_arm64] + url=${work_dir}/pre-built/toolchain-arm64/ + + [profile.tizen5.0_mobile] + repos=repo.tizen5.0_x86,repo.tizen5.0_arm,repo.tizen5.0_base <==== Here!!! Append this line. + buildconf=${work_dir}/scm/meta/build-config/build.conf + buildroot=./GBS-ROOT/ <==== Here!!! Append this line. (*Caution: Don't use ${work_dir} for buildroot) + exclude_packages=libtool,gettext,texinfo + +\ + +Build full source with gbs command +---------------------------------- + +- Run \"gbs build\" command in \$workspace folder with appropriate + build options.\ +- Refer to + <https://source.tizen.org/ko/documentation/developer-guide/getting-started-guide/building-packages-locally-gbs> + in order to set the list of packages to be excluded or to break + dependency circle. +- While \"gbs build\" command is running, The **depanneur** tool goes + through local Git trees and evaluates packaging meta-data to + determine packages needed and the build order. Please, refer to + <https://wiki.tizen.org/wiki/Working_Mechanism_of_Depanneur> for + more details on **depanneur**. + +**Example** + + $ cd $workspace + $ accel_pkgs="bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,\ + gawk,gmp,gzip,libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,\ + ncurses-libs,nodejs,nspr,nss-softokn-freebl,nss,openssl,patch,popt,rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc" + $ time sudo gbs build -A armv7l --threads=4 --clean-once --exclude=${accel_pkgs},filesystem,aul,libmm-sound,libtool -B ./GBS-ROOT + +- For you convenience, you can specify the package list using + \"exclude\_packages\" variable in order to be excluded for building + as follows. Not that multiple packages can be separated by comma(,) + +**Example** + + $ vi $workspace/.gbs.conf + [profile.tizen5.0_mobile] + exclude_packages=bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,gawk,gmp,gzip,\ + libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss- softokn-freebl,nss,openssl,patch,popt,\ + rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc,filesystem,aul,libmm-sound,libtool + +- Sometimes, you have to utilize the below flags of \"gbs build\" + command to find a reason of a unexpected issue. + +**Example** + + $ time sudo gbs build -A armv7l --threads=4 --clean-once -B ./GBS-ROOT + + $ gbs build -A armv7l # build all packages under current dir for armv7l + $ gbs build -A armv7l --overwrite # rebuild the packages + $ gbs build -A armv7l --include-all # build packages including un-commit changes + $ gbs build -A armv7l --incremental # incremental build + $ gbs build -A armv7l --noinit # build with offline mode + $ gbs build -A armv7l --clean # clean build by deleting the old build root + $ gbs build -A armv7l --clean --clean-repos #clean build by deleting the old build root and old repository + $ gbs build -A armv7l <gitdir> # build all packages under <gitdir> + +- **TroubleShooting**: **qemu: Unsupported syscall: 311** + +While building all packages, the 311 numbered system call(e.g., **qemu: +Unsupported syscall: 311** ) warning message is displayed because +QEMU\'s linux-user emulation layer doesn\'t currently support any of the +compatible key control system calls. Fortunately, It is not harmful to +build Tizen packages.\ + +- **TroubleShooting**: \"**Permission Denied at /usr/bin/depanneur + line 2017**\" error message + +If \"gbs build -A armv7l \...\" command generates the below error +message from second time with the same command (e.g., gbs build \....), +It results from the root privilege for QEMU\'s chroot. + +**Example** + + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) .applications: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/skel/) apps_rw: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/etc/ssl/) private: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/) root: Permission Denied + at /usr/bin/depanneur line 2017. + Can't cd to (/work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.2/var/cache/) ldconfig: Permission Denied + at /usr/bin/depanneur line 2017. + +Please, remove ./GBS-ROOT/ folder. OR \"gbs build\" command with sudo. + +**Example** + + sudo rm -rf ./GBS-ROOT/ + +- **TroubleShooting**: \"**nothing provides pkgconfig(\...)**\" error + message + +It is not mandatory. However,If you face \"**nothing provides +pkgconfig(\...)**\" error message at build-time, you have to follow up +the below recipe that prepares Pre-built RPMs of Base to solve the issue +. + +**Solution**: Using local folder as a base repository (Recommended): +Download all the RPMs in \$snapshot\_base/repos/arm/packages/ to +\$repo\_base. Check all the RPMs are well downloaded in \$repo\_base.\ +**Example** + + $ wget --directory-prefix=$repo_base --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $snapshot_base/repos/arm/packages/ + $ createrepo --update $repo_base + $ createrepo --update pre-built/toolchain-arm + $ createrepo --update pre-built/toolchain-x86 + +- **TroubleShooting**: the build error of tizen-debug: **nothing + provides glibc-debuginfo = 2.20** + +The tizen-debug package requires glibc-debuginfo package to support +debugging operations(e.g. .debug\_frame section) via valgrind. The +glibc-debuginfo package is located in debug folder of download.tizen.org +website. So, you have to append the below repository additonally to +build tizen-debug package normally. **Example** + + http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/debug/ + +\ + +- **TroubleShooting**: error: Start commit \'upstream/x.x.x\' **not an + ancestor of end commit \'HEAD**\' + +Sometime, While running \"gbs build\" command, you can meet the below +error messages as a \"Export Error Packages\" issue. Please, refer to +the +<https://wiki.tizen.org/wiki/Analyzing_GBS_Local_Full_Build_Errors#Upstream_Tag_Issue> +for more details. + +**Example**: error messages + + . . . Upper Omission . . . + 1941 info: start export source from: /work/infra/gbs_fullbuild_mobile3/platform/upstream/newfs-msdos ... + 1942 info: tracking branch: tizen-gerrit/upstream -> upstream + 1943 info: tracking branch: tizen-gerrit/pristine-tar -> pristine-tar + 1944 warning: Deprecated option '--git-export-only', please use '--no-build' instead! + 1945 info: Generating patches from git (upstream/1.0.0..HEAD) + 1946 error: Start commit 'upstream/1.0.0' not an ancestor of end commit 'HEAD' + 1947 error: Generating upstream tarball and/or generating patches failed. GBS tried this as you have upstream branch in you git tree. Fix the problem by either: + 1948 1. Update your upstream branch and/or fix the spec file. Also, check the upstream tag format. + 1949 2. Remove or rename the upstream branch (change the package to native) + 1950 See https://source.tizen.org/documentation/reference/git-build-system/upstream-package for more details. + 1951 error: <gbs>Failed to export packaging files from git tree + . . . Below Omission . . . + +You have to ask an appropriate package developers in order to fix the +incorrect tagging issue. Actually, this issue is generated by the +package developers that do not correctly observe [the \"Updating +Packages\" +manual](https://wiki.tizen.org/wiki/Updating_packages#3._Use_tarball) + +**Example** : How to fix the issue + + $ git checkout tizen + $ gbs submit -m "update to x.x.x" + +Creating image using MIC +======================== + +Mobile Image Creator (MIC) is used to create images for Tizen software +platform. + +Setup parameters +---------------- + +- workspace : overall workspace for mic\ +- mic\_workspace: path for MIC workspace\ +- mic\_images: path where images are created\ +- mic\_ks\_files: path where \*.ks files are downloaded\ +- mic\_logs: path where mic log files are saved\ +- snapshot\_date: snapshot date that is available in the official + repository.\ +- snapshot\_mobile which is used in GBS Local Fullbuild\ +- repo\_base: path which is used in GBS Local Fullbuild\ + +**Example** + + $ workspace=/work/infra/gbs_fullbuild_mobile + $ mic_workspace=$workspace/mic_workspace + $ mic_images=$mic_workspace/images + $ mic_ks_files=$mic_workspace/builddata/image-configs + $ mic_logs=$mic_workspace/builddata/logs + $ snapshot_date=20180103.1 + $ snapshot_mobile=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_$snapshot_date/ + $ repo_base=$workspace/pre-built/toolchain-arm/ + + $ mkdir -p $mic_workspace $mic_images $mic_ks_files $mic_logs + +\ + +Download \*.ks file +------------------- + +- Download \*.ks file (kickstart file) what you want from + \$snapshot\_mobile/images\ + +`* `[`http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snaptshot_date}_mobile-wayland-armv7l-tm1.ks`](http://download.tizen.org/snapshots/tizen/mobile/latest/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_$%7Bsnaptshot_date%7D_mobile-wayland-armv7l-tm1.ks) + +**Example** + + $ wget --directory-prefix=$mic_ks_files $snapshot_mobile/images/target-TM1/mobile-wayland-armv7l-tm1/tizen-mobile_${snapshot_date}_mobile-boot-armv7l-tm1.ks + +How to customize \*.ks file +--------------------------- + +- We have to modify baseurl of \'repo\' in \*.ks file in order to use + \*.RPMs which are built by GBS Local Full-build,\ +- Add \'\--priority=99\' to profile related repo to download + mic-bootstrap.\ +- Add \'local\' repo in \*.ks file whose baseurl is path of GBS + full-build results \*.RPMs\ +- Replace baseurl of \'base\' repo in \*.ks file from remote\_url to + \$repo\_base\ +- Create repo and repodata from \$repo\_base to be used in \*.ks file\ + +**Example** + + $ vi ./tizen-mobile_20180105.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #original ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no + repo --name=base_arm --baseurl=http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/ --ssl_verify=no + + $ vi ./tizen-mobile_20180105.4_mobile-wayland-armv7l-tm1.ks + . . . Upper Omission . . . + #modified ks file + repo --name=mobile-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_${snapshot_date}/repos/arm-wayland/packages/ --ssl_verify=no --priority=99 + repo --name=base_arm --baseurl=file:///work/infra/gbs_fullbuild_mobile/pre-built/toolchain-arm --priority=1 + repo --name=local_mobile --baseurl=file:///work/infra/gbs_fullbuild_mobile/GBS-ROOT/local/repos/tizen5.0_mobile/armv7l --priority=1 + +\ + +Generating image file using mic +------------------------------- + +- To create Tizen images, execute the following commands:\ +- Refer to the Tizen:IVI case + (https://source.tizen.org/ko/documentation/developer-guide/all-one-instructions/creating-tizen-ivi-images-based-on-specific-snapshot-one-page?langredirect=1)\ + +<!-- --> + + $ mkdir $workspace + $ sudo mic cr auto $mic_ks_files/tizen-mobile_${snapshot_date}_mobile-target-TM1-armv7l-tm1.ks --logfile=$mic_logs/_mobile-target-TM1-armv7l-tm1 -o $mic_images + ( $ sudo mic cr auto tizen_mobile-target-TM1-armv7l-tm1.ks --tmpfs) + +Tip & Techniques +================ + +Filtering Base Packages +----------------------- + +To filter base packages, perform the following procedure: + +1\. Move binaries to another directory by executing the following +commands: + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/base/`\ +`       mv ~/GBS-ROOT/local/cache/*rpm ~/tizen_mobile_src/pre-built-set/base/` + +2\. Filter the base binaries by using the references below: + +- For failed packages (caused by downloading or other reasons), remove + related binaries in the cache. In this case, we need to move the + related binaries from base to another dir because the rpm is not + neccessary. In the end, these failed packages should be fixed by + developers and they don\'t belong to pre-built. + +`       mkdir -p ~/tizen_mobile_src/pre-built-set/extra/`\ +`       mv ~/tizen_mobile_src/pre-built-set/base/xxx.rpm ~/tizen_mobile_src/pre-built-set/extra/` + +- Based on experience, exclude the following packages from cache: + +`     ail, alarm, app-core, app-checker, app-svc, aul, automotive-message-*, dbus-glib,`\ +`     bundle, capi-*, docbook, ecore, evas, eeze, elf-*, gst-plugins, gstreamer, pkgmgr,`\ +`     privacy-manager, python-*, perl-*, sensor, vconf, xdgmime, xmlcharent etc.` + +- Packages in a circle must be kept in cache or there will be + expansion errors. + +<!-- --> + +- There is another case as follows: + +`     package A run time requires B, but the build order of package B is later than A, in this case, we should remove binary of package B directly.`\ +`     Check the build log under ~/GBS-ROOT/local/repos/tizen5.0_mobile/armv7l/logs/success/`\ +`     grep -r downloading *`\ +`     A-1-0/log.txt:[    5s] [1/1] downloading `[`http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm`](http://download.tizen.org/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/i686/B-1-1.i686.rpm)` ...`\ +`     the build order:`\ +`     ...`\ +`     info: *** [1/897] building A-1-0 armv7l tizen5.0_mobile (worker: 0) ***`\ +`     info: finished building A`\ +`     ...`\ +`     info: *** [10/897] building B-1-1 armv7l tizen5.0_mobile (worker: 2) ***`\ +`     info: finished building B`\ +`     ...`\ +`     In this case, remove B-1-1.armv7l.rpm in cache` + +Removing and Adding Dependency Packages +--------------------------------------- + +The logistics of this section is as follows: + +`   check whether expansion error occurs`\ +`   if yes`\ +``        Add binaries to pre-built by following `Appendix_How to find dependency relationship for any package from repo` ``\ +`   else`\ +`       Go back to step-2 and step-3 recursively until you get a minimal pre-built`\ +`       set.` + +For example: + +`   bluetooth-share:`\ +`     nothing provides pkgconfig(aul)` + +Then find the package that provides pkgconfig (aul) + +`   pushd ./GBS-ROOT/local/order/`\ +`   grep -e "pkgconfig(aul)" .repo.cache| grep P:`\ +`   P:aul-devel.i686-1397286673/1397286678/0: aul-devel = 0.0.286-2.291 aul-devel(x86-32) = 0.0.286-2.291 pkgconfig(aul) = 0.1.0`\ +`   P:aul-devel.i686-1397286694/1397286699/0: aul-devel = 0.0.286-2.10 aul-devel(x86-32) = 0.0.286-2.10 pkgconfig(aul) = 0.1.0`\ +`   popd` + +So put **aul-devel** binary into pre-built + +Updating Pre-Built Binaries with Latest Repo +-------------------------------------------- + +To prepare pre-built binaries, execute the following commands: + +`  $ cd ~/tizen_mobile_src/pre-built/toolchain-arm`\ +`  $ ./tools/update_prebuilt.py -L . -R `[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20180103.1/repos/arm/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20180103.1/repos/arm/packages/) + +Upon successful execution of this script, the old binaries will be +replaced by the new binaries. If there is a repodata dir, make sure to +run \`createrepo \--update\` to update this pre-built directory. + +`   $createrepo --update ./repos_mobile`\ +`   $ ls ./repos_mobile/repodata/`\ +`   2fbd464035e46f900abeb4d84039d4afb1b3489420c9b633073faae470fa6b7d-primary.xml.gz`\ +`   4931aad22ff6a92ae94024c6db65a52687a0ff20ed5560fc01558b4fe8b45f32-primary.sqlite.bz2`\ +`   6bc611a44d146ae2171a53a3f2f5733e58998f4bd85b2e27a9d438fb44adf903-other.sqlite.bz2`\ +`   6cc425f57f8a218ba78cbd190b1e3391068e62927876ed627f270ee60561b5f5-filelists.sqlite.bz2`\ +`   713f5170c01e01b652f211baec23444e6aef7fdd699c867a32424d2f0ca962fc-filelists.xml.gz`\ +`   d9224b4b38b9d6c2b18ef3dce0002ac0ff511dcc21177d9578eb83bceb423157-other.xml.gz`\ +`   repomd.xml` + +How to find dependency relationship for any package from repo +------------------------------------------------------------- + +Run gbs build with any package, press Ctr-c at the start of build. Repo +is which you want to build with. + +`   gbs build -A armv7 -R /pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/ --skip-conf-repos --buildroot=~/GBS-ROOT`\ +`   info: generate repositories ...`\ +`   info: build conf has been downloaded at:`\ +`         /var/tmp/tizen.conf`\ +`   info: start building packages from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77 (git)`\ +`   2014-05-20 13:54 +0800`\ +`   info: prepare sources...`\ +`   info: start export source from: /home/testspace/f81517f68c214eabbd4f1445e9b01e77/fake ...`\ +`   info: Creating (native) source archive fake-1.0.tbz2 from 'HEAD'`\ +`   info: package files have been exported to:`\ +`   /home/GBS-ROOT/local/sources/tizen/fake-1.0-1`\ +`   info: retrieving repo metadata...`\ +`   info: parsing package data...`\ +`   info: building repo metadata ...`\ +`   info: package dependency resolving ...`\ +`   info: next pass:`\ +`   fake`\ +`   info: *** [1/1] building fake-1.0-1 armv7l tizen (worker: 0) ***`\ +`   VM_IMAGE: , VM_SWAP:`\ +`   --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   logging output to /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.build.log...`\ +`   [    0s] Memory limit set to 21777108KB`\ +`   [    0s] Using BUILD_ROOT=/home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0`\ +`   [    0s] Using BUILD_ARCH=i686:armv7l:i486:i386:noarch`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] started "build fake.spec" at Tue May 20 05:54:35 UTC 2014.`\ +`   [    0s]`\ +`   [    0s]`\ +`   [    0s] processing specfile /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /home/GBS-ROOT/local/cache --repository /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages --repository HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages /home/GBS-ROOT/local/sources/tizen/fake-1.0-1/fake.spec ...`\ +`   [    0s] initializing /home/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/.srcfiles.cache ...`\ +`   [    0s] /usr/lib/build/createrpmdeps /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS`\ +`   [    0s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages`\ +`   [    1s] /usr/lib/build/createrepomddeps --cachedir=/home/GBS-ROOT/local/cache HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/emul/arm/packages`\ +`   ^C^C captured`\ +`   warning: build failed, Leaving the logs in /home/GBS-ROOT/local/repos/tizen/armv7l/logs/fail/fake-1.0-1/log.txt` + +Then open \~/GBS-ROOT/local/order/.repo.cache, it can provide all +information about every package from repo like: + +`   P:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm = 1.0-13.20 mic-bootstrap-x86-arm(x86-32) = 1.0-13.20`\ +`   R:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: /bin/sh`\ +`   I:mic-bootstrap-x86-arm.armv7l-1397164816/1397165006/0: mic-bootstrap-x86-arm-1.0-13.20 1397164816`\ +`   F:gdb-locale.noarch-1387595787/1387595811/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/gdb-locale-7.5.1-10.1.noarch.rpm`\ +`   P:gdb-locale.noarch-1387595787/1387595811/0: gdb-lang-all = 7.5.1 gdb-locale = 7.5.1-10.1`\ +`   R:gdb-locale.noarch-1387595787/1387595811/0: gdb = 7.5.1`\ +`   I:gdb-locale.noarch-1387595787/1387595811/0: gdb-locale-7.5.1-10.1 1387595787`\ +`   F:zypper-locale.noarch-1387597203/1387597217/0: HOSTNAME/pub/mirrors/tizen/releases/milestone/tizen/mobile/tizen_20140422.1/repos/mobile/arm/packages/noarch/zypper-locale-1.8.14-12.1.noarch.rpm` + +The meaning of these prefix characters are: + +- P what this package provides +- R what this package requires +- F where to find this package +- I Identifier of package + +Full Build Script (FBS) +======================= + +If you understand the above sections enough, you can easily repeat the +build procedure for your convenience. The Full Build Script (FBS) is a +simple script to understand how both full-build and partial-build are +executed by gbs. It helps that the developers can do both full-build and +partial-build easy-to-use without the need to read step-by-step +instruction. + +Full build +---------- + +**Example: to build full-source locally** + +1\. In case of the **repo sync \...** command, The script does not +perfectly handle the incorrect projects.xml.\ +2. In case of the **gbs build \...** command, The normal operation of +the script is dependent on the correctness of the fetched snapshot +packages and that of the git repositories. 3. If you meet gbs issues, +please report your issue at Tizen mailling list. + +- Mailman - <https://lists.tizen.org/listinfo/dev> +- Jira - <https://bugs.tizen.org/jira/projects/DEVT> + +\$ vi ./fbs.sh + + + + #!/usr/bin/env bash + # @Title: Full Build Script (FBS) + # @License: Apache + # @Date: Jan-11-2017 + # @Contacts: leemgs@gmail.com + # @Prequisites: cat, grep, wc, curl, time, repo, mkdir, wget, createrepo, rm, gunzip, gbs, tee, python-pip + # ($ sudo apt-get install coreutils gbs createrepo python-pip wget curl grep time gzip lynx-cur lynx ) + # @Host PC: + # 1. Ubuntu 16.04.5 LTS X64, Linux kernel 3.15.0-98-generic, GCC 4.8.4, Glibc 2.19 + # 2. Ubuntu 16.04.1 LTS X64, Linux kernel 4.5.0-42-generic, GCC 5.5.0, Glibc 2.23 + # @Description: This script is to build full source with just one 'enter' key + # It is Full Build Script (FBS) is a simple script to help personal developers that deploy Tizen platform + # on their embedded devices as well as Tizen reference devices. + # @Todo: a. Error handling function , b. Enabling check_manifest.py, c. Bottle-neck profiling + # + #-------------------------------- Configuration area: Please, modify with appropriate content -------------------- + # Define input arguments. There are five profiles currently in Tizen 5.0 + # __profie={common | mobile | ivi | tv | wearable | ...}, + # __target={arm-wayland | target-TM1 | ...}, + # __rpmrepo_date_base={20180119.1 | 20180119.2 | latest} // We don't recommend that you use "latest" because it is not stable. + # __rpmrepo_date_profile={20180123.1 | 20180123.1 | latest} // We don't recommend that you use "latest" because it is not stable. + + # 1) snapshot: lifespan of sanpshot is 3 months. + function define_snapshot { + __rpmrepo_date_base=20170210.1 + __rpmrepo_date_profile=20170210.1 + __rpmrepo_path=snapshots + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 2) release(daily): lifespan of release(daily) is 3 months . + function define_release_daily { + __rpmrepo_date_base=20181016.1 + __rpmrepo_date_profile=20181020.2 + __rpmrepo_path=releases/daily + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 3) release(weekly): lifespan of release(weekly) is 2 years . + function define_release_weekly { + __rpmrepo_date_base=20181016.1 + __rpmrepo_date_profile=20181020.2 + __rpmrepo_path=releases/weekly + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/base/tizen-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/${__profile}/tizen-${__profile}_${__rpmrepo_date_profile} + } + + # 4) release(official,m1/m2/m3): lifespan of release(official,m1/m2/m3) is 10 years. + function define_release_official { + __rpmrepo_date_base=20170104.1 + __rpmrepo_date_profile=20170111.1 + __rpmrepo_path=releases/milestone + __rpmrepo_addr=http://download.tizen.org/${__rpmrepo_path}/tizen + __rpmrepo_base_url=${__rpmrepo_addr}/5.0.m2/5.0.m2-base/tizen-5.0.m2-base_${__rpmrepo_date_base} + __rpmrepo_profile_url=${__rpmrepo_addr}/5.0.m2/5.0.m2-${__profile}/tizen-5.0.m2-${__profile}_${__rpmrepo_date_profile} + } + + # Select one among the four RPM repositories. + define_release_official + __cpu_number=`cat /proc/cpuinfo | grep "model name" | wc -l` + + #-------------------------------- Execution area: Please, don't modify the script from here ---------------------- + + function error_display { + if [ $? != 0 ]; then echo -e "$1"; exit 1 ;fi + } + + #### STEP 1/4: Sync the repository from https://git.tizen.org ####################################### + + # TBI (To Be Implemented) + function fix_incorrect_project_path_automatic { + cat ./.repo/manifests/README + ./.repo/manifests/Check_manfiest/check_manifest.py --help + error_display "\n\n* FBS:[1/4] Error Occurred while running check_manifest.py script" + # How to add user id and password for https authentification of https://review.tizen.org + # sudo apt-get install python-pip + # sudo pip install pygerrit + # vi ./.repo/manifests/Check_manfiest/check_manifest.py + # 171 gc = GerritClient('https://review.tizen.org/gerrit', '<usrname>', '<passwd>') + ./.repo/manifests/Check_manfiest/check_manifest.py --tizen-src . -p ${__profile} --url ${__profile}-latest --update + # cat tizen_mobile_revision_diff.csv + } + + # Custom area: modify git repository address correctly in case of an wrong web addresses. + function fix_incorrect_project_path_manual { + sed -i -e 's/framework\/base\/tizen-locale/core\/base\/tizen-locale/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-direct/native\/ug-wifi-direct/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-nfc-efl/native\/ug-nfc-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-wifi-efl/native\/ug-wifi-efl/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/bluetooth-share-ui/native\/bluetooth-share-ui/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-mobile-ap/native\/ug-mobile-ap/g' ./.repo/manifests/${__profile}/projects.xml + sed -i -e 's/core\/preloaded\/ug-bluetooth-efl/native\/ug-bluetooth-efl/g' ./.repo/manifests/${__profile}/projects.xml + } + + function repo_init { + cd $__workspace + # time repo init -u ssh://${__tizen_id}@review.tizen.org:29418/scm/manifest -b tizen -m ${__profile}.xml + # time repo init -u https://${__tizen_id}:TylhenFPwSGpNtEg19ZA6u81ylrvqvEiAiemsF4MpQ@review.tizen.org/gerrit/p/scm/manifest -b tizen -m ${__profile}.xml + time repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m ${__profile}.xml + error_display "\n\n* FBS:[1/4] Error Occurred while running 'repo init' command" + curl $__rpmrepo_profile_url/builddata/manifest/tizen-${__profile}_${__rpmrepo_date_profile}_arm-wayland.xml > ./.repo/manifests/${__profile}/projects.xml + error_display "\n\n* FBS:[1/4] Error Occurred while downloading projects.xml with curl" + # todo: fix_incorrect_project_path_automatic + # todo: fix_incorrect_project_path_manual + } + + function repo_sync { + time repo sync -j${__cpu_number} 2>repo-sync-error.txt + if [[ $? != 0 ]]; then + echo -e "\n\n* FBS:[1/4] Error Occurred while downloading Source with repo sync" + echo -e " Please, modify correctly the below incorrect project paths after openning ./.repo/manifests/${__profile}/projects.xml.\n\n" + cat repo-sync-error.txt | grep "error: Cannot fetch" + exit 1 + fi + } + + function download_git_repo { + repo_init + repo_sync + } + + #### STEP 2/4: Download the pre-built RPM packages from http://download.tizen.org ################### + function download_prebuilt_rpms { + mkdir ./repos_base_packages + mkdir ./repos_base_debug + mkdir ./repos_${__profile}_packages + mkdir ./repos_${__profile}_debug + wget --directory-prefix=repos_base_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/packages/ + wget --directory-prefix=repos_base_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_base_url}/repos/arm/debug/ + wget --directory-prefix=repos_${__profile}_packages --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/packages/ + wget --directory-prefix=repos_${__profile}_debug --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 ${__rpmrepo_profile_url}/repos/${__target}/debug/ + createrepo --update ./repos_base_packages + createrepo --update ./repos_base_debug + createrepo --update ./repos_${__profile}_packages + createrepo --update ./repos_${__profile}_debug + build_conf_file=`curl -l ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/ | grep -o "href=.*build\.conf\.gz\"" | sed -e 's/href="//g; s/"//g' ` + curl ${__rpmrepo_profile_url}/repos/${__target}/packages/repodata/${build_conf_file} | gunzip > ./scm/meta/build-config/build.conf + error_display "\n\n* FBS:[2/4] Error Occurred while downloading build.conf with curl" + } + + #### STEP 3/4: Run full-build ######################################################################## + function run_full_build { + rm -f ~/.gbs.conf + rm -f ./.gbs.conf + __local_repository_url="-R ./repos_base_packages/ -R ./repos_base_debug/ -R ./repos_${__profile}_packages/ -R ./repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ./GBS-ROOT ${__local_repository_url} -D ./scm/meta/build-config/build.conf | tee fbs-${__rpmrepo_date_profile}.txt + error_display "\n\n* FBS:[3/4] Error Occurred while building packages with gbs build" + } + #### STEP 4/4: View the report ####################################################################### + function view_report { + __report_file=${__workspace}/GBS-ROOT/local/repos/tizen/armv7l/index.html + if [ ! -f ${__report_file} ];then + echo -e "\n [Error] ${__report_file} is not generated." + else + lynx ${__report_file} + error_display "\n\n* FBS:[4/4] Error Occurred while reading the report file" + fi + } + + #### Main function ################################################################################### + # repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m <PROFILE>.xml + # repo sync + # gbs build --arch armv7l --threads <#CPU> --clean-once --include-all + # firefox /GBS-ROOT/local/repos/tizen/<ARCH>/index.html + # + download_git_repo # STEP 1/4 + download_prebuilt_rpms # STEP 2/4 + run_full_build # STEP 3/4 + view_report # STEP 4/4 + +**Screenshot** + +The below screenshot shows the console-based report result after +completing \"Tizen5.0:Common local full-build\" with full build script +on Ubuntu 16.04.1 X64 PC. If you want to see the report with GUI +interface, you may run \"firefox +./GBS-ROOT/local/repos/tizen/armv7l/index.html\" command. + +![FBS (Skeleton) +Screenshot](gbs-full-build-20181013-horizontal.png "FBS (Skeleton) Screenshot"){width="500"} + +Partial build +------------- + +**Example: to build one package (e.g. tizen-release package)** + +- The below example is to describe how to build a package in case that + the developer try to enhance existing packages after doing + full-build. + +<!-- --> + + $ cd $__workspace + $ cd ./platform/upstream/tizen-release + $ vi ./partial-build.sh + + #!/bin/bash + __work_space=/work/infra/gbs_fullbuild_common_20181108.1 + __profile=common + __cpu_number=1 + __local_repository_url="-R ${__work_space}/repos_base_packages/ -R ${__work_space}/repos_base_debug/ -R ${__work_space}/repos_${__profile}_packages/ -R ${__work_space}/repos_${__profile}_debug/" + time gbs build --arch armv7l --threads ${__cpu_number} --clean-once --include-all -B ${__work_space}/GBS-ROOT ${__local_repository_url} -D ${__work_space}/scm/meta/build-config/build.conf + +Contributing your experience +============================ + +If you find additional tips and techniques to compile Tizen 5.0 full +source locally, Please, update this wiki page as a volunteer. + +[Category:Platform](Category:Platform "wikilink") +[Category:Tizen-3](Category:Tizen-3 "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_Common_Emulator.md b/docs/platform/tool/Tizen_Common_Emulator.md new file mode 100644 index 0000000000..87c34f5050 --- /dev/null +++ b/docs/platform/tool/Tizen_Common_Emulator.md @@ -0,0 +1,54 @@ +Start Tizen Common Emulator through Tizen IVI SDK +================================================= + +Install Tizen IVI SDK +--------------------- + +You can refer to this wiki page [Tizen IVI +SDK](https://wiki.tizen.org/wiki/Tizen_IVI_SDK) to install Tizen IVI +SDK. + +Download Tizen Common Emulator image +------------------------------------ + +Tizen [Common](Common "wikilink") [Emulator](Emulator "wikilink") image +can be built out automatically. You can download it at this link + +- <http://download.tizen.org/snapshots/tizen/common/latest/images/#> + emulator32-wayland/common-emulator-qa-unsafe-wayland-mbr-i586/. + +TODO: update link to more recent than: + +- <http://download.tizen.org/releases/milestone/tizen/common-3.0.2015.Q2/> + +Modify Emulator Image +--------------------- + +- Enlarge the loop image root partition size. + +`$ e2fsck -f tizen-common.img`\ +`$ resize2fs tizen-common.img 3900M` + +- Change the loop format to qcow2 format. + +`$ ~/tizen-sdk/tools/emulator/bin/qemu-img convert -O qcow2 tizen-common.img emulimg-3.0.x86` + +Create a Tizen Common Emulator +------------------------------ + +1\. Launch Emulator Manager. + +2\. Click \"ivi-custom\" lable. Select \"Base image\" and find the image +emulimg-3.0.x86 you downloaded. Name it and then click \"Confirm\" +button. + +![](Create_Common_Image.png "Create_Common_Image.png") + +3\. Launch it. + +### LINKS + +- <https://wiki.tizen.org/wiki/Emulator> + +[Category:Common](Category:Common "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_GBS_Local_Fullbuild_Script.md b/docs/platform/tool/Tizen_GBS_Local_Fullbuild_Script.md new file mode 100644 index 0000000000..f0ab7c3ff1 --- /dev/null +++ b/docs/platform/tool/Tizen_GBS_Local_Fullbuild_Script.md @@ -0,0 +1,536 @@ +Introduction +------------ + +This document describes how to use GBS fullbuild script and how to +create Tizen images using MIC.\ +How to install GBS and MIC is well described in Tizen +documentation.(https://source.tizen.org/documentation/reference/git-build-system, +<https://source.tizen.org/documentation/reference/mic-image-creator>)\ +\'repo init\' and \'repo sync\' are used to construct full source tree +of Tizen\ + +GBS Local Fullbuild Script +-------------------------- + + #!/bin/bash + + + #input workspace + echo "Input your workspace" + echo "If you input nothing, default workspace is ~/gbs_fullbuild" + echo -e "workspace: \c" + read workspace + + if [ ! $workspace ] + then + workspace=~/gbs_fullbuild + fi + + echo "Your workspace=$workspace" + mkdir -p $workspace + + #Input tizen version + echo -e "\n\nInput tizen version" + + + while [ 1 ] + do + echo "Supported tizen version is 3 and 4" + echo -e "Tizen version: \c" + read tizen_version + + if [ $tizen_version = 3 -o $tizen_version = 4 ];then + break + fi + + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "You selected nothing or invalid tizen version" + echo -e "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n" + done + + echo "Selected tizen version=$tizen_version" + + + + #Input tizen profile + echo -e "\n\n" + if [ $tizen_version = 3 ] + then + echo "Input tizen profile" + + while [ 1 ] + do + echo "Select one of tizen profile for tizen 3.0: " + echo "common, mobile, tv, wearable, ivi" + echo -e "Tizen profile: \c" + read profile + + if [ $profile = common -o $profile = mobile -o $profile = tv -o $profile = wearable -o $profile = ivi ];then + break + fi + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "You selected nothing or invalid tizen profile" + echo -e "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n" + done + else + echo "There is only one profile in tizen 4.0" + profile=unified + fi + + echo "Selected tizen profile=$profile" + + + + #Input profile snapshot number + echo -e "\n\nSelect profile snapshot" + if [ $tizen_version = 3 ] + then + profile_prefix="3.0-" + fi + + while [ 1 ] + do + snapshot_candidate=$(curl http://download.tizen.org/snapshots/tizen/${profile_prefix}${profile}/ | grep -e "tizen-${profile_prefix}${profile}" | awk -F\" '{print $2}' | sed 's/\///') + echo "You have to select one of snapshot number in http://download.tizen.org/snapshots/tizen/${profile_prefix}${profile}/" + echo "Candidate snapshot lists are like below. You have to select snapshot number among them" + echo "=================================================" + echo "latest" + for ss in $snapshot_candidate; do echo $ss;done + echo "=================================================" + echo -e "Snapshot number: \c" + read tmp_snapshot_number + + snapshot_number=$(echo $tmp_snapshot_number | sed 's/\///') + + snapshot_error=$(curl http://download.tizen.org/snapshots/tizen/${profile_prefix}${profile}/$snapshot_number/ | grep "Not Found") + + if [ ! $snapshot_error -a $snapshot_number ];then + break + fi + + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "You selected nothing or invalid snapshot number" + echo -e "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n" + done + + echo "Selected tizen snapshot number=$snapshot_number" + srcrpm_snapshot=http://download.tizen.org/snapshots/tizen/${profile_prefix}${profile}/${snapshot_number}/ + + + #Input repository + echo -e "\n\nSelect build repository" + + while [ 1 ] + do + repo_candidate=$(curl $srcrpm_snapshot/repos/ | grep "a href" | sed '1d' | awk -F\" '{print $2}' | sed 's/\///') + echo "You have to select one of repositories in $srcrpm_snapshot/repos/" + echo "Candidate repository lists are like below. You have to select repository among them" + echo "=================================================" + for repo in $repo_candidate;do echo $repo;done + echo "=================================================" + + echo -e "build repository: \c" + read build_repository + + snapshot_error=$(curl $srcrpm_snapshot/repos/${build_repository} | grep "Not Found") + if [ ! $snapshot_error -a $build_repository ];then + break + fi + + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "You selected nothing or invalid build repository" + echo -e "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n" + done + + echo "Selected build repository=$build_repository" + + + #Clone all tizen code using repo init/ repo sync + cd $workspace + repo init -u https://git.tizen.org/cgit/scm/manifest -b tizen -m common.xml + + #replace projects.xml to manifest.xml in snapshot repo + pushd $workspace/.repo/manifests/common/ + wget $srcrpm_snapshot/builddata/manifest/${snapshot_number}_$build_repository.xml + mv ${snapshot_number}_$build_repository.xml projects.xml + popd + + repo sync + + REPO_SYNC_LOG=$workspace/repo_sync_log + if [ -e $REPO_SYNC_LOG ];then + rm $REPO_SYNC_LOG + fi + repo sync >> $REPO_SYNC_LOG 2>&1 + REPO_SYNC_ERR_RESULT=$(cat $REPO_SYNC_LOG | grep "Cannot fetch") + if [ $(echo $REPO_SYNC_ERR_RESULT | sed -n '1p' | awk '{print $1}') ];then + echo -e "\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo $REPO_SYNC_ERR_RESULT + echo -e "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n" + echo "repo sync is terminated due to error above" + exit + fi + + + #Replace build.conf file to that in snapshot repo + build_conf_dl=$workspace/scm/meta/build-config/ + pushd $build_conf_dl + build_conf_file=$(curl $srcrpm_snapshot/repos/$build_repository/packages/repodata/ | grep build.conf | awk -F\" '{print $2}') + wget $srcrpm_snapshot/repos/$build_repository/packages/repodata/$build_conf_file + gzip -d $build_conf_file + mv *-build.conf build.conf + buildconf=$build_conf_dl/build.conf + popd + + + #compose .gbs.conf file + gbs_conf_file=$workspace/.gbs.conf + chmod +w $gbs_conf_file + + if [ $tizen_version = 3 ] + then + profile_prefix="3.0-" + fi + + echo "[general] + profile = profile.tizen_${profile} + + [profile.tizen_${profile}] + repos = repo.${profile_prefix}base.arm,repo.${profile_prefix}base.arm64,repo.${profile_prefix}base.emulator32,repo.${profile_prefix}base.emulator64,\ + repo.${profile_prefix}base.arm.debug,repo.${profile_prefix}base.arm64.debug,repo.${profile_prefix}base.emulator32.debug,repo.${profile_prefix}base.emulator64.debug + buildroot=$workspace/GBS-ROOT/ + buildconf=$build_conf_dl/build.conf + + [repo.3.0-base.arm] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/arm/packages/ + [repo.3.0-base.arm.debug] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/arm/debug/ + + [repo.3.0-base.arm64] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/arm64/packages/ + [repo.3.0-base.arm64.debug] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/arm64/debug/ + + [repo.3.0-base.emulator32] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/emulator32/packages/ + [repo.3.0-base.emulator32.debug] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/emulator32/debug/ + + [repo.3.0-base.emulator64] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/emulator64/packages/ + [repo.3.0-base.emulator64.debug] + url = http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/emulator64/debug/ + + + [repo.base.arm] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/ + [repo.base.arm.debug] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/debug/ + + [repo.base.arm64] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm64/packages/ + [repo.base.arm64.debug] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm64/debug/ + + [repo.base.emulator32] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/ia32/packages/ + [repo.base.emulator32.debug] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/ia32/debug/ + + [repo.base.emulator64] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/x86_64/packages/ + [repo.base.emulator64.debug] + url = http://download.tizen.org/snapshots/tizen/base/latest/repos/x86_64/debug/ + " > $gbs_conf_file + + + + #Input gbs build command + echo -e "\n\nInput gbs build command:" + read gbs_build_command + + cd $workspace + $gbs_build_command --define 'jobs 8' --define '_smp_mflags -j8' + +\ + +How to use GBS Local Fullbuild Script +------------------------------------- + +You have to input parameters while script is running\ +====workspace==== + +- Overall workspace where source codes are downloaded and GBS build + results are saved\ +- You will meet below instroction\ + +<!-- --> + + Input your workspace + If you input nothing, default workspace is ~/gbs_fullbuild + workspace: + +#### Tizen version + +- Currently, supported tizen version is \'3\' and \'4\'\ +- You will meet below instroction\ + +<!-- --> + + Input tizen version + Supported tizen version is 3 and 4 + Tizen version: + +- If you input tizen version except \'3\' and \'4\', you have to input + tizen version again\ + +#### Tizen profile + +- If you select tizen version as \'4\', \'unified\' profile will be + automatically selected, because there is only one profile in tizen + version \'4\'\ +- If you select tizen version as \'3\', you have to select one of + profiles among \'mobile, tv, common, ivi, wearabe\'\ +- If you select tizen version as \'3\', you will meet below + instroction\ + +<!-- --> + + Select one of tizen profile for tizen 3.0: + common, mobile, tv, wearable, ivi + Tizen profile: + +- If you select tizen version as \'3\', and if you input tizen profile + except \'mobile, tv, common, ivi, wearabe\', you have to input tizen + profile again\ + +#### Snapshot number + +- You have to select one of snapshot number which will be used in + source code downloading\ +- Snapshot candidates are listed up. You have to select one of them\ + +<!-- --> + + You have to select one of snapshot number in $snapshot_url + Candidate snapshot lists are like below. You have to select snapshot number among them + ================================================= + Snapshot candidate list + ================================================= + Snapshot number: + +- If you select snapshot number which is not in snapshot candidate + list, you have to input snapshot number again\ + +#### Build Repository + +- You have to select one of build repository which will be used in + source code downloading\ +- Repository candidates are listed up. You have to select one of them\ + +<!-- --> + + You have to select one of repositories in $repository_url + Candidate repository lists are like below. You have to select repository among them + ================================================= + Repository candidate list + ================================================= + build repository: + +- If you select build repository which is not in repository candidate + list, you have to input build repository again\ + +\ + +#### Full source code download + +- Full source code will be downloaded automatically using \'repo + init\' & \'repo sync\'\ +- .gbs.conf file will be automatically created (path: + \$workspace/.gbs.conf)\ +- build.conf file will be automatically downloaded (path: + \$workspace/scm/meta/build-conf/build.conf)\ +- GBS build results will be stored in \$workspace/GBS-ROOT/\ + +\ + +#### GBS build command + +- Input build command which will be used in gbs building\ +- example\ + +<!-- --> + + gbs build -A armv7l --threads=8 + +\ +\ + +Example +------- + +#### Tizen 3.0 Mobile + + nanjing@t016:/data/park_temp/fullbuild_general$ ./gbs_fullbuild.sh + Input your workspace + If you input nothing, default workspace is ~/gbs_fullbuild + workspace: /data/park_temp/fullbuild_general/3.0-mobile-#1 + Your workspace=/data/park_temp/fullbuild_general/3.0-mobile-#1 + + + Input tizen version + Supported tizen version is 3 and 4 + Tizen version: 3 + Selected tizen version=3 + + + + Input tizen profile + Select one of tizen profile for tizen 3.0: + common, mobile, tv, wearable, ivi + Tizen profile: mobile + Selected tizen profile=mobile + + + Select profile snapshot + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 2312 0 2312 0 0 30523 0 --:--:-- --:--:-- --:--:-- 30826 + You have to select one of snapshot number in http://download.tizen.org/snapshots/tizen/3.0-mobile/ + Candidate snapshot lists are like below. You have to select snapshot number among them + ================================================= + latest + tizen-3.0-mobile_20170407.1 + tizen-3.0-mobile_20170407.2 + tizen-3.0-mobile_20170407.3 + tizen-3.0-mobile_20170407.4 + tizen-3.0-mobile_20170410.1 + tizen-3.0-mobile_20170410.2 + tizen-3.0-mobile_20170411.1 + tizen-3.0-mobile_20170411.2 + tizen-3.0-mobile_20170412.1 + tizen-3.0-mobile_20170412.2 + tizen-3.0-mobile_20170414.1 + tizen-3.0-mobile_20170414.2 + tizen-3.0-mobile_20170414.3 + tizen-3.0-mobile_20170420.1 + tizen-3.0-mobile_20170420.2 + ================================================= + Snapshot number: tizen-3.0-mobile_20170420.2 + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 713 0 713 0 0 16997 0 --:--:-- --:--:-- --:--:-- 17390 + Selected tizen snapshot number=tizen-3.0-mobile_20170420.2 + + + Select build repository + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 630 0 630 0 0 8231 0 --:--:-- --:--:-- --:--:-- 8289 + You have to select one of repositories in http://download.tizen.org/snapshots/tizen/3.0-mobile/tizen-3.0-mobile_20170420.2//repos/ + Candidate repository lists are like below. You have to select repository among them + ================================================= + arm-wayland + emulator32-wayland + target-TM1 + ================================================= + build repository: arm-wayland + ... + ... + repo init log + repo sync log + ... + ... + gbs build command: gbs build -A armv7l --threads=8 + ... + ... + gbs build log + ... + ... + +\ +\ +====Tizen Unified==== + + nanjing@t016:/data/park_temp/fullbuild_general$ ./gbs_fullbuild.sh + Input your workspace + If you input nothing, default workspace is ~/gbs_fullbuild + workspace: /data/park_temp/fullbuild_general/unified-#1 + Your workspace=/data/park_temp/fullbuild_general/unified-#1 + + + Input tizen version + Supported tizen version is 3 and 4 + Tizen version: 4 + Selected tizen version=4 + + + + There is only one profile in tizen 4.0 + Selected tizen profile=unified + + + Select profile snapshot + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 3301 0 3301 0 0 10440 0 --:--:-- --:--:-- --:--:-- 10413 + You have to select one of snapshot number in http://download.tizen.org/snapshots/tizen/unified/ + Candidate snapshot lists are like below. You have to select snapshot number among them + ================================================= + latest + tizen-unified_20170408.1 + tizen-unified_20170408.2 + tizen-unified_20170410.1 + tizen-unified_20170411.1 + tizen-unified_20170411.2 + tizen-unified_20170412.1 + tizen-unified_20170413.1 + tizen-unified_20170414.1 + tizen-unified_20170414.2 + tizen-unified_20170414.3 + tizen-unified_20170414.4 + tizen-unified_20170417.1 + tizen-unified_20170418.1 + tizen-unified_20170418.2 + tizen-unified_20170418.3 + tizen-unified_20170419.1 + tizen-unified_20170419.2 + tizen-unified_20170420.1 + tizen-unified_20170420.2 + tizen-unified_20170421.1 + tizen-unified_20170421.2 + tizen-unified_20170421.3 + tizen-unified_20170424.1 + ================================================= + Snapshot number: tizen-unified_20170424.1 + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 701 0 701 0 0 1865 0 --:--:-- --:--:-- --:--:-- 1864 + Selected tizen snapshot number=tizen-unified_20170424.1 + + + Select build repository + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 489 0 489 0 0 3599 0 --:--:-- --:--:-- --:--:-- 3622 + You have to select one of repositories in http://download.tizen.org/snapshots/tizen/unified/tizen-unified_20170424.1//repos/ + Candidate repository lists are like below. You have to select repository among them + ================================================= + emulator + standard + ================================================= + build repository: standard + ... + ... + repo init log + repo sync log + ... + ... + gbs build command: gbs build -A armv7l --threads=8 + ... + ... + gbs build log + ... + ... + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_IoT_reference_board.md b/docs/platform/tool/Tizen_IoT_reference_board.md new file mode 100644 index 0000000000..7d4f752254 --- /dev/null +++ b/docs/platform/tool/Tizen_IoT_reference_board.md @@ -0,0 +1,170 @@ +**Eagleye Board**\ + +![](Eagleye_530s.jpg "fig:Eagleye_530s.jpg")\ +After getting an Eagleye 530s board, you should migrate the boot image +for tizen to it.\ + +Prerequisite +------------- + +\$ sudo apt-get install android-tools-fastboot lthor\ + +Migrate boot image for tizen. +------------------------------ + +**Target Side**\ +1. Enter boot mode.\ +2. Enter fastboot mode.\ +*ARTIK\# fastboot 0\ +* + +**Host Side**\ +1. Download the tool - compressed file. (file : +<https://github.com/playchang22/tizeniot/raw/master/Migration_artik533s_tizen_usb_recovery.tar.gz>)\ +2. Extract it on Host PC(Ubuntu linux)\ +3. Move to artik533s/os\_3.2.0\ +4. Execute \"flash\_boot\_for\_tizen.sh\"\ +*\$ ./flash\_boot\_for\_tizen.sh*\ + +How to download tizen images. +------------------------------ + +1\. Getting images.\ +Boot Image : a +tarball(tizen-unified\_<snapshotid>\_iot-boot-armv7l-artik533s.tar.gz) +on +<http://download.tizen.org/snapshots/tizen/unified/latest/images/standard/iot-boot-armv7l-artik533s/>\ +Platform Image : a +tarball(tizen-unified\_<snapshotid>\_iot-headless-2parts-armv7l-artik530\_710.tar.gz) +on +<http://download.tizen.org/snapshots/tizen/unified/latest/images/standard/iot-headless-2parts-armv7l-artik530_710/>\ +2. Downloading image to a target\ +**Target Side**\ +artik530\# thordown\ +{\| class=\"wikitable\" \|- \| + + U-Boot 2016.01-g1aec83841-TIZEN.org (Jun 01 2018 - 02:02:19 +0000) + + Model: Samsung artik533 board based on Nexell s5p4418 + + Board: ARTIK533 Raptor + DRAM: 992 MiB + HW Revision: 6 + MMC: NEXELL DWMMC: 0, NEXELL DWMMC: 1 + In: serial + Out: serial + Err: serial + Writing to MMC(0)... done + Net: eth0: ethernet@c0060000 + Hit any key to stop autoboot: 0 + artik530# + artik530# thordown + TIZEN "THOR" Downloader + Download request from the Host PC + ##File System is consistent + file found deleting + update journal finished + File System is consistent + update journal finished + 45918 bytes written in 87 ms (514.6 KiB/s) + #File System is consistent + file found deleting + update journal finished + File System is consistent + update journal finished + 6344432 bytes written in 751 ms (8.1 MiB/s) + #File System is consistent + file found deleting + update journal finished + File System is consistent + update journal finished + 49898 bytes written in 89 ms (546.9 KiB/s) + U-Boot signature: "artik533_raptor" + bootloader.img signature: "artik533_raptor". OK! + Target version : 3.2.0 + Image version : 3.2.0 + ###File System is consistent + file found deleting + update journal finished + File System is consistent + update journal finished + 7340032 bytes written in 844 ms (8.3 MiB/s) + ###########File System is consistent + file found deleting + update journal finished + File System is consistent + update journal finished + 7732224 bytes written in 881 ms (8.4 MiB/s) + resetting ... + +\|} **Host Side**\ +\$ lthor tizen-unified\_20180629.3\_iot-boot-armv7l-artik533s.tar.gz +tizen-unified\_20180629.3\_iot-headless-2parts-armv7l-artik530\_710.tar.gz + ++-----------------------------------------------------------------------+ +| $ lthor tizen-unified_20180629.3_iot-boot-armv7l-artik533s.tar.gz | +| tizen-unified_20180629.3_iot-headless-2parts-armv7l-artik530_710.tar | +| .gz | +| | +| Linux Thor downloader, version 2.0 | +| Authors: Jaehoon You <jaehoon.you@samsung.com> | +| Krzysztof Opasiak <k.opasiak@samsung.com> | +| | +| tizen-unified_20180629.3_iot-boot-armv7l-artik533s.tar.gz : | +| [modules.img] 20480k | +| [s5p4418-artik533-compy.dtb] 44k | +| [zImage] 6195k | +| [s5p4418-artik533-raptor-rev00.dtb] 48k | +| [bootloader.img] 1024k | +| [params.bin] 16k | +| tizen-unified_20180629.3_iot-headless-2parts-armv7l-artik530_710. | +| tar.gz : | +| [ramdisk.img] 7168k | +| [rootfs.img] 243084k | +| [system-data.img] 61012k | +| [ramdisk-recovery.img] 7551k | +| ------------------------- | +| total : 338.50MB | +| | +| | +| Download files from tizen-unified_20180629.3_iot-boot-armv7l-arti | +| k533s.tar.gz | +| | +| [modules.img] | sending 20480k/ 20480k 100% block 20 [avg | +| 39.89 MB/s] | +| [s5p4418-artik53\ sending 44k/ 44k 100% block 1 [avg | +| 1.69 MB/s] | +| [zImage] | sending 6195k/ 6195k 100% block 7 [avg | +| 34.25 MB/s] | +| [s5p4418-artik53\ sending 48k/ 48k 100% block 1 [avg | +| 1.77 MB/s] | +| [bootloader.img]| sending 1024k/ 1024k 100% block 1 [avg | +| 30.61 MB/s] | +| [params.bin] - sending 16k/ 16k 100% block 1 [avg | +| 0.60 MB/s] | +| | +| Download files from tizen-unified_20180629.3_iot-headless-2parts- | +| armv7l-artik530_710.tar.gz | +| | +| [ramdisk.img] | sending 7168k/ 7168k 100% block 7 [avg | +| 39.51 MB/s] | +| [rootfs.img] | sending 243084k/243084k 100% block 238 [avg | +| 12.45 MB/s] | +| [system-data.img\ sending 61012k/ 61012k 100% block 60 [avg | +| 18.40 MB/s] | +| [ramdisk-recover/ sending 7551k/ 7551k 100% block 8 [avg | +| 35.96 MB/s] | +| | +| request target reboot : success | ++-----------------------------------------------------------------------+ + +Reference Site: +---------------- + +<http://wiki.seeedstudio.com/Eagleye_530s/> + +[Category:Tizen](Category:Tizen "wikilink") +[Category:IoT](Category:IoT "wikilink") +[Category:Tool](Category:Tool "wikilink") +[Category:ARTIK](Category:ARTIK "wikilink") +[Category:Hardware](Category:Hardware "wikilink") diff --git a/docs/platform/tool/Tizen_IoT_tbb.md b/docs/platform/tool/Tizen_IoT_tbb.md new file mode 100644 index 0000000000..063a0336f3 --- /dev/null +++ b/docs/platform/tool/Tizen_IoT_tbb.md @@ -0,0 +1,354 @@ +Introduction +============ + +**Tizen Building Block Tool** is a tool to make a Tizen IoT Image +easily.\ +**It is experimental.**\ +Tizen makes some building-blocks according to API reference category.\ +A developer can make a Tizen IoT image to select some building-blocks +with **tbb**.\ +It is based on kconfig of Linux.\ +**tbb** supports Raspberry pi3/4 and ARTIK 530 reference boards. + +Prerequisites +============= + +It works on Ubuntu 16.04.\ +libncurses5-dev, mic, libxml2-utils(xmllint), wget, gzip\ +how to install mic and gbs\ +<https://source.tizen.org/documentation/developer-guide/getting-started-guide/installing-development-tools>\ +Connected to internet (download.tizen.org)\ + +How to download tbb +=================== + +Cloning tbb from review.tizen.org +--------------------------------- + +\$ git clone <https://git.tizen.org/cgit/tools/tbb>\ +\$ git checkout tizen + +Usage +----- + +1\. Cleanning configurations and build output\ +\$ make distclean + +2\. Cleanning build output & sdk extension\ +\$ make clean + +3\. Selecting configurations\ +\$ make menuconfig + +4\. Making a image (After selecting configurations)\ +\$ make + +5\. Making a sdk extension (After making a image)\ +\$ make configsdk + +6\. Saving a configuration file (After selection configurations)\ +\$ cp .config configs/xxx\_defconfig\ +xxx : configuration name + +7\. Loading a configuration\ +\$ make xxx\_defconfig + +8\. Help\ +\$ make help + +How to make a Tizen IoT image +============================= + +**It is simple**.\ +A developer runs tbb UI, select some configurations and make a image. + +Running menuconfig UI +--------------------- + +In tbb directory, execute the below command\ +**\$ make menuconfig**\ +![](Tbb_FirstPage.jpg "fig:Tbb_FirstPage.jpg"){width="790"} + +Selecting configurations +------------------------ + +**1. Platform Version (Can use the default)**\ +- You should select 6.0. + +**2. Snapshot ID (Can use the default)**\ +- Tizen repo snapshot id. Its format is yyyymmdd.n.\ +- You can check it on +<http://download.tizen.org/snapshots/tizen/unified/>. + +**3. Image Name (Can use the default)**\ +- You can change the prefix of output image name. + +**4. Select Board**\ +- You must select a board. (Currently ARTIK530, RPI3/4 are supported)\ +- You can see next menu when selecting a board.\ +![](Tbb_SelectBoard.jpg "fig:Tbb_SelectBoard.jpg"){width="790"} + +**5. HW & HAL Features**\ +- You should select some HW and HAL features which you add to a device.\ +- **According to selection, Post menu configuration will be +different**.\ +![](Tbb_Select_HW_HAL.jpg "fig:Tbb_Select_HW_HAL.jpg"){width="790"} + +**6. Select Partition**\ +- You must select a partition.\ +- You can see next menu when selecting a partition.\ +![](Tbb_Select_Partition.jpg "fig:Tbb_Select_Partition.jpg"){width="790"} +**→** +![](Tbb_Select_Partition_2.jpg "fig:Tbb_Select_Partition_2.jpg"){width="790"} + +**7. Tizen IoT Preset**\ +- You should select a Tizen IoT Preset.\ +- If you are a export, you can select no preset and packages directly in +\"Advanced Configuration\" menu.\ +- There are two presets. (Tizne IoT Core and Tizen IoT Headed). You can +see Tizen IoT Headed preset only when selecting Display Server in \"HW & +HAL Features\" menu.\ +- You can see next menu when selecting a preset.\ +![](Tbb_Select_Preset.jpg "fig:Tbb_Select_Preset.jpg"){width="790"} +**→** +![](Tbb_Select_Preset_HL.jpg "fig:Tbb_Select_Preset_HL.jpg"){width="790"} + +**8. Tizen Native API Sets**\ +- You should select API which you add to a device.\ +![](Tbb_Select_API.jpg "fig:Tbb_Select_API.jpg"){width="790"}\ +![](Tbb_Select_API_2.jpg "fig:Tbb_Select_API_2.jpg"){width="790"} **→** +![](Tbb_Select_API_mm.jpg "fig:Tbb_Select_API_mm.jpg"){width="790"} + +Optionally + +**9. Tizen Platform Internal Feature Sets** + +**10. Tizen IoT Reference Application** + +**11. Advanced Configuration**\ +- You can select some individual packages. + +**12. Custom repository for your rpm packages**.\ +Adding your repository to private repository menu if needed.\ +- local repo - <file:///directory>\ +- http(s) repo - <http://URL> or <https://URL> + +Making a image +-------------- + +After selecting configurations, execute the below command.\ +**\$ make**\ +After complete, you can see the output into the directory of +\"output/build\"\ +tizen-iot-img-4.0-20171214.5\_armv7l.tar.gz : image file\ + +How to update a image +===================== + +ARTIK 530 (under construction) +------------------------------ + +**1. Changing the boot and partition for Tizen environment.**\ +**2. Updating boot image and platform image**.\ +**3. Installing plugin**\ +- After updating a firmware, Do the below.\ +- Booting the device.\ +- Downloading the plugin on +<http://developer.samsung.com/tizendevice/firmware>.\ +- Unzip and Install the plugin of artik530.\ +\$ ./ARTIK\_530\_plugin\_tizen4.0.sh\ +![](Artik530_plugin.jpg "fig:Artik530_plugin.jpg") + +Raspberry pi3 +------------- + +**1. Prerequisites**\ +\$ sudo apt-get install pv + +**2. Downloading the fusing-script for Raspberry pi3**\ +\$ wget +<https://git.tizen.org/cgit/platform/kernel/u-boot/plain/scripts/tizen/sd_fusing_rpi3.sh?h=tizen> +\--output-document=sd\_fusing\_rpi3.sh\ +\$ chmod 755 sd\_fusing\_rpi3.sh + +**3. Updating new firmware to sdcard**\ +- Insert a sd-card to Linux host PC.\ +- Check the device node of the sd-card. (ex. sdx : x is alphabet)\ +- Download a boot image.\ +(http://download.tizen.org/snapshots/tizen/4.0-unified/tizen-4.0-unified\_20171214.5/images/standard/iot-boot-arm64-rpi3/tizen-4.0-unified\_20171214.5\_iot-boot-arm64-rpi3.tar.gz)\ +- Update new firmwares.\ +\$ sudo ./sd\_fusing\_rpi3.sh -d /dev/sdx -b +tizen-iot-img-4.0-20171214.5.tar.gz +tizen-4.0-unified\_20171214.5\_iot-boot-arm64-rpi3.tar.gz \--format + +**4. Installing plugin**\ +- After updating a firmware, Do the below.\ +- Downloading the plugin on +<http://developer.samsung.com/tizendevice/firmware>\ +- Insert a sd-card to Linux host PC.\ +- Check the device node of the sd-card. (ex. sdx : x is alphabet)\ +- Install the plugin of rpi3\ +\$ sudo RPI3\_plugin\_tizen4.0 /dev/sdx\ +![](Rpi3_plugin.jpg "fig:Rpi3_plugin.jpg") + +Structure of Building Blocks +============================ + +The structure of Building Blocks is almost same as the structure of +Tizen Native API.\ +<https://developer.tizen.org/development/api-references/native-application> + + Building Blocks─┬─Account─┬AccountManager + │ ├FIDO Client + │ ├OAuth2 + │ ├Sync Manager + │ └libOauth + ├─AppFW──┬Alarm + │ ├Attach-Pannel + │ ├Badge + │ ├Data Contorl + │ ├App Event + │ ├Package management in externel storage SD card + │ ├Media Key + │ ├Message Port + │ ├Native EFL UI app model + │ ├EFL widget App model + │ ├Notification + │ ├Shortcut + │ └TPK package management + ├─Base ──┬C++ Standard library + │ ├Common Error + │ ├Glib + │ ├Glibc + │ ├LibXML + │ ├Minizip + │ ├OpenMP + │ ├Sqlite + │ ├Base-Utils + │ └zlib + ├─Content─┬Download + │ ├MIME Type + │ └Media Content + ├─Context─┬ActivityGeusture Recognition + │ ├Contextual History + │ └Contextual Trigger + ├─Location ┬Geofence Manager + │ └Location Manager + ├─Maps ──┬Here_Plugin + │ ├Maps_Service + │ └Mapzen_Plugin + ├─Messaging┬Email + │ ├Messages + │ └Push Client + ├─Multimedia┬AudioCore + │ ├Audio_IO + │ ├Camera + │ ├Configuration + │ ├Image_Util + │ ├Media_Codec + │ ├Media_Controller + │ ├Media_Demuxer + │ ├Media_Muxer + │ ├Media_Streamer + │ ├Media_Tool + │ ├Media_Vision_Barcode + │ ├Media_Vision_Face + │ ├Media_Vision_Image + │ ├Media_Vision_Surveillance + │ ├Metadata_Editor + │ ├Metadata_Extractor + │ ├OpenAL + │ ├Player + │ ├Radio + │ ├Recorder + │ ├Screen_Mirroring + │ ├Sound_Manager + │ ├Stream Recorder + │ ├Thumbnail_Util + │ ├Tone_Player + │ ├Video_Util + │ ├WAV_Player + │ └libEXIF + ├─Network─┬ASP + │ ├Bluetooth_BREDR + │ ├Bluetooth_Call_Audio + │ ├Bluetooth_LE + │ ├Bluetooth_Media_Audio + │ ├Bluetooth_Transfer + │ ├Connection + │ ├Curl + │ ├DNS-SD + │ ├HTTP + │ ├IoTCon + │ ├MTP + │ ├NFC + │ ├SSDP + │ ├STC + │ ├Smartcard + │ ├VPN_Service + │ ├WiFi + │ ├WiFi_Direct + │ └WiFi_Manager + ├─Security ┬CSR + │ ├Device Certificate + │ ├Device Policy + │ ├Key Manager + │ ├OpenSSL + │ ├Privilege Info + │ └YACA + ├─Social ─┬Calendar + │ ├Contacts + │ └Phonenumber utils + ├─System ─┬Device_Battery + │ ├Device_Callback + │ ├Device_Display + │ ├Device_Haptic + │ ├Device_IR + │ ├Device_Led + │ ├Device_Power + │ ├Feedback + │ ├Runtime information with Resourced + │ ├Runtime information with Resourced-headless + │ ├Runtime information with Resourced-light + │ ├Sensor_Listener + │ ├Sensor_Recorder + │ ├Storage + │ ├System information + │ ├System_Settings + │ ├T_Trace + │ ├USB_Host + │ └dlog + ├─Telephony + ├─UI ───┬Cairo + │ ├Clipboard History Manager + │ ├DALi + │ ├Display_Server + │ ├Display_ServerHeadless + │ ├EFL_ELM_Accessbility + │ ├EFL_Extension + │ ├EFL_MainLoop + │ ├EFL_NativeUIToolkit + │ ├External_Output_Manager + │ ├FontConfig + │ ├Freetype + │ ├HarfBuzz + │ ├Minicontrol + │ ├OpenGL ES with SDL + │ ├Vulkan with SDL + │ ├TBM_Surface + │ ├Tizen_WS_Shell + │ ├ViewManager + │ └Vulkan + ├─UIX───┬Input Method + │ ├STT + │ ├TTS + │ ├Voice control + │ └Voice control elementary + └─Web──┬WebView + └json glib + +[Category:Tizen](Category:Tizen "wikilink") +[Category:IoT](Category:IoT "wikilink") +[Category:Tool](Category:Tool "wikilink") +[Category:ARTIK](Category:ARTIK "wikilink") +[Category:Hardware](Category:Hardware "wikilink") diff --git a/docs/platform/tool/Tizen_OBS_Management.md b/docs/platform/tool/Tizen_OBS_Management.md new file mode 100644 index 0000000000..f75e7cb24a --- /dev/null +++ b/docs/platform/tool/Tizen_OBS_Management.md @@ -0,0 +1,10 @@ +The relationship of OBS projects and git path and branches +---------------------------------------------------------- + +The below picture is for Tizen-3.0 proejcts: + +![Tizen-3.0 OBS Projects +Mapping](Tizen-3.0-obs-projects-mapping.PNG "Tizen-3.0 OBS Projects Mapping") + +[Category:Infrastructure](Category:Infrastructure "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tizen_Porting_Guide.md b/docs/platform/tool/Tizen_Porting_Guide.md new file mode 100644 index 0000000000..2cd3c0740c --- /dev/null +++ b/docs/platform/tool/Tizen_Porting_Guide.md @@ -0,0 +1,813 @@ +Introduction +============ + +This is the porting guide for the latest Tizen version. + +Tizen Architecture +================== + +Development Environment Setup +============================= + +To set up the Tizen OS Development environment and to obtain information +regarding development, see the following links: + +- [Setup your + environment](https://source.tizen.org/documentation/developer-guide/environment-setup) +- [Installing development + tools](https://source.tizen.org/documentation/developer-guide/installing-development-tools) + +Getting the Source Code and Build +================================= + +Tizen Bootup Overview +===================== + +BSP Customization +================= + +Kernel Fundamentals +=================== + +System +====== + +Graphics and UI +=============== + +Multimedia +========== + +Connectivity +============ + +Location +======== + +Telephony +========= + +\ +This document covers detailed Telephony architecture including the +various components of Telephony and workflow through Telephony +framework. The document also provides porting guidelines for vendors to +ease the OAL interface development for their hardware. + +Tizen Telephony features + +- Telecommunication functionalities, such as call, SS, SMS, SIM, + network, and packet service +- Plug-in Architecture + +Definitions + +- Core object + - Bundle of functions and supportive database information + designated to specific module, such as call, SS, SIM, network, + which processes requests, responses, and notifications. + - Core objects form the executable component of a Telephony module + (call, SS, SIM, network) +- HAL + - HAL, Hardware Abstraction Layer, abstracts the actual hardware + used and ensures that similar functionality is provided by + various hardware (modems) of the same modem vendor. + - All hardware specific changes are controlled and processed by + HALs. + - The modem driver can be required depending on the modem chipset. +- Hooks + - Hooks provide a mechanism to tap requests, responses, and + notifications of other Telephony modules. + - Hooking is a transparent mechanism and does not affect the + normal processing of requests, responses, and notifications. + +Tizen Telephony Architecture +---------------------------- + +Tizen Telephony supports the plugin architecture, which provides +flexibility to include various types of predefined plugins into the +system with little change. + +![](telephony-arch.png "telephony-arch.png"){width="700"} + +The 3 major components of Tizen Telephony are the libraries, plugins, +and server. + +Telephony Libraries +------------------- + +Telephony API (TAPI) library + +The TAPI library (or simply TAPI) is a standardized interface provided +to applications to interact with Tizen Telephony. It is provided as a +`libtapi` package. The TAPI executes in the application's context, and +it provides sync and async APIs. The following figure shows the +`libtapi` internal composition. + +![](Libtapi.PNG "Libtapi.PNG"){width="500"} + +Applications can interface to Telephony features, such as call, SMS, and +network, through the respective module APIs exposed in the `libtapi` +library. Telephony also provides an additional library, `capi-telephony` +for third party applications. + +Core Telephony library + +The Core Telephony library (or `libtcore`) provides an API framework for +Tizen Telephony to inter-work. It is provided as `libtcore` package. The +following figure shows the internal composition overview of the +`libtcore`. + +![](Telephony03.png "Telephony03.png"){width="500"} + +With `libtcore`, you can: + +- Create, destroy, and maintain various server components, such as + server, communicator, HAL, plugin, and core object. +- Maintain storage, queue mechanism, and general utilities. +- Support CMUX (creation/destruction/processing). +- Parse AT. + +Telephony Plugins +----------------- + +There are 4 kinds of plugins: + +- Communicator plugins + - Interfaces TAPI and Telephony Server. + - For example, DBUS communicator (`DBUS_TAPI`) is provided by + default. + +: ![](Telephony04.png "fig:Telephony04.png"){width="200"} + +- Modem plugins + - Core functional units providing the Telephony functionality. + - Maintain and manage the Telephony states. + - Maintain and manage the databases related to Telephony. + +: ![](Telephony05.png "fig:Telephony05.png"){width="300"} + +- Modem interface plugins + - Interfaces the telephony server to the communication processor. + - Hardware specific plugins which define hardware capabilities and + usage + - Modem interface plugin is also called HAL. + +: ![](Telephony06.png "fig:Telephony06.png"){width="200"} + +- Free Style plugins + - Provide completely independent functionality irrespective of + hardware (communication processor). + - For example plugins, such as packetservice, storage, and + indicator. + +: ![](Telephony07.png "fig:Telephony07.png"){width="300"} + +The following figure provides an overview of all the Telephony plugins +together. + +![](Telephony08.png "Telephony08.png"){width="500"} + +Telephony Server +---------------- + +Tizen Telephony runs as a Telephony server daemon called +`telephony-daemon`. + +The Telephony server executes as a `g-main` loop from the `glib` +library. + +![](Telephony09.png "Telephony09.png"){width="800"} + +\ +\ + +Porting OAL Interface +--------------------- + +OEM vendors can port available plugins within Telephony as needed. It is +not mandatory that all the plugins to be ported to support a specific +hardware. + +This section provides guidance to OEM vendors to develop various +Telephony plugins. + +### Plugin Descriptors + +Any telephony plugin is required to provide a descriptor structure +described in the following example. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_plugin_define_de | Structure referred by Telephony | +| sc { | server to load, initialize, and | +| gchar *name; | unload the plugin. This structure | +| enum tcore_plugin_priorit | defines: | +| y priority; | | +| int version; | 1. Name of the plugin | +| gboolean(*load)(); | 2. Initializing priority of the | +| gboolean(*init)(TcorePlug | plugin | +| in *); | 3. Plugin version | +| void (*unload)(TcorePlugi | 4. Plugin \'load\' function | +| n *); | reference | +| }; | 5. Plugin \'init\' function | +| | reference | +| | 6. Plugin \'unload\' function | +| | reference | ++-----------------------------------+-----------------------------------+ + +The descriptor structure of each plugin must be named as +`plugin_define_desc`. The server obtains the address of this symbol in +order to provide control to the plugin to execute its defined +functionality. + +The order of initialization among various Telephony plugins is defined +based on the plugin's priority. + +OEMs need to specifically implement the modem and modem interface +plugins to support their hardware. + +### Call Service Operations + +The implementation of the functions described in the following example +is required to provide call services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_call_operations | The structure referred by the | +| { | Telephony server to provide call | +| TReturn (*dial)(CoreObjec | services. This structure defines: | +| t *o, UserRequest *ur); | | +| TReturn (*answer)(CoreObj | 1. Call \'dial\' function | +| ect *o, UserRequest *ur); | reference | +| TReturn (*end)(CoreObject | 2. Call \'answer\' function | +| *o, UserRequest *ur); | reference | +| TReturn (*hold)(CoreObjec | 3. Call \'end\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*active)(CoreObj | 4. Call \'hold\' function | +| ect *o, UserRequest *ur); | reference | +| TReturn (*swap)(CoreObjec | 5. Call \'active\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*join)(CoreObjec | 6. Call \'swap\' function | +| t *o, UserRequest *ur); | reference | +| TReturn (*split)(CoreObje | 7. Call \'join\' function | +| ct *o, UserRequest *ur); | reference | +| }; | 8. Call \'split\' function | +| | reference | ++-----------------------------------+-----------------------------------+ + +### SMS Service Operations + +The implementation of the functions described in the following example +is required to provide SMS services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_sms_operations { | Structure referred by the | +| TReturn (*send_umts_msg)( | Telephony server to provide | +| CoreObject *o, UserRequest *ur); | SMS-related services. This | +| TReturn (*send_cdma_msg)( | structure defines: | +| CoreObject *o, UserRequest *ur); | | +| TReturn (*read_msg)(CoreO | 1. SMS \'send\' function | +| bject *o, UserRequest *ur); | reference | +| TReturn (*save_msg)(CoreO | 2. SMS \'read\' function | +| bject *o, UserRequest *ur); | reference | +| TReturn (*delete_msg)(Cor | 3. SMS \'save\' function | +| eObject *o, UserRequest *ur); | reference | +| TReturn (*get_sca)(CoreOb | 4. SMS \'delete\' function | +| ject *o, UserRequest *ur); | reference | +| TReturn (*set_sca)(CoreOb | 5. SMS \'get sca\' function | +| ject *o, UserRequest *ur); | reference | +| TReturn (*get_sms_params) | 6. SMS \'set sca\' function | +| (CoreObject *o, UserRequest *ur); | reference | +| TReturn (*set_sms_params) | 7. SMS \'get sms params\' | +| (CoreObject *o, UserRequest *ur); | function reference | +| }; | 8. SMS \'set sms params\' | +| | function reference | ++-----------------------------------+-----------------------------------+ + +### Network Service Operations + +The implemenation of the functions described in the following example is +required to provide network services. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_network_operatio | Structure referred by the | +| ns { | Telephony server to provide | +| TReturn (*search)(CoreObj | network services. This structure | +| ect *o, UserRequest *ur); | defines: | +| TReturn (*set_plmn_select | | +| ion_mode)(CoreObject *o, UserRequ | 1. Network \'search\' function | +| est *ur); | reference | +| TReturn (*get_plmn_select | 2. Network \'set plmn selection | +| ion_mode)(CoreObject *o, UserRequ | mode\' function reference | +| est *ur); | 3. Network \'get plmn selection | +| TReturn (*set_service_dom | mode\' function reference | +| ain)(CoreObject *o, UserRequest * | 4. Network \'set service | +| ur); | domain\' function reference | +| TReturn (*get_service_dom | 5. Network \'get service | +| ain)(CoreObject *o, UserRequest * | domain\' function reference | +| ur); | 6. Network \'set band\' function | +| TReturn (*set_band)(CoreO | reference | +| bject *o, UserRequest *ur); | 7. Network \'get band\' function | +| TReturn (*get_band)(CoreO | reference | +| bject *o, UserRequest *ur); | | +| }; | | ++-----------------------------------+-----------------------------------+ + +### HAL operations + +The implementation of the functions described in the following example +is required to provide HAL operations. + ++-----------------------------------+-----------------------------------+ +| Structure | Description | ++===================================+===================================+ +| struct tcore_hal_operations { | Structure referred by Telephony | +| TReturn (*power)(TcoreHal | server to provide HAL operations. | +| *hal, gboolean flag); | This structure defines: | +| TReturn (*send)(TcoreHal | | +| *hal, unsigned int data_len, void | 1. HAL \'power\' function | +| *data); | reference | +| TReturn (*setup_netif)(Co | 2. HAL \'send\' function | +| reObject *co, | reference | +| Tc | 3. HAL \'setup network | +| oreHalSetupNetifCallback func, vo | interface\' function | +| id *user_data, | reference | +| un | | +| signed int cid, gboolean enable); | | +| }; | | ++-----------------------------------+-----------------------------------+ + +Sample implementations of the modem and modem interface plugins is +available in the [Appendix](Tizen_3.0_Porting_Guide#Appendix "wikilink") +section. + +Configuration +------------- + +There are no specific configurations required for Telephony except for +conforming to the installation paths of various Telephony plugins. + +All Telephony plugins need to be installed in the following folders: + +- Modem Plugins: `%{_libdir}/telephony/plugins/modems/` +- Other Plugins: `%{_libdir}/telephony/plugins/` + +References +---------- + +Tizen source website <http://review.tizen.org/git/> + +Telephony packages + +- Telephony daemon + +: `platform/core/telephony/telephony-daemon.git` + +- Telephony core library + +: `platform/core/telephony/libtcore.git` + +- TAPI + +: `platform/core/telephony/libtapi.git` + +- Telephony API for a third party application + +: `platform/core/api/telephony.git` + +- Communicator (`DBUS_TAPI`) + +: `platform/core/telephony/tel-plugin-dbus_tapi.git` + +- Free Style plugin (indicator) + +: `platform/core/telephony/tel-plugin-indicator.git` + +- Free Style plugin (packetservice) + +: `platform/core/telephony/tel-plugin-packetservice.git` + +- Free Style plugin (nitz) + +: `platform/core/telephony/tel-plugin-nitz.git` + +- Free Style plugin (Database) + +: `platform/core/telephony/tel-plugin-vconf.git` + +- Free Style plugin (VCONF) + +: `platform/core/telephony/tel-plugin-database.git` + +- Modem plugin (device) + +: `platform/core/telephony/tel-plugin-imc.git` + +- Modem Interface plugin (device) + +: `platform/core/telephony/tel-plugin-imcmodem.git` + +- Modem plugin (emulator) + +: `platform/core/telephony/tel-plugin-atmodem.git` + +- Modem Interface plugin (emulator) + +: `platform/core/telephony/tel-plugin-vmodem.git` + +Appendix +-------- + +#### Sample Implementation for the Modem Interface Plugin + + /* HAL Operations */ + static struct tcore_hal_operations hal_ops = { + .power = hal_power, + .send = hal_send, + .setup_netif = hal_setup_netif, + }; + + static + gboolean on_load() + { + dbg(" Load!!!"); + + return TRUE; + } + + static + gboolean on_init(TcorePlugin *plugin) + { + TcoreHal *hal; + PluginData *user_data; + struct custom_data *data; + + dbg(" Init!!!"); + + if (plugin == NULL) { + err(" PLug-in is NULL"); + + return FALSE; + } + + /* User data for Modem Interface plugin */ + user_data = g_try_new0(PluginData, 1); + if (user_data == NULL) { + err(" Failed to allocate memory for Plugin data"); + + return FALSE; + } + + /* Register to eerver */ + user_data->modem = tcore_server_register_modem(tcore_plugin_ref_server(plugin), plugin); + if (user_data->modem == NULL) { + err(" Registration Failed"); + g_free(user_data); + + return FALSE; + } + dbg(" Registered from Server"); + + + data = g_try_new0(struct custom_data, 1); + if (data == NULL) { + err(" Failed to allocate memory for Custom data"); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + + /* Open DPRAM device */ + data->vdpram_fd = vdpram_open(); + if (data->vdpram_fd < 0) { + /* Free custom data */ + g_free(data); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + /* Create and initialize HAL */ + hal = tcore_hal_new(plugin, "vmodem", &hal_ops, TCORE_HAL_MODE_AT); + if (hal == NULL) { + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + + /* Free custom data */ + g_free(data); + + /* Unregister from server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free Plugin data */ + g_free(user_data); + + return FALSE; + } + user_data->hal = hal; + + /* Link custom data to HAL user data */ + tcore_hal_link_user_data(hal, data); + + /* Set HAL as Modem Interface plugin's user data */ + tcore_plugin_link_user_data(plugin, user_data); + + /* Register to Watch list */ + data->watch_id_vdpram = __register_gio_watch(hal, data->vdpram_fd, on_recv_vdpram_message); + dbg(" fd: [%d] Watch ID: [%d]", data->vdpram_fd, data->watch_id_vdpram); + + /* Power ON VDPRAM device */ + if (_modem_power(hal, TRUE) == TCORE_RETURN_SUCCESS) { + dbg(" Power ON - [SUCCESS]"); + } else { + err(" Power ON - [FAIL]"); + goto EXIT; + } + + /* Check CP Power ON */ + g_timeout_add_full(G_PRIORITY_HIGH, SERVER_INIT_WAIT_TIMEOUT, __load_modem_plugin, hal, 0); + + dbg("[VMMODEM] Exit"); + + return TRUE; + + EXIT: + /* Deregister from Watch list */ + __deregister_gio_watch(data->watch_id_vdpram); + + /* Free HAL */ + tcore_hal_free(hal); + + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + + /* Free custom data */ + g_free(data); + + /* Unregister from Server */ + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + + /* Free plugin data */ + g_free(user_data); + + return FALSE; + } + + static void + on_unload(TcorePlugin *plugin) + { + TcoreHal *hal; + struct custom_data *data; + PluginData *user_data; + + dbg(" Unload!!!"); + + if (plugin == NULL) + return; + + user_data = tcore_plugin_ref_user_data(plugin); + if (user_data == NULL) + return; + + hal = user_data->hal; + + data = tcore_hal_ref_user_data(hal); + if (data == NULL) + return; + + /* Deregister from Watch list */ + __deregister_gio_watch(data->watch_id_vdpram); + dbg(" Deregistered Watch ID"); + + /* Free HAL */ + tcore_hal_free(hal); + dbg(" Freed HAL"); + + /* Close VDPRAM device */ + vdpram_close(data->vdpram_fd); + dbg(" Closed VDPRAM device"); + + /* Free custom data */ + g_free(data); + + tcore_server_unregister_modem(tcore_plugin_ref_server(plugin), user_data->modem); + dbg(" Unregistered from Server"); + + dbg(" Unloaded MODEM"); + g_free(user_data); + } + + /* VMODEM Descriptor Structure */ + EXPORT_API struct tcore_plugin_define_desc plugin_define_desc = { + .name = "VMODEM", + .priority = TCORE_PLUGIN_PRIORITY_HIGH, + .version = 1, + .load = on_load, + .init = on_init, + .unload = on_unload + }; + +#### Sample Implementation for the Modem Plugin + + static + gboolean on_load() + { + dbg("LOAD!!!"); + + return TRUE; + } + + static + gboolean on_init(TcorePlugin *p) + { + TcoreHal *h; + + dbg("INIT!!!"); + + if (!p) { + err("Plug-in is NULL"); + + return FALSE; + } + + h = tcore_server_find_hal(tcore_plugin_ref_server(p), "vmodem"); + if (!h) { + err("HAL is NULL"); + + return FALSE; + } + + tcore_hal_add_send_hook(h, on_hal_send, p); + tcore_hal_add_recv_callback(h, on_hal_recv, p); + + /* Initialize Modules */ + s_modem_init(p, h); + s_network_init(p, h); + s_sim_init(p, h); + s_ps_init(p, h); + s_call_init(p, h); + s_ss_init(p, h); + s_sms_init(p, h); + tcore_hal_set_power(h, TRUE); + + /* Send "CPAS" command to invoke POWER UP NOTI */ + s_modem_send_poweron(p); + + dbg("Init - Successful"); + + return TRUE; + } + + static void + on_unload(TcorePlugin *p) + { + TcoreHal *h; + + dbg("UNLOAD!!!"); + + if (!p) { + err("Plug-in is NULL"); + + return; + } + + h = tcore_server_find_hal(tcore_plugin_ref_server(p), "vmodem"); + if (h) { + tcore_hal_remove_send_hook(h, on_hal_send); + tcore_hal_remove_recv_callback(h, on_hal_recv); + } + + /* Deinitialize the modules */ + s_modem_exit(p); + s_network_exit(p); + s_sim_exit(p); + s_ps_exit(p); + s_call_exit(p); + s_ss_exit(p); + s_sms_exit(p); + } + + /* ATMODEM plug-in descriptor */ + struct tcore_plugin_define_desc plugin_define_desc = { + .name = "ATMODEM", + .priority = TCORE_PLUGIN_PRIORITY_MID, + .version = 1, + .load = on_load, + .init = on_init, + .unload = on_unload + }; + +#### Workflow + +1. Initialization sequence + 1. The server loads the modem interface plugin. + 2. The modem interface plugin registers to the server. + 3. The server enumerates the modem interface plugin. + 4. Create the physical HAL. + 5. The modem interface plugin queries the modem state. + 6. If the modem is online, the CMUX (internal) channels are + established. + 7. The logical HAL is created for each CMUX channel and assigned + for a core object type. These are updated to the mapping table. + 8. Change the physical HAL mode to `TRANSPARENT` (disables the + queue). + 9. The modem interface plugin requests server to load the modem + plugin (corresponding to its architecture). + 10. The server loads modem plugin. + 11. The modem plugin initializes the sub-modules and creates the + core objects (based on the core object types defined in the + mapping table by the modem interface plugin). + 12. The modem plugin notifies the server of the `PLUGIN_ADDED` + event. + 13. The modem notifies the communicator of the `PLUGIN_ADDED` event. + 14. The communicator creates interfaces for the sub-modules present + (based on the core objects created). + + : The following figure shows the telephony loading sequence. + : ![](telephony10.png "fig:telephony10.png"){width="700"} + +2. Request processing sequence + 1. The application request is sent to the communicator through + TAPI. + 2. The communicator creates a user request based on the incoming + request. + 3. The user request is dispatch to communicator. + 4. The communicator dispatches user request to server. + 5. The server finds the plugin based on the modem name. + 6. The server extracts the core object type based on the request + command from plugin's core objects list. + 7. The server dispatches the user request to the core object. + 8. The core object dispatches the user request to dispatch a + function based on the request command. + 9. Pending request is formed, added to the queue, and sent to the + logical HAL assigned for the core object. + 10. The logical HAL dispatches the request data to a CMUX channel + dedicated to it. + 11. CMUX encodes the request data and dispatches it to the physical + HAL. + 12. The physical HAL sends the request data to the modem. + + : The following figure shows the telephony request processing + sequence. + : ![](telephony11.png "fig:telephony11.png"){width="700"} + +3. Response processing sequence + 1. Response data sent by the modem is received by the physical HAL. + 2. The physical HAL dispatches the response data to CMUX. + 3. CMUX decodes the received response data and dispatches the + corresponding logical HAL based on the CMUX channel. + 4. The logical HAL dispatches the decoded response data to the + corresponding core object. + 5. The core object processes the received response data and + extracts the user request from the pending queue and sends the + response data corresponding to the user request. + 6. The user request extracts the communicator. + 7. The received response data is sent to the corresponding + communicator. + 8. The communicator sends the response data to TAPI which + communicates the response to application. + + : The following figure shows the telephony response processing + sequence. + : ![](telephony12.png "fig:telephony12.png"){width="700"} + +4. Indication processing sequence + 1. Notification data sent by the modem is received by the physical + HAL. + 2. The physical HAL dispatches the notification data to CMUX. + 3. CMUX decodes the received notification data and dispatches the + corresponding logical HAL based on the CMUX channel registered + for the notification. + 4. The logical HAL dispatches the decoded notification data to the + corresponding core object that registered for the notification. + 5. The core object processes the received notification data and + dispatches to the server. + 6. The server dispatches the notification data to corresponding + communicator. + 7. The communicator sends the notification data to TAPI, which + communicates the same to the application. + + : The following figure shows the telephony indication processing + sequence. + : ![](telephony13.png "fig:telephony13.png"){width="700"} + +Application +=========== + +Appendix +======== diff --git a/docs/platform/tool/Tizen_Standalone_Emulator.md b/docs/platform/tool/Tizen_Standalone_Emulator.md new file mode 100644 index 0000000000..5660bc8305 --- /dev/null +++ b/docs/platform/tool/Tizen_Standalone_Emulator.md @@ -0,0 +1,220 @@ +This document describes how to download and use a Tizen +[Emulator](Emulator "wikilink") image without installing the full Tizen +SDK. Running the emulator without the SDK is useful in environments +where web application development is not the primary focus such as +platform development and QA. + +These steps have been tested on Ubuntu 12.04 (32/64-bit), Ubuntu 14.04 +64-bit, Mac OS X 10.7 and Mac OS X 10.9. And these steps are also +described in the **README** file of the standalone emulator package. + +Install the prerequisites for Tizen Emulator +============================================ + +1\. Oracle Java\* v6 or later needs to be installed (Do not use OpenJDK). + +2\. For Ubuntu, the pre-requisite packages for Tizen Emulator are listed +as below. + +`$ sudo apt-get install libdbus-1-3 libpng12-0 libpixman-1-0 libsdl1.2debian` + +3\. For Mac OS X, the package e2fsprogs needs to be installed which +provides the tool e2fsck and resize2fs described in the following part +\"Modify Emulator image\". + +`$ brew install e2fsprogs` + +Download Tizen Emulator image +============================= + +The compressed emulator files are about 300MB to 400M. + +Tizen IVI Emulator snapshot image: + +<http://download.tizen.org/snapshots/tizen/ivi/latest/images/emulator/ivi-mbr-i586-emul/><snapshot ID>\_ivi-mbr-i586-emul.tar.gz + +Tizen Common Emulator snapshot image: + +<http://download.tizen.org/snapshots/tizen/common/latest/images/emulator32-wayland/common-emulator-wayland-mbr-i586/><snapshot ID>\_common-emulator-wayland-mbr-i586.tar.gz + +Download Tizen Standalone Emulator package +========================================== + +The latest version is always updated on Intel internal wiki page [Tizen +Standalone +Emulator](http://otc-sdk.bj.intel.com/wiki/Tizen_Standalone_Emulator) in +advance. It will be updated to this public wiki page for each milestone. + +Note that please keep using the latest version, since the old version +may not be able to boot up the latest emulator image. + + PLATFORM STANDALONE EMULATOR FILE SIZE MD5 Checksum + ----------------- -------------------------------------------------------------------------------------------------------------------------------------------------------- ----------- ---------------------------------- + Ubuntu® 32-bit [standalone-emulator\_20141031\_ubuntu-32.zip](http://download.tizen.org/sdk/IVI/m14.4/standalone-emulator/standalone-emulator_20150129_ubuntu-32.zip) 24M 6af403be23388e619c625725be9c3541 + Ubuntu® 64-bit [standalone-emulator\_20141031\_ubuntu-64.zip](http://download.tizen.org/sdk/IVI/m14.4/standalone-emulator/standalone-emulator_20150129_ubuntu-64.zip) 25M 2655734433113a07bdfe10a09b3c9ecd + Mac OS X 64-bit [standalone-emulator\_20141031\_macos-64.zip](http://download.tizen.org/sdk/IVI/m14.4/standalone-emulator/standalone-emulator_20150129_macos-64.zip) 15M 5f4bcd98410a156065e5aa2cfbf2a7fe + +Modify Emulator image +===================== + +1\. Move image \*.tar.gz to ./data/emulator-images/ + +`$ mv `<image>` ./data/emulator-images/` + +2\. Run the script convert.sh. + +`$ ./convert.sh` + +The script convert.sh will do the following things. + +1\) Unpack the image. + +`$ tar xvzf `<image> + +2\) Enlarge the image root partition size. + +The resulting platform.img image file is about 1GB to 1.5GB. It is a +loop format image. The root partition is compressed by MIC tool when +creating the image. It was used by Samsung Mobile at the beginning. +However, qemu doesn\'t support loop format. To make it be used for +Emulator, we have to convert the format. Before image conversion, it +needs to enlarge root partition size by the following commands. This +will increase the image size to about 3.9G. + +`$ e2fsck -f platform.img`\ +`$ resize2fs platform.img 3900M` + +3\) Change the image format to qcow2 format. + +Qcow2 format is supported by qemu and meanwhile it is a growable format +which supports compression. The empty sectors are detected and +suppressed from the destination image in the process of converting the +format to qcow2. The conversion command is as below. + +`$ ./bin/qemu-img convert -O qcow2 platform.img emulimg-3.0.x86` + +The resulting emulimg-3.0.x86 is about 900MB. + +[TC-1342](https://bugs.tizen.org/jira/browse/TC-1342) that is the +sub-task of [TC-199](https://bugs.tizen.org/jira/browse/TC-199) is being +tracked to solve the manual step 2 and step 3. + +Use hardware virtualization +=========================== + +- For Ubuntu, enable KVM module to use hardware virtualization. + +`$ sudo modprobe -b kvm_intel`\ +`or`\ +`$ sudo modprobe -b kvm_amd` + +You can use this command to confirm KVM has been loaded by kernel. + +`$ lsmod | grep kvm` + +- For Mac OS X, install Intel HAXM to use hardware virtualization. + +Open the DMG file ./intelhaxm/IntelHaxmTizen.dmg and run the installer +contained inside. + +You can use this command to confirm HAXM has been loaded by kernel. + +`$ kextstat | grep haxm` + +Run +=== + +`$ ./run.sh` + +This is the content of run.sh for Ubuntu. For Mac OS X, \'-enable-kvm\' +needs to be replaced by \'-enable-hax\'. + + LD_LIBRARY_PATH=./bin ./bin/emulator-x86 \ + --skin-args width=1080 height=1920 \ + skin.path=./skins/ivi \ + --qemu-args \ + -drive file=./data/emulator-images/emulimg-3.0.x86,if=virtio,index=1 \ + -boot c \ + -append "root=/dev/vda rw drm.debug=0 loglevel=255 console=ttyS0 video=LVDS-1:1080x1920-32@30 dpi=3140 ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none vm_name=ivi" \ + -serial file:./logs/emulator.klog \ + -m 512 \ + -M maru-x86-machine \ + -net nic,model=virtio,macaddr=74:D0:2B:93:0E:12 \ + -soundhw all \ + -usb \ + -vga none \ + -L ./data/bios \ + -kernel ./data/kernel/bzImage.x86 \ + -net user,dhcpstart=10.0.2.16 \ + -rtc base=utc \ + -drive file=./data/swap/swap.img,if=virtio,index=2 \ + -enable-kvm \ + -enable-yagl \ + -enable-vigs \ + -yagl-backend vigs \ + -vigs-backend gl \ + -device virtio-esm-pci \ + -device virtio-hwkey-pci \ + -device codec-pci \ + -device maru-brightness \ + -device maru-camera \ + -device virtio-touchscreen-pci,max_point=10 + +Logs +==== + +You can find Emulator logs in ./logs directory. + +Tools +===== + +You can find sdb and qemu-img in ./bin directory. For Mac OS X, running +qemu-img depends on the libraries which are in the directory ./bin. So +qemu-img is put in the same directory ./bin with them. + +Usefull tips +============ + +1\. Enable host keyboard. + +Right click the Emulator skin -\> Advanced -\> Host Keyboard -\> On + +2\. Custom Emulator scale. + +Right click the Emulator skin -\> Scale -\> 1/4x or others. The +configuration will be saved in the file ./.skin.properties. + +3\. Enable Emulator shell. + +Right click the Emulator skin -\> Shell + +It may pop an error dialog which says \"SDB file does not exist in the +following path\". The cause is that Tizen Emulator gets the sdb tool +from the \"../../\" directory which is relative to ./bin/emulator-x86. +If the SDK is installed, sdb is actually in that path. + +Now you can copy the sdb tool to the parent directory of this package +\"standalone-emulator\" like this to work around this issue. + +`$ cp ./bin/sdb ../` + +4\. SDB online documentation. + +You can also enter to the image by running sdb command \"./sdb shell\". +For more sdb commands, you can refer to [SDB online +documentation.](https://developer.tizen.org/dev-guide/2.2.0/org.tizen.gettingstarted/html/dev_env/smart_development_bridge.htm) + +5\. Power key is used for turning on the screen. + +Power key is used for turning on the screen when the screen is black. +But it cannot be used for power off. + +FAQ +=== + +If you have any questions about Tizen standalone emulator, please +contact with [Liu, Alice](mailto:alice.liu@intel.com). + +[Category:Tool](Category:Tool "wikilink") +[Category:Development](Category:Development "wikilink") +[Category:Common](Category:Common "wikilink") diff --git a/docs/platform/tool/Toolchain_spec_templates.md b/docs/platform/tool/Toolchain_spec_templates.md new file mode 100644 index 0000000000..3a2f0bc78e --- /dev/null +++ b/docs/platform/tool/Toolchain_spec_templates.md @@ -0,0 +1,495 @@ +[Back to Porting Tizen](https://wiki.tizen.org/wiki/MIPS) + +### qemu-accel + +` %define gcc_version         483`\ +` %define gcc_suffix          4.8.3`\ +` %define CROSS_COMPILER_PATH /opt/toolchains/gcc-%{gcc_suffix}`\ +` %define tizen_arch          your_new_arch`\ +` %define libc                your_libc`\ +` # spec file for package qemu-accel-%{tizen_arch}`\ +` #`\ +` # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.`\ +` #`\ +` # All modifications and additions to the file contributed by third parties`\ +` # remain the property of their copyright owners, unless otherwise agreed`\ +` # upon. The license for this file, and modifications and additions to the`\ +` # file, is the same license as for the pristine package itself (unless the`\ +` # license for the pristine package is not an Open Source License, in which`\ +` # case the license is the MIT License). An "Open Source License" is a`\ +` # license that conforms to the Open Source Definition (Version 1.9)`\ +` # published by the Open Source Initiative.`\ +` # Please submit bugfixes or comments via `[`http://bugs.opensuse.org/`](http://bugs.opensuse.org/)\ +` # Choose which gcc hijack method (if any) to use.`\ +` # Only select one of the two at a time!`\ +` %define hijack_gcc         1`\ +` %if 0%{?_with_perl_and_python_emul}`\ +` Name:             qemu-accel-%{tizen_arch}-cross`\ +` %else`\ +` Name:             qemu-accel-%{tizen_arch}`\ +` %endif`\ +` Version:          0.4`\ +` Release:          0`\ +` AutoReqProv:      off`\ +` BuildRequires:    gcc-%{libc}`\ +` BuildRequires:    fdupes`\ +` BuildRequires:    glibc-locale`\ +` BuildRequires:    gcc-c++`\ +` BuildRequires:    gettext-runtime`\ +` BuildRequires:    gettext-tools`\ +` BuildRequires:    m4`\ +` BuildRequires:    gawk`\ +` BuildRequires:    flex`\ +` BuildRequires:    cmake`\ +` %if 0%{?_with_perl_and_python_emul}`\ +` BuildRequires:    perl`\ +` BuildRequires:    python`\ +` %endif`\ +` # required for xxd`\ +` BuildRequires:    vim`\ +` BuildRequires:    patchelf`\ +` #BuildRequires:    rpmlint-mini`\ +` BuildRequires:    qemu-linux-user`\ +` Requires:         coreutils`\ +` Summary:          Native binaries for speeding up cross compile`\ +` License:          GPL-2.0`\ +` Group:            Development/Libraries/Cross`\ +` ExclusiveArch:    %ix86`\ +` # default path in qemu`\ +` %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")`\ +` %define our_path /emul/%{HOST_ARCH}-for-%{tizen_arch}`\ +` %define %{tizen_arch}_cross_env gcc-%{gcc_suffix}`\ +` %description`\ +` This package is used in %{tizen_arch} architecture builds using qemu to speed up builds`\ +` with native binaries.`\ +` This should not be installed on systems, it is just intended for qemu environments.`\ +` %prep`\ +` %setup -q -D -T -n .`\ +` %build`\ +` %install`\ +` binaries="/%_lib/libnsl.so.1 /%_lib/libnss_compat.so.2 %{_libdir}/rpm-plugins/msm.so" # loaded via dlopen by glibc`\ +` %ifarch %ix86`\ +`     LD="/lib/ld-linux.so.2"`\ +` %else`\ +`     echo "ERROR unhandled arch"`\ +`     exit 1`\ +` %endif`\ +` for executable in $LD \`\ +`     /usr/bin/{bash,rpm,rpmdb} \`\ +`     /usr/bin/{gzip,grep,egrep,sed,tar} \`\ +`     /usr/lib/libnssdbm3.so /usr/lib/libsoftokn3.so /lib/libfreebl3.so \`\ +`     /usr/bin/{bzip2,cat,expr,make,m4,mkdir,msgexec,msgfmt,msgcat,msgmerge,mv,patch,rm,rmdir,rpmbuild,xz,xzdec} \`\ +`     /usr/bin/{awk,gawk} \`\ +`     /usr/bin/flex \`\ +` %if 0%{?_with_perl_and_python_emul}`\ +`     /usr/bin/{a2p,perl,perl5.16.3} \`\ +`     /usr/bin/python \`\ +` %endif`\ +`     /usr/bin/{cmake,ccmake,cpack,ctest} `\ +` do    `\ +`     # add lib dependencies`\ +``      binaries="$binaries $executable `ldd $executable | sed -n 's,.*=>  ``$/[^ ]*$``  .*,\1,p'`" ``\ +` done`\ +` %if %hijack_gcc`\ +` for executable in %{CROSS_COMPILER_PATH}/bin/* \`\ +` %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/bin/* \`\ +` %{CROSS_COMPILER_PATH}/lib/gcc/%{tizen_arch}-linux/%{gcc_suffix}/* \`\ +` %{CROSS_COMPILER_PATH}/libexec/gcc/%{tizen_arch}-linux/%{gcc_suffix}/*`\ +` do`\ +`     [ -d $executable ] && continue`\ +`     binaries="$binaries $executable"`\ +` done`\ +` %endif`\ +` for binary in $binaries`\ +` do`\ +`     outfile=%buildroot%{our_path}$(echo $binary | sed 's:/opt/toolchains/gcc-%{gcc_suffix}:/usr:;s:%{%{tizen_arch}_cross_env}:/usr:;s:%{tizen_arch}-linux-::')`\ +`     [ -f $outfile ] && continue`\ +`     mkdir -p ${outfile%/*}`\ +`     cp -aL $binary $outfile `\ +`     objdump -s -j .rodata -j .data $outfile | sed 's/^ *`$[a-z0-9]*$`/\1:/' | \`\ +`         grep ': ' | grep -v 'file format' | grep -v 'Contents of section' | \`\ +`         xxd -g4 -r - $outfile.data`\ +`     if grep -q "%{HOST_ARCH}"$outfile.data; then`\ +`         echo "ERROR file $binary leaks host information into the guest"`\ +`         exit 1`\ +`     fi`\ +`     rm -f $outfile.data`\ +`     [ "$binary" == "$LD" ] && continue`\ +`     if `[`|`` ``"$outfile"`` ``==`` ``*".a"`` ``||`` ``"$outfile"`` ``==`` ``*".la"`` `]("$outfile"_==_*".o" "wikilink")` ; then`\ +`         continue`\ +`     fi`\ +`     patchelf --debug --set-rpath "%our_path/%_lib:%our_path%_libdir" $outfile`\ +`     # not all binaries have an .interp section`\ +`     if patchelf --print-interpreter $outfile; then`\ +`         patchelf --debug --set-interpreter %{our_path}$LD $outfile`\ +`     fi`\ +` done`\ +` pushd %{buildroot}%{our_path} &&    ln -s usr/bin && popd`\ +` %if %hijack_gcc`\ +`     # create symlinks for lib64 / lib mappings (gcc!)`\ +`     mkdir -p "%{buildroot}%{our_path}/usr/lib/"`\ +`     mkdir -p "%{buildroot}%{our_path}/usr/lib/gcc/%{tizen_arch}-linux/%{gcc_suffix}"`\ +`     mkdir -p "%{buildroot}%{our_path}/usr/libexec/gcc"`\ +`     mkdir -p "%{buildroot}%{our_path}/usr/%{tizen_arch}-linux"`\ +`     cp "%{buildroot}%{our_path}/usr/bin/gcc" "%{buildroot}%{our_path}/usr/bin/cc"`\ +`     ln -s ../bin/cpp %{buildroot}%{our_path}/usr/lib`\ +`     rm -rf %{buildroot}%{our_path}/usr/bin/%{tizen_arch}-linux-*`\ +`     ln -sf ../bin %{buildroot}%{our_path}/usr/%{tizen_arch}-linux/bin`\ +`     ln -sf bash %{buildroot}%{our_path}/bin/sh`\ +`     # allow abuild to do the mv`\ +`     chmod 777 %{buildroot}/emul`\ +` %endif`\ +` # Make QEMU available through /qemu`\ +` mkdir %buildroot/qemu`\ +` cp -L /usr/bin/qemu-%{tizen_arch}{,-binfmt} %buildroot/qemu/`\ +` %fdupes -s %{buildroot}`\ +` export NO_BRP_CHECK_RPATH="true"`\ +` %files`\ +` %defattr(-,root,root)    `\ +` %dir`\ +` /emul`\ +` /qemu` + +### libc + +` %define gcc_version         483`\ +` %define gcc_suffix          4.8.3`\ +` %define CROSS_COMPILER_PATH /opt/toolchains/gcc-%{gcc_suffix}`\ +` %define tizen_arch          your_new_arch`\ +` %define libc                your_libc`\ +` Name:           %{libc}`\ +` Summary:        Standard Shared Libraries (from the GNU C Library)`\ +` License:        LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+`\ +` Group:          Base/Libraries`\ +` AutoReq:        0`\ +` BuildRequires:  fdupes`\ +` BuildRequires:  xz`\ +` BuildRequires:  gcc-%{libc}`\ +` Version:        2.18`\ +` Release:        0`\ +` Url:            `[`http://www.gnu.org/software/libc/libc.html`](http://www.gnu.org/software/libc/libc.html)\ +` Source5:        nsswitch.conf`\ +` Source7:        bindresvport.blacklist`\ +` # For systemd `\ +` Source20:       nscd.conf`\ +` Source21:       nscd.service`\ +` Requires(pre):  filesystem`\ +` Requires:       /usr/bin/sed`\ +` Provides:       rtld(GNU_HASH)`\ +` Provides:       ldconfig`\ +` # The dynamic linker supports DT_GNU_HASH`\ +` Provides:       rtld(GNU_HASH)`\ +` Provides:       glibc`\ +` Provides:       kernel-headers`\ +` Provides:       linux-kernel-headers = 3.1.0`\ +` ExclusiveArch:  %ix86 %{tizen_arch}`\ +` %description`\ +` The GNU C Library provides the most important standard libraries used`\ +` by nearly all programs: the standard C library, the standard math`\ +` library, and the POSIX thread library. A system is not functional`\ +` without these libraries.`\ +` %package         locale`\ +` Summary:         Locale Data for Localized Programs`\ +` License:         GPL-2.0+ and MIT and LGPL-2.1+`\ +` Requires(post):  /usr/bin/cat`\ +` Requires:        %{libc} = %{version}`\ +` Provides:        glibc-locale`\ +` %description locale`\ +` Locale data for the internationalisation features of the GNU C library.`\ +` %package         devel`\ +` Summary:         Include Files and Libraries Mandatory for Development`\ +` License:         BSD-3-Clause and LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+`\ +` Requires:        %{libc} = %{version}`\ +` Provides:        glibc-devel`\ +` Provides:        glibc-devel-32bit`\ +` %description devel`\ +` These libraries are needed to develop programs which use the standard C`\ +` library.`\ +` %package         devel-static`\ +` Summary:         C library static libraries for -static linking`\ +` License:         BSD-3-Clause and LGPL-2.1+ and LGPL-2.1+-with-GCC-exception and GPL-2.0+`\ +` Requires:        %{name}-devel = %{version}`\ +` Provides:        %{name}-static = %version`\ +` Provides:        glibc-devel-static`\ +` %description     devel-static`\ +` The glibc-devel-static package contains the C library static libraries`\ +` for -static linking.  You don't need these, unless you link statically,`\ +` which is highly discouraged.`\ +` %prep`\ +` %setup -q -D -T -n .`\ +` %build`\ +` %install`\ +` # We don't want to strip the .symtab from our libraries in find-debuginfo.sh,`\ +` # certainly not from libpthread.so.* because it is used by libthread_db to find`\ +` # some non-exported symbols in order to detect if threading support`\ +` # should be enabled.  These symbols are _not_ exported, and we can't easily`\ +` # export them retroactively without changing the ABI.  So we have to`\ +` # continue to "export" them via .symtab, instead of .dynsym :-(`\ +` # But we also want to keep .symtab and .strtab of other libraries since some`\ +` # debugging tools currently require these sections directly inside the main`\ +` # files - specifically valgrind and PurifyPlus.`\ +` export STRIP_KEEP_SYMTAB=*.so*`\ +` # Make sure we will create the gconv-modules.cache`\ +` mkdir -p %{buildroot}%{_libdir}/gconv`\ +` touch    %{buildroot}%{_libdir}/gconv/gconv-modules.cache`\ +` # Install base glibc`\ +` mkdir -p %buildroot%{_libdir}`\ +` cp -rf   %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/lib/*     %buildroot%{_libdir}`\ +` cp -rf   %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/lib/lib*         %buildroot%{_libdir}`\ +` rm -rf   %buildroot/%{_libdir}/*.a`\ +` rm -rf   %buildroot/%{_libdir}/*.la`\ +` # Miscelanna:`\ +` mkdir -p %{buildroot}/etc`\ +` install -m 644 %{SOURCE7} %{buildroot}/etc`\ +` install -m 644 %{SOURCE5} %{buildroot}/etc`\ +` # Create ld.so.conf`\ +` cat > %{buildroot}/etc/ld.so.conf <<EOF`\ +` /usr/local/lib`\ +` include /etc/ld.so.conf.d/*.conf`\ +` EOF`\ +` # Add ldconfig cache directory for directory ownership`\ +` mkdir -p %{buildroot}/var/cache/ldconfig`\ +` # Empty the ld.so.cache:`\ +` rm -f %{buildroot}/etc/ld.so.cache`\ +` touch %{buildroot}/etc/ld.so.cache`\ +` # Remove timezone data, now coming in standalone package:`\ +` for i in sbin/sln usr/bin/tzselect usr/sbin/zic usr/sbin/zdump etc/localtime; do`\ +`     rm -f  %{buildroot}/$i`\ +` done`\ +` rm -rf     %{buildroot}%{_datadir}/zoneinfo`\ +` mkdir   -p %{buildroot}/usr/lib/tmpfiles.d/`\ +` install -m 644 %{SOURCE20}  %{buildroot}/usr/lib/tmpfiles.d/`\ +` mkdir   -p %{buildroot}/usr/lib/systemd/system`\ +` install -m 644 %{SOURCE21}  %{buildroot}/usr/lib/systemd/system`\ +` mkdir   -p %{buildroot}/usr/bin`\ +` mkdir   -p %{buildroot}/sbin`\ +` install -m 655 %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/sbin/ldconfig     %{buildroot}/sbin`\ +` install -m 655 %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/bin/ldd       %{buildroot}/usr/bin`\ +` install -m 655 %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/bin/getconf   %{buildroot}/usr/bin`\ +` install -m 655 %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/bin/iconv     %{buildroot}/usr/bin`\ +` install -m 655 %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/bin/getent    %{buildroot}/usr/bin`\ +` %files`\ +` # glibc`\ +` %defattr(-,root,root)`\ +` %config(noreplace)  /etc/bindresvport.blacklist`\ +` %config             /etc/ld.so.conf`\ +` %config             /etc/nsswitch.conf`\ +` %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache`\ +` /usr/bin/ldd`\ +` /usr/bin/iconv`\ +` /usr/bin/getconf`\ +` /usr/bin/getent`\ +` /sbin/ldconfig`\ +` %{_libdir}/*`\ +` %files locale`\ +` %defattr(-,root,root)`\ +` %files devel`\ +` %defattr(-,root,root)`\ +` #%{_includedir}/*`\ +` #%{_libdir}/*.o`\ +` #%{_libdir}/*.so` + +### gcc + +` %define gcc_version         483`\ +` %define gcc_suffix          4.8.3`\ +` %define CROSS_COMPILER_PATH /opt/toolchains/gcc-%{gcc_suffix}`\ +` %define tizen_arch          your_new_arch`\ +` %define libc                your_libc`\ +` Name:           gcc%{gcc_version}`\ +` URL:            `[`http://gcc.gnu.org/`](http://gcc.gnu.org/)\ +` Version:        %{gcc_suffix}`\ +` Release:        1`\ +` ExclusiveArch:  %ix86 %{tizen_arch}`\ +` Group:          Development/Toolchain`\ +` AutoReq:        0`\ +` BuildRequires:  gcc-%{libc}`\ +` Summary:        The GNU C Compiler and Support Files`\ +` License:        GPL-3.0+`\ +` Provides:       gcc%{gcc_version}`\ +` %description`\ +` Core package for the GNU Compiler Collection, including the C language`\ +` frontend.`\ +` Language frontends other than C are split to different sub-packages,`\ +` namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and`\ +` gcc-obj-c++.`\ +` %package -n     gcc%{gcc_version}-cross`\ +` Summary:        The GNU C Compiler and Support Files`\ +` License:        GPL-3.0+`\ +` %description -n gcc%{gcc_version}-cross`\ +` Fake rpm that emulate crosscomipler, needed for refsw compilation.`\ +` %package -n     cpp%{gcc_version}`\ +` Summary:        The system GNU Preprocessor`\ +` License:        GPL-3.0+`\ +` %description -n cpp%{gcc_version}`\ +` The system GNU Preprocessor.`\ +` %package -n     gcc%{gcc_version}-locale`\ +` Summary:        The system GNU Compiler locale files`\ +` License:        GPL-3.0+`\ +` %description -n gcc%{gcc_version}-locale`\ +` The system GNU Compiler locale files.`\ +` %package -n     gcc%{gcc_version}-info`\ +` Summary:        The system GNU Compiler documentation`\ +` License:        GFDL-1.2`\ +` %description -n gcc%{gcc_version}-info`\ +` The system GNU Compiler documentation.`\ +` %package -n     gcc%{gcc_version}-c++`\ +` Summary:        The system GNU C++ Compiler`\ +` License:        GPL-3.0+`\ +` Provides:       c++_compiler`\ +` %description -n gcc%{gcc_version}-c++`\ +` The system GNU C++ Compiler.`\ +` %package -n     libstdc++%{gcc_version}-devel`\ +` Summary:        The system GNU C++ development files`\ +` License:        GPL-3.0-with-GCC-exception`\ +` %description -n libstdc++%{gcc_version}-devel`\ +` The system GNU C++ development files.`\ +` %prep`\ +` %setup -q -D -T -n .`\ +` %build`\ +` %install`\ +` mkdir -p %buildroot/usr/bin`\ +` rm -rf   %buildroot/usr/%{tizen_arch}-linux/bin`\ +` mkdir -p %buildroot/usr/%{tizen_arch}-linux/bin`\ +` # create fake binaries`\ +` for executable in %buildroot/usr/bin/{c++,c++filt,cc,cpp,g++,gcc,gcc-%{gcc_suffix},gcj,gcov,gprof,jcf-dump,ld,run,size,strip,sstrip,strings}`\ +` do`\ +`     ln -sf fake_binary $executable`\ +` done`\ +` # prepare folders without fake executables`\ +` cp -rf %{CROSS_COMPILER_PATH}/include   %buildroot/usr`\ +` cp -rf %{CROSS_COMPILER_PATH}/share     %buildroot/usr`\ +` cp -rf %{CROSS_COMPILER_PATH}/lib       %buildroot/usr`\ +` ln -sf /usr/bin/cpp                     %buildroot/usr/lib/cpp`\ +` #prepare folders with fake executables`\ +` mkdir -p %buildroot/usr/libexec/gcc/%{tizen_arch}-linux/%{gcc_suffix}`\ +` cp     %{CROSS_COMPILER_PATH}/libexec/gcc/%{tizen_arch}-linux/%{gcc_suffix}/liblto_plugin.so* %buildroot/usr/libexec/gcc/%{tizen_arch}-linux/%{gcc_suffix}/`\ +` for executable in %buildroot/usr/libexec/gcc/%{tizen_arch}-linux/%{gcc_suffix}/{cc1,cc1obj,cc1plus,collect2,f951,jc1,jvgenmain,lto1,lto-wrapper}`\ +` do`\ +`    ln -sf /usr/bin/fake_binary $executable`\ +` done`\ +` mkdir -p %buildroot/usr/%{tizen_arch}-linux/bin`\ +` cp -rf   %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/include                    %buildroot/usr/%{tizen_arch}-linux`\ +` cp -rf   %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/lib                        %buildroot/usr/%{tizen_arch}-linux`\ +` cp -r    %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/include/*     %buildroot/usr/include`\ +` cp -r    %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/sys-root/usr/lib/*         %buildroot/usr/lib`\ +` ln -sf /usr/bin/fake_binary %buildroot/usr/%{tizen_arch}-linux/bin/fake_binary`\ +` ln -sf ../../               %buildroot/usr/%{tizen_arch}-linux/sys-root`\ +` for executable in %buildroot/usr/%{tizen_arch}-linux/bin/{ar,as,c++,g++,gcc,gfortran,ld,nm,objcopy,objdump,ranlib,strip}`\ +` do`\ +`    ln -sf /usr/bin/fake_binary $executable`\ +` done`\ +` # create wrappers on standard tools`\ +` for i in ld gcc c++ cpp ar nm strip objcopy objdump ranlib readelf; do`\ +`     echo '#!/bin/bash`\ +`     exec '$i' "$@"`\ +`     ' > %{buildroot}/usr/bin/%{tizen_arch}-linux-$i`\ +`     chmod +x %{buildroot}/usr/bin/%{tizen_arch}-linux-$i`\ +` done`\ +` #clean unnecessary files`\ +` rm -rf %buildroot/usr/share/info`\ +` rm -rf %buildroot/usr/share/man`\ +` rm -rf %buildroot/usr/share/gdb`\ +``  rm -rf `find %buildroot/usr| grep "\.la$"` ``\ +` %files`\ +` %defattr(-,root,root)`\ +` /usr/bin/c++`\ +` /usr/bin/c++filt`\ +` /usr/bin/cc`\ +` /usr/bin/cpp`\ +` /usr/bin/g++`\ +` /usr/bin/gcc`\ +` /usr/bin/gcc-%{gcc_suffix}`\ +` /usr/bin/gcj`\ +` /usr/bin/gcov`\ +` /usr/bin/gprof`\ +` /usr/bin/jcf-dump`\ +` /usr/bin/ld`\ +` /usr/bin/run`\ +` /usr/bin/size`\ +` /usr/bin/strip`\ +` /usr/bin/sstrip`\ +` /usr/bin/strings`\ +` /usr/include/*`\ +` /usr/lib/*`\ +` /usr/libexec/*`\ +` /usr/%{tizen_arch}-linux/*`\ +` /usr/share/locale/*`\ +` /usr/share/gcc-%{gcc_suffix}/*`\ +` %files -n gcc%{gcc_version}-cross`\ +` %defattr(-,root,root)`\ +` /usr/bin/%{tizen_arch}-linux-*`\ +` %files -n cpp%{gcc_version}`\ +` %defattr(-,root,root)`\ +` %files -n gcc%{gcc_version}-c++`\ +` %defattr(-,root,root)`\ +` %files -n gcc%{gcc_version}-locale`\ +` %defattr(-,root,root)`\ +` %files -n gcc%{gcc_version}-info`\ +` %defattr(-,root,root)`\ +` %files -n libstdc++%{gcc_version}-devel`\ +` %defattr(-,root,root)` + +### fake\_binutils + +` %define gcc_version          483`\ +` %define gcc_suffix           4.8.3`\ +` %define CROSS_COMPILER_PATH  /opt/toolchains/gcc-%{gcc_suffix}`\ +` %define tizen_arch           your_new_arch`\ +` %define libc                 your_libc`\ +` Name:           fake_binutils`\ +` Version:        2.19.92`\ +` Release:        0`\ +` Url:            `[`http://www.gnu.org/software/binutils/`](http://www.gnu.org/software/binutils/)\ +` Summary:        GNU Binutils`\ +` License:        GFDL-1.3 and GPL-3.0+`\ +` Group:          Development/Tools/Building`\ +` AutoReq:        0`\ +` BuildRequires:  gcc-%{libc}`\ +` Provides:       binutils`\ +` ExclusiveArch:  %ix86 %{tizen_arch}`\ +` %description`\ +` C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,`\ +` size, strings, and strip. These utilities are needed whenever you want`\ +` to compile a program or kernel.`\ +` %package        devel`\ +` Summary:        The GNU Binutils devel`\ +` License:        GPL-3.0+`\ +` Provides:       binutils-devel`\ +` %description    devel`\ +` Fake package to resolve dependencies`\ +` %prep`\ +` %setup -q -D -T -n .`\ +` %build`\ +` echo 'int printf(char *, ...);int main(int argc, char **argv){printf("\nThis is fake \"%s\". If you see this message that smth is wrong with qemu\n", argv[0]);return 0;}' > fake_binary.c`\ +` %ifarch %{tizen_arch}`\ +`     gcc -o fake_binary fake_binary.c`\ +` %endif`\ +` %ifarch %ix86`\ +`     %{CROSS_COMPILER_PATH}/bin/%{tizen_arch}-linux-gcc -o fake_binary fake_binary.c`\ +` %endif`\ +` cp fake_binary %_sourcedir/`\ +` %install`\ +` mkdir -p  %buildroot/usr/bin`\ +` cp -rf    %_sourcedir/fake_binary     %buildroot/usr/bin`\ +` chmod a+x %buildroot/usr/bin/fake_binary`\ +` rm    -rf %buildroot/usr/%{tizen_arch}-linux/bin`\ +` mkdir -p  %buildroot/usr/%{tizen_arch}-linux/bin`\ +` for executable in %buildroot/usr/bin/{ar,as,ld,ld.gold,ld.bfd,nm,ranlib,strip,addr2line,objcopy,objdump,readelf}`\ +` do`\ +`     ln -sf fake_binary $executable`\ +` done`\ +` # add linker scripts`\ +` mkdir -p %buildroot/%{_libdir}`\ +` cp -rf   %{CROSS_COMPILER_PATH}/%{tizen_arch}-linux/lib/ldscripts %buildroot/%{_libdir}`\ +` mkdir -p %buildroot/usr/%{tizen_arch}-linux/lib/`\ +` %post`\ +` %files `\ +` %defattr(-,root,root)`\ +` %{_libdir}/ldscripts`\ +` %{_bindir}/*`\ +` %files devel`\ +` %defattr(-,root,root)`\ +` %changelog` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-13.05.md b/docs/platform/tool/Tools-Announcement-13.05.md new file mode 100644 index 0000000000..81200f5f03 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-13.05.md @@ -0,0 +1,84 @@ +On behalf of Tizen tools development team + +We are very pleased to announce that new version of Tizen developer +tools \[13.05\] is released on tizen.org, at: + +` `[`http://download.tizen.org/tools/latest-release/`](http://download.tizen.org/tools/latest-release/) + +Highlight of this release +------------------------- + +- It contains several major enhancements for the existing tools: + +` - gbs 0.17`\ +` - mic 0.20`\ +` - bmap-tools 2.4` + +- For tools tools release naming convention and download folder + structure, + +` please see details at: `[`http://download.tizen.org/tools/README.txt`](http://download.tizen.org/tools/README.txt) + +Details of the enhancements +--------------------------- + +- gbs 0.17 release: + +` - Totally local full build support, refer to document [3]`\ +` - gbs config refinements`\ +` - Support fetching build conf from standard RPM repodata`\ +` - Create debuginfo and debugsource packages by default`\ +` - Add --packaging-branch option for 'gbs clone' to specify default working branch`\ +` - Optimizations`\ +` - bug fixes`\ +`   * get target arch from build conf if 'Target' is set in build config, which`\ +`     make gbs and remote obs generate the same arch for final RPM package` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt) + +- mic 0.20 release: + +` - new distribution support: CentOS 6`\ +` - drop image creation if checked packages not present in image`\ +` - introduce 'installerfw' command in kickstart to customize configuration`\ +` - improve output message of post scripts`\ +` - bug fixes` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt) + +- bmap-tools 2.4 release + +` - Add SSH URLs support. These URLs start with "`[`ssh://`](ssh://)`" and have the following`\ +`   format: `[`ssh://user:password@host:path`](ssh://user:password@host:path)`, where`\ +`      * user - user name (optional)`\ +`      * password - the password (optional)`\ +`      * host - hostname`\ +`      * path - path to the image file on the remote host`\ +`   If the password was given in the URL, bmaptool will use password-based SSH`\ +`   authentication, otherwise key-based SSH authentication will be used.` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt) + +Documentation +------------- + +- Tools installation: + <https://source.tizen.org/documentation/developer-guide/environment-setup> +- gbs: + <https://source.tizen.org/documentation/reference/git-build-system> +- local full build: + <https://source.tizen.org/documentation/developer-guide/creating-tizen-platform-image-scratch-through-local-build> +- mic: + <https://source.tizen.org/documentation/reference/mic-image-creator> +- bmap-tools: + <https://source.tizen.org/documentation/reference/bmaptool> + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-13.06.md b/docs/platform/tool/Tools-Announcement-13.06.md new file mode 100644 index 0000000000..638843bf19 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-13.06.md @@ -0,0 +1,88 @@ +On behalf of Tizen tools development team + +We are very pleased to announce that new version of Tizen developer +tools \[13.06\] is released on tizen.org, at: + +` `[`http://download.tizen.org/tools/latest-release/`](http://download.tizen.org/tools/latest-release/) + +Highlight of this release +------------------------- + +- It contains several major enhancements for the existing tools: + +` - gbs 0.18`\ +` - mic 0.21`\ +` - bmap-tools 2.6` + +- Distributions support changes: + +` * One new distribution supportted`\ +`   - Fedora 19`\ +` * One distribution dropped:`\ +`   - Fedora 17` + +- For tools tools release naming convention and download folder + structure, + +` please see details at: `[`http://download.tizen.org/tools/README.txt`](http://download.tizen.org/tools/README.txt) + +Details of the enhancements +--------------------------- + +- gbs 0.18 release: + +` - offline local full build support for the following Tizen branches:`\ +`   * Tizen 2.1`\ +`   * Tizen 2.2`\ +`   * Tizen 3.0 (tizen): with both common and ivi/mobile profile support`\ +` - support CI_CNT and B_CNT OBS build related macros`\ +` - zsh command line auto-completion support`\ +` - enhance build conf and profile naming:`\ +`   * build config file can contains '-'`\ +`   * profile name can start with digital and contains '-'` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt) + +- mic 0.21 release: + +` - refactor part of chroot modules for better cleanup handling`\ +` - add an alias "installerfw_plugins" for installerfw`\ +` - remove unnecessary fuser dependency for "fuser" command`\ +` - enable proxy with user authentication setting`\ +` - correct no_proxy handling in openSUSE`\ +` - kill processes inside chroot after post script running`\ +` - ulitize 'dmsetup' to avoid possible dm device unaccessible issue`\ +` - bug fixes` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt) + +- bmap-tools 2.6 release + +` - add on-the-fly decompression support for '.xz' and '.tar.xz' files.`\ +` - enhancements and fixes in the Debian packaging` + +\- see details release notes at: + +` `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt) + +Documentation +------------- + +- Tools installation: + +` `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup) + +- gbs: + <https://source.tizen.org/documentation/reference/git-build-system> +- mic: + <https://source.tizen.org/documentation/reference/mic-image-creator> +- bmap-tools: + <https://source.tizen.org/documentation/reference/bmaptool> + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-13.07.md b/docs/platform/tool/Tools-Announcement-13.07.md new file mode 100644 index 0000000000..08aeb558fc --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-13.07.md @@ -0,0 +1,71 @@ +On behalf of Tizen tools development team, we are very pleased to +announce that new versions of Tizen developer tools \[13.07\] have been +released on tizen.org (http://download.tizen.org/tools/latest-release/), +including the following: + +\- Git Build System (GBS) 0.19 - Image Creator (MIC) 0.22 - bmap-tools +3.0 + +For naming convention and download folder structure for tools release, +refer to <http://download.tizen.org/tools/README.txt>. + +Highlights and Major Enhancements +--------------------------------- + +- GBS 0.19 release + +` - Remove previous built rpm and srpm if new version has been built out.`\ +` - Track upstream/pristine-tar branch automatically, as well as using upstream and pristine-tar branch to generate tar ball.`\ +` - Split out remote build module to separate sub-package: gbs-remotebuild.`\ +` - Fix the bug below:` + +`   Failure of loading project specific gbs.conf when gitdir is specified.` + +` - Update dependencies below:` + +`   * Depend on new pristine-tar 1.28, which contains bug fix while creating pristine-tar delta data.`\ +`   * Depend on new librpm-tizen to ignore some spec parser error.` + +` For detailed information, refer to `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)`.` + +- MIC 0.22 release + +` - Refactor msger module to ulitize logging module.`\ +` - Refine error class module.`\ +` - Enhance the support for virtualenv.`\ +` - Add bash and zsh completion support.`\ +` - Update BmapCreate module to the latest version.`\ +` - Fix the bugs below:` + +`   + Exit during packing process in Ubuntu.`\ +`   + Failure of loop device alloaction in openSUSE.` + +` For detailed information, refer to `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)`.` + +- bmap-tools 3.0 release + +` - Switch from using SHA1 checksums in the bmap file to using SHA256.`\ +` - Support OpenPGP (AKA gpg) signatures for the bmap file.`\ +` - Guarantee the Fiemap module (and thus, bmaptool) to always synchronize the`\ +`   image before scanning it for mapped areas. This is done by using the`\ +`   "FIEMAP_FLAG_SYNC" flag of the FIEMAP ioctl.` + +` For detailed information, refer to `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt)`.` + +Documentation +------------- + +- Tools installation: + +` `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup) + +- gbs: + <https://source.tizen.org/documentation/reference/git-build-system> +- mic: + <https://source.tizen.org/documentation/reference/mic-image-creator> +- bmap-tools: + <https://source.tizen.org/documentation/reference/bmaptool> + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-13.08.md b/docs/platform/tool/Tools-Announcement-13.08.md new file mode 100644 index 0000000000..501271cbd0 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-13.08.md @@ -0,0 +1,132 @@ +We are very pleased to announce that new version of Tizen development +tools \[13.08\] is released on download.tizen.org. Repositories can be +found at: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +Highlight of this release +------------------------- + +In this release, we have included three new tools, including repa, +prekit and lthor. Thanks for all the authors for these projects. And +from this release, both GBS and MIC can support ARM64(aarch64) +architecture now. + +- This release contains many enhancements for the following tools: + +` - gbs 0.20`\ +` - mic 0.23`\ +` - bmap-tools 3.1`\ +` - repa 0.1 (New)`\ +` - prekit 0.9 (New)`\ +` - lthor 1.4 (New)` + +- And two new Linux distributions have been added into the support + list, as + +shown below: + +` - Ubuntu 13.10`\ +` - openSUSE 13.1` + +- All the supported Linux distributions are: + +` - Ubuntu 13.10 (New)`\ +` - Ubuntu 13.04`\ +` - Ubuntu 12.10`\ +` - Ubuntu 12.04`\ +` - openSUSE 13.1 (New)`\ +` - openSUSE 12.3`\ +` - openSUSE 12.2`\ +` - openSUSE 12.1`\ +` - Fedora 19`\ +` - Fedora 18`\ +` - CentOS 6` + +- For tools release naming convention and download folder structure, + please refer to: + +` [Tools Repository Specifiation](http://download.tizen.org/tools/README.txt)` + +Details of the enhancements +--------------------------- + +- GBS 0.20 release + +` - support ARM64(aarch64) build`\ +` - enhance gbs build report summary, including print log directory, show`\ +`   number of succeeded packages and always show build report even if some`\ +`   packages build failed`\ +` - generate html and json format build report`\ +` - depend on new pristine-tar (1.28) to fix pristine-tar branch broken issue`\ +` - use HTTP no-cache headers to avoid unexpected proxy caching`\ +` - depend on initvm static binary to register qemu handler, instead of using`\ +`   qemu bash script(/usr/sbin/qemu-binfmt-conf.sh)` + +` For detailed information, refer to: [GBS Release Notes][1]` + +- MIC 0.22 release + +` - support arm64 architecture image creation in native mode`\ +` - split the "native" running mode support to a separated sub-package`\ +` - reduce the dependencies(packages) of mic main package dramatically`\ +` - add new options '--interactive' and '--non-interactive' to flip`\ +`   interaction`\ +` - add new option '--uuid' for 'part' in ks file to set filesystem uuid`\ +` - export more environment variables related to installer framework for loop`\ +`   image format` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- bmap-tools 3.1 release + +` - Changes the bmap format version from 1.4 to 2.0 in order to lessen the`\ +`   versioning screw-up. Increased major bmap format version number will make`\ +`   sure that older bmap-tools fail with a readable error message, instead of`\ +`   crashing.` + +` For detailed information, refer to: [bmap-tools Release Notes][3]` + +- repa 0.1 release + +` - Tool for assisting release engineers with their tasks, including operate`\ +`   with submissions in easy and flexible manner.` + +- prekit 0.9 release + +` - prekit is a Tizen IA client tool of Pre-OS, which is the proviioning`\ +`   environment of Tizen operating system. It's the tool used to flash Tizen`\ +`   operation system to IA device.` + +` For detailed information, refer to: [Prekit Project Home][4]` + +- lthor 1.4 release + +` - Tool for downloading binaries from a Linux host PC to a target phone. It`\ +`   uses a USB cable as a physical communication medium.` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt)\ +`       "bmap-tools Release Notes"`\ +`[4]: `[`https://github.com/kangkai/prekit`](https://github.com/kangkai/prekit)\ +`       "Prekit Project Home"`\ +`[5]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools installation Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[8]: `[`https://source.tizen.org/documentation/reference/bmaptool`](https://source.tizen.org/documentation/reference/bmaptool)\ +`       "bmap-tools Guide"`\ +`[9]: `[`https://source.tizen.org/documentation/developer-guide/creating-tizen-image-scratch`](https://source.tizen.org/documentation/developer-guide/creating-tizen-image-scratch)\ +`       "GBS Local Full Build Guide"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-14.01.md b/docs/platform/tool/Tools-Announcement-14.01.md new file mode 100644 index 0000000000..1d04ff91b4 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-14.01.md @@ -0,0 +1,121 @@ +We are very pleased to announce that new version of Tizen development +tools \[14.01\] is released on download.tizen.org, including the +following: + +- GBS 0.21 +- MIC 0.24 +- bmap-tools 3.2 +- repa 0.1.1 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +Highlights +---------- + +- New feature: GBS Jenkins jobs for local full build + +` These newly added jobs are well documented, easy to deploy and configure,`\ +` providing automation solution for small team to efficiently perform package`\ +` building, image creation and build artifacts publishing.` + +- New support list + +` All the supported Linux distributions versions are as follows:` + +` - Ubuntu 13.10`\ +` - Ubuntu 12.10`\ +` - Ubuntu 12.04`\ +` - openSUSE 13.1`\ +` - openSUSE 12.3`\ +` - openSUSE 12.2`\ +` - Fedora 20 (New)`\ +` - Fedora 19`\ +` - CentOS 6` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.21 release + +` - From this version, Jenkins jobs support has been included.`\ +`     Two subpackages (gbs-jenkins-jobs and gbs-jenkins-scripts) have been`\ +`     introduced for jenkins local full build support accordingly.` + +` - Add two options, --package-list and --package-from-file, to build customized`\ +`   packages specified in the package list directly given in the CLI or a file`\ +`   stored in local disk.`\ +` - Add more user-friendly error message output for network proxy issues.` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +` For detailed information about GBS Jenkins jobs, refer to:`\ +` [Deployment and Usage Guide for GBS Jenkins jobs][10]` + +` For instructions of the manual equivalent of GBS jenkins jobs, refer to:`\ +` [GBS Local Full Build Guide][9]` + +- MIC 0.24 release + +` - Add two options, --repo and --ignore-ksrepo, to create customized images`\ +`   without updating the ks file.`\ +` - Add --user and --password option for %repo directive of ks file.`\ +` - Clean up codes relevant to EULA agreement to deprecated EULA support.`\ +` - Enhance the handling of password string with special characters.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- bmap-tools 3.2 release + +` - Multi-stream bzip2 archives are now supported.`\ +` - LZO archives are supported.`\ +` - Make 'bmaptool create' (and hence, the BmapCreate module) work with the`\ +`   "tmpfs" file-system.`\ +` - Decompression should now require less memory, which should fix`\ +`   out-of-memory problems reported by some users recently.`\ +` - Improve reading and decompressing images.` + +` For detailed information, refer to: [bmap-tools Release Notes][3]` + +- repa 0.1.1 release + +` - Added --project option to avoid resolving submission to multiple products.`\ +` - Added obs and download urls to 'repa list' output` + +` For detailed information, refer to: [repa Release Notes][11]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt)\ +`       "bmap-tools Release Notes"`\ +`[4]: `[`https://github.com/kangkai/prekit`](https://github.com/kangkai/prekit)\ +`       "Prekit Project Home"`\ +`[5]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools installation Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[8]: `[`https://source.tizen.org/documentation/reference/bmaptool`](https://source.tizen.org/documentation/reference/bmaptool)\ +`       "bmap-tools Guide"`\ +`[9]: `[`https://source.tizen.org/documentation/developer-guide/creating-tizen-image-scratch`](https://source.tizen.org/documentation/developer-guide/creating-tizen-image-scratch)\ +`       "GBS Local Full Build Guide"`\ +`[10]: `[`https://source.tizen.org/documentation/developer-guide/jenkins-jobs-local-full-build`](https://source.tizen.org/documentation/developer-guide/jenkins-jobs-local-full-build)\ +`       "Deployment and Usage Guide for GBS Jenkins jobs"`\ +`[11]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-14.02.2.md b/docs/platform/tool/Tools-Announcement-14.02.2.md new file mode 100644 index 0000000000..f0ed4091fc --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-14.02.2.md @@ -0,0 +1,64 @@ +We are very pleased to announce that new bug-fix version of Tizen +development tools \[14.02.2\] is released on download.tizen.org, +including the following: + +- GBS 0.22.1 +- MIC 0.25.2 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.22.1 release + +`  - Fix backtrace issue caused by desktop notifications`\ +`  - Change VCS tag in spec to commitish sha1sum in export module`\ +`  - Fix bug: OS/ABI field in ELF header messed up aarch64` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.25.2 release + +` - Fix critial bug that crashed /etc if using /etc/mic.conf as config option`\ +` - Fix python xml module requirements`\ +` - Fix AttributeError traceback in zypp backend` + +` For detailed information, refer to: [MIC Release Notes][2]` + +WARNING +------- + +In MIC 0.25, a critial bug would crash your /etc directory when adding +\'-c /etc/mic.conf\' in MIC command line, this bug only affects 0.25 and +it has been fixed in 0.25.1. Please avoid this bug by upgrading MIC +version according to the hints. + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-14.02.md b/docs/platform/tool/Tools-Announcement-14.02.md new file mode 100644 index 0000000000..009f6103df --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-14.02.md @@ -0,0 +1,107 @@ +We are very pleased to announce that new version of Tizen development +tools \[14.02\] is released on download.tizen.org, including the +following: + +- GBS 0.22 +- MIC 0.25 +- repa 0.2 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +Highlights +---------- + +- New feature: orphan-packaging development model + +` Implement 'devel' subcommand for orphan-packaging development model, which`\ +` facilitates package maintainers to better maintain package in the orphan-`\ +` packaging branch model by providing five actions, including 'start', 'export',`\ +` 'drop', 'switch', and 'convert'. Currently, this is only an experimental`\ +` version, so please report jira tickets if you find any issues.` + +` For detailed information, refer to: [Maintenance Models][7] and [GBS 'devel' command][8]` + +- New support list + +` All the supported Linux distributions versions are as follows:` + +` - Ubuntu 14.04(New)`\ +` - Ubuntu 13.10`\ +` - Ubuntu 12.04`\ +` - openSUSE 13.1`\ +` - openSUSE 12.3`\ +` - openSUSE 12.2`\ +` - Fedora 20`\ +` - Fedora 19`\ +` - CentOS 6`\ +` - Debian 7(New)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.22 release + +`  - Implement 'devel' subcommand to support orphan-packaging development model`\ +`  - Conf: support adding new sections and updating an empty conf file`\ +`  - Support new profile key 'exclude_packages' like --exclude build option`\ +`  - Changelog: utilize rpm-ch from git-buildpackage`\ +`  - Build: add group metadata to local repodata if package-groups.rpm exists` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.25 release + +` - Generate manifest file to describe image information`\ +` - Refactor archive and compress module`\ +` - Support sparse handle for tar command`\ +` - Replace system V with systemd on locale setting`\ +` - Support lzop compress` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- repa 0.2 release + +` - Implement --processes options for repa list`\ +` - Implement --colorize option`\ +` - Implement --showurls option`\ +` - Reduce the amount of information in repa list output`\ +` - Make 'project' a mandatory config option`\ +` - Add configuration file info to the man page`\ +` - Enhance man page`\ +` - Get rid of --regexp command line option`\ +` - Create one SR for all packages in submission`\ +` - Add -group suffix to the path for the group`\ +` - Draft implementation of repa diff` + +` For detailed information, refer to: [repa Release Notes][3]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"`\ +`[8]: `[`https://source.tizen.org/documentation/reference/git-build-system/usage/gbs-devel`](https://source.tizen.org/documentation/reference/git-build-system/usage/gbs-devel)\ +`       "GBS 'devel' command"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-14.03.1.md b/docs/platform/tool/Tools-Announcement-14.03.1.md new file mode 100644 index 0000000000..136f1fd41c --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-14.03.1.md @@ -0,0 +1,63 @@ +We are pleased to announce that new bug-fix version of Tizen development +tools \[14.03.1\] is released on download.tizen.org, including the +following: + +- GBS 0.23 +- MIC 0.24.3 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.23 release + +`  - Added --fallback-to-native option, to enable gbs-export to fallback to`\ +`    "native" packaging mode for "non-native" packages with git tree errors.`\ +`  - Added native config option in gbs configuration file to specify packages as`\ +`    "native" packaging mode explicitly.`\ +`  - Added --skip-srcrpm option, support no source rpm building.`\ +`  - Start to support MIPS(mips and mipsel)architecture building targets.`\ +`  - Added --icecream option, to build with distributed compiler network.`\ +`  - Fix: build on development branch with --include-all option.`\ +`  - Fix: dependency issue on gbs repository for fedora.`\ +`  - Fix: disable invalid pylint errors.` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.24.3 release + +`  - Added support for creating arm64(aarch64) images`\ +`  - Fix: qemu arm execution register issue.`\ +`  - Fix: remove --preserve-order option in taring fs image` + +` For detailed information, refer to: [MIC Release Notes][2]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-15.01.md b/docs/platform/tool/Tools-Announcement-15.01.md new file mode 100644 index 0000000000..f656cd73ac --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-15.01.md @@ -0,0 +1,85 @@ +We are pleased to announce that new version of Tizen development tools +\[15.01\] is released on download.tizen.org, including the following: + +- GBS 0.23.2 +- MIC 0.24.4 +- REPA 0.3 +- BMAP-TOOLS 3.3 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.23.2 release + +`  - Fixed get "fallback_to_native" value from non-default gbs configuration`\ +`  - Fixed bad indentation from pylint checking`\ +`  - Fixed tag mode in test_import script` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.24.4 release + +`  - Generate manifest file to describe image information`\ +`  - Modify mount option to support both toybox and busybox`\ +`  - Other hot bug fixes` + +` For detailed information, refer to: [MIC Release Notes][2]`\ +` The latest mic-appliance can be downloaded from `[`http://download.tizen.org/tools/mic-appliance/15.01/`](http://download.tizen.org/tools/mic-appliance/15.01/) + +- REPA 0.3 release + +`  - group: disable publishing when aggregating packages`\ +`  - Skip conflicting submissions when creating a group`\ +`  - group: Implemented parallel package aggregating`\ +`  - info: Excluded 'disabled' build status from the list`\ +`  - list: Implement --ignore command line option`\ +`  - group: Remove binary package check`\ +`  - Implement --noaggregate command line and config option`\ +`  - List all projects in submitrequest message`\ +`  - Drop 'Commit' keyword from the submitrequest info`\ +`  - Reworked repa diff`\ +`  - Implement --base option for repa list`\ +`  - Pylinted codebase`\ +`  - Output SR for rejected/accepted submissions`\ +`  - create_sr: Fix unicode issue` + +` For detailed information, refer to: [repa Release Notes][3]` + +- BMAP-TOOLS 3.3 release + +`  - Fix rpm dependency issue for Fedora` + +` For detailed information, refer to: [bmap-tools Release Notes][4]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt)\ +`       "bmap-tools Release Notes"`\ +`[5]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[8]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-16.02.md b/docs/platform/tool/Tools-Announcement-16.02.md new file mode 100644 index 0000000000..a2b5596efa --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-16.02.md @@ -0,0 +1,90 @@ +We are pleased to announce that new version of Tizen development tools +\[16.02\] is released on download.tizen.org, including the following: + +- GBS 0.24.1 +- MIC 0.27.1 +- REPA 0.4 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/archive/16.02/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.24.1 release + +`  - Bug fix:`\ +`   * Upgrade pristine-tar with xdelta3 instead of xdelta(xdelta can not work well when codes' size is bigger than 2GB )`\ +`   * Add tar extract patches to solve bad message generated by git(2.7.4) mailinfo`\ +`  - New feature and enhancements added:`\ +`   * Upgrade latest 'build' package from upstream and suit for gbs`\ +`   * Upgrade depannuer to meet new version of build`\ +`   * Support new platform Ubuntu 16.04, Fedora 23` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.27.1 release + +`  * new distribution support: Ubuntu 16.04, Fedora 23`\ +`  * add raw image format support`\ +`  * Remove BmapCreate and Filemap source code from MIC (#DEVT-151)` + +` For detailed information, refer to: [MIC Release Notes][2]`\ +` The latest mic-appliance can be downloaded from `[`http://download.tizen.org/tools/mic-appliance/15.01/`](http://download.tizen.org/tools/mic-appliance/15.01/) + +- REPA 0.4 release + +`  - New features and enhancements:`\ +`   * group: remove --force option`\ +`   * Rename command info -> show`\ +`   * Implement rebuild subcommand`\ +`   * Implement lock/unlock subcommand`\ +`   * Implement remove subcommand`\ +`   * list: add build time`\ +`   * Implement --edit command line option` + +`  - Bugfixes:`\ +`   * fix pylint error` + +` For detailed information, refer to: [repa Release Notes][3]` + +The upgrade reminder +-------------------- + +\[GBS\]: + +`    Duo to we use new dependency for pristine-tar, If you have installed GBS with old version(<0.24) on debian's system(Ubuntu, Debian),`\ +`    you need upgrade as below:` + +`    1.Add new repo to sources.list file;`\ +`    2."sudo apt-get update";`\ +`    3."sudo apt-get upgrade gbs";`\ +`    4."sudo apt-get upgrade  pristine-tar"` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.3.md b/docs/platform/tool/Tools-Announcement-18.01.3.md new file mode 100644 index 0000000000..496ca70626 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.3.md @@ -0,0 +1,38 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.3\] is released on download.tizen.org, including the following: + +- GBS 0.25.1 +- MIC 0.28 +- REPA 0.6 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.3/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.3/RELEASE_NOTES_GBS.txt)`\ +` [MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.3/RELEASE_NOTES_MIC.txt)`\ +` [REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.3/RELEASE_NOTES_REPA.txt)` + +Enhancements +------------ + +- GBS 0.25.1 + +`  - No update` + +- MIC 0.28 release + +`  * Apply btrfs mount options "--fsoptions=compress"`\ +`  * In Tizen, losetup command support '-f' option, change '--find' to '-f'`\ +`  * Fix issue, set blocksize by parsing "-b [BLOCKSIZE]" from extoptions in ks file` + +- REPA 0.4 release + +`  - No update` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.4.md b/docs/platform/tool/Tools-Announcement-18.01.4.md new file mode 100644 index 0000000000..b7d6e262f0 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.4.md @@ -0,0 +1,31 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.4\] is released on download.tizen.org, including the following: + +`GBS 0.25.2`\ +`MIC 0.28.1`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.4/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.4/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.4/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.4/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.2`\ +` * Fix umount directories inside build root after build is finished` + +`MIC 0.28.1 release`\ +` * Check exit status of vdfs image creation`\ +` * Change the user and root passwd hash algorithm order to avoid user name same as root name.` + +`REPA 0.4 release`\ +` - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.5.md b/docs/platform/tool/Tools-Announcement-18.01.5.md new file mode 100644 index 0000000000..6219b881e9 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.5.md @@ -0,0 +1,38 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.5\] is released on download.tizen.org, including the following: + +`GBS 0.25.3`\ +`MIC 0.28.2`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.5/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.5/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.5/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.5/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.3`\ +`   - Bug fix:`\ +`     * Fix deb package build error`\ +`     * Remove chroot memory limit on x86_64`\ +`   - New feature and enhancements added:`\ +`     * Optimize gbs export process`\ +`   - Update dependencies:`\ +`     * depanneur >= 0.16.3` + +`MIC 0.28.2 release`\ +`  * remove tmp dir in runscript period.`\ +`  * ext4 images are created with inode size 256 bytes.`\ +`  * Add locale related environment varibale because language is not set to one specified in ks file.` + +`REPA 0.4 release`\ +` - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.6.md b/docs/platform/tool/Tools-Announcement-18.01.6.md new file mode 100644 index 0000000000..8396fc3387 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.6.md @@ -0,0 +1,37 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.6\] is released on download.tizen.org, including the following: + +`GBS 0.25.4`\ +`MIC 0.28.2`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.6/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.6/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.6/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.6/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.4`\ +`  - Bug fix:`\ +`   * Fix build error on x86_64 with expand error`\ +`   * Fix bugs of perl tempdir function call`\ +`   * Remove mount info check after build finished`\ +`  - New feature and enhancements added:`\ +`   * Add --style=tar feature, which can build with gbs export source`\ +`  - Update dependencies:`\ +`   * depanneur >= 0.16.4` + +`MIC 0.28.2 release`\ +`  - No update` + +`REPA 0.4 release`\ +`  - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.7.md b/docs/platform/tool/Tools-Announcement-18.01.7.md new file mode 100644 index 0000000000..a445f320bd --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.7.md @@ -0,0 +1,31 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.7\] is released on download.tizen.org, including the following: + +`GBS 0.25.4`\ +`MIC 0.28.3`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.7/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.7/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.7/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.7/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.4`\ +`  - No Update` + +`MIC 0.28.3`\ +`  - Bug Fixes`\ +`   * Revert "ext4 images are created with inode size 256 bytes".` + +`REPA 0.4 release`\ +`  - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.8.md b/docs/platform/tool/Tools-Announcement-18.01.8.md new file mode 100644 index 0000000000..2eb2c12c52 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.8.md @@ -0,0 +1,32 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.8\] is released on download.tizen.org, including the following: + +`GBS 0.25.5`\ +`MIC 0.28.4`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.8/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.8/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.8/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.8/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.5`\ +`  - Bug fix:`\ +`   * Fix file conflicts when package install` + +`MIC 0.28.4`\ +`  - New feature`\ +`   * add new option --fslabel in part section.` + +`REPA 0.4 release`\ +`  - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-18.01.9.md b/docs/platform/tool/Tools-Announcement-18.01.9.md new file mode 100644 index 0000000000..2effd2d0ec --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-18.01.9.md @@ -0,0 +1,32 @@ +We are pleased to announce that new version of Tizen development tools +\[18.01.8\] is released on download.tizen.org, including the following: + +`GBS 0.25.6`\ +`MIC 0.28.5`\ +`REPA 0.6` + +For information about Tools repositories, refer to: + +`[Tools Repository](http://download.tizen.org/tools/.staging/archive/18.01.9/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +`[GBS Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.9/RELEASE_NOTES_GBS.txt)`\ +`[MIC Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.9/RELEASE_NOTES_MIC.txt)`\ +`[REPA Repository Specification](http://download.tizen.org/tools/.staging/archive/18.01.9/RELEASE_NOTES_REPA.txt)` + +Enhancements + +`GBS 0.25.6`\ +`  - Enhancement:`\ +`   * Speed up the download packages when use https` + +`MIC 0.28.5`\ +`  - New feature`\ +`   * Add %env section support.` + +`REPA 0.4 release`\ +`  - No update` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-19.01.md b/docs/platform/tool/Tools-Announcement-19.01.md new file mode 100644 index 0000000000..e10a4f5056 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-19.01.md @@ -0,0 +1,65 @@ +We are pleased to announce that new version of Tizen development tools +\[19.01\] is released on download.tizen.org, including the following: + +- GBS 0.25.10 +- MIC 0.28.7 +- REPA 0.6 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/archive/16.02/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.25.10 release + +`  - Bug fix:`\ +`   * Fix pylint issue for gbs` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.7 release + +`  - New features and enhancements:  `\ +`    * add option for mic to skip set hosts when create.`\ +`  `\ +`  - Bug fix:`\ +`    * fix pylint errors for mic.`\ +`    * skip set hosts by mic when /etc/hosts exists.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- REPA 0.6 release + +` - No update` + +The upgrade reminder +-------------------- + +\[GBS\]: + +`    Duo to we use new dependency for pristine-tar, If you have installed GBS with old version(<0.24) on debian's system(Ubuntu, Debian),`\ +`    you need upgrade as below:` + +`    1.Add new repo to sources.list file;`\ +`    2."sudo apt-get update";`\ +`    3."sudo apt-get upgrade gbs";`\ +`    4."sudo apt-get upgrade  pristine-tar"` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/archive/16.02/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-20.01.md b/docs/platform/tool/Tools-Announcement-20.01.md new file mode 100644 index 0000000000..df31beac7a --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-20.01.md @@ -0,0 +1,60 @@ +We are pleased to announce that new version of Tizen development tools +\[20.01\] is released on download.tizen.org, including the following: + +- GBS 0.25.10 +- MIC 0.28.7 +- REPA 0.6 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.25.10 release + +`  - Bug fix:`\ +`   * Fix pylint issue for gbs` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.7 release + +`  - New features and enhancements:  `\ +`    * add option for mic to skip set hosts when create.`\ +`  `\ +`  - Bug fix:`\ +`    * fix pylint errors for mic.`\ +`    * skip set hosts by mic when /etc/hosts exists.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- REPA 0.6 release + +` - No update` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-20.02.md b/docs/platform/tool/Tools-Announcement-20.02.md new file mode 100644 index 0000000000..ab2baaebc8 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-20.02.md @@ -0,0 +1,58 @@ +We are pleased to announce that new version of Tizen development tools +\[20.02\] is released on download.tizen.org, including the following: + +- GBS 0.25.11 +- MIC 0.28.8 +- REPA 0.6 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.25.11 release + +`  - Bug fix:`\ +`   * Remove --replacefile option in build-pkg-rpm`\ +`   * Fix errors about check_circle in depanneur`\ +`   * Fix build error with '[]' in path` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.8 release + +`  - Bug fix:`\ +`    * Remove unnecessary /etc/fstab file.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- REPA 0.6 release + +` - No update` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-20.03.md b/docs/platform/tool/Tools-Announcement-20.03.md new file mode 100644 index 0000000000..701e71469c --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-20.03.md @@ -0,0 +1,72 @@ +We are pleased to announce that new version of Tizen development tools +\[20.03\] is released on download.tizen.org, including the following: + +- GBS 0.25.12 +- MIC 0.28.9 +- REPA 0.7 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +\'\'\'Notice: + +` '''For Ubuntu 20.04 OS, need to set python version to python 2.x version before using GBS/MIC. The python version on Ubuntu 20.04 is python 3.x on default.`\ +` How to switch python version to python 2.x, please refer to the below link:'''`\ +` `[`https://www.vultr.com/docs/how-to-install-python-2-on-ubuntu-20-04`](https://www.vultr.com/docs/how-to-install-python-2-on-ubuntu-20-04) + +\'\'\'==Enhancements== + +- GBS 0.25.12 release + +`  - Update dependencies:`\ +`   * depanneur >= 0.16.7`\ +`   * tizen-qemu-arm-static >= 2020.06.17`\ +`   * git-buildpackage-rpm >= 0.9.20-tizen20200522`\ +`  - New Feature and enhancements:`\ +`   * Support Ubuntu 20.04` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.9 release + +` - Bug Fixes:`\ +`  * Increase max loop device number in mic.`\ +`  * Fix build error with Typeerror.`\ +`  * Fix the bug that truncates existing inittab file.`\ +` - New Feature and enhancements:`\ +`  * Support Ubuntu 20.04` + +` For detailed information, refer to: [MIC Release Notes][2]` + +- REPA 0.7 release + +` - Bug Fixes:`\ +`  * Fix pylint error for repa`\ +` - New Feature and enhancements:`\ +`  * Support Ubuntu 20.04` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-20.04.md b/docs/platform/tool/Tools-Announcement-20.04.md new file mode 100644 index 0000000000..77357ae1a9 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-20.04.md @@ -0,0 +1,61 @@ +We are pleased to announce that new version of Tizen development tools +\[20.04\] is released on download.tizen.org, including the following: + +- GBS 0.25.13 +- MIC 0.28.10 +- REPA 0.7 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +\'\'\'Notice: + +` '''For Ubuntu 20.04 OS, need to set python version to python 2.x version before using GBS/MIC. The python version on Ubuntu 20.04 is python 3.x on default.`\ +` How to switch python version to python 2.x, please refer to the below link:'''`\ +` `[`https://www.vultr.com/docs/how-to-install-python-2-on-ubuntu-20-04`](https://www.vultr.com/docs/how-to-install-python-2-on-ubuntu-20-04) + +\'\'\'==Enhancements== + +- GBS 0.25.13 release + +` - Bug fix::`\ +`   * Fix reorder error when gbs quickbuild.`\ +` - New feature and enhancements added:`\ +`   * Refine code with SAM tools check.` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.10 release + +` - Bug fix::`\ +`   * Fix reorder error when gbs quickbuild.`\ +` - New feature and enhancements added:`\ +`   * Refine code with SAM tools check.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-20.05.md b/docs/platform/tool/Tools-Announcement-20.05.md new file mode 100644 index 0000000000..1c7f66c514 --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-20.05.md @@ -0,0 +1,69 @@ +We are pleased to announce that new version of Tizen development tools +\[20.04\] is released on download.tizen.org, including the following: + +- GBS 0.25.15 +- MIC 0.28.11 +- REPA 0.7 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +\'\'\'Notice: + +` '''In this version, we have a big change, we removed dependence for createrepo package, because it is too old. Instead, we use creterepo-c package, So before installing gbs 0.25.15 version, you need to   uninstall creterepo. `\ +` '''Ubuntu: "sudo apt-get remove createreo", or "sudo apt-get autoremove gbs", then "sudo apt-get install gbs"; `\ +` '''OpenSuse: "sudo zypper remove createrepo", or "sudo zypper remove gbs". Then sudo "sudo zypper install gbs"`\ +`   '''` + +\'\'\' + +Enhancements +------------ + +- GBS 0.25.15 release + +` - Bug fix::`\ +`   * Fix build failed when gbs full build.`\ +` - New feature and enhancements added:`\ +`   * Remove build dependence with python-support.`\ +`   * Support gen depends of exported sources.`\ +`   * Add --tarfile option for gbs depends subcommand to generate tar xml file.`\ +`   * Support zstd decompression for old rpm version`\ +`   * Support zstd arch for tar` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.11 release + +` - Bug fix::`\ +`   * fix run error issue for parser repomd.xml when here is group type..`\ +` - New feature and enhancements added:`\ +`   * Separate qcow plugin scripts.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools-Announcement-21.01.md b/docs/platform/tool/Tools-Announcement-21.01.md new file mode 100644 index 0000000000..ca803f599b --- /dev/null +++ b/docs/platform/tool/Tools-Announcement-21.01.md @@ -0,0 +1,63 @@ +We are pleased to announce that new version of Tizen development tools +\[21.01\] is released on download.tizen.org, including the following: + +- GBS 0.25.16 +- MIC 0.28.12 +- REPA 0.7 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/releases/milestone/latest/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +\'\'\'Notice: + +` '''In this version, we have a big change, we removed dependence for createrepo package, because it is too old. Instead, we use creterepo-c package, So before installing gbs 0.25.15 version, you need to   uninstall creterepo. `\ +` '''Ubuntu: "sudo apt-get remove createreo", or "sudo apt-get autoremove gbs", then "sudo apt-get update" and "sudo apt-get install gbs"; `\ +` '''OpenSuse: "sudo zypper remove createrepo", or "sudo zypper remove gbs". Then sudo "sudo zypper install gbs"`\ +`   '''` + +\'\'\' + +Enhancements +------------ + +- GBS 0.25.16 release + +` - New feature and enhancements added:`\ +`   * Add arguments, --preordered-list and --local-only.` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.28.12 release + +` - New feature and enhancements added:`\ +`   * Support to create image with f2fs file system.`\ +`   * Fix the bug that no print last installed package.`\ +`   * Remove urlgrabber directory from mic.` + +` For detailed information, refer to: [MIC Release Notes][2]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/releases/milestone/latest/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`      "Tools Installation Guide"`\ +`[4]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`      "GBS Reference Guide"`\ +`[5]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`      "MIC Reference Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`      "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Tools_Announcement.md b/docs/platform/tool/Tools_Announcement.md new file mode 100644 index 0000000000..f656cd73ac --- /dev/null +++ b/docs/platform/tool/Tools_Announcement.md @@ -0,0 +1,85 @@ +We are pleased to announce that new version of Tizen development tools +\[15.01\] is released on download.tizen.org, including the following: + +- GBS 0.23.2 +- MIC 0.24.4 +- REPA 0.3 +- BMAP-TOOLS 3.3 + +For information about Tools repositories, refer to: + +` [Tools Repository](http://download.tizen.org/tools/latest-release/)` + +For information about tools release naming conventions and download +folder strucuture, refer to: + +` [Tools Repository Specification](http://download.tizen.org/tools/README.txt)` + +Enhancements +------------ + +- GBS 0.23.2 release + +`  - Fixed get "fallback_to_native" value from non-default gbs configuration`\ +`  - Fixed bad indentation from pylint checking`\ +`  - Fixed tag mode in test_import script` + +` For detailed information about GBS enhancements, refer to: [GBS Release Notes][1]` + +- MIC 0.24.4 release + +`  - Generate manifest file to describe image information`\ +`  - Modify mount option to support both toybox and busybox`\ +`  - Other hot bug fixes` + +` For detailed information, refer to: [MIC Release Notes][2]`\ +` The latest mic-appliance can be downloaded from `[`http://download.tizen.org/tools/mic-appliance/15.01/`](http://download.tizen.org/tools/mic-appliance/15.01/) + +- REPA 0.3 release + +`  - group: disable publishing when aggregating packages`\ +`  - Skip conflicting submissions when creating a group`\ +`  - group: Implemented parallel package aggregating`\ +`  - info: Excluded 'disabled' build status from the list`\ +`  - list: Implement --ignore command line option`\ +`  - group: Remove binary package check`\ +`  - Implement --noaggregate command line and config option`\ +`  - List all projects in submitrequest message`\ +`  - Drop 'Commit' keyword from the submitrequest info`\ +`  - Reworked repa diff`\ +`  - Implement --base option for repa list`\ +`  - Pylinted codebase`\ +`  - Output SR for rejected/accepted submissions`\ +`  - create_sr: Fix unicode issue` + +` For detailed information, refer to: [repa Release Notes][3]` + +- BMAP-TOOLS 3.3 release + +`  - Fix rpm dependency issue for Fedora` + +` For detailed information, refer to: [bmap-tools Release Notes][4]` + +Links +----- + +`[1]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_GBS.txt)\ +`       "GBS Release Notes"`\ +`[2]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_MIC.txt)\ +`       "MIC Release Notes"`\ +`[3]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_REPA.txt)\ +`       "repa Release Notes"`\ +`[4]: `[`http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt`](http://download.tizen.org/tools/latest-release/RELEASE_NOTES_BMAP-TOOLS.txt)\ +`       "bmap-tools Release Notes"`\ +`[5]: `[`https://source.tizen.org/documentation/developer-guide/environment-setup`](https://source.tizen.org/documentation/developer-guide/environment-setup)\ +`       "Tools Installation Guide"`\ +`[6]: `[`https://source.tizen.org/documentation/reference/git-build-system`](https://source.tizen.org/documentation/reference/git-build-system)\ +`       "GBS Reference Guide"`\ +`[7]: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`       "MIC Reference Guide"`\ +`[8]: `[`https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs`](https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs)\ +`       "Maintenance Models"` + +Thanks + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Trepo.md b/docs/platform/tool/Trepo.md new file mode 100644 index 0000000000..be78302452 --- /dev/null +++ b/docs/platform/tool/Trepo.md @@ -0,0 +1,367 @@ +This is a git-repo wrapper to manage tizen platform source codes on your +host more easily. + +<http://download.tizen.org/snapshots/tizen/unified/latest/builddata/manifest/> +provides you repo manifest xmls on website, but if you want to clone +source codes with git-repo tools and that manifest then the xml file has +to be located in git repository. (\'repo init\' requires git uri with -u +option.) + +This wrapper will generate temporary git automatically and update +manifest.xml. You just need to pass a few arguments (tizen snapshot +version, regex for filtering projects, etc) then trepo tool initialize +proper repo workspace. + +How to build and install +------------------------ + +Build sources with debuild. + +`   sudo apt-get install devscripts debhelper python3-setuptools python3-yaml python3-requests python3-bs4`\ +`   git clone `[`https://github.com/dhs-shine/trepo`](https://github.com/dhs-shine/trepo)\ +`   cd trepo`\ +`   debuild` + +Install dependencies and trepo deb package with dpkg. + +`   cd ..`\ +`   sudo dpkg -i trepo_0.1_all.deb` + +How to install trepo from launchpad ppa (Recommend) +--------------------------------------------------- + +`   sudo add-apt-repository ppa:tizen.org/pdk`\ +`   sudo apt-get update`\ +`   sudo apt-get install trepo` + +How to use +---------- + +### Get a list of tizen snapshots + +You can get a list of available snapshots with \'snapshots\' subcommand. + +`   trepo snapshots` + +Output: + +`   20170524.4`\ +`   20170524.3`\ +`   20170524.2`\ +`   20170524.1`\ +`   20170523.3`\ +`   20170523.2`\ +`   20170523.1`\ +`   20170522.2`\ +`   20170522.1`\ +`   20170520.1`\ +`   ...` + +### Initialize trepo workspace + +Let\'s initialize trepo workspace on new directory with \'init\' +subcommand. + +`   mkdir test`\ +`   cd test`\ +`   trepo init` + +You can get trepo workspace information with \'info\' subcommand. + +`   trepo info -l` + +Output: + +`   tizen repo snapshot version: tizen-unified_20170524.4`\ +`   tizen repo target type: standard`\ +`   tizen repo project names (982 projects):`\ +`     apps/native/bluetooth-share-ui`\ +`     apps/native/boot-animation`\ +`     apps/native/menu-screen`\ +`     apps/native/starter`\ +`     apps/native/thing-toggler`\ +`     apps/native/ug-bluetooth-efl`\ +`     apps/native/ug-mobile-ap`\ +`     apps/native/ug-nfc-efl`\ +`     apps/native/ug-wifi-direct`\ +`     apps/native/ug-wifi-efl`\ +`     apps/native/volume-app`\ +`     apps/web/download-manager`\ +`     platform/adaptation/ap_samsung/libexynos-common`\ +`   ...` + +Example) You can reinitialize your trepo workspace whenever you want. +Let\'s reinitialize trepo workspace based on 20170524.1, includes +\'kernel\' string in project name but do not include \'u-boot\' string. + +`   trepo init -s 20170524.1 -r 'kernel' -i 'u-boot'`\ +`   trepo info -l` + +Outputs: + +`   tizen repo snapshot version: tizen-unified_20170524.1`\ +`   tizen repo target type: standard`\ +`   tizen repo project names (8 projects):`\ +`     platform/kernel/linux-exynos`\ +`     platform/kernel/linux-rpi3`\ +`     profile/common/kernel-common`\ +`     profile/common/platform/kernel/linux-3.10-artik`\ +`     profile/common/platform/kernel/linux-artik7`\ +`     profile/mobile/platform/kernel/linux-3.10-sc7730`\ +`     profile/wearable/platform/kernel/linux-3.18-exynos7270`\ +`     profile/wearable/platform/kernel/linux-3.4-exynos3250` + +You can also initialize your trepo workspace with trepo yaml file. + +Exmple) trepo\_test.yaml + +`   snapshot_version: latest`\ +`   project_names:`\ +`     - platform/core/api/alarm`\ +`     - platform/core/api/app-manager`\ +`     - platform/core/api/application`\ +`     - platform/core/api/asp`\ +`     - platform/core/api/audio-io`\ +`     - platform/core/api/base-utils`\ +`     - platform/core/api/bluetooth`\ +`     - platform/core/api/camera`\ +`     - platform/core/api/common`\ +`     - platform/core/api/connection`\ +`     - platform/core/api/context`\ +`     - platform/core/api/cordova-plugins`\ +`     - platform/core/api/device`\ +`     - platform/core/api/efl-util` + +Initialize trepo workspace with this file + +`   trepo init -f trepo_test.yaml`\ +`   trepo info -l` + +Output: + +`   tizen repo snapshot version: tizen-unified_20170524.4`\ +`   tizen repo target type: standard`\ +`   tizen repo project names (14 projects):`\ +`     platform/core/api/alarm`\ +`     platform/core/api/app-manager`\ +`     platform/core/api/application`\ +`     platform/core/api/asp`\ +`     platform/core/api/audio-io`\ +`     platform/core/api/base-utils`\ +`     platform/core/api/bluetooth`\ +`     platform/core/api/camera`\ +`     platform/core/api/common`\ +`     platform/core/api/connection`\ +`     platform/core/api/context`\ +`     platform/core/api/cordova-plugins`\ +`     platform/core/api/device`\ +`     platform/core/api/efl-util` + +### Sync source codes + +Trepo workspace was initialized but source codes are not cloned. Let\'s +sync source codes with \'sync\' subcommand + +`     trepo sync -f -j 8` + +Output: + +`   Fetching project platform/core/api/alarm`\ +`   Fetching project platform/core/api/audio-io`\ +`   Fetching project platform/core/api/context`\ +`   Fetching project platform/core/api/efl-util`\ +`   Fetching project platform/core/api/app-manager`\ +`   Fetching project platform/core/api/base-utils`\ +`   Fetching project platform/core/api/connection`\ +`   Fetching project platform/core/api/asp`\ +`   remote: Counting objects: 84, done`\ +`   remote: Counting objects: 45, done`\ +`   remote: Finding sources: 100% (25/25)`\ +`   remote: Finding sources: 100% (84/84)`\ +`   ....`\ +`    * [new tag]         submit/tizen_wearable/20160325.075408 -> submit/tizen_wearable/20160325.075408`\ +`    * [new tag]         submit/tizen_wearable/20160328.061957 -> submit/tizen_wearable/20160328.061957`\ +`    * [new tag]         tizen_3.0.2014.q3_common_release -> tizen_3.0.2014.q3_common_release`\ +`    * [new tag]         tizen_3.0.m14.2_ivi_release -> tizen_3.0.m14.2_ivi_release`\ +`    * [new tag]         tizen_3.0.m14.3_ivi_release -> tizen_3.0.m14.3_ivi_release`\ +`    * [new tag]         tizen_3.0.m1_mobile_release -> tizen_3.0.m1_mobile_release`\ +`    * [new tag]         tizen_3.0.m1_tv_release -> tizen_3.0.m1_tv_release`\ +`    * [new tag]         tizen_3.0.m2.a1_mobile_release -> tizen_3.0.m2.a1_mobile_release`\ +`    * [new tag]         tizen_3.0.m2.a1_tv_release -> tizen_3.0.m2.a1_tv_release`\ +`    * [new tag]         tizen_3.0_ivi_release -> tizen_3.0_ivi_release`\ +`   Fetching projects: 100% (14/14), done.` + +You can figure out that platform source codes are synced. + +`   tree -d`\ +`   .`\ +`   ├── platform`\ +`   │   └── core`\ +`   │       └── api`\ +`   │           ├── alarm`\ +`   │           │   ├── capi-appfw-alarm.pc.in`\ +`   │           │   ├── CMakeLists.txt`\ +`   │           │   ├── doc`\ +`   │           │   │   └── appfw_alarm_doc.h`\ +`   │           │   ├── include`\ +`   │           │   │   ├── app_alarm_extension.h`\ +`   │           │   │   └── app_alarm.h`\ +`   │           │   ├── LICENSE`\ +`   │           │   ├── packaging`\ +`   │           │   │   ├── capi-appfw-alarm.manifest`\ +`   │           │   │   └── capi-appfw-alarm.spec`\ +`   │           │   └── src`\ +`   │           │       └── alarm.c`\ +`   │           ├── application`\ +`   │           │   ├── app_common`\ +`   │           │   │   ├── app_error.c`\ +`   │           │   │   ├── app_event.c`\ +`   │           │   │   ├── app_finalizer.c`\ +`   │           │   │   ├── app_package.c`\ +`   │           │   │   ├── app_path.c`\ +`   │           │   │   ├── app_resource_manager.c`\ +`   │           │   │   └── CMakeLists.txt`\ +`   │           │   ├── app_control`\ +`   │           │   │   ├── app_control.c`\ +`   │           │   │   └── CMakeLists.txt`\ +`   │           │   ├── AUTHORS`\ +`   │           │   ├── capi-appfw-module.pc.in`\ +`   │           │   ├── CMakeLists.txt`\ +`   │           │   ├── doc`\ +`   │           │   │   ├── appfw_app_common_doc.h`\ +`   │           │   │   ├── appfw_app_control_doc.h`\ +`   │           │   │   ├── appfw_app_doc.h`\ +`   │           │   │   ├── appfw_event_doc.h`\ +`   │           │   │   ├── appfw_i18n_doc.h`\ +`   │           │   │   ├── appfw_preference_doc.h`\ +`   │           │   │   ├── appfw_resource_manager_doc.h`\ +`   │           │   │   └── images`\ +`   │           │   │       ├── capi_appfw_application_lifecycle.png`\ +`   │           │   │       ├── capi_appfw_application_package.png`\ +`   │           │   │       ├── capi_appfw_application_resource.png`\ +`   │           │   │       └── capi_appfw_application_states.png`\ +`   ....` + +And this sync command generate a proper .gbs.conf file, too. You can +build tizen plaform source code with gbs without gbs.conf configuration +manually. + +`   cat .gbs.conf` + +Output: + +`   [general]`\ +`   #Current profile name which should match a profile section name`\ +`   profile = profile.standard`\ +`   ########################### PROFILES ############################`\ +`   [profile.standard]`\ +`   repos = repo.base-arm, repo.base-arm-debug, repo.base-arm64, repo.base-arm64-debug, repo.base-ia32, repo.base-ia32-  debug, repo.base-x86_64, repo.base-x86_64-debug, repo.unified-standard`\ +`   [profile.emulator]`\ +`   repos = repo.base-ia32, repo.base-ia32-debug, repo.base-x86_64, repo.baes-x86_64-debug, repo.unified-emulator`\ +`   ########################### REPO ADDRESSES ############################`\ +`   [repo.base-arm]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm/packages/)\ +`   [repo.base-arm64]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm64/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm64/packages/)\ +`   [repo.base-ia32]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/ia32/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/ia32/packages/)\ +`   [repo.base-x86_64]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/x86_64/packages/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/x86_64/packages/)\ +`   [repo.base-arm-debug]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm/debug/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm/debug/)\ +`   [repo.base-arm64-debug]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm64/debug/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/arm64/debug/)\ +`   [repo.base-ia32-debug]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/ia32/debug/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/ia32/debug/)\ +`   [repo.base-x86_64-debug]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/x86_64/debug/`](http://download.tizen.org/snapshots/tizen/base/tizen-base_20170520.1/repos/x86_64/debug/)\ +`   [repo.unified-standard]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/unified/tizen-unified_20170524.4/repos/standard/packages/`](http://download.tizen.org/snapshots/tizen/unified/tizen-unified_20170524.4/repos/standard/packages/)\ +`   [repo.unified-emulator]`\ +`   url=`[`http://download.tizen.org/snapshots/tizen/unified/tizen-unified_20170524.4/repos/emulator/packages/`](http://download.tizen.org/snapshots/tizen/unified/tizen-unified_20170524.4/repos/emulator/packages/) + +You can build these source codes with gbs now. + +`   gbs build -A armv7l --threads=4` + +Please refer to <https://wiki.tizen.org/GBS> if you want to know more +detail aboug gbs. + +### Show the working tree status + +You can see the working tree status with subcommand \'status\' + +`   trepo status` + +Output: + +`   project platform/core/api/alarm/                branch tizen-unified_20170524.4`\ +`   project platform/core/api/app-manager/          branch tizen-unified_20170524.4`\ +`   project platform/core/api/asp/                  branch tizen-unified_20170524.4`\ +`   project platform/core/api/application/          branch tizen-unified_20170524.4`\ +`   project platform/core/api/audio-io/             branch tizen-unified_20170524.4`\ +`   project platform/core/api/base-utils/           branch tizen-unified_20170524.4`\ +`   project platform/core/api/camera/               branch tizen-unified_20170524.4`\ +`   project platform/core/api/bluetooth/            branch tizen-unified_20170524.4`\ +`   project platform/core/api/common/               branch tizen-unified_20170524.4`\ +`   project platform/core/api/connection/           branch tizen-unified_20170524.4`\ +`   project platform/core/api/context/              branch tizen-unified_20170524.4`\ +`   project platform/core/api/device/               branch tizen-unified_20170524.4`\ +`   project platform/core/api/cordova-plugins/      branch tizen-unified_20170524.4`\ +`   project platform/core/api/efl-util/             branch tizen-unified_20170524.4` + +This show you current branch name and changes not staged for commit. For +example, if you modify file platform/core/api/device/NOTICE then \'trepo +status\' show you unstaged file name. + +`   project platform/core/api/alarm/                branch tizen-unified_20170524.4`\ +`   project platform/core/api/app-manager/          branch tizen-unified_20170524.4`\ +`   project platform/core/api/asp/                  branch tizen-unified_20170524.4`\ +`   project platform/core/api/application/          branch tizen-unified_20170524.4`\ +`   project platform/core/api/audio-io/             branch tizen-unified_20170524.4`\ +`   project platform/core/api/base-utils/           branch tizen-unified_20170524.4`\ +`   project platform/core/api/bluetooth/            branch tizen-unified_20170524.4`\ +`   project platform/core/api/camera/               branch tizen-unified_20170524.4`\ +`   project platform/core/api/common/               branch tizen-unified_20170524.4`\ +`   project platform/core/api/connection/           branch tizen-unified_20170524.4`\ +`   project platform/core/api/context/              branch tizen-unified_20170524.4`\ +`   project platform/core/api/device/               branch tizen-unified_20170524.4`\ +`    -m     NOTICE`\ +`   project platform/core/api/cordova-plugins/      branch tizen-unified_20170524.4`\ +`   project platform/core/api/efl-util/             branch tizen-unified_20170524.4` + +### Export trepo yaml + +You can export trepo yaml to reuse it on another directory or host. + +`   trepo export` + +default yaml file name is \'default.yml\' + +`   cat default.yml` + +Output: + +`   project_names:`\ +`    - platform/core/api/alarm`\ +`    - platform/core/api/app-manager`\ +`    - platform/core/api/application`\ +`    - platform/core/api/asp`\ +`    - platform/core/api/audio-io`\ +`    - platform/core/api/base-utils`\ +`    - platform/core/api/bluetooth`\ +`    - platform/core/api/camera`\ +`    - platform/core/api/common`\ +`    - platform/core/api/connection`\ +`    - platform/core/api/context`\ +`    - platform/core/api/cordova-plugins`\ +`    - platform/core/api/device`\ +`    - platform/core/api/efl-util`\ +`   snapshot_version: '20170524.4'`\ +`   target_type: standard` + +### More options + +`   trepo -h` + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Understanding_MIC.md b/docs/platform/tool/Understanding_MIC.md new file mode 100644 index 0000000000..199acc25b2 --- /dev/null +++ b/docs/platform/tool/Understanding_MIC.md @@ -0,0 +1,917 @@ +Build Your Own Linux Distro +=========================== + +- LFS + +<http://www.linuxfromscratch.org/lfs/> + +- Remastersys + +<https://www.maketecheasier.com/backup-ubuntu-with-remastersys> + +- Linux Live Kit + +<http://www.linux-live.org/> + +- Live-Magic + +<apt:live-magic> + +- Revisor + +<https://fedoraproject.org/wiki/JeroenVanMeeuwen/Revisor> +<http://pykickstart.readthedocs.io/en/latest/> yum install +system-config-kickstart livecd-creator + +- Instalinux.com + +<http://www.instalinux.com/> + +- SUSE Studio + +<https://susestudio.com/> + +Reference +========= + +- <https://source.tizen.org/documentation/reference/mic-image-creator> +- <https://source.tizen.org/documentation/developer-guide/getting-started-guide/creating-tizen-images-mic> +- <https://wiki.tizen.org/wiki/Mic-guide> +- <https://wiki.tizen.org/wiki/Build_Tizen_in_a_private_OBS#Build_your_image> +- <https://github.com/01org/mic/releases> +- <https://www.slideshare.net/again4you/tizen-talk-2016-in-seoul> + +MIC file tree +============= + + invain@ubuntu:/work/infra/mic.git$ tree + . + ├── AUTHORS + ├── COPYING + ├── ChangeLog + ├── Makefile + ├── README.rst + ├── debian + │   ├── changelog + │   ├── compat + │   ├── control + │   ├── copyright + │   ├── docs + │   ├── mic.install + │   └── rules + ├── doc + │   ├── FAQ.rst + │   ├── KNOWN_ISSUES + │   ├── RELEASE_NOTES + │   ├── install.rst + │   ├── man.rst + │   └── usage.rst + ├── etc + │   ├── bash_completion.d + │   │   └── mic.sh + │   ├── mic.conf.in + │   └── zsh_completion.d + │   └── _mic + ├── html + │   ├── arrowdown.png + │   ├── arrowright.png + │   ├── bc_s.png + │   ├── bdwn.png + │   ├── closed.png + │   ├── doc.png + │   ├── doxygen.css + │   ├── doxygen.png + │   ├── dynsections.js + │   ├── files.html + │   ├── folderclosed.png + │   ├── folderopen.png + │   ├── graph_legend.html + │   ├── graph_legend.md5 + │   ├── graph_legend.png + │   ├── index.html + │   ├── jquery.js + │   ├── namespacemembers.html + │   ├── namespacemembers_func.html + │   ├── namespacemembers_vars.html + │   ├── namespaces.html + │   ├── namespacesetup.html + │   ├── nav_f.png + │   ├── nav_g.png + │   ├── nav_h.png + │   ├── open.png + │   ├── search + │   │   ├── all_0.html + │   │   ├── all_0.js + │   │   ├── all_1.html + │   │   ├── all_1.js + │   │   ├── all_2.html + │   │   ├── all_2.js + │   │   ├── all_3.html + │   │   ├── all_3.js + │   │   ├── all_4.html + │   │   ├── all_4.js + │   │   ├── all_5.html + │   │   ├── all_5.js + │   │   ├── all_6.html + │   │   ├── all_6.js + │   │   ├── all_7.html + │   │   ├── all_7.js + │   │   ├── all_8.html + │   │   ├── all_8.js + │   │   ├── all_9.html + │   │   ├── all_9.js + │   │   ├── all_a.html + │   │   ├── all_a.js + │   │   ├── all_b.html + │   │   ├── all_b.js + │   │   ├── close.png + │   │   ├── files_0.html + │   │   ├── files_0.js + │   │   ├── functions_0.html + │   │   ├── functions_0.js + │   │   ├── mag_sel.png + │   │   ├── namespaces_0.html + │   │   ├── namespaces_0.js + │   │   ├── nomatches.html + │   │   ├── search.css + │   │   ├── search.js + │   │   ├── search_l.png + │   │   ├── search_m.png + │   │   ├── search_r.png + │   │   ├── searchdata.js + │   │   ├── variables_0.html + │   │   ├── variables_0.js + │   │   ├── variables_1.html + │   │   ├── variables_1.js + │   │   ├── variables_2.html + │   │   ├── variables_2.js + │   │   ├── variables_3.html + │   │   ├── variables_3.js + │   │   ├── variables_4.html + │   │   ├── variables_4.js + │   │   ├── variables_5.html + │   │   ├── variables_5.js + │   │   ├── variables_6.html + │   │   ├── variables_6.js + │   │   ├── variables_7.html + │   │   ├── variables_7.js + │   │   ├── variables_8.html + │   │   ├── variables_8.js + │   │   ├── variables_9.html + │   │   ├── variables_9.js + │   │   ├── variables_a.html + │   │   ├── variables_a.js + │   │   ├── variables_b.html + │   │   └── variables_b.js + │   ├── setup_8py.html + │   ├── splitbar.png + │   ├── sync_off.png + │   ├── sync_on.png + │   ├── tab_a.png + │   ├── tab_b.png + │   ├── tab_h.png + │   ├── tab_s.png + │   └── tabs.css + ├── latex + │   ├── Makefile + │   ├── doxygen.sty + │   ├── files.tex + │   ├── namespaces.tex + │   ├── namespacesetup.tex + │   ├── refman.tex + │   └── setup_8py.tex + ├── mic + │   ├── 3rdparty + │   │   └── pykickstart + │   │   ├── __init__.py + │   │   ├── __init__.pyc + │   │   ├── base.py + │   │   ├── base.pyc + │   │   ├── commands + │   │   │   ├── __init__.py + │   │   │   ├── __init__.pyc + │   │   │   ├── authconfig.py + │   │   │   ├── authconfig.pyc + │   │   │   ├── autopart.py + │   │   │   ├── autopart.pyc + │   │   │   ├── autostep.py + │   │   │   ├── autostep.pyc + │   │   │   ├── bootloader.py + │   │   │   ├── bootloader.pyc + │   │   │   ├── clearpart.py + │   │   │   ├── clearpart.pyc + │   │   │   ├── device.py + │   │   │   ├── device.pyc + │   │   │   ├── deviceprobe.py + │   │   │   ├── deviceprobe.pyc + │   │   │   ├── displaymode.py + │   │   │   ├── displaymode.pyc + │   │   │   ├── dmraid.py + │   │   │   ├── dmraid.pyc + │   │   │   ├── driverdisk.py + │   │   │   ├── driverdisk.pyc + │   │   │   ├── fcoe.py + │   │   │   ├── fcoe.pyc + │   │   │   ├── firewall.py + │   │   │   ├── firewall.pyc + │   │   │   ├── firstboot.py + │   │   │   ├── firstboot.pyc + │   │   │   ├── group.py + │   │   │   ├── group.pyc + │   │   │   ├── ignoredisk.py + │   │   │   ├── ignoredisk.pyc + │   │   │   ├── interactive.py + │   │   │   ├── interactive.pyc + │   │   │   ├── iscsi.py + │   │   │   ├── iscsi.pyc + │   │   │   ├── iscsiname.py + │   │   │   ├── iscsiname.pyc + │   │   │   ├── key.py + │   │   │   ├── key.pyc + │   │   │   ├── keyboard.py + │   │   │   ├── keyboard.pyc + │   │   │   ├── lang.py + │   │   │   ├── lang.pyc + │   │   │   ├── langsupport.py + │   │   │   ├── langsupport.pyc + │   │   │   ├── lilocheck.py + │   │   │   ├── lilocheck.pyc + │   │   │   ├── logging.py + │   │   │   ├── logging.pyc + │   │   │   ├── logvol.py + │   │   │   ├── logvol.pyc + │   │   │   ├── mediacheck.py + │   │   │   ├── mediacheck.pyc + │   │   │   ├── method.py + │   │   │   ├── method.pyc + │   │   │   ├── monitor.py + │   │   │   ├── monitor.pyc + │   │   │   ├── mouse.py + │   │   │   ├── mouse.pyc + │   │   │   ├── multipath.py + │   │   │   ├── multipath.pyc + │   │   │   ├── network.py + │   │   │   ├── network.pyc + │   │   │   ├── partition.py + │   │   │   ├── partition.pyc + │   │   │   ├── raid.py + │   │   │   ├── raid.pyc + │   │   │   ├── reboot.py + │   │   │   ├── reboot.pyc + │   │   │   ├── repo.py + │   │   │   ├── repo.pyc + │   │   │   ├── rescue.py + │   │   │   ├── rescue.pyc + │   │   │   ├── rootpw.py + │   │   │   ├── rootpw.pyc + │   │   │   ├── selinux.py + │   │   │   ├── selinux.pyc + │   │   │   ├── services.py + │   │   │   ├── services.pyc + │   │   │   ├── skipx.py + │   │   │   ├── skipx.pyc + │   │   │   ├── sshpw.py + │   │   │   ├── sshpw.pyc + │   │   │   ├── timezone.py + │   │   │   ├── timezone.pyc + │   │   │   ├── updates.py + │   │   │   ├── updates.pyc + │   │   │   ├── upgrade.py + │   │   │   ├── upgrade.pyc + │   │   │   ├── user.py + │   │   │   ├── user.pyc + │   │   │   ├── vnc.py + │   │   │   ├── vnc.pyc + │   │   │   ├── volgroup.py + │   │   │   ├── volgroup.pyc + │   │   │   ├── xconfig.py + │   │   │   ├── xconfig.pyc + │   │   │   ├── zerombr.py + │   │   │   ├── zerombr.pyc + │   │   │   ├── zfcp.py + │   │   │   └── zfcp.pyc + │   │   ├── constants.py + │   │   ├── constants.pyc + │   │   ├── errors.py + │   │   ├── errors.pyc + │   │   ├── handlers + │   │   │   ├── __init__.py + │   │   │   ├── __init__.pyc + │   │   │   ├── control.py + │   │   │   ├── control.pyc + │   │   │   ├── f10.py + │   │   │   ├── f11.py + │   │   │   ├── f12.py + │   │   │   ├── f13.py + │   │   │   ├── f14.py + │   │   │   ├── f15.py + │   │   │   ├── f16.py + │   │   │   ├── f7.py + │   │   │   ├── f8.py + │   │   │   ├── f9.py + │   │   │   ├── fc3.py + │   │   │   ├── fc4.py + │   │   │   ├── fc5.py + │   │   │   ├── fc6.py + │   │   │   ├── rhel3.py + │   │   │   ├── rhel4.py + │   │   │   ├── rhel5.py + │   │   │   └── rhel6.py + │   │   ├── ko.py + │   │   ├── ko.pyc + │   │   ├── options.py + │   │   ├── options.pyc + │   │   ├── parser.py + │   │   ├── parser.pyc + │   │   ├── sections.py + │   │   ├── sections.pyc + │   │   ├── urlgrabber + │   │   │   ├── __init__.py + │   │   │   ├── __init__.pyc + │   │   │   ├── byterange.py + │   │   │   ├── byterange.pyc + │   │   │   ├── grabber.py + │   │   │   ├── grabber.pyc + │   │   │   ├── keepalive.py + │   │   │   ├── keepalive.pyc + │   │   │   ├── mirror.py + │   │   │   ├── progress.py + │   │   │   ├── sslfactory.py + │   │   │   └── sslfactory.pyc + │   │   ├── version.py + │   │   └── version.pyc + │   ├── __init__.py + │   ├── __init__.pyc + │   ├── archive.py + │   ├── bootstrap.py + │   ├── chroot.py + │   ├── cmd_chroot.py + │   ├── cmd_create.py + │   ├── conf.py + │   ├── conf.pyc + │   ├── helpformat.py + │   ├── imager + │   │   ├── __init__.py + │   │   ├── baseimager.py + │   │   ├── fs.py + │   │   ├── loop.py + │   │   └── raw.py + │   ├── kickstart + │   │   ├── __init__.py + │   │   ├── __init__.pyc + │   │   └── custom_commands + │   │   ├── __init__.py + │   │   ├── __init__.pyc + │   │   ├── desktop.py + │   │   ├── desktop.pyc + │   │   ├── installerfw.py + │   │   ├── installerfw.pyc + │   │   ├── micboot.py + │   │   ├── micboot.pyc + │   │   ├── micrepo.py + │   │   ├── micrepo.pyc + │   │   ├── partition.py + │   │   └── partition.pyc + │   ├── msger.py + │   ├── msger.pyc + │   ├── plugin.py + │   ├── pluginbase.py + │   ├── rt_util.py + │   └── utils + │   ├── __init__.py + │   ├── __init__.pyc + │   ├── errors.py + │   ├── errors.pyc + │   ├── fs_related.py + │   ├── fs_related.pyc + │   ├── gpt_parser.py + │   ├── gpt_parser.pyc + │   ├── grabber.py + │   ├── grabber.pyc + │   ├── lock.py + │   ├── lock.pyc + │   ├── misc.py + │   ├── misc.pyc + │   ├── partitionedfs.py + │   ├── proxy.py + │   ├── proxy.pyc + │   ├── rpmmisc.py + │   ├── rpmmisc.pyc + │   ├── runner.py + │   ├── runner.pyc + │   ├── safeurl.py + │   └── safeurl.pyc + ├── packaging + │   ├── mic.changes + │   ├── mic.manifest + │   └── mic.spec + ├── plugins + │   ├── backend + │   │   ├── yumpkgmgr.py + │   │   └── zypppkgmgr.py + │   ├── hook + │   │   └── empty_hook.py + │   └── imager + │   ├── fs_plugin.py + │   ├── loop_plugin.py + │   ├── qcow_plugin.py + │   └── raw_plugin.py + ├── setup.py + ├── tests + │   ├── baseimgr_fixtures + │   │   ├── i586 + │   │   │   ├── A-0.1-1.i586.rpm + │   │   │   ├── ABC-0.1-1.i586.rpm + │   │   │   ├── B-0.1-1.i586.rpm + │   │   │   ├── D-0.1-1.i586.rpm + │   │   │   ├── E-0.1-1.i586.rpm + │   │   │   └── G-0.1-1.i586.rpm + │   │   ├── i686 + │   │   │   └── C-0.2-1.i686.rpm + │   │   ├── localpkgs + │   │   │   ├── H-0.2-1.armv7hl.rpm + │   │   │   └── H-0.2-1.i586.rpm + │   │   ├── noarch + │   │   │   ├── F-0.1-1.noarch.rpm + │   │   │   └── H-0.1-1.noarch.rpm + │   │   ├── repodata + │   │   │   ├── 4bb63d1039a6f0d3fd1e7035acff76e7015963cabab2751263c7a20f4ff1c668-group.xml.gz + │   │   │   ├── ea95ecaccf9abc214715b1724188a3ecfcae1eb9b7855127938b39de83fbc303-patterns.xml.gz + │   │   │   ├── filelists.xml.gz + │   │   │   ├── other.xml.gz + │   │   │   ├── primary.xml.gz + │   │   │   └── repomd.xml + │   │   └── test.ks + │   ├── chroot_fixtures + │   │   └── minchroot.tar.gz + │   ├── configmgr_fixtures + │   │   ├── mic.conf + │   │   ├── packages + │   │   │   ├── repodata + │   │   │   │   ├── filelists.sqlite.bz2 + │   │   │   │   ├── filelists.xml.gz + │   │   │   │   ├── other.sqlite.bz2 + │   │   │   │   ├── other.xml.gz + │   │   │   │   ├── primary.sqlite.bz2 + │   │   │   │   ├── primary.xml.gz + │   │   │   │   └── repomd.xml + │   │   │   └── test-0-1.i686.rpm + │   │   └── test.ks + │   ├── pluginmgr_fixtures + │   │   ├── backend + │   │   │   ├── yumtest.py + │   │   │   └── zypptest.py + │   │   └── imager + │   │   ├── fs_test.py + │   │   └── loop_test.py + │   ├── suite.py + │   ├── test_archive.py + │   ├── test_baseimager.py + │   ├── test_chroot.py + │   ├── test_configmgr.py + │   ├── test_pluginmgr.py + │   ├── test_proxy.py + │   └── test_runner.py + └── tools + └── mic + + 38 directories, 390 files + invain@ubuntu:/work/infra/mic.git$ + +Example of MIC configuration file +================================= + + + # -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*- + + # + # Do not Edit! Generated by: + # kickstarter.py + # + + lang en_US.UTF-8 + keyboard us + timezone --utc Asia/Seoul + part / --size=2000 --ondisk mmcblk0p --fstype=ext4 --label=rootfs --extoptions="-J size=16" + part /opt/ --size=1000 --ondisk mmcblk0p --fstype=ext4 --label=system-data --extoptions="-m 0" + part /boot/kernel/mod_tizen_tm1/lib/modules --size=12 --ondisk mmcblk0p --fstype=ext4 --label=modules + rootpw tizen + xconfig --startxonboot + bootloader --timeout=3 --append="rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0" --ptable=gpt --menus="install:Wipe and Install:systemd.unit=system-installer.service:test" + + desktop --autologinuser=root + user --name root --groups audio,video --password 'tizen' + + + repo --name=mobile-target-TM1 --baseurl=http://download.tizen.org/snapshots/tizen/mobile/tizen-mobile_20170323.3/repos/target-TM1/packages/ --ssl_verify=no + repo --name=base_arm --baseurl=http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/ --ssl_verify=no + + %packages + + # @ Mobile Headless + bash + coreutils + dbus + dlogutil + e2fsprogs + filesystem + fsck-msdos + grep + gzip + kmod + kmod-compat + libdlog + net-tools + newfs-msdos + pam + pam-modules-extra + procps + psmisc + rpm + rpm-security-plugin + sdbd + setup + shadow-utils-adm + system-plugin-headless + systemd + tar + tizen-release + unzip + util-linux + wpa_supplicant + xz + zip + # @ Mobile Headless Adaptation TM1 + linux-3.10-sc7730_tizen_tm1 + model-config-tm1 + system-plugin-spreadtrum + # Others + + + + + %end + + + %attachment + /boot/kernel/dzImage + %end + + %post + #!/bin/sh + echo "#################### generic-base.post ####################" + + test ! -e /opt/var && mkdir -p /opt/var + test -d /var && cp -arf /var/* /opt/var/ + rm -rf /var + ln -snf opt/var /var + + test ! -e /opt/usr/home && mkdir -p /opt/usr/home + test -d /home && cp -arf /home/* /opt/usr/home/ + rm -rf /home + ln -snf opt/usr/home /home + + build_ts=$(date -u +%s) + build_date=$(date -u --date @$build_ts +%Y%m%d_%H%M%S) + build_time=$(date -u --date @$build_ts +%H:%M:%S) + + sed -ri \ + -e 's|@BUILD_ID[@]|tizen-mobile_20170323.3|g' \ + -e "s|@BUILD_DATE[@]|$build_date|g" \ + -e "s|@BUILD_TIME[@]|$build_time|g" \ + -e "s|@BUILD_TS[@]|$build_ts|g" \ + /etc/tizen-build.conf + + # setup systemd default target for user session + cat <<'EOF' >>/usr/lib/systemd/user/default.target + [Unit] + Description=User session default target + EOF + mkdir -p /usr/lib/systemd/user/default.target.wants + + # sdx: fix smack labels on /var/log + chsmack -a '*' /var/log + + # create appfw dirs inside homes + function generic_base_user_exists() { + user=$1 + getent passwd | grep -q ^${user}: + } + + function generic_base_user_home() { + user=$1 + getent passwd | grep ^${user}: | cut -f6 -d':' + } + + function generic_base_fix_user_homedir() { + user=$1 + generic_base_user_exists $user || return 1 + + homedir=$(generic_base_user_home $user) + mkdir -p $homedir/apps_rw + for appdir in desktop manifest dbspace; do + mkdir -p $homedir/.applications/$appdir + done + find $homedir -type d -exec chsmack -a User {} \; + chown -R $user:users $homedir + return 0 + } + + # fix TC-320 for SDK + . /etc/tizen-build.conf + [ "${TZ_BUILD_WITH_EMULATOR}" == "1" ] && generic_base_fix_user_homedir developer + + # Add info.ini for system-info CAPI (TC-2047) + /etc/make_info_file.sh + + #!/bin/sh + echo "############### mobile-base.post ################" + + ######### multiuser mode: create additional users and fix their homedirs + + if ! generic_base_user_exists owner; then + gum-utils --offline --add-user --username=owner --usertype=admin --usecret=tizen + fi + + + #!/bin/sh + echo "#################### generic-console-tools.post ####################" + + # customize bash prompt + cat >/etc/profile.d/bash_prompt_custom.sh <<'EOF' + if [ "$PS1" ]; then + + function proml { + # set a fancy prompt (overwrite the one in /etc/profile) + local default="\[\e[0m\]" + local usercol='\[\e[1;34m\]' # blue + local hostcol='\[\e[1;32m\]' # green + local pathcol='\[\e[1;33m\]' # yellow + local gitcol='\[\e[1;31m\]' # light red + local termcmd='' + local _p="$"; + + if [ "`id -u`" -eq 0 ]; then + usercol='\[\e[1;31m\]' + _p="#" + fi + + PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}" + } + + proml + + function rcd () { + [ "${1:0:1}" == "/" ] && { cd $1; } || { cd $(pwd -P)/$1; } + } + + alias ll="ls -lZ" + alias lr="ls -ltrZ" + alias la="ls -alZ" + + function get_manifest () { + rpm -qa --queryformat="%{name} %{Version} %{Release} %{VCS}\n" | sort + } + fi + EOF + + + #!/bin/sh + echo "############### mobile-packaging.post ################" + + # generate repo files for zypper + function genrepo() { + local url=$1 + local reponame=$2 + local filename=${3:-$2} + local enabled=${4:-0} + + local prefix=${TZ_BUILD_VENDOR}-${TZ_BUILD_PROFILE}-${TZ_BUILD_REPO} + + # remove double slashes if any + url=$(sed -e 's|/\+|/|g' -e 's|:/|://|' <<<$url) + + cat >> /etc/zypp/repos.d/$prefix-${filename}.repo << EOF + [$prefix-${reponame}] + name=$prefix-${reponame} + enabled=$enabled + autorefresh=0 + baseurl=${url}?ssl_verify=no + type=rpm-md + gpgcheck=0 + + EOF + } + + # source /etc/tizen-build.conf to get more infos about project, repos etc. + . /etc/tizen-build.conf + + # adjust build_id if this scripts executes before the replacement in /etc/tizen-build.conf + TZ_BUILD_ID=$(echo $TZ_BUILD_ID | sed 's|@BUILD_ID[@]|tizen-mobile_20170323.3|') + + # snapshot repo + genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/packages snapshot snapshot 1 + genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/debug snapshot-debug snapshot 1 + + # latest repo + genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/packages update update 0 + genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/debug update-debug update 0 + + # daily repo + genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/packages daily daily 0 + genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/debug daily-debug daily 0 + + # weekly repo + genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/packages weekly weekly 0 + genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/debug weekly-debug weekly 0 + + + #!/bin/sh + echo "#################### generic-adaptation.post ####################" + + # fix TIVI-2291 + sed -ri "s/(^blacklist i8042.*$)/#fix from base-general.post \1/" /etc/modprobe.d/blacklist.conf + + + #!/bin/sh + echo "############### mobile-adaptation.post ################" + + + #!/bin/sh + echo "############### mobile-middleware.post ################" + + + #!/bin/sh + echo "#################### generic-multimedia.post ####################" + + + #!/bin/sh + echo "#################### generic-desktop-applications.post ####################" + + # depends on generic-base functions + function generic_desktop_applications_fix_userhome() { + user=$1 + + generic_base_user_exists $user || return 1 + homedir=$(generic_base_user_home $user) + + echo "Fix app_info.db of $user" + chown -R $user:users $homedir/.applications/dbspace/ + } + + # fix TC-320 for SDK + . /etc/tizen-build.conf + [ "${TZ_BUILD_WITH_EMULATOR}" == "1" ] && generic_desktop_applications_fix_userhome developer + + + #!/bin/sh + echo "#################### generic-crosswalk.post ####################" + + + #!/bin/sh + echo "############### mobile-web-framework.post ################" + + # start wrt widgets preinstall + prepare_widgets.sh + + + #!/bin/sh + echo "#################### mobile-bluetooth.post ####################" + + + #!/bin/sh + echo "############### mobile-user.post ################" + + #for user in alice bob carol guest; do + # if ! generic_base_user_exists $user; then + # gum-utils --offline --add-user --username="$user" --usertype=normal --usecret=tizen + # fi + #done + + + #!/bin/sh + echo "############### mobile-license.post ################" + + LICENSE_DIR=/usr/share/licenses + LICENSE_FILE=/usr/share/license.html + MD5_TEMP_FILE=/usr/share/temp_license_md5 + + if [[ -f $LICENSE_FILE ]]; then + rm -f $LICENSE_FILE + fi + + if [[ -f $MD5_TEMP_FILE ]]; then + rm -f $MD5_TEMP_FILE + fi + + + cd $LICENSE_DIR + LICENSE_LIST=`ls */*` + + for INPUT in $LICENSE_LIST; do + if [[ -f $INPUT ]]; then + PKG_NAME=`echo $INPUT|cut -d'/' -f1` + echo `md5sum $INPUT` $PKG_NAME >> $MD5_TEMP_FILE + fi + done + + MD5_LIST=`cat $MD5_TEMP_FILE|awk '{print $1}'|sort -u` + + echo "<html>" >> $LICENSE_FILE + echo "<head>" >> $LICENSE_FILE + echo "<meta name=\"viewport\" content=\"initial-scale=1.0\">" >> $LICENSE_FILE + echo "</head>" >> $LICENSE_FILE + echo "<body>" >> $LICENSE_FILE + echo "<xmp>" >> $LICENSE_FILE + + for INPUT in $MD5_LIST; do + PKG_LIST=`cat $MD5_TEMP_FILE|grep $INPUT|awk '{print $3}'` + FILE_LIST=`cat $MD5_TEMP_FILE|grep $INPUT|awk '{print $2}'` + PKG_FILE=`echo $FILE_LIST |awk '{print $1}'` + + echo "$PKG_LIST :" >> $LICENSE_FILE + cat $PKG_FILE >> $LICENSE_FILE + echo >> $LICENSE_FILE + echo >> $LICENSE_FILE + echo >> $LICENSE_FILE + done + + echo "</xmp>" >> $LICENSE_FILE + echo "</body>" >> $LICENSE_FILE + echo "</html>" >> $LICENSE_FILE + + rm -rf $LICENSE_DIR/* $MD5_TEMP_FILE + + #!/bin/sh + echo "#################### generic-security.post ####################" + + if [ -e /usr/share/security-config/set_capability ]; then + echo 'Give capabilities to daemons via set_capability from security-config package' + /usr/share/security-config/set_capability + fi + + #!/bin/sh + echo "#################### mobile-adaptation-tm1.post ####################" + + # remove exported dzImage and dzImage-recovery + rm -f /boot/kernel/dzImage + rm -f /boot/kernel/dzImage-recovery + + # remove manuals, docs and headers + rm -rf /usr/include + rm -rf /usr/share/man + rm -rf /usr/share/doc + + + + %end + + %post --nochroot + # buildname.nochroot + if [ -n "$IMG_NAME" ]; then + echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release + echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release + fi + + + %end + +How to create your own platform image for yourself +================================================== + + ./run.sh + #!/bin/bash + wget http://download.tizen.org/snapshots/tizen/unified/latest/builddata/images/standard/image-configurations/mobile-headless-tm1.ks + sudo python -m cProfile -o profile8.pstats /usr/bin/mic create loop mobile-headless-tm1.ks -A armv7l -o ./mic-output/mobile-wayland-armv7l-tm1-1 --pack-to=mobile-wayland-armv7l-tm1-1.tar.gz + tree ./mic-output/ + +How to update a package via network with dnf +============================================ + +**Coming Soon. !!!** + + + $ sudo cp /usr/bin/qemu-arm-static /home/invain/tizen-rootfs/usr/bin/ + $ sudo mount -t proc /proc /home/invain/tizen-rootfs/proc + $ sudo mount -o bind /dev/ /home/invain/tizen-rootfs/dev + $ sudo mount -o bind /dev/pts /home/invain/tizen-rootfs/pts + $ sudo mount -t tmpfs shm /home/invain/tizen-rootfs/run/shm + $ sudo mount -o bind /sys /home/invain/tizen-rootfs/sys + $ sudo chroot /home/invain/tizen-rootfs/ (qemu-arm-static) dnf -y install strace + +Analysis +======== + +How to generate callgraph from \*.py file +----------------------------------------- + + $ sudo apt install graphviz gthumb + $ sudo pip install gprof2dot + $ python -m cProfile -o profile.pstats ./mic/utils/partitionedfs.py + $ gprof2dot -f pstats profile.pstats | dot -Tsvg -o ./mic/utils/partitionedfs.svg + $ gthumb ./mic/utils/partitionedfs.png + +Example: ./mic/utils/partitionedfs.svg ![FBS (Skeleton) +Screenshot](Partitionedfs.png "fig:FBS (Skeleton) Screenshot"){width="500"} + +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Updating_packages.md b/docs/platform/tool/Updating_packages.md new file mode 100644 index 0000000000..8b582c5d21 --- /dev/null +++ b/docs/platform/tool/Updating_packages.md @@ -0,0 +1,214 @@ +The purpose of this page is to explain how to +[Maintain](Maintain "wikilink") packages by updating to new versions +according to various situations. + +Chart +===== + +![Updating packages +chart](Updating-packages-medium.png "Updating packages chart") + +Source: +[updating-packages.svg](https://drive.google.com/file/d/0B5ClyE_v6LT1SDAyNF9rckVTMkE/view?usp=sharing) + +Steps +===== + +1. Clone project +---------------- + +`git clone review.tizen.org:`<project> + +2. Use git +---------- + +Add the remote repository: + +`git remote add upstream `<repo-url> + +Fetch the sources: + +`git fetch --all`\ +`git checkout -b upstream-git upstream/master` + +Upload them to tizen : + +`git push origin upstream-git:upstream-git` + +Or + +`git push origin upstream-git:sandbox/$USER/upstream-git` + +Update packaging : + +Add a local .gbs.conf file (if it doesn\'t exist): + + [general] + upstream_branch = upstream-git + upstream_tag = ${upstreamversion} + +This one is assuming tags from upstream are matching version numbers, it +can be adjusted, for example, if the upsteam tag uses the form +\"v<version>\" the .gbs.conf becomes: + + [general] + upstream_branch = upstream-git + upstream_tag = v${upstreamversion} + +Alternatively you can tag the revision you want to use as the base of +the Tizen package (in this case you don\'t need a local .gbs.conf): + +`git tag upstream/`<new-version>` [`<commit>`/`<upstream-tag>`]` + +Rebase the tizen branch atop of the new upstream version; using the +\"-i\" option allows you to ditch non-needed commits: + +`git rebase -i `<new-version> + +Check example : + +<https://review.tizen.org/gerrit/#/c/32102/2> + +You can also insert a \"pseudo meta information\" to mention the +upstream\'s repo in the spec file, for example: + +`#X-Vcs-Url:     `[`git://git.%{name}.org/%{name}`](git://git.%%7Bname%7D.org/%%7Bname%7D) + +(https://review.tizen.org/gerrit/\#/c/29574/1/packaging/rsync.spec) + +Maybe this information could move to a new standardized meta data +file\... + +### Using gitmodules + +Git in git (\~ svn externals) used for common code among projects + +Commit this script in packaging subfolder : + +- <https://gitorious.org/tizen/tizen-helper/raw/master:bin/gitmodules.sh> + +Usage : + +` git rebase -i ${upstream_tag} # ie v1.2.3 keep only changes from tizen branch`\ +` sh packaging/gitmodules.sh `\ +` git commit -sam 'packaging: gitmodules refresh' packaging/*.tar.bz2` + +References : + +- <https://review.tizen.org/gerrit/gitweb?p=platform/upstream/gstreamer-vaapi.git;a=summary> + +See page 29 : + +- <http://www.slideshare.net/rzrfreefr/tizen-upstreamcooptdc2014pcoval#> + p29 + +3. Use tarball +-------------- + +Download the tarball of the version of the package you want to update. + +Import it in the git tree: + +`git checkout `<upstream-branch-name>\ +`gbs import `<tarball> + +Rebase the tizen branch: + +`git checkout tizen`\ +`git rebase upstream/`<version> + +4. Local build & push sandbox +----------------------------- + +**Update the package version in the spec file** + +`grep Version packaging/*.spec` + +**Test your changes locally and make the appropriate changes for the +package to build.** Note that when switching from a tarball source to a +git one, it is generally needed to generate the configure files +(configure, Makefile.in\...) which aren\'t provided in the git (but are +provided in the tarball). The preferred way to generate those files is +to do it in the spec file (for example by replacing \"%configure\" with +\"%reconfigure\" or calling the bootstrap script provided). + +Commit your changes: + +`git commit -as` + +Push your branch in your sandbox: + +`git push origin HEAD:sandbox/`<your-gerrit-id>`/`<remote-branch-name> + +\"<remote-branch-name>\" can be anything you want. + +5. Make corrections +------------------- + +If the packages fails to build in the OBS or break other packages, fix +them (or alert the maintainers of the broken packages to get their +help). + +6. Push (for maintainers) +------------------------- + +Check this page for Maintainer\'s tasks : + +<https://wiki.tizen.org/wiki/Maintain> + +**If the build doesn\'t break anything (this needs to be tested with an +OBS), you can push the changes in the git repository.** + +If the tizen branch wasn\'t using the upstream branch, rename it and +create a new tizen branch : + +`git branch -m tizen previous/tizen`\ +`git checkout -b tizen` + +Push your work: + +`git push -f`\ +`git push --tags` + +Then submit the package to be released in repo using \"gbs sr\": + +`profile=tizen_common`\ +`gbs sr -t ${profile}` + +Extra : make sure you\'re pushing the right tag if not you need to +delete to remote (and local) tag (see hints : +<https://bugs.tizen.org/jira/browse/TC-2015> ) + +FAQ +=== + +What if the package to update needs another package to be updated ? +------------------------------------------------------------------- + +- If no bug report regarding the package to update has been opened, + open one. +- Mark this bug as blocking the update of your package. + +What if the new updated package requires a new dependency ? +----------------------------------------------------------- + +- Open a bug in Jira requesting for this new package to be added to + the Tizen project. Please also specify the version needed. +- Mark this bug as blocking the update of your package. + +What if the updated package breaks a package that depends on it ? +----------------------------------------------------------------- + +- Open a bug in Jira and provides the logs and the sandbox containing + the updated package so anyone can reproduce the error. + +LINKS +===== + +- <http://www.slideshare.net/rzrfreefr/tizen-upstreamcooptdc2014pcoval> +- <https://wiki.tizen.org/wiki/Talk:Packaging/Guidelines> + +[Category:Development](Category:Development "wikilink") +[Category:Platform](Category:Platform "wikilink") +[Category:Platform\_Development](Category:Platform_Development "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/Yocto.md b/docs/platform/tool/Yocto.md new file mode 100644 index 0000000000..06247571af --- /dev/null +++ b/docs/platform/tool/Yocto.md @@ -0,0 +1,55 @@ +Yocto Project can be used to build Tizen [Common](Common "wikilink") and +Tizen:[IVI](IVI "wikilink") check subpages : + +- <https://wiki.tizen.org/wiki/Category:Yocto> + +DEMOS +----- + +Project was presented at various [Events](Events "wikilink"), latest on +is [FOSDEM](FOSDEM "wikilink") 2016 by +[User:Pcoval](User:Pcoval "wikilink") and +[User:Leon](User:Leon "wikilink") + +- <https://fosdem.org/2016/schedule/event/connected_tizen/> +- <http://www.slideshare.net/SamsungOSG/connected-tizen-bringing-tizen-to-your-connected-devices-using-the-yocto-project> +- <https://wiki.iotivity.org/tizen> +- <https://github.com/TizenTeam/meta-yocto-demos> +- <https://notabug.org/tizen/iotivity-example> +- <https://vimeo.com/153263103#connected-tizen-20160131rzr> + +[IoT](IoT "wikilink") demo code is about to be cleaned up\... + +Ask [User:PCoval](User:PCoval "wikilink") and +[User:Leon](User:Leon "wikilink") for support. + +Tizen:IVI +--------- + +Helper script to rebuild image : + +` url=`[`http://github.com/TizenTeam/meta-yocto-demos`](http://github.com/TizenTeam/meta-yocto-demos)\ +` branch=meta/tizen-distro/tizen_ivi`\ +` git clone -b $branch $url`\ +` cd meta-yocto-demos && make` + +For building for [MinnowMax](MinnowMax "wikilink") image just add this +arg : + +` make IMAGE=genericx86-64` + +NOTES +----- + +This page will be used to also list random resources + +How to setup yocto begin a firewall ? + +- <http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#source-mirrors> + +[Category:Yocto](Category:Yocto "wikilink") +[Category:Common](Category:Common "wikilink") +[Category:IVI](Category:IVI "wikilink") +[Category:Development](Category:Development "wikilink") +[Category:Platform](Category:Platform "wikilink") +[Category:Tool](Category:Tool "wikilink") diff --git a/docs/platform/tool/mic-guide.md b/docs/platform/tool/mic-guide.md new file mode 100644 index 0000000000..27d118bfc4 --- /dev/null +++ b/docs/platform/tool/mic-guide.md @@ -0,0 +1,400 @@ +Guide of MIC +------------ + +Overview +-------- + +The documentation is an essential guide of [MIC](MIC "wikilink"), which +is the image creation tool of Tizen OS, and it\'s supposed for people +that would like to study MIC more in principle and technical, if you +want to know the usage of MIC, you can learn it from manual pages and +help messages. + +Description +----------- + +MIC is supposed to create images for Linux distributions, currently +it\'s used for Tizen. The tool offers three major functions: + +\- image creation + +\- image conversion between two different formats + +\- chrooting into an image + +With the MIC tool, users can create different types of images for +different verticals, including live CD images, live USB images, raw +images, loop images, and fs images for chrooting. Also, if users would +like to modify the image directly, they can work in a chroot +environment, based on an existing live image using MIC\'s enhanced +chrooting. Besides, MIC enables transforming an image to another image +format, a very useful function for those sensitive to image format. + +It can also provide plugin mechanism for developers to expand image type +or image options, and even to hook. + +Background +---------- + +MIC is inherited from Meego mic, in Meego Times, they use OpenSUSE Build +System (now named as Open Build System) as infrastructure, the original +OBS integrated with kiwi as image creator, but kiwi is not good for +Meego customers. They borrowed Livecd from Fedora, turned out \'mic\', +say \'Meego Image Creator\'. The original Livecd is only focus on +creating Livecd format image, but \'mic\' extended more image formats, +like loop, raw, etc. Moreover this \'mic\' introduced \'chroot\' for +chrooting images directly, \'convert\' for converting between livecd and +liveusb, between raw and qcow2. + +Coming to Tizen Times, people asked for a better user interface, and a +new designed \'mic\' was turned out with subcommands, plugin system and +improved messages, cleaning up most messes in original \'mic\'. In +Meego/Tizen infrastructure, image creator is integrated in BOSS, which +mainly dispatchs requests to generate repositories and create images. +This BOSS system has been replaced with Jenkins in current Tizen +infrastructure. + +Image Formats +------------- + +As \'mic\' has a long history, so it inherited many image format +support, and they are changing and updating in period. But the basic +usage should be in consistency. + +\- fs: actually it\'s just a chroot directory, most of the time, it\'s +used for chroot + +` and debugging, but it can be also used for 'nfs' booting` + +\- loop: it targets to create an image being able to loop mount, and now +it can + +` create one loop-mountable image for each partition, in Sumsung mobile development,`\ +` these loop-mountable images are usually flashed by 'lthor'` + +\- livecd: it\'s used to create iso format image, it supports hybrid iso +creation and + +` squashfs compression, this format can be used in live booting` + +\- liveusb: it\'s based on livecd format, adapts some specifics for usb +devices, so it + +` targets to live booting by usb devices` + +\- raw: actually it\'s a partitioned image, supports syslinux +bootloader, the original + +` target is booted in a virtual machine, now it's used in Tizen IVI platform` + +\- qcow2: it\'s introduced by QEMU team, and has the largest overhead +when growing the + +` image, now it's used by Tizen Emulator image maintained by Tizen SDK team` + +\- vmdk & vdi: deprecated + +Workflow +-------- + +In simple, mic will require some loop devices for image files, and mount +them to mount point as kickstart file described, they are partitioned +and often with partition table, and each partition is formatted by +\'mkfs\' utilities. Then package manager (current is zypp) installs +packages described in kickstart file to build rootfs, the package +manager zypp is supposed to handle rpm files, retrieving rpm packages +from repositories described in kickstart file. + +When rootfs finished, some configurations will be performed to set up +locale, language, timezone, etc. After that, mic will prepare the final +image, and release the compressed image file to output directory. +Finally, mic will unmount and clean up. + +Say that there are two partitions present at kickstart file, which means +\'boot\' partition is 500MB, and root partition is 3500MB:: + +` lang en_US.UTF-8`\ +` part /boot --size 500 --ondisk sda --fstype=ext2 --active`\ +` part / --size 3500 --ondisk sda --fstype=ext4` + +` %packages`\ +` bash`\ +` gcc`\ +` %end` + +` %post`\ +` rpmdb --initdb`\ +` %end` + +So mic will possibly perform the following steps: + +\- find one loopback device to setup image file of 4000MB:: + +` $ truncate --size=4000M mic.img`\ +` $ losetup /dev/loop0 mic.img` + +\- create two partitions and format the filesystems:: + +` $ parted -s /dev/loop0 unit s mkpart primary ext2 1 1023999  # first partition`\ +` $ parted -s /dev/loop0 unit s mkpart primary ext4 1024000 7167999 # second partition`\ +` $ parted -s /dev/loop0 set 1 boot on # active first partition`\ +` $ kpartx -sa /dev/loop0`\ +` $ mkfs.ext2 -F /dev/mapper/loop0p1 # format first partition`\ +` $ mkfs.ext4 -F /dev/mapper/loop0p1 # format second partition` + +\- mount two partitions to corresponding mountpoints:: + +` $ mount -t ext4 /dev/mapper/loop0p2 /var/tmp/mic/install_root`\ +` $ mount -t ext2 /dev/mapper/loop0p1 /var/tmp/mic/install_root/boot` + +\- install all needed packages to install\_root via backend package +manager:: + +` $ rpm --root=/var/tmp/mic/install_root -p -i bash.rpm gcc.rpm ...` + +\- configure the image like \'lang en\_US.UTF-8\':: + +` $ chroot /var/tmp/mic/install_root sed -i 's/^LANG=.*$/LANG=en_US.UTF-8/' /etc/sysconfig/i18n` + +\- run post script in \'%post\' section:: + +` $ chroot /var/tmp/mic/install_root rpmdb --initdb` + +\- unmount all mountpoints in reverse:: + +` $ umount -l /var/tmp/mic/install_root/boot`\ +` $ umount -l /var/tmp/mic/install_root` + +\- release up all devices in use:: + +` $ kpartx -d /dev/loop0`\ +` $ losetup -d /dev/loop0` + +\- package the image file and publish it to outdir:: + +` $ tar -czvf mic.tar.gz mic.img`\ +` $ mv mic.img /var/tmp/mic/outdir`\ +` $ mv /var/tmp/mic/outdir /home/who/mic-output/image` + +Components & Modules +-------------------- + +The MIC tool is implemented by Python module, and it is designed to be +formed of the following components, like main program, config manager, +plugin manager, etc. + +Main Program +------------ + +Source: tools/mic + +The main program for mic is formed by three subcommands: create, +convert, chroot, they are supposed to be user interfaces. The three +subcommands are using \'cmdln\' module as command line parser. + +Config Manager +-------------- + +Source: mic/conf.py + +It is designed as singleton, the initial configures will be load from +mic config file, which is parsed by \'ConfigParser\' module. If config +file were not found, it will support default values. All values loaded +form config file could be overloaded by the value of the same option +from command line. It is designed to do: + +\- fetch configure information from mic config file + +\- get the value of the options from mic command line + +\- keep the configuration information for other components to query + +Plugin Manager +-------------- + +Source: mic/plugin.py + +It is also designed as singleton, it will load all found plugins, which +will be running according to the value of specified options from config +manager. The default directory of plugins is \'/usr/lib/mic/plugins\'. + +\- find all types of plugins from the plugin directory + +\- store all found plugins in categories + +\- provide interface to create, convert, and chroot + +Kickstart Adapter +----------------- + +Source: mic/kickstart/\* + +As the whole image creation is driven by kickstart file, the kickstart +adapter provides \'read\_kickstart\' to parse kickstart syntax, and it +also allows some particular syntax by introducing custom commands and +sections, moreover it implements many KickstartConfigs according to +specified commands. + +Custom sections in MIC: + +\- \'%prepackages\': directive for packages needed to be pre-installed +under rootfs + +\- \'%attachment\': directive for packages or files needed to be +attached as outputs + +Custom commands in MIC: + +\- \'repo\': based on \'repo\' of F14, introduced options: \'\--save\', +\'\--debuginfo\', \'\--source\', \'\--disable\', \'\--nocache\', +\'\--gpgkey\', \'\--priority\', \'\--ssl\_verify\' + +\- \'part\': based on \'part\' of FC6, introduced options: \'\--align\', +\'\--extoptions\', \'\--uuid\', \'\--part-type\' + +\- \'bootloader\': based on \'bootloader\' of F8, introduced options: +\'\--menus\', \'\--ptables\' + +\- \'installerfw\_plugins\': new introduced command in MIC, see details +at following section + +Partition & Filesystem +---------------------- + +Source: mic/utils/fs\_related.py, mic/utils/partitionedfs.py + +The filesystem related module in MIC is used to provide functions like: +make filesystem, resize filesystem, mount filesystem, unmount +filesystem, loop setup, etc. + +The partition module in MIC is used to provide functions like: create +partitions, format partition filesystem, mount partition image, unmount +partition image, etc. Supported features: + +\- supported filesystems: vfat, ext2/3/4, btfs, squashfs + +\- sparse loopback image + +\- device mapper snapshot + +Miscellaneous +------------- + +Many utilities are introduced in MIC: + +\- mic/msger.py: support formatted logging and colored messages + +\- mic/utils/runner.py: support running external programs and pipeline + +\- mic/archive.py: support archiving and compression + +\- mic/utils/proxy.py: handle proxies including http\_proxy, +https\_proxy, no\_proxy + +\- mic/utils/gpt\_parser.py: parse GPT partitions including GPT header +and GPT partition table + +\- mic/utils/grabber.py: retrieve files and show text process of +retrieving + +\- mic/utils/rpmmisc.py: provide rpm related functions + +\- mic/utils/safeurl.py: handle url in safety way + +Plugin Framework +---------------- + +The plugin framework is designed to make mic flexible to enhance, +developers can benefit it to implement their own image formats easily. + +Plugin Class +------------ + +It consists of three types: imager, backend, hook. They are all +inherited from \_Plugin class, the \_Plugin class is designed as +metaclass and makes plugins easy to category. + +\- imager: implement the special interface for create, convert, and +chroot + +\- backend: provide interface to use package manager + +\- hook: deal the hook function (Not Implemented) + +\- considered as mid-ware between main program and imager class + +Imager Plugins +-------------- + +It implements the necessary interfaces for create/chroot/convert the +image file with specified image format, basically each image format +supported in MIC will own one Imager plugin class separately, and will +utilize the related ImageCreator class. + +\- fs\_plugin: implement fs image creation + +\- loop\_plugin: implement loop image creation + +\- raw\_plugin: implement raw image creation + +\- livecd\_plugin: implement livecd image creation + +\- liveusb\_plugin: implement liveusb image creation + +\- qcow\_plugin: implement qcow2 image creation + +Backend Plugins +--------------- + +It implements the necessary interfaces for installing packages, and it +will depend on some external package management tools, like libzypp and +yum. The interfaces is supposed to add repositories, select/deselect +packages, install/remove packages/groups, etc. + +\- zypppkgmgr: depend on python binding of libzypp (python-zypp), and +used as default + +\- yumpkgmgr: depend on pure yum module, and only available in native +mode + +Installer Framework +------------------- + +As raw image format is used in Tizen IVI, this format is changing over +time, like adding EFI support, record sparse info to bmap file, etc; and +mic has applied changes to support the features. Among them, A +remarkable feature is installer framework, original proposal from Sasha, +which can offload some work like \"set up bootloader\", \"configure +rootfs\" to product RPM package in Tizen IVI project. + +In this framework, mic can drop several stages during image creation, +like set up bootloader, configure root filesystem. And they will be +migrated to rpm packages, for example, when rootfs is mounting in +/dev/loop0, and inside rootfs there is /tmp/dev/loop0 deep copied from +it. Originally bootloader should be set up in /dev/loop0 owned by host +OS, now it will be set up inside rootfs chroot in /tmp/dev/loop0 owned +by Tizen OS. + +In technique, this deep copying is handled in mic, also mic will provide +some environment variables for the information, those setting up stuff +will be stored in setup-ivi-mbr or setup-ivi-efi, this package will be +installed into rootfs during installing stage, and its script will be +called during running post script from kickstart file to set up +bootloader. + +References +---------- + +`*  MIC Reference: `[`https://source.tizen.org/documentation/reference/mic-image-creator`](https://source.tizen.org/documentation/reference/mic-image-creator)\ +`*  Kickstart Reference: `[`http://fedoraproject.org/wiki/Anaconda/Kickstart`](http://fedoraproject.org/wiki/Anaconda/Kickstart)\ +`*  Man page of losetup: `[`http://linux.die.net/man/8/losetup`](http://linux.die.net/man/8/losetup)\ +`*  Man page of kpartx: `[`http://linux.die.net/man/8/kpartx`](http://linux.die.net/man/8/kpartx)\ +`*  Man page of parted: `[`http://linux.die.net/man/8/parted`](http://linux.die.net/man/8/parted)\ +`*  Man page of dmsetup: `[`http://linux.die.net/man/8/dmsetup`](http://linux.die.net/man/8/dmsetup)\ +`*  RPM Documentation: `[`http://www.rpm.org/wiki/Docs#UserDocumentation`](http://www.rpm.org/wiki/Docs#UserDocumentation)\ +`*  Sparse file: `[`http://en.wikipedia.org/wiki/Sparse_file`](http://en.wikipedia.org/wiki/Sparse_file)\ +`*  Device mapper: `[`http://en.wikipedia.org/wiki/Device_mapper`](http://en.wikipedia.org/wiki/Device_mapper)\ +`*  Libzypp Documentation: `[`http://doc.opensuse.org/projects/libzypp/HEAD/`](http://doc.opensuse.org/projects/libzypp/HEAD/)\ +`*  Yum Wiki: `[`https://fedoraproject.org/wiki/Yum`](https://fedoraproject.org/wiki/Yum) + +[Category:Tool](Category:Tool "wikilink")