Qt on Pi Contribute: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:QtonPi]] | |||
== | [toc align_right="yes" depth="2"] | ||
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 | = 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. | 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. | ||
Line 20: | Line 24: | ||
* SD Card Image | * SD Card Image | ||
* Toolchain and Sysroot | * Toolchain and Sysroot | ||
* Qt Creator based App | * Qt Creator based App SDK | ||
* Cross-build tools | * Cross-build tools | ||
==QtonPi Roadmap== | == 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 | 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, | ||
# Base Layer | # Base Layer | ||
Line 31: | Line 35: | ||
# Apps | # Apps | ||
===Base Layer=== | === Base Layer === | ||
Base Layer essentially consists of everything above the hardware providing all the enablers to run our middleware. This includes | 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=== | === Middleware === | ||
Our middleware consists of Qt 5 (plus additional optional modules where it makes sense) and a Qt Creator based QtonPi | 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, | The programming models that we will support would be, | ||
Line 48: | Line 52: | ||
For UI, you can use, | For UI, you can use, | ||
* | * QML (or) | ||
* | * HTML (though QtWebKit) | ||
===Apps=== | === Apps === | ||
Interesting Apps is something that we hope our community will create, so that we can build a better Middleware and Base Layer. | 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 | 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 | 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=== | === Releases === | ||
QtonPi is a community project. Following is a general direction on where we would like to go. | QtonPi is a community project. Following is a general direction on where we would like to go. | ||
====Release-0==== | ==== Release-0 ==== | ||
* Base Layer | * Base Layer | ||
** Fedora | ** Fedora RPM Packages plus some additional Raspberry Pi Specific packages | ||
** Linaro | ** Linaro GCC 4.5.4 toolchain | ||
** QtonPi image creator and sysroot tools | ** QtonPi image creator and sysroot tools | ||
* Middleware | * Middleware | ||
** Documentation on how to get toolchain + sysroot + Qt Creator working to Develop Apps | ** Documentation on how to get toolchain + sysroot + Qt Creator working to Develop Apps | ||
** Qt 5 running on full-screen | ** Qt 5 running on full-screen EGLFS mode | ||
====Release-1==== | ==== Release-1 ==== | ||
Target | Target - Spring 2012 | ||
* Base Layer | * Base Layer | ||
** OpenSuse QtonPi Packages (without GPLv3 packages) | ** OpenSuse QtonPi Packages (without GPLv3 packages) | ||
** Build Envrionment | ** Build Envrionment | ||
** Updated Compiler ( | ** Updated Compiler (GCC 4.6) | ||
** QtProcessManager | ** QtProcessManager | ||
** QtJsonDB (App Development) | ** QtJsonDB (App Development) | ||
* Middleware | * Middleware | ||
** QtonPi | ** QtonPi SDK delivered as an installer with integrated toolchain + community documentation | ||
** Auto configuration/discovery of Raspberry Pis from QtonPi | ** Auto configuration/discovery of Raspberry Pis from QtonPi SDK | ||
** Qt 5 running on Full Screen | ** Qt 5 running on Full Screen EGLFS mode | ||
====Release-2==== | ==== Release-2 ==== | ||
Target | Target - Summer 2012 | ||
* Base Layer | * Base Layer | ||
** Migrate to a kernel version that supports | ** Migrate to a kernel version that supports CMA | ||
** Update or add packages to support Multimedia and Multi-process Qt/Qt Quick Apps | ** 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 | ** Provide an example compositor environment based on qt-compositor and process manager | ||
* Middleware | * Middleware | ||
** Update QtonPi | ** Update QtonPi SDK to include the release version of Qt 5 | ||
** Improve community documentation | ** Improve community documentation | ||
==QtonPi Image Creator and Sysroot== | == 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. | 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=== | === 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 <code&gt;Development Tools&lt;/code&gt; meta-package. | |||
<code><br />$ sudo yum groupinstall 'Development Tools'<br /></code> | |||
Once this is done, next step would be to install <code&gt;augeas-libs&lt;/code&gt;, which is needed to install <code&gt;zypper&lt;/code&gt; package. | |||
<code><br />$ sudo yum install augeas-libs<br /></code> | |||
==== Installing <code&gt;host-rpms&lt;/code&gt; ==== | |||
You will find <code&gt;host-rpms&lt;/code&gt; in the following directory. | |||
<code><br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ ├── host-rpms/<br /></code> | |||
To install, just go into that directory and do an <code&gt;sudo rpm -ivh * </code&gt; | |||
<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk/host-rpms<br />$ sudo rpm -ivh *rpm<br /></code> | |||
==== Getting Image Creator and Sysroot scripts ==== | |||
Image Creator and Sysroot tools are shipped as a part of the QtonPi software release in the <code&gt;mt-cross-tools&lt;/code&gt; directory which you should find here, | |||
<code><br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ └── mt-cross-tools/<br /></code> | |||
=== Creating custom Sysroot === | |||
<code&gt;mksysroot-rasp-pi&lt;/code&gt; script present in <code&gt;mt-cross-tools&lt;/code&gt; directory can be used to build custom sysroot. This script must be run as <code&gt;root&lt;/code&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 <code&gt;rasp-pi-sysroot-list.default&lt;/code&gt;. | |||
<code><br />$ ./mksysroot-rasp-pi<br />This script must be run as root<br />usage: sudo ./mksysroot-rasp-pi RPM_LIST<br /></code> | |||
'''Note -''' <code&gt;mksysroot-rasp-pi&lt;/code&gt; generates the sysroot at <code&gt;/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root&lt;/code&gt;. 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) | |||
[…] | |||
$ 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> | |||
Your newly minted sysroot is now available at <code&gt;/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root&lt;/code&gt; | |||
=== | === 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 <code&gt;/dev/sdb&lt;/code&gt; device. | |||
<code> | <code><br /># fdisk /dev/sdb | ||
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 | |||
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 | |||
Command (m for help): q | |||
#<br /></code> | |||
All partitions are primary partitions. | 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 | * 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 second paritition is a Ext4 partition, where the root filesystem resides | ||
* The third partition is a swap partition that | * 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 <code&gt;Disk Utility&lt;/code&gt;, <code&gt;fdisk&lt;/code&gt;, <code&gt;parted&lt;/code&gt; and <code&gt;mkfs&lt;/code&gt; 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 <code&gt;rasp-pi-kernel-3.1-partition.tar.bz2&lt;/code&gt;, 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> | |||
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 | Assuming your boot partition is mounted at <code&gt;/media/boot&lt;/code&gt;, 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 | |||
[…]<br />$<br /></code> | |||
====Root Filesystem h4.==== | ==== Root Filesystem h4. ==== | ||
The root partition must be an Ext4 partition. | The root partition must be an Ext4 partition. | ||
<code&gt;mkrootfs-rasp-pi&lt;/code&gt; script present in <code&gt;mt-cross-tools&lt;/code&gt; directory can be used to build custom rootfs. This script must be run as <code&gt;root&lt;/code&gt; 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 | # 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 <code&gt;rasp-pi-rootfs-list.default&lt;/code&gt; | |||
<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> | |||
Now, to build your new rootfs at <code&gt;/tmp/rootfs&lt;/code&gt;, | |||
<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) | |||
Your newly minted rootfs is now available at | […] | ||
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> | |||
Your newly minted rootfs is now available at <code&gt;/tmp/rootfs&lt;/code&gt;. You can now copy over this directory over to the rootfs partition on the SD Card. Assuming your rootfs partition is mounted at <code&gt;/media/root&lt;/code&gt;, you can do the following, | |||
<code><br />$ sudo rsync -av /tmp/rootfs/* /media/root/<br />[sudo] password for rajiv: | |||
[…] | |||
var/tmp/<br />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> | |||
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 | === Updating <code&gt;mt-cross-tools&lt;/code&gt; h3. === | ||
<code&gt;mt-cross-tools&lt;/code&gt; repository which is available on "Gitorious&quot;:http://qt.gitorious.org/qtonpi/mt-cross-tools or "Gerrit&quot;:http://codereview.qt.io/#admin,project,qtonpi/mt-cross-tools,info. | |||
'''Note | '''Note -''' You will need to clone <code&gt;mt-cross-tools&lt;/code&gt; into the <code&gt;platform-sdk/&lt;/code&gt; 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> | |||
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> | |||
Revision as of 10:29, 24 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,
- Base Layer
- Middleware
- 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 <code>Development Tools</code> meta-package.
<br />$ sudo yum groupinstall 'Development Tools'<br />
Once this is done, next step would be to install <code>augeas-libs</code>, which is needed to install <code>zypper</code> package.
<br />$ sudo yum install augeas-libs<br />
Installing <code>host-rpms</code>
You will find <code>host-rpms</code> in the following directory.
<br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ ├── host-rpms/<br />
To install, just go into that directory and do an <code>sudo rpm -ivh * </code>
<br />$ pwd<br />/home/rajiv/qtonpi-0.2/platform-sdk/host-rpms<br />$ sudo rpm -ivh *rpm<br />
Getting Image Creator and Sysroot scripts
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,
<br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ └── mt-cross-tools/<br />
Creating custom Sysroot
<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>.
<br />$ ./mksysroot-rasp-pi<br />This script must be run as root<br />usage: sudo ./mksysroot-rasp-pi RPM_LIST<br />
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.
<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)
[…]
$ 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 />
Your newly minted sysroot is now available at <code>/opt/qtonpi/armv5tel-qtonpi-linux-gnueabi/sys-root</code>
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 <code>/dev/sdb</code> device.
<br /># fdisk /dev/sdb
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
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
Command (m for help): q
#<br />
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 <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.
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,
<br />qtonpi-0.2<br />├── platform-sdk<br />│ ├── image-creator-binaries<br />│ │ ├── rasp-pi-kernel-3.1-modules.tar.bz2<br />
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 <code>/media/boot</code>, you could do something like,
<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
[…]<br />$<br />
Root Filesystem h4.
The root partition must be an Ext4 partition.
<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
- 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 <code>rasp-pi-rootfs-list.default</code>
<br />$ ./mkrootfs-rasp-pi<br />This script must be run as root<br />usage: sudo ./mkrootfs-rasp-pi ROOTFS_DIR RPM_LIST<br />
Now, to build your new rootfs at <code>/tmp/rootfs</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)
[…]
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 />
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,
<br />$ sudo rsync -av /tmp/rootfs/* /media/root/<br />[sudo] password for rajiv:
[…]
var/tmp/<br />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 />
Your SD card is now ready with custom QtonPi image for use on Raspberry Pi.
Updating <code>mt-cross-tools</code> h3.
<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 <code>mt-cross-tools</code> into the <code>platform-sdk/</code> subdirectory of your QtonPi release.
<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 />
After cloning, your relative directory structure should look as follows,
<br />qtonpi-X.Y/<br />├── platform-sdk/<br />│ └── mt-cross-tools/<br />