Qt on Pi Contribute: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:QtonPi]]
[[Category:QtonPi]]


[toc align_right="yes" depth="2"]
[toc align_right="yes" depth="2"]


= Qt on Pi - Contribute =
= Qt on Pi - Contribute =
Line 117: Line 117:
==== Setting up Fedora 14 ====
==== Setting up Fedora 14 ====


First please ensure that you've all the necessary development tools on your host. You can do this by installing the <code>Development Tools</code> meta-package.
First please ensure that you've all the necessary development tools on your host. You can do this by installing the <code>Development Tools</code> meta-package.


<code><br />$ sudo yum groupinstall 'Development Tools'<br /></code>
<code>
$ sudo yum groupinstall 'Development Tools'
</code>


Once this is done, next step would be to install &lt;code&amp;gt;augeas-libs&amp;lt;/code&amp;gt;, which is needed to install &lt;code&amp;gt;zypper&amp;lt;/code&amp;gt; package.
Once this is done, next step would be to install <code>augeas-libs</code>, which is needed to install <code>zypper</code> package.


<code><br />$ sudo yum install augeas-libs<br /></code>
<code>
$ sudo yum install augeas-libs
</code>


==== Installing &lt;code&amp;gt;host-rpms&amp;lt;/code&amp;gt; ====
==== Installing <code>host-rpms</code> ====


You will find &lt;code&amp;gt;host-rpms&amp;lt;/code&amp;gt; in the following directory.
You will find <code>host-rpms</code> in the following directory.


<code><br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ ├── host-rpms/<br /></code>
<code>
qtonpi-X.Y/
├── platform-sdk/
│ ├── host-rpms/
</code>


To install, just go into that directory and do an &lt;code&amp;gt;sudo rpm -ivh * &lt;/code&amp;gt;
To install, just go into that directory and do an <code>sudo rpm -ivh * </code>


<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk/host-rpms<br />$ sudo rpm -ivh *rpm<br /></code>
<code>
$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/host-rpms
$ sudo rpm -ivh *rpm
</code>


==== Getting Image Creator and Sysroot scripts ====
==== Getting Image Creator and Sysroot scripts ====


Image Creator and Sysroot tools are shipped as a part of the QtonPi software release in the &lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; directory which you should find here,
Image Creator and Sysroot tools are shipped as a part of the QtonPi software release in the <code>mt-cross-tools</code> directory which you should find here,


<code><br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ └── mt-cross-tools/<br /></code>
<code>
qtonpi-X.Y/
├── platform-sdk/
│ └── mt-cross-tools/
</code>


=== Creating custom Sysroot ===
=== Creating custom Sysroot ===


&lt;code&amp;gt;mksysroot-rasp-pi&amp;lt;/code&amp;gt; script present in &lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; directory can be used to build custom sysroot. This script must be run as &lt;code&amp;gt;root&amp;lt;/code&amp;gt; user and it needs a file containing a list of RPM packages that you would like to be installed in your sysroot. Default sysroot packages are provided in the file &lt;code&amp;gt;rasp-pi-sysroot-list.default&amp;lt;/code&amp;gt;.
<code>mksysroot-rasp-pi</code> script present in <code>mt-cross-tools</code> directory can be used to build custom sysroot. This script must be run as <code>root</code> user and it needs a file containing a list of RPM packages that you would like to be installed in your sysroot. Default sysroot packages are provided in the file <code>rasp-pi-sysroot-list.default</code>.


<code><br />$ ./mksysroot-rasp-pi<br />This script must be run as root<br />usage: sudo ./mksysroot-rasp-pi RPM_LIST<br /></code>
<code>
$ ./mksysroot-rasp-pi
This script must be run as root
usage: sudo ./mksysroot-rasp-pi RPM_LIST
</code>


