0

I tried to include my custom helloword patch to build root.

in

make menuconfig

I have added global patch directory /home/Downloads/buildroot/buildroot-2017.11/patches

enter image description here

and I place my patch files inside the below directory

(/home/Downloads/buildroot/buildroot-2017.11/patches/packagename/version/patch).

I referred this link and this link

After make command the patch is not getting applied in my source directory, the source is getting extracted to the output/build directory from the .tar fle. please suggest a solution..

Config.in

config BR2_PACKAGE_HELLOWORLD
bool "helloworld"
help
  Hello World package says hello world to you
  see http://helloworld.com for more on this software

helloworld.mk

HELLOWORLD_VERSION = 1.0.0
HELLOWORLD_SOURCE = helloworld-1.1.tar.gz
HELLOWORLD_PATCH = 18-helloworld-testing.patch
HELLOWORLD_SITE_METHOD = local

define  HELLOWORLD_BUILD_CMDS
    $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
endef

define  HELLOWORLD_INSTALL_TARGET_CMDS
    $(INSTALL) -D -m 0755 $(@D)/helloworld $(TARGET_DIR)/usr/bin/helloworld

    $(INSTALL) -D -m 0755 $(@D)/helloworld-init $(TARGET_DIR)/etc/init.d/S90helloworld  
endef


$(eval $(generic-package))
TamiL
  • 2,706
  • 4
  • 24
  • 44
  • I guess your patch is in `/home/Downloads/buildroot/buildroot-2017.11/patches/helloworld/1.0.0/0001-some-patch-description.patch`, and not in `/home/Downloads/buildroot/buildroot-2017.11/patches/packagename/version/patch` like you put in the question? – Arnout May 16 '18 at 15:19
  • Yes, i just give general format, actually path is /home/Downloads/buildroot/buildroot-2017.11/patches/helloworld/1.0.0/ – TamiL May 17 '18 at 04:42
  • And it is called `something.patch`? Just `patch` is not going to work, it needs to end in `.patch`. – Arnout May 18 '18 at 10:23
  • Just to be sure: you did do `rm -rf output/build/helloworld*` before calling make, right? Patches are not re-applied except when you completely remove the build directory. – Arnout May 18 '18 at 10:50

1 Answers1

0

With the local _SITE_METHOD, patches are not applied. local is when you want to use the files directly from their source directory. With the local _SITE_METHOD, the directory specified in HELLOWORLD_SITE will be copied to the build directory, no patches are applied, the _SOURCE is not used.

However, since you don't specify HELLOWORLD_SITE, you trigger a corner case that causes it to behave like the file _SITE_METHOD (which is the one you actually want). Buildroot should give an error for this case. A patch is pending for this.

Unfortunately, that doesn't explain why the patches don't get applied.

Arnout
  • 2,927
  • 16
  • 24