Difference between revisions of "Buildroot Packages"

From ArmadeusWiki
Jump to: navigation, search
(Preliminary work)
m
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Need_Update}}
 +
 
In this page you will learn how to add a new package or a new application to the Armadeus buildroot
 
In this page you will learn how to add a new package or a new application to the Armadeus buildroot
  
 
== Preliminary work ==
 
== Preliminary work ==
 +
{{Note| It could be a good idea to [http://buildroot.uclibc.org/buildroot.html read Buildroot's documentation] first ;-)}}
  
 
# Take a look at the buildroot mailing list to check whether the work has not already been done
 
# Take a look at the buildroot mailing list to check whether the work has not already been done
 
# Send an email on the Armadeus mailing list (SourceForge) to verify that nobody is working on this  package or to get help
 
# Send an email on the Armadeus mailing list (SourceForge) to verify that nobody is working on this  package or to get help
# Check that the package is not available here: http://www.daimi.au.dk/~spider/gumstix/gumstix-buildroot/package/ or here: http://downloads.openwrt.org/whiterussian/packages/ then https://dev.openwrt.org/browser/branches/whiterussian/openwrt/package
+
# Check if the package is not already available here (could be easier to start with):  
 +
#*http://www.daimi.au.dk/~spider/gumstix/gumstix-buildroot/package/ or here:
 +
#*https://svn.openwrt.org/openwrt/packages/
 +
#*http://downloads.openwrt.org/whiterussian/packages/
 +
#*https://dev.openwrt.org/browser/branches/whiterussian/openwrt/package
 +
#* and eventually here: http://cgit.openembedded.net/cgit.cgi?url=openembedded/tree/
 
# Create a directory in buildroot/package. For our exemple we will install the package named "toto" <pre>$ mkdir buildroot/package/toto</pre>
 
# Create a directory in buildroot/package. For our exemple we will install the package named "toto" <pre>$ mkdir buildroot/package/toto</pre>
# In this folder, create a new Makefile "toto.mk" and a new config file "Config.in". If you need some tips on how to write these files, take a look here: buildroot/package/sdl/
+
# In this folder, create a new Makefile "toto.mk" and a new config file "Config.in". If you need some tips on how to write these files, take a look here: [http://buildroot.uclibc.org/buildroot.html#add_software buildroot documentation] and there buildroot/package/sdl/
 
# Modify Config.in according to the description of the "Toto" package:
 
# Modify Config.in according to the description of the "Toto" package:
 
# Modify toto.mk. This Makefile should contain several steps:  
 
# Modify toto.mk. This Makefile should contain several steps:  
Line 20: Line 28:
 
== Compilation test of the package ==
 
== Compilation test of the package ==
  
Try this:
+
# Try this: <pre>$ make -C buildroot/ toto</pre>
$ make -C buildroot/ toto
+
# If this command works, test your package on an Armadeus plateform. If it's ok you can jump to the next chapter and proceed with the integration into Buildroot. Otherwise it is perhaps necessary to do some modifications of the sources/Makefile.  
 
+
# Start by creating a new folder containing the package to modify: <pre>$ cp -Rf buildroot/build_armv4t/toto buildroot/build_arm/toto.org </pre>
If this command works, test your package on an Armadeus plateform. If it's ok you can jump to the next chapter and proceed with the integration into buildroot.
+
# Now perform the modifications in the ''toto'' directory until you get a running package. Once done, one or several patches will be probably required against the original sources: <pre>$  diff -urN toto.org/fichier toto/fichier > ../package/toto/toto.0.patch</pre>
Otherwise it is perhaps necessary to do some modifications of the sources/Makefile.  
+
# These patches will be applied by the toto.mk file. Save your work: <pre>$ mv buildroot/build_armv4t/toto buildroot/build_armv4t/toto.ok</pre>
Start by creating a new folder containing the package to modify:
+
# and check it:<pre> $ make -C buildroot/ toto</pre>
$ cd buildroot/build_arm
+
$ cp -Rf toto toto.org  
+
 
+
Now perform the modifications in the ''toto'' directory until you get a running package. Once done, one or several patches will be probably required against the original sources:
+
$  diff -rup toto.org/fichier toto/fichier > ../package/toto/toto.0.patch
+
 
+
These patches will be applied by the toto.mk file. Save your work and check it:
+
$ mv toto toto.ok
+
$ cd ../..
+
  $ make -C buildroot/ toto
+
 
+
if it is ok, remove the directories buildroot/build_arm/toto.org and buildroot/build_arm/toto.ok which are now useless
+
  
 +
If it is ok, remove the directories buildroot/build_armv4t/toto.org and buildroot/build_armv4t/toto.ok which are now useless
  
 
== Integration of the package into Buildroot ==
 
== Integration of the package into Buildroot ==
Line 54: Line 51:
  
 
  $ diff -rup buildroot/package/Config.org  buildroot/package/Config.in > patches/numero_buildroot_nompaquet.diff
 
  $ diff -rup buildroot/package/Config.org  buildroot/package/Config.in > patches/numero_buildroot_nompaquet.diff
 +
 +
'''IMPORTANT: Do not forget to test your patch before any SVN commit. You can use a second Armadeus directory to validate your patch'''
  
 
== Add the new package to the Armadeus distro ==
 
== Add the new package to the Armadeus distro ==
Line 62: Line 61:
 
  $ svn commit -m [BUILDROOT PACKAGE] Adding an usefull toto package  files --non-interactive  
 
  $ svn commit -m [BUILDROOT PACKAGE] Adding an usefull toto package  files --non-interactive  
  
 +
Do not forget to validate your patch after commit to avoid some patch conflict:
  
And now check with a fresh developpement tree...
+
$ touch patches/numero_buildroot_nompaquet.diff
 +
$ svn update
 +
$ make
  
{{LanguageBar|Buildroot_Packages|Paquets_Buildroot|Buildroot_Paketen}}
+
You can also complete your validation with a fresh developpement tree...

Latest revision as of 10:08, 15 November 2011

Update.png This page is too old and need some updates. Informations on this page are not guaranteed !! Update.png

In this page you will learn how to add a new package or a new application to the Armadeus buildroot

Preliminary work

Note Note: It could be a good idea to read Buildroot's documentation first ;-)


  1. Take a look at the buildroot mailing list to check whether the work has not already been done
  2. Send an email on the Armadeus mailing list (SourceForge) to verify that nobody is working on this package or to get help
  3. Check if the package is not already available here (could be easier to start with):
  4. Create a directory in buildroot/package. For our exemple we will install the package named "toto"
    $ mkdir buildroot/package/toto
  5. In this folder, create a new Makefile "toto.mk" and a new config file "Config.in". If you need some tips on how to write these files, take a look here: buildroot documentation and there buildroot/package/sdl/
  6. Modify Config.in according to the description of the "Toto" package:
  7. Modify toto.mk. This Makefile should contain several steps:
    • software download
    • untar the archive
    • apply patches to the sources if necessary
    • configure the sources
    • build
    • install in the rootfs
    This makefile has to contain one target toto-clean to clean up the sources after a build and an other one toto-dirclean to remove the folder from the overall compilation process

Compilation test of the package

  1. Try this:
    $ make -C buildroot/ toto
  2. If this command works, test your package on an Armadeus plateform. If it's ok you can jump to the next chapter and proceed with the integration into Buildroot. Otherwise it is perhaps necessary to do some modifications of the sources/Makefile.
  3. Start by creating a new folder containing the package to modify:
    $ cp -Rf buildroot/build_armv4t/toto buildroot/build_arm/toto.org 
  4. Now perform the modifications in the toto directory until you get a running package. Once done, one or several patches will be probably required against the original sources:
    $  diff -urN toto.org/fichier toto/fichier > ../package/toto/toto.0.patch
  5. These patches will be applied by the toto.mk file. Save your work:
    $ mv buildroot/build_armv4t/toto buildroot/build_armv4t/toto.ok
  6. and check it:
     $ make -C buildroot/ toto

If it is ok, remove the directories buildroot/build_armv4t/toto.org and buildroot/build_armv4t/toto.ok which are now useless

Integration of the package into Buildroot

Once the package or the application successfully tested, add a reference to package/toto/Config.in.

$ cp buildroot/package/Config.in  buildroot/package/Config.org

then perform the modifications in the Config.in and start buildroot menuconfig

$ make menuconfig

Select your package in the menu "package", save the configuration et retry the installation:

$ make toto-dirclean
$ make 

As soon as all is ok, you need to create the configuration patch for buildroot:( file buildroot/package/Config.in) with the same method as before

$ diff -rup buildroot/package/Config.org  buildroot/package/Config.in > patches/numero_buildroot_nompaquet.diff

IMPORTANT: Do not forget to test your patch before any SVN commit. You can use a second Armadeus directory to validate your patch

Add the new package to the Armadeus distro

All the files located in buildroot/package/toto and the patches (buildroot configuration) as well have to be added to SVN

$ svn add -N fichiers
$ svn commit -m [BUILDROOT PACKAGE] Adding an usefull toto package  files --non-interactive 

Do not forget to validate your patch after commit to avoid some patch conflict:

$ touch patches/numero_buildroot_nompaquet.diff
$ svn update
$ make

You can also complete your validation with a fresh developpement tree...