'''Note -''' &lt;code&amp;gt;mksysroot-rasp-pi&amp;lt;/code&amp;gt; generates the sysroot at &lt;code&amp;gt;/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root&amp;lt;/code&amp;gt;. Please make sure that this directory does '''not''' exist before running the script.
'''Note -''' <code>mksysroot-rasp-pi</code> generates the sysroot at <code>/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root</code>. Please make sure that this directory does '''not''' exist before running the script.


<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools<br />$ sudo ./mksysroot-rasp-pi rasp-pi-sysroot-list.default<br />[sudo] password for rajiv:<br />./<br />./zypp/<br />./zypp/zypp.conf<br />./zypp/systemCheck<br />./zypp/zypper.conf<br />./zypp/repos.d/<br />./zypp/repos.d/f14.repo<br />using the following repos:<br /># | Alias | Name | Enabled | Refresh<br />—''———''———————————''———''———<br />1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No<br />refreshing the repos, this will take awhile (~ 5min)
<code>
$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools
$ sudo ./mksysroot-rasp-pi rasp-pi-sysroot-list.default
[sudo] password for rajiv:
./
./zypp/
./zypp/zypp.conf
./zypp/systemCheck
./zypp/zypper.conf
./zypp/repos.d/
./zypp/repos.d/f14.repo
using the following repos:
# | Alias | Name | Enabled | Refresh
—''———''———————————''———''———
1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No
refreshing the repos, this will take awhile (~ 5min)


[…]
[…]


$ ls /opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root<br />./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/<br />../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/<br />$<br /></code>
$ ls /opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root
./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/
../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/
$
</code>


Your newly minted sysroot is now available at &lt;code&amp;gt;/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root&amp;lt;/code&amp;gt;
Your newly minted sysroot is now available at <code>/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root</code>


=== Creating custom SD Card Image h3. ===
=== Creating custom SD Card Image h3. ===
Line 161: Line 201:
==== Partition Layout h4. ====
==== Partition Layout h4. ====


For QtonPi Release 0.x, we've organized the SD Card as follows. Assuming your SD Card is on &lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; device.
For QtonPi Release 0.x, we've organized the SD Card as follows. Assuming your SD Card is on <code>/dev/sdb</code> device.


<code><br /># fdisk /dev/sdb
<code>
# fdisk /dev/sdb


Command (m for help): p
Command (m for help): p


Disk /dev/sdb: 1977 MB, 1977614336 bytes<br />61 heads, 62 sectors/track, 1021 cylinders, total 3862528 sectors<br />Units = sectors of 1 * 512 = 512 bytes<br />Sector size (logical/physical): 512 bytes / 512 bytes<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />Disk identifier: 0x0000cded
Disk /dev/sdb: 1977 MB, 1977614336 bytes
61 heads, 62 sectors/track, 1021 cylinders, total 3862528 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: 0x0000cded


Device Boot Start End Blocks Id System<br />/dev/sdb1 62 249611 124775 c W95 FAT32 (LBA)<br />/dev/sdb2 249612 2250289 1000339 83 Linux<br />/dev/sdb3 2250290 3248737 499224 82 Linux swap / Solaris
Device Boot Start End Blocks Id System
/dev/sdb1 62 249611 124775 c W95 FAT32 (LBA)
/dev/sdb2 249612 2250289 1000339 83 Linux
/dev/sdb3 2250290 3248737 499224 82 Linux swap / Solaris


Command (m for help): q
Command (m for help): q


#<br /></code>
#
</code>


All partitions are primary partitions.
All partitions are primary partitions.
Line 181: Line 231:
* The third partition is a swap partition that we've thrown in for a good measure. This might be removed in the subsequent releases.
* The third partition is a swap partition that we've thrown in for a good measure. This might be removed in the subsequent releases.


