0

I have created a custom package for buildroot and put it in an external buildroot tree. I have enabled it by using make menuconfig BR_EXTERNAL=../buildroot-external

It is build successfully when triggered with make mypackage.

However when run make clean && make BR_EXTERNAL=../buildroot-external everything rebuilds while my custom package is simply forgotten. I want it to be automatically compiled as all the other packages.

As I am still developing that package the sourcecode is stored locally which is configured in the ../buildroot-external/locals.mk

For completeness those are the config-files for defining the package:

buildroot-external/package/mypackage/Config.in

config BR2_PACKAGE_MY_PACKAGE
       bool "MyPackage"
       help
            Some help about MyPackage

buildroot-external/package/mypackage/mypackage.mk

################################################################################
#
# mypackage
#
################################################################################

MYPACKAGE_VERSION = 1.0
MYPACKAGE_SOURCE = mypackage

# PACKAGE_OVERRIDE_SRC_DIR set in buildroot-external/local.mk
# sources are taken from local folder to ease development

MYPACKAGE_LICENSE = GPL-3.0+
MYPACKAGE_LICENSE_FILES = COPYING

define MYPACKAGE_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/Buildserver all
endef

define MYPACKAGE_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/Buildserver/MyPackage $(TARGET_DIR)/root/MyPackageBamboo
endef

$(eval $(generic-package))
Toto
  • 79
  • 10

2 Answers2

2

Enter make menuconfig, enable your package, exit saving changes. Now make will build your package too.

This is because by default nearly all packages are disabled since Buildroot cannot know what you need on your target root filesystem.

Luca Ceresoli
  • 1,591
  • 8
  • 19
  • I did that. Enabled the specific package, among others and saved the config. The other packages build, but mine does not. Not even an error is thrown, it seems to be forgotten. – Toto Jan 03 '20 at 09:36
  • 1
    @Toto did you try `make clean` before `make`? If the package is not built it might be because it has already been built. Also double check that it's enabled using `grep MYPACKAGE .config` – Luca Ceresoli Jan 03 '20 at 09:39
  • 1
    I found it! It was a typo in the `Config.in` I defined a package called `my_package`, while having a `mypackage.mk`. The underscore makes them two different packages. Thanks for guiding me to doublecheck everything! – Toto Jan 03 '20 at 09:52
  • Btw the mistake was orignially not in my minimal example. So you could not have spotted it. I just introduced it by purpose to better reflect my original problem. – Toto Jan 03 '20 at 09:54
0

Even though this issue was solved, I bumped into this as well, but with another source of error: I had forgotten to include/source my package's Config.in in the top level package/Config.in.

I didn't spot this in make menuconfig, because I'm using predefined configuration files (in which I had selected my package).

Different source of error, but exactly the same symptoms.

(The question and previous answers and comments acted as a fine rubber duck to make me find my issue, so a big thank you to all previously engaged!)

Jörgen Sigvardsson
  • 4,839
  • 3
  • 28
  • 51