Discussion:
[OpenWrt-Devel] Working with patches
Peter Lawler
2012-05-05 08:29:49 UTC
Permalink
Hi!
I'm working on submitting a patch for the appweb package by following
the Wiki page
http://wiki.openwrt.org/doc/devel/patches#edit.an.existing.patch

The specific patch I'm working on is this one for appweb
https://github.com/embedthis/appweb-3/commit/3c1a8e11ddef0b3c771dc8b09f0fe8c52b4f97f2#build/make/Makefile.top
(mixed implicit and normal rules - as per this change to gnu make
http://osdir.com/ml/bug-make-gnu/2011-04/msg00011.html regarding
backward incompatibility )

Whilst I realise I could *probably* just submit the upstream patch, I
thought it best to follow the Wiki as my first submission, particularly
as I'd like to keep local changes in a formal way as documented by OpenWRT.

However I've got a 'little' stuck at the section of the wiki regarding
how to 'move the new patch file over to the buildroot, run update on the
package'

"make package/example/update V=99"
In my case, this is

"make package/appweb/update V=99"

generates
make[2]: *** No rule to make target `update'. Stop.

So I'm wondering if I'm holding it wrong or whether the wiki page is
incorrect.

Hoping someone's able to handhold me through this step in case I want or
need to do the procedure again elsewhere.

Regards,

Pete.
Philip Prindeville
2012-05-05 22:10:04 UTC
Permalink
Try 'refresh' instead.
Post by Peter Lawler
Hi!
I'm working on submitting a patch for the appweb package by following
the Wiki page
http://wiki.openwrt.org/doc/devel/patches#edit.an.existing.patch
The specific patch I'm working on is this one for appweb
https://github.com/embedthis/appweb-3/commit/3c1a8e11ddef0b3c771dc8b09f0fe8c52b4f97f2#build/make/Makefile.top
(mixed implicit and normal rules - as per this change to gnu make
http://osdir.com/ml/bug-make-gnu/2011-04/msg00011.html regarding
backward incompatibility )
Whilst I realise I could *probably* just submit the upstream patch, I
thought it best to follow the Wiki as my first submission, particularly
as I'd like to keep local changes in a formal way as documented by OpenWRT.
However I've got a 'little' stuck at the section of the wiki regarding
how to 'move the new patch file over to the buildroot, run update on the
package'
"make package/example/update V=99"
In my case, this is
"make package/appweb/update V=99"
generates
make[2]: *** No rule to make target `update'. Stop.
So I'm wondering if I'm holding it wrong or whether the wiki page is
incorrect.
Hoping someone's able to handhold me through this step in case I want or
need to do the procedure again elsewhere.
Regards,
Pete.
Peter Lawler
2012-05-15 20:57:23 UTC
Permalink
Post by Philip Prindeville
Try 'refresh' instead.
Hi!
Not much luck there either, though it did seem like it wanted to build
something.

It's complaining about the directory not being unpacked with QUILT=1
though I was presuming that was what "make {clean,prepare} QUILT=1" did.
Are there other things missing from the devel/patches Wiki page that I'm
missing?


$ make package/appweb/{clean,prepare} V=99 QUILT=1
$ cd build_dir/target-mips_r2_uClibc-0.9.30.1/appweb-3.2.2-1/
$ quilt push -a
$ quilt new 010-fix-make-rules.patch
$ quilt edit build/make/Makefile.top
$ quilt refresh
Refreshed patch 010-fix-make-rules.patch
$ cd ../../../
$ make package/appweb/refresh V=99
make[1]: Entering directory `/build/openwrt/svn/backfire'
make[2]: Entering directory
`/build/openwrt/svn/backfire/feeds/packages/net/appweb'
if [ -s
"/build/openwrt/svn/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/appweb-3.2.2-1/patches/series"
]; then (cd
"/build/openwrt/svn/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/appweb-3.2.2-1";
if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push
-a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
touch
"/build/openwrt/svn/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/appweb-3.2.2-1/.quilt_checked"

The source directory was not unpacked using quilt. Please rebuild with
QUILT=1


Cheers,

Pete.
Jo-Philipp Wich
2012-05-15 21:19:07 UTC
Permalink
Hi,

the errors you're experiencing are not your fault.

The appweb Makefile overrides the default Build/Prepare action which
prevents the Quilt make targets from getting executed.

This change will enable quilt patching as documented in the wiki:

diff --git a/net/appweb/Makefile b/net/appweb/Makefile
index d52e7ae..31a3783 100644
- --- a/net/appweb/Makefile
+++ b/net/appweb/Makefile
@@ -53,6 +53,7 @@ CONFIGURE_ARGS += \

define Build/Prepare
tar xzf "$(DL_DIR)/$(PKG_SOURCE)" --strip-components 1 -C "$(PKG_BUILD_DIR)"
+ $(call Build/Prepare/Default)
endef

define Build/Configure


Feel free to include that in your final patch too.

Regards,
Jow
Peter Lawler
2012-05-15 21:52:02 UTC
Permalink
Post by Jo-Philipp Wich
Hi,
the errors you're experiencing are not your fault.
woots! :)
Post by Jo-Philipp Wich
diff --git a/net/appweb/Makefile b/net/appweb/Makefile
...
Post by Jo-Philipp Wich
+ $(call Build/Prepare/Default)
Feel free to include that in your final patch too.
Thanks :)

Is there a particular procedure for patching the feeds? I ask as the
feeds wiki page talks about how to add/configure new feeds, but not
patching and the patching wiki page talks about patching packages and
the toolchain but not feeds.

I'm still reading all the build docs etc., but in the back of my mind
I'm wondering whether there's a possible issue here with using quilt to
patch a feed Makefile to get a feed Makefile to use quilt.

Regards,

Pete.

Loading...