Feel free to resize the partitions depending on the space available on your SD Card. However, we do urge you preserve this layout. You can use Apps such as &lt;code&amp;gt;Disk Utility&amp;lt;/code&amp;gt;, &lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt;, &lt;code&amp;gt;parted&amp;lt;/code&amp;gt; and &lt;code&amp;gt;mkfs&amp;lt;/code&amp;gt; to manipulate the partition layout to fit your needs.
Feel free to resize the partitions depending on the space available on your SD Card. However, we do urge you preserve this layout. You can use Apps such as <code>Disk Utility</code>, <code>fdisk</code>, <code>parted</code> and <code>mkfs</code> to manipulate the partition layout to fit your needs.


==== Boot Partition h4. ====
==== Boot Partition h4. ====


The boot partition must be a FAT32 partition. The contents of this partition is shipped in the file &lt;code&amp;gt;rasp-pi-kernel-3.1-partition.tar.bz2&amp;lt;/code&amp;gt;, which is located here,
The boot partition must be a FAT32 partition. The contents of this partition is shipped in the file <code>rasp-pi-kernel-3.1-partition.tar.bz2</code>, which is located here,


<code><br />qtonpi-0.2<br />├── platform-sdk<br />│ ├── image-creator-binaries<br />│ │ ├── rasp-pi-kernel-3.1-modules.tar.bz2<br /></code>
<code>
qtonpi-0.2
├── platform-sdk
│ ├── image-creator-binaries
│ │ ├── rasp-pi-kernel-3.1-modules.tar.bz2
</code>


So, to build your boot partition, all you need to do is to extract the contents of this file onto that partition.
So, to build your boot partition, all you need to do is to extract the contents of this file onto that partition.


Assuming your boot partition is mounted at &lt;code&amp;gt;/media/boot&amp;lt;/code&amp;gt;, you could do something like,
Assuming your boot partition is mounted at <code>/media/boot</code>, you could do something like,


<code><br />$ cd /media/boot<br />$ sudo tar jxvf /home/rajiv/qtonpi-0.2/platform-sdk/image-creator-binaries/rasp-pi-kernel-3.1-partition.tar.bz2<br />[sudo] password for rajiv:<br />./<br />./arm224_start.elf<br />./cmdline.txt
<code>
$ cd /media/boot
$ sudo tar jxvf /home/rajiv/qtonpi-0.2/platform-sdk/image-creator-binaries/rasp-pi-kernel-3.1-partition.tar.bz2
[sudo] password for rajiv:
./
./arm224_start.elf
./cmdline.txt


[…]<br />$<br /></code>
[…]
$
</code>


==== Root Filesystem h4. ====
==== Root Filesystem h4. ====
Line 201: Line 264:
The root partition must be an Ext4 partition.
The root partition must be an Ext4 partition.


&lt;code&amp;gt;mkrootfs-rasp-pi&amp;lt;/code&amp;gt; script present in &lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; directory can be used to build custom rootfs. This script must be run as &lt;code&amp;gt;root&amp;lt;/code&amp;gt; user and it needs a two things.
<code>mkrootfs-rasp-pi</code> script present in <code>mt-cross-tools</code> directory can be used to build custom rootfs. This script must be run as <code>root</code> user and it needs a two things.


# Pointer to directory where you would like your rootfs to be built
# Pointer to directory where you would like your rootfs to be built
# File containing a list of RPM packages that you would like to be installed in your sysroot
# File containing a list of RPM packages that you would like to be installed in your sysroot


Default rootfs packages are provided in the file &lt;code&amp;gt;rasp-pi-rootfs-list.default&amp;lt;/code&amp;gt;
Default rootfs packages are provided in the file <code>rasp-pi-rootfs-list.default</code>


<code><br />$ ./mkrootfs-rasp-pi<br />This script must be run as root<br />usage: sudo ./mkrootfs-rasp-pi ROOTFS_DIR RPM_LIST<br /></code>
<code>
$ ./mkrootfs-rasp-pi
This script must be run as root
usage: sudo ./mkrootfs-rasp-pi ROOTFS_DIR RPM_LIST
</code>


Now, to build your new rootfs at &lt;code&amp;gt;/tmp/rootfs&amp;lt;/code&amp;gt;,
Now, to build your new rootfs at <code>/tmp/rootfs</code>,


