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
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
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.
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.
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.