
I got into my hands for a while a sample phone with Tizen OS. I decided to take the opportunity to see what kind of Linux is hiding inside. Most of the Tizen OS reviews describe the user interface, in this article I will briefly review the phone and operating system from the system administrator. The most interesting pre-installed console applications, work with the graphical interface and the ability to update from the repository will be considered.
In order to connect to the device console, we need the Smart Development Bridge (SDB) utility from the Tizen SDK. From the developer’s site you can
download it separately In the form of a binary file, the Smart Development Bridge is available under the same platforms as the Tizen SDK: Windows 7 (32 and 64 bits), Ubuntu (32 and 64 bits), Mac OS X (64 bits). Specifying Ubuntu in this case is somewhat arbitrary, my utility worked without any problems under Fedora 19 (x64). Smart Development Bridge is able to work with multiple devices and provides a basic set of commands for working with the device, including remote access to the device's command shell. He is what interests us first and foremost. All further manipulations will be made from the console.
In Tizen there are initially two main users under which work is possible: developer and root, by default, developer is used. To get maximum opportunities when interacting with the operating system, we will need to increase the level of privileges, for this we need to enable the super-user mode. We introduce the necessary commands to connect:
$ sdb root on
Switched to 'root' account mode
$ sdb shell
sh-4.1 #
So, we got root access to the system. To begin, let's do simple tests that allow us to get information about the platform. Let's try to find out the shell, the version of the system and the kernel provided to us.
sh-4.1 # echo $ SHELL
/ bin / sh
sh-4.1 # sh --version
sh --version
GNU bash, version 4.1.5 (1) -release (armv7l-unknown-linux-gnueabi)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3 +: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
sh-4.1 $ cat / etc / system-release
Tizen release 2.2.0 (Tizen)
sh-4.1 # uname -a
Linux TRATS2 3.0.15-00002-g277d62a # 1-Tizen SMP PREEMPT Tue Jul 16 13:12:44 KST 2013 armv7l GNU / Linux
Tizen 2.2.0 is quite common with Linux kernel 3.0.15, Bash 4.1.5 is used as the command shell. Ask for information about the characteristics of the platform such as the processor and memory.
')
sh-4.1 # cat / proc / cpuinfo
Processor: ARMv7 Processor rev 0 (v7l)
processor: 0
BogoMIPS: 1590.88
processor: 1
BogoMIPS: 1590.88
processor: 2
BogoMIPS: 1590.88
processor: 3
BogoMIPS: 1590.88
Features: swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer: 0x41
CPU architecture: 7
CPU variant: 0x3
CPU part: 0xc09
CPU revision: 0
Chip revision: 0011
Hardware: TRATS2
Revision: 000c
Serial: 4df764b878e3cf00
sh-4.1 # cat / proc / meminfo | grep mem
MemTotal: 797944 kB
MemFree: 385720 kB
sh-4.1 # fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/ dev / mmcblk0'!
The util fdisk doesn't support GPT. Use GNU Parted.
Disk / dev / mmcblk0: 15.8 GB, 15758000128 bytes
1 heads, 16 sectors / track, 1923584 sectors, total 30777344 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 512 bytes
I / O size (minimum / optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/ dev / mmcblk0p1 1 30777343 15388671+ ee GPT
Quite expected parameters are a quad-core armv7 with a frequency of 1.6 GHz and a gigabyte of RAM, of which about 800MB is available to the system. The drive is 16 Gb. Features fully comply with the Samsung Galaxy S III (GT-i9300), which as a devoleper sample is provided to the developers of Tizen.
Let's try to get information about available executable files by pressing TAB twice. In response, the shell proposes to withdraw about a thousand items. I don’t cite the exact number, since with several launches the number of options ranged from 952 to 1003. In any case, this number is quite large for the operating system of the phone. The entire list is a very long list, so I’ll note the most interesting ones in my opinion: X11, enlightenment, scp, ssh, sshd, rpm, zypper, xclock, xeyes, xmessage. From this we can conclude that the phone has an operating system for a set of applications not inferior to the desktop - there are X's, a shell, package managers. Enlightenment is used as the desktop environment. Some applications when launched from the console are displayed on the phone screen, closing the menu. If you run xeyes, you will see eyes on the screen of your phone that follow the touches to the screen. An example of the result of launching xeyes is shown in the photo at the beginning of the article. Similarly, oclock, xclock, xlogo, xmessage can be displayed on the display.
sh-4.1 $ xmessage -geometry 240x120 -center HELLO HABRAHABR!

Not all applications work out of the box in order to be able to use them, you need to configure them. For example, the sshd daemon launch scripts are not in the system, and the head-on daemon does not start, displaying the message “Missing privilege separation directory: / var / run / sshd. The problem is solved simply - it is necessary to create this directory and give the necessary rights to it:
mkdir / var / run / sshd
chmod 0755 / var / run / sshd
After the manipulations, the daemon can be started:
start-stop-daemon --start --pidfile /var/run/sshd.pid --exec / usr / sbin / sshd - -p 22
Connecting to an ssh server as root happens without a password, so we will not leave the server turned on.
start-stop-daemon --stop --pidfile /var/run/sshd.pid
Let's move on to the package management system. The system has the Red Hat package manager version 4.9.1 installed.
sh-4.1 # rpm --version
RPM version 4.9.1
Check the ability to update the pre-installed packages. Zypper is a console package manager used in the GNU / Linux openSUSE distribution. If there is a package manager, then there should be repositories in which it takes packages. We try to update the list of packages with the zypper refresh command, but disappointment is waiting for us here - the repository was not found.
sh-4.1 # zypper refresh
Retrieving repository 'Tizen-main' metadata [\]
Specified path '/srv/snapshots//tizen-2.2/common/tizen-2.2_20130717.6/repos/tizen-main/armv7l/packages/' is not a directory: file: /srv/snapshots//tizen-2.2/ common / tizen-2.2_20130717.6 / repos / tizen-main / armv7l / packages /
Retrieving repository 'Tizen-main' metadata [error]
Repository 'Tizen-main' is invalid.
[|] Valid metadata not found at specified URL (s)
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'Tizen-main' because of the above error.
Could not refresh the repositories because of errors.
Judging by the text of the error message, the Tizen-Main repository is located along a nonexistent path. Let's look at the official repository site. As we have already found out in our phone TIZEN 2.2, there are several suitable repositories on
http://download.tizen.org . Disable the old repository and connect a couple of new ones. Together with the tizen-2.2 repository, at the same time we will connect a slightly more recent tizen-2.2_20130719.3. Unclaimed repositories can always be disabled.
zypper mr -d 1
zypper ar http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-base/armv7l/packages/ Base
zypper ar http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-main/armv7l/packages/ Main
zypper ar http://download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/armv7l/packages/ Base20130719
zypper ar http://download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/armv7l/packages/ Main20130719
zypper refresh
The system is ready to install packages and upgrade.
Tizen is quite a flexible system in which there is a lot of potential. In conclusion, I note that in the connected repositories found development tools: cmake, ccache, gcc and others. This fact opens up new opportunities for development under Tizen.