<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools<br />$ sudo ./mkrootfs-rasp-pi /tmp/rootfs rasp-pi-rootfs-list.default<br />[sudo] password for rajiv:<br />using the following repos:<br /># | Alias | Name | Enabled | Refresh<br />—''———''———————————''———''———<br />1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No<br />refreshing the repos, this will take awhile (~ 5min)
<code>
$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools
$ sudo ./mkrootfs-rasp-pi /tmp/rootfs rasp-pi-rootfs-list.default
[sudo] password for rajiv:
using the following repos:
# | Alias | Name | Enabled | Refresh
—''———''———————————''———''———
1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No
refreshing the repos, this will take awhile (~ 5min)


[…]
[…]


unpacking the etc files<br />unpacking the kernel modules<br />unpacking the gles libs<br />unpacking qt5<br />$ ls /tmp/rootfs<br />./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/<br />../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/<br />$<br /></code>
unpacking the etc files
unpacking the kernel modules
unpacking the gles libs
unpacking qt5
$ ls /tmp/rootfs
./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/
../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/
$
</code>


Your newly minted rootfs is now available at &lt;code&amp;gt;/tmp/rootfs&amp;lt;/code&amp;gt;. You can now copy over this directory over to the rootfs partition on the SD Card. Assuming your rootfs partition is mounted at &lt;code&amp;gt;/media/root&amp;lt;/code&amp;gt;, you can do the following,
Your newly minted rootfs is now available at <code>/tmp/rootfs</code>. You can now copy over this directory over to the rootfs partition on the SD Card. Assuming your rootfs partition is mounted at <code>/media/root</code>, you can do the following,


