After the enigma2 compilation
we show how to create a package.
In the recipes-local folder
1 |
~/enigma2/openatv/build-enviroment/meta-local/recipes-local |
we create a folder for our package, for example testpackage, and a subfolder files
1 2 3 4 |
mkdir testpackage cd testpackage makdir files cd files |
In the file testpackage.c, in the files folder, we insert the test code
1 2 3 4 5 |
#include <stdio.h> int main(int argc, char** argv){ printf("Test Package!\n\n"); return 0; } |
We have to create the Readme.txt in the files folder and the LICENSE file in the testpackage folder. The Readme.txt file contains informations about the application. For the LICENSE, without information at the moment, we have to generate the hash to insert into the bitbake file.
md5sum command creates the md5 file for the LICENSE
1 2 |
md5sum ~/enigma2/openatv/build-enviroment/meta-local/recipes-local/testpackage/LICENCE d41d8cd98f00b204e9800998ecf8427e |
Now we are ready to create the bitbake testpackage_0.1.bb file in the testpackage folder; here is the content of this file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
DESCRIPTION = "testpackage application" PR = "r0" LICENSE = "TEST" LIC_FILES_CHKSUM = "file:///home/sviluppo/enigma2/openatv/build-enviroment/meta-local/recipes-local/testpackage/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e" SRC_URI = "file://testpackage.c \ file://README.txt" do_compile() { ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/testpackage.c -o testpackage } do_install() { install -m 0755 -d ${D}${bindir} ${D}${docdir}/testpackage install -m 0755 ${S}/testpackage ${D}${bindir} install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/testpackage } |
We are now ready to compile the testpackage. We use the Zgemma envinronment to compile the files, as described below
1 2 3 |
cd /home/sviluppo/enigma2/openatv/build-enviroment/builds/openatv/release/h3/ source env.source bitbake testpackage |
The package is available in the folder shown below
1 2 3 4 |
sviluppo@debian8:~/enigma2/openatv/build-enviroment/builds/openatv/release/h3/tmp/deploy/ipk/mips32el$ ls testpackage* testpackage_0.1-r0_mips32el.ipk testpackage-dev_0.1-r0_mips32el.ipk testpackage-dbg_0.1-r0_mips32el.ipk testpackage-doc_0.1-r0_mips32el.ipk sviluppo@debian8:~/enigma2/openatv/build-enviroment/builds/openatv/release/h3/tmp/deploy/ipk/mips32el$ |
To install the package on the Zgemma H2H we have to trasfer the testpackage_0.1-r0_mips32el.ipk file on ZGemma H3 in the /tmp folder and execute in a shell, accessible using the telnet application, the following command
1 |
opkg install testpackage_0.1-r0_mips32el.ipk |
To force the installation use
1 |
opkg --nodeps install testpackage_0.1-r0_mips32el.ipk |
The executable is available in the /usr/bin folder; the execution gives us the expected output
1 2 |
root@zgemmah2h:/tmp# testpackage Test Package! |