Difference between revisions of "Package usage"

From ArmadeusWiki
Jump to: navigation, search
(New page: Even if Buildroot doesn't fully handle packages like debian/OpenEmbbeded and will probably never do ([http://lists.busybox.net/pipermail/buildroot/2011-November/047229.html]), you can stil...)
 
(Generate a package for your app)
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:
 
</pre>
 
</pre>
 
* add a new compile rule in ''buildroot/package/my_app/my_app.mk''
 
* add a new compile rule in ''buildroot/package/my_app/my_app.mk''
 +
<source lang="bash">
 +
MY_APP_PACKAGE_DIR = $(BUILD_DIR)/my_app_package
 +
 +
define MY_APP_BUILD_CMDS
 +
        mkdir -p $(MY_APP_PACKAGE_DIR)/CONTROL
 +
        cp ./package/my_app/opkg/control $(MY_APP_PACKAGE_DIR)/CONTROL/
 +
        mkdir -p $(MY_APP_PACKAGE_DIR)/usr/local/bin
 +
        cp -a $(@D)/my_app $(MY_APP_PACKAGE_DIR)/usr/local/bin
 +
        sh ./package/opkg/opkg-build $(MY_APP_PACKAGE_DIR) $(BINARIES_DIR)
 +
endef
 +
</source>

Latest revision as of 09:30, 4 June 2013

Even if Buildroot doesn't fully handle packages like debian/OpenEmbbeded and will probably never do ([1]), you can still generate a package for your custom application and use it to update it on field, thanks to opkg.

Install opkg on target

$ make menuconfig
Package Selection for the target  --->
    Package managers  --->
        [*] opkg
$ make
  • reflash the rootfs on your APF

Generate a package for your app

  • we assume that you already integrated your application in Buildroot and that buildroot/package/my_app/ is existing.
  • create a "control" file that will describe your application for opkg (buildroot/package/my_app/opkg/control):
Package: my-app
Version: 2.0.800
Description: My application
Section: applications
Priority: optional
Maintainer: Me
Architecture: arm
Homepage:
Source:
Depends:
  • add a new compile rule in buildroot/package/my_app/my_app.mk
MY_APP_PACKAGE_DIR = $(BUILD_DIR)/my_app_package

define MY_APP_BUILD_CMDS
        mkdir -p $(MY_APP_PACKAGE_DIR)/CONTROL
        cp ./package/my_app/opkg/control $(MY_APP_PACKAGE_DIR)/CONTROL/
        mkdir -p $(MY_APP_PACKAGE_DIR)/usr/local/bin
        cp -a $(@D)/my_app $(MY_APP_PACKAGE_DIR)/usr/local/bin
        sh ./package/opkg/opkg-build $(MY_APP_PACKAGE_DIR) $(BINARIES_DIR)
endef