<code><br />$ sudo rsync -av /tmp/rootfs/* /media/root/<br />[sudo] password for rajiv:
<code>
$ sudo rsync -av /tmp/rootfs/* /media/root/
[sudo] password for rajiv:


[…]
[…]


var/tmp/<br />var/yp/
var/tmp/
var/yp/


sent 503804268 bytes received 250274 bytes 9082063.82 bytes/sec<br />total size is 502887293 speedup is 1.00<br />$ ls /media/root<br />./ bin/ dev/ home/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/<br />../ boot/ etc/ lib/ media/ opt/ root/ selinux/ sys/ usr/<br />$<br /></code>
sent 503804268 bytes received 250274 bytes 9082063.82 bytes/sec
total size is 502887293 speedup is 1.00
$ ls /media/root
./ bin/ dev/ home/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
../ boot/ etc/ lib/ media/ opt/ root/ selinux/ sys/ usr/
$
</code>


Your SD card is now ready with custom QtonPi image for use on Raspberry Pi.
Your SD card is now ready with custom QtonPi image for use on Raspberry Pi.


=== Updating &lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; h3. ===
=== Updating <code>mt-cross-tools</code> h3. ===


&lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; repository which is available on &quot;Gitorious&amp;quot;:http://qt.gitorious.org/qtonpi/mt-cross-tools or &quot;Gerrit&amp;quot;:http://codereview.qt.io/#admin,project,qtonpi/mt-cross-tools,info.
<code>mt-cross-tools</code> repository which is available on "Gitorious":http://qt.gitorious.org/qtonpi/mt-cross-tools or "Gerrit":http://codereview.qt.io/#admin,project,qtonpi/mt-cross-tools,info.


'''Note -''' You will need to clone &lt;code&amp;gt;mt-cross-tools&amp;lt;/code&amp;gt; into the &lt;code&amp;gt;platform-sdk/&amp;lt;/code&amp;gt; subdirectory of your QtonPi release.
'''Note -''' You will need to clone <code>mt-cross-tools</code> into the <code>platform-sdk/</code> subdirectory of your QtonPi release.


<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk<br />$ git clone git://gitorious.org/qtonpi/mt-cross-tools.git<br />Cloning into mt-cross-tools…<br />remote: Counting objects: 64, done.<br />remote: Compressing objects: 100% (56/56), done.<br />remote: Total 64 (delta 20), reused 0 (delta 0)<br />Receiving objects: 100% (64/64), 34.68 KiB, done.<br />Resolving deltas: 100% (20/20), done.<br /></code>
<code>
$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk
$ git clone git://gitorious.org/qtonpi/mt-cross-tools.git
Cloning into mt-cross-tools…
remote: Counting objects: 64, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 64 (delta 20), reused 0 (delta 0)
Receiving objects: 100% (64/64), 34.68 KiB, done.
Resolving deltas: 100% (20/20), done.
</code>


After cloning, your relative directory structure should look as follows,
After cloning, your relative directory structure should look as follows,


<code><br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ └── mt-cross-tools/<br /></code>
<code>
qtonpi-X.Y/
├── platform-sdk/
│ └── mt-cross-tools/
</code>

Revision as of 10:49, 25 February 2015


[toc align_right="yes" depth="2"]

Qt on Pi - Contribute

QtonPi Platform

With QtonPi platform we aim to provide our community with the tools needed to create awesome Qt 5 Apps on Raspberry Pi hardware. We intend to take a minimalistic approach towards what's included in the platform and let our App Developers drive the evolution of the platform with real world App use cases.

QtonPi platform is not intended to be another full fledged Linux distribution. While we plan to use packages and tools from other distributions, our goal really is to provide an easy-to-use flexible innovation environment for Qt and Qt related technologies.

We really welcome your contributions to QtonPi platform.

Following are some general principles on which we hope to build QtonPi platform

  • Full cross-build environment for QtonPi stack
  • No GPLv3 packages
  • Clean separation (to the extent possible without excessive over-engineering) of QtonPi packages and Raspberry Pi specific packages
  • Upstream as much as possible and aim to maintain minimal set of necessary changes in QtonPi project

QtonPi Platform consists of the following,

  • SD Card Image
  • Toolchain and Sysroot
  • Qt Creator based App SDK
  • Cross-build tools

QtonPi Roadmap

QtonPi software stack can be broken down into three layers. These layers exits so that folks in the QtonPi community can organize themselves in areas that they're most passionate about. The layers are,

  1. Base Layer
  2. Middleware
  3. Apps

Base Layer

Base Layer essentially consists of everything above the hardware providing all the enablers to run our middleware. This includes - boot loader, codecs, kernel, root filesystem, RPM packages, compiler, build environment, etc.,

Middleware

Our middleware consists of Qt 5 (plus additional optional modules where it makes sense) and a Qt Creator based QtonPi SDK for App Creation along with all the community documentation we can put together.

That's it! Nothing more, nothing less.

The programming models that we will support would be,

  • Qt C++
  • JavaScript

For UI, you can use,

  • QML (or)
  • HTML (though QtWebKit)

Apps

Interesting Apps is something that we hope our community will create, so that we can build a better Middleware and Base Layer.

We might have scenarios where we might not be able to provide all the APIs needed for folks trying to do some really cool Apps with QtonPi.

We should however make it easy both at the Base Layer and Middleware for folks to be able to add their own APIs where necessary and provide all the freedom for App Developers innovate.

Releases

QtonPi is a community project. Following is a general direction on where we would like to go.

Release-0

  • Base Layer
    • Fedora RPM Packages plus some additional Raspberry Pi Specific packages
    • Linaro GCC 4.5.4 toolchain
    • QtonPi image creator and sysroot tools
  • Middleware
    • Documentation on how to get toolchain + sysroot + Qt Creator working to Develop Apps
    • Qt 5 running on full-screen EGLFS mode

Release-1

Target - Spring 2012

  • Base Layer
    • OpenSuse QtonPi Packages (without GPLv3 packages)
    • Build Envrionment
    • Updated Compiler (GCC 4.6)
    • QtProcessManager
    • QtJsonDB (App Development)
  • Middleware
    • QtonPi SDK delivered as an installer with integrated toolchain + community documentation
    • Auto configuration/discovery of Raspberry Pis from QtonPi SDK
    • Qt 5 running on Full Screen EGLFS mode

Release-2

Target - Summer 2012

  • Base Layer
    • Migrate to a kernel version that supports CMA
    • Update or add packages to support Multimedia and Multi-process Qt/Qt Quick Apps
    • Provide an example compositor environment based on qt-compositor and process manager
  • Middleware
    • Update QtonPi SDK to include the release version of Qt 5
    • Improve community documentation

QtonPi Image Creator and Sysroot

QtonPi releases comes with a default SD Card Image and Sysroot. Following instructions are for you to be able to build your custom SD Card Image and Sysroot.

Download and Installation Requirements

In order to build your custom QtonPi SD Card Image/Sysroot, you'll need Fedora 14 (as it is the distro most contributors are working on). We hope in subsequent release we can take this dependency away.

Setting up Fedora 14

First please ensure that you've all the necessary development tools on your host. You can do this by installing the

Development Tools

meta-package.

$ sudo yum groupinstall 'Development Tools'

Once this is done, next step would be to install

augeas-libs

, which is needed to install

zypper

package.

$ sudo yum install augeas-libs

Installing
host-rpms

You will find

host-rpms

in the following directory.

qtonpi-X.Y/
├── platform-sdk/
 ├── host-rpms/

To install, just go into that directory and do an

sudo rpm -ivh *
$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/host-rpms
$ sudo rpm -ivh *rpm

Getting Image Creator and Sysroot scripts

Image Creator and Sysroot tools are shipped as a part of the QtonPi software release in the

mt-cross-tools

directory which you should find here,

qtonpi-X.Y/
├── platform-sdk/
 └── mt-cross-tools/

Creating custom Sysroot

mksysroot-rasp-pi

script present in

mt-cross-tools

directory can be used to build custom sysroot. This script must be run as

root

user and it needs a file containing a list of RPM packages that you would like to be installed in your sysroot. Default sysroot packages are provided in the file

rasp-pi-sysroot-list.default

.

$ ./mksysroot-rasp-pi
This script must be run as root
usage: sudo ./mksysroot-rasp-pi RPM_LIST

Note -

mksysroot-rasp-pi

generates the sysroot at

/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root

. Please make sure that this directory does not exist before running the script.

$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools
$ sudo ./mksysroot-rasp-pi rasp-pi-sysroot-list.default
[sudo] password for rajiv:
./
./zypp/
./zypp/zypp.conf
./zypp/systemCheck
./zypp/zypper.conf
./zypp/repos.d/
./zypp/repos.d/f14.repo
using the following repos:
# | Alias | Name | Enabled | Refresh
—''———''———————————''———''———
1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No
refreshing the repos, this will take awhile (~ 5min)

[]

$ ls /opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root
./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/
../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/
$

Your newly minted sysroot is now available at

/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root

Creating custom SD Card Image h3.

Partition Layout h4.

For QtonPi Release 0.x, we've organized the SD Card as follows. Assuming your SD Card is on

/dev/sdb

device.

# fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 1977 MB, 1977614336 bytes
61 heads, 62 sectors/track, 1021 cylinders, total 3862528 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: 0x0000cded

Device Boot Start End Blocks Id System
/dev/sdb1 62 249611 124775 c W95 FAT32 (LBA)
/dev/sdb2 249612 2250289 1000339 83 Linux
/dev/sdb3 2250290 3248737 499224 82 Linux swap / Solaris

Command (m for help): q

#

All partitions are primary partitions.

  • The first partition is a Fat32 partition which consists of the secondary bootloader, kernel, and other files needed to be initalize the GPU.
  • The second paritition is a Ext4 partition, where the root filesystem resides
  • The third partition is a swap partition that we've thrown in for a good measure. This might be removed in the subsequent releases.

Feel free to resize the partitions depending on the space available on your SD Card. However, we do urge you preserve this layout. You can use Apps such as

Disk Utility

,

fdisk

,

parted

and

mkfs

to manipulate the partition layout to fit your needs.

Boot Partition h4.

The boot partition must be a FAT32 partition. The contents of this partition is shipped in the file

rasp-pi-kernel-3.1-partition.tar.bz2

, which is located here,

qtonpi-0.2
├── platform-sdk
 ├── image-creator-binaries
  ├── rasp-pi-kernel-3.1-modules.tar.bz2

So, to build your boot partition, all you need to do is to extract the contents of this file onto that partition.

Assuming your boot partition is mounted at

/media/boot

, you could do something like,

$ cd /media/boot
$ sudo tar jxvf /home/rajiv/qtonpi-0.2/platform-sdk/image-creator-binaries/rasp-pi-kernel-3.1-partition.tar.bz2
[sudo] password for rajiv:
./
./arm224_start.elf
./cmdline.txt

[]
$

Root Filesystem h4.

The root partition must be an Ext4 partition.

mkrootfs-rasp-pi

script present in

mt-cross-tools

directory can be used to build custom rootfs. This script must be run as

root

user and it needs a two things.

  1. Pointer to directory where you would like your rootfs to be built
  2. File containing a list of RPM packages that you would like to be installed in your sysroot

Default rootfs packages are provided in the file

rasp-pi-rootfs-list.default
$ ./mkrootfs-rasp-pi
This script must be run as root
usage: sudo ./mkrootfs-rasp-pi ROOTFS_DIR RPM_LIST

Now, to build your new rootfs at

/tmp/rootfs

,

$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk/mt-cross-tools
$ sudo ./mkrootfs-rasp-pi /tmp/rootfs rasp-pi-rootfs-list.default
[sudo] password for rajiv:
using the following repos:
# | Alias | Name | Enabled | Refresh
—''———''———————————''———''———
1 | f14-arm | ARM RPM Repository for Fedora14 | Yes | No
refreshing the repos, this will take awhile (~ 5min)

[]

unpacking the etc files
unpacking the kernel modules
unpacking the gles libs
unpacking qt5
$ ls /tmp/rootfs
./ bin/ dev/ home/ media/ opt/ root/ selinux/ sys/ usr/
../ boot/ etc/ lib/ mnt/ proc/ sbin/ srv/ tmp/ var/
$

Your newly minted rootfs is now available at

/tmp/rootfs

. You can now copy over this directory over to the rootfs partition on the SD Card. Assuming your rootfs partition is mounted at

/media/root

, you can do the following,

$ sudo rsync -av /tmp/rootfs/* /media/root/
[sudo] password for rajiv:

[…]

var/tmp/
var/yp/

sent 503804268 bytes received 250274 bytes 9082063.82 bytes/sec
total size is 502887293 speedup is 1.00
$ ls /media/root
./ bin/ dev/ home/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
../ boot/ etc/ lib/ media/ opt/ root/ selinux/ sys/ usr/
$

Your SD card is now ready with custom QtonPi image for use on Raspberry Pi.

Updating
mt-cross-tools
h3.

mt-cross-tools

repository which is available on "Gitorious":http://qt.gitorious.org/qtonpi/mt-cross-tools or "Gerrit":http://codereview.qt.io/#admin,project,qtonpi/mt-cross-tools,info. Note - You will need to clone

mt-cross-tools

into the

platform-sdk/

subdirectory of your QtonPi release.

$ pwd
/home/rajiv/qtonpi-0.2/platform-sdk
$ git clone git://gitorious.org/qtonpi/mt-cross-tools.git
Cloning into mt-cross-tools
remote: Counting objects: 64, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 64 (delta 20), reused 0 (delta 0)
Receiving objects: 100% (64/64), 34.68 KiB, done.
Resolving deltas: 100% (20/20), done.

After cloning, your relative directory structure should look as follows,

qtonpi-X.Y/
├── platform-sdk/
 └── mt-cross-tools/