Tizen+RPI2 got smart

July 28, 2015 - Mauro Carvalho Chehab

RPi2: Getting Smart on Tizen

Once you’ve got Tizen running on your Raspberry PI 2 (RPi2) using the procedures described in Tizen on RPi2: Now Supporting 3D Acceleration, you will probably want to be able to dynamically add/remove packages. It’s a pain to be required to rebuild and flash your OS every time you want to change the included software, so following this tutorial will help make this much easier. This small tutorial shows how to install the smart tool that is shipped on Tizen, but is not installed by default.

1) Add Smart to the RPi2 Image

The first step is to add the Smart Package Manager (python-smartpm) to the RPi2 Tizen image. This is the same package manager used on Yocto, and Tizen has its own patches for it.

In order to install it, you should apply the following simple patch on your Tizen repository:

If you are unfamiliar with the patching process in linux, create a file that contains the above information, and use patch to apply the patch to: meta-tizen/meta-tizen-common-base/recipes-image/images/tizen-core-image-minimal.bb

Once patched, re-build the image as described on the previous tutorials and copy it to an SD card.

NOTE: You should replace /dev/sdz on the commands below and on the next sections of this article, in order to point to your specific disk that it is mapped. Otherwise you may damage your system!

As shown at Tizen on RPi2: Now Supporting 3D Acceleration, the build and install procedure is:

2) Resize the RPi2 Root Image to the Disk Size

By default, the RPi image size is minimal and does not fill the entire SD disk. We likely need to extend it to use all your SD card space, in order to have space to install new rpm packages on it.

Check the first sector number of the second partition of the disk, remember it, and use it to re-create the partition using the maximum sector number as the end of the partition.

In the example below, the first sector is 90112, and the last sector is 15564799. Delete partition 2 and make a new one from 90112 to 15564799. Note this is a slightly dangerous operation – you are deleting the sector with the important data on it. As long as you don’t do anything else in between it should be fine. The usual cautions about making sure which device’s partition table you are changing of course apply.

Now, we’ll use the resize2fs command to extend the ext4 filesystem to fill the entire partition. Before that, the partition should be checked with e2fsck. Resize2fs may complain that you need to check again using “e2fsck -f”; if so, follow those instructions.

Those steps are shown below:

3) Put the rpm Files on a Web Server

After the bitbake build completes, you will find RPM packages in the directory build/tmp-glibc/deploy/rpm/. Copy the contents to your apache (or similar) web server root into a suitable directory (if you intend to use the same machine to do the builds and serve the packages, you can also make a symbolic link instead of copying).

The next step assumes that the server is at address 192.168.1.1 and that the files were copied under the rpm directory.

4) Add Smart Repositories to the RPi2 rootfs

Boot the RPi2 Tizen image, and log in as root (the default password is root). Then run the following command to create the package distribution channels on smart:

And update the channels with smart update:

5) Install Packages on RPi2!

Now, installing a new package is no more complicated than this simple command:

Once you’ve successfully completed these steps, you should be able to install new versions of packages as they are developed without being required to flash your device every time. This seemingly minor change should help save time for anyone trying to build things for Tizen on the RPi2.

Get Involved

If you want to learn more or get involved, you can join us in the Tizen IRC chatroom, or subscribe to the Tizen Community mailing list. Lastly, you can also stay tuned to this blog to catch more articles about building things on Tizen and Raspberry Pi.

Have fun!

Raspberry Pi is a trademark of the Raspberry Pi Foundation

About Mauro Carvalho Chehab

Mauro is the upstream maintainer of the Linux kernel media and EDAC subsystems, and also a major contributor for the Reliability Availability and Serviceability (RAS) subsystems. Mauro also maintains Tizen on Yocto packages upstream. He works for the Samsung Open Source Group since 2013. Has worked during 5 years at the Red Hat RHEL Kernel team, having broad experience in telecommunications due to his work at some of the Brazilian largest wired and wireless carriers.

Embedded Technology / Linux / Tizen Raspberry PI2 / rpi2 / smart / Tizen / Yocto /

Comments

  • HI! Very good article.
    I was trying to bitbake the RPi2 image, but it’s returning an error message:

    | Makefile:1682: recipe for target ‘../obj_s/lib_gen.o’ failed
    | make[1]: *** [../obj_s/lib_gen.o] Error 1
    | make[1]: *** Waiting for unfinished jobs….
    | /home/aideguchi/Tizen/tizen-distro/build/tmp-glibc/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/base/lib_mouse.c:1533:1: error: expected identifier or ‘(‘ before ‘{‘ token
    | {
    | ^
    | Makefile:1736: recipe for target ‘../obj_s/lib_mouse.o’ failed
    | make[1]: *** [../obj_s/lib_mouse.o] Error 1
    | make[1]: Leaving directory ‘/home/aideguchi/Tizen/tizen-distro/build/tmp-glibc/work/x86_64-linux/ncurses-native/5.9-r15.1/build/narrowc/ncurses’
    | Makefile:134: recipe for target ‘libs’ failed
    | make: *** [libs] Error 2
    | make: Leaving directory ‘/home/aideguchi/Tizen/tizen-distro/build/tmp-glibc/work/x86_64-linux/ncurses-native/5.9-r15.1/build/narrowc’
    | ERROR: oe_runmake failed
    | WARNING: /home/aideguchi/Tizen/tizen-distro/build/tmp-glibc/work/x86_64-linux/ncurses-native/5.9-r15.1/temp/run.do_compile.25892:1 exit 1 from
    | exit 1
    | ERROR: Function failed: do_compile (log file is located at /home/aideguchi/Tizen/tizen-distro/build/tmp-glibc/work/x86_64-linux/ncurses-native/5.9-r15.1/temp/log.do_compile.25892)
    ERROR: Task 927 (virtual:native:/home/aideguchi/Tizen/tizen-distro/meta/recipes-core/ncurses/ncurses_5.9.bb, do_compile) failed with exit code ‘1’

    Any idea on how to solve this?
    Thansk a lot!

  • Mats Wichmann Mats Wichmann says:

    This problem is caused by building with gcc 5.x, which doesn’t entirely work yet. Patches exist for some of the build problems (including the ncurses one which is the “first failure”), but not for all of them. If possible, try to use a build host with a gcc 4 version on it, things will just go more smoothly for now.

Leave a Reply to Toni Ideguchi Cancel reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam