User Tools

Site Tools


doc:appunti:prog:openmoko_compile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:appunti:prog:openmoko_compile [2009/12/16 15:20] niccolodoc:appunti:prog:openmoko_compile [2009/12/16 15:39] niccolo
Line 143: Line 143:
 === Using the toolchains === === Using the toolchains ===
  
-The OpenMoko toolchain provides the **''om-make-ipkg''** utility, just provide the directory where to **''make install''** and a control file:+The OpenMoko toolchain provides the **''om-make-ipkg''** utility. It requires the **directory** name where to execute the ''make install'' and the name of the **control file**:
  
 <code> <code>
Line 152: Line 152:
 The control file is described [[http://wiki.openmoko.org/wiki/Toolchain#Packaging_your_application|here]]. The control file is described [[http://wiki.openmoko.org/wiki/Toolchain#Packaging_your_application|here]].
  
-If you need more control files (e.g. a ''postinst'' or alike) you have to tweak with the ''om-make-ipkg'' script. +If you need more control files (e.g. a ''postinst'' or alike) you have to tweak with the ''om-make-ipkg'' script.  Here it is the script I use, it looks for the control files into an **''opkg''** directory, so you have to pass just the directory name containing the source tree. 
 + 
 +<code bash> 
 +#!/bin/sh -e 
 + 
 +error_exit () { 
 +        echo usage: $(basename ${0}) [app_dir_name] [ipkg_control_file] 
 +        exit 1 
 +
 + 
 +test x${OMTOOL_DIR} = x && . /usr/local/openmoko/arm/setup-env 
 +. ${OMTOOL_DIR}/arm/scripts/functions 
 +S=${1} 
 +(test x${S} = x || test ! -d ${S}) && error_exit 
 +appname=$(basename ${S}) 
 +tmpdir=/tmp/${appname}-ipkg-tmp 
 +test -e "${tmpdir}" && echo Cannot use ${tmpdir} because it already exists. && exit 1 
 +make -C ${S} install DESTDIR="${tmpdir}" 
 +# Copy control files to destination directory. 
 +cp -pr opkg/* ${tmpdir} 
 +ipkg-build -o 0 -g 0 ${tmpdir} 
 +rm -rf ${tmpdir} 
 +</code> 
 + 
 +Control files and other files are arranged into the ''opkg'' directory as needed, here it is an example: 
 + 
 +<code> 
 +opkg/CONTROL/postinst 
 +opkg/CONTROL/control 
 +opkg/etc/rcS.d/S96overcommit_memory.sh 
 +</code>
  
 === Using opkg-utils === === Using opkg-utils ===
doc/appunti/prog/openmoko_compile.txt · Last modified: 2009/12/17 11:20 by niccolo