Package usage

From ArmadeusWiki
Jump to: navigation, search

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
  • add a new compile rule in buildroot/package/my_app/
MY_APP_PACKAGE_DIR = $(BUILD_DIR)/my_app_package

        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)