Commit Graph

71 Commits

Author SHA1 Message Date
Christian Marangi 9536446965
quilt.mk: don't error on refresh/update if patches doesn't exist
The current code fails if we have package or host tools with no patches
to apply. The error printend is the following: (taking ubus as an
example)

make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[1]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt'
make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
The source directory contains no quilt patches.
make[2]: *** [Makefile:81: quilt-check] Error 1
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
time: package/system/ubus/refresh#0.06#0.00#0.07
    ERROR: package/system/ubus failed to build.
make[1]: *** [package/Makefile:120: package/system/ubus/refresh] Error 1
make[1]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt'
make: *** [/home/ansuel/openwrt-ansuel/openwrt/include/toplevel.mk:232: package/ubus/refresh] Error 2

We exit 1 after saying that there are no patches because later in the
function quilt pop fails to execute.

Having no patches for a package and calling refresh should not be
a critical error and the function should just do nothing.

To handle this improve quilt.mk with the following addition.
- If we don't have any patch for the package, we print a warning and we
  create an empty series. This is useful to trick quilt and make it do
  nothing.
  We also create a status file .quilt_no_patch to detect in the other
  function that we don't have patches to handle.
- In refresh makefile target, we check if .quilt_no_patch exist and
  we skip quilt cleanup if this exist.
- In RefreshDir function we change the logic and now we delete the
  patches directory and not only the content. This is done as a cleanup
  to clean case with empty patches directory.
- In RefreshDir we check if .quilt_no_patch exist and we skip creating
  the patches directory and copying the refreshed patches.
- In RefreshDir we delete at the end any trace of .quilt_no_patch if
  present.

This is needed to support run like package/refresh that will run the
refresh process on any package present in the buildroot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-06 21:59:29 +02:00
Christian Marangi bb1bfb4602
quilt.mk: use CURDIR instead of ./ for PATCH_DIR and FILES_DIR
To better reference them for diagnostic use, reference the PATCH_DIR and
FILES_DIR with the absolute path instead of using ./ and reference by
the relative location.

No behaviour change intended.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-06 21:59:28 +02:00
Rosen Penev 9586a270a0 quilt.mk: fix typo in the Host section
HOST_PATCH_DIR is used for host patches, not PATCH_DIR.

Fixes refreshing patches with a custom HOST_PATCH_DIR.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-19 16:13:58 +01:00
Leonardo Mörlein b993b68b6c build: introduce $(MKHASH)
Before this commit, it was assumed that mkhash is in the PATH. While
this was fine for the normal build workflow, this led to some issues if

    make TOPDIR="$(pwd)" -C "$pkgdir" compile

was called manually. In most of the cases, I just saw warnings like this:

    make: Entering directory '/home/.../package/gluon-status-page'
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    [...]

While these were only warnings and the package still compiled sucessfully,
I also observed that some package even fail to build because of this.

After applying this commit, the variable $(MKHASH) is introduced. This
variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the
correct path.

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
2021-05-13 15:13:15 +02:00
Paul Spooren a17b8eaa2e build: use SPDX license tags
The license folder is a core part of OpenWrt and all GPL-2.0 licensed.
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[rebase, keep some Copyright lines, sharpen commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 14:54:47 +01:00
Michal Hrusecky 37e91861cc build: Use LINUX_DIR for Kernel/Patch
Use LINUX_DIR as a path when patching kernel. Doesn't break the current usage,
but allows to create packages that will contain variation of a kernel with
kernel being build in some subdirectory of PKG_BUILD_DIR.

Signed-off-by: Michal Hrusecky <michal.hrusecky@nic.cz>
2019-01-30 13:20:14 +01:00
John Crispin 74d00a8c38 kernel: split patches folder up into backport, pending and hack folders
* properly format/comment all patches
* merge debloat patches
* merge Kconfig patches
* merge swconfig patches
* merge hotplug patches
* drop 200-fix_localversion.patch - upstream
* drop 222-arm_zimage_none.patch - unused
* drop 252-mv_cesa_depends.patch - no longer required
* drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused
* drop 661-fq_codel_keep_dropped_stats.patch - outdated
* drop 702-phy_add_aneg_done_function.patch - upstream
* drop 840-rtc7301.patch - unused
* drop 841-rtc_pt7c4338.patch - upstream
* drop 921-use_preinit_as_init.patch - unused
* drop spio-gpio-old and gpio-mmc - unused

Signed-off-by: John Crispin <john@phrozen.org>
2017-08-05 08:46:36 +02:00
Jonas Gorski 2ab0963971 build: fix kernel refresh failure on first run
Override {HOST_}QUILT before making decisions based on it, else it will
cause target/linux/refresh to fail on first run.

Fixes: 36ba6237d6 ("build: fix quilt for mixed package/host builds")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
2017-06-04 10:36:48 +02:00
Felix Fietkau 36ba6237d6 build: fix quilt for mixed package/host builds
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-05-25 19:01:07 +02:00
Felix Fietkau 221f323782 build: set QUILT=1 automatically when calling package host build refresh
Makes behavor consistent with package builds and regular host builds

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-05-25 19:01:07 +02:00
Felix Fietkau 5aa03e16a7 build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is used
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-19 13:30:22 +01:00
Felix Fietkau 84bd74057f build: use mkhash to replace various quirky md5sum/openssl calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-05 11:09:12 +01:00
Felix Fietkau 22ef1c83b3 kernel: make the kernel build auto-clean the build dir like package builds
Previous behavior can be restored by using QUILT=1 on target/prepare

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-08-05 14:17:08 +02:00
Felix Fietkau e5c1cc5545 build: for refresh, override HOST_QUILT like QUILT
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47868
2015-12-11 19:21:29 +00:00
Luka Perkov 7002f6326e include: remove trailing whitespaces
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 45127
2015-03-29 07:29:18 +00:00
Felix Fietkau 9cf5926eff quilt: add a NO_RECONFIGURE override for compiling a package without re-running Build/Configure
SVN-Revision: 30500
2012-02-13 15:31:28 +00:00
Jo-Philipp Wich 149341faf1 silence error when package has no patches (patchwork 321)
SVN-Revision: 26627
2011-04-12 21:11:24 +00:00
Jo-Philipp Wich 38e3474542 quilt.mk: export PATCH for patch-kernel.sh
SVN-Revision: 23315
2010-10-08 09:21:34 +00:00
Jo-Philipp Wich d3f412f4ec rename PATCH to KPATCH
SVN-Revision: 23286
2010-10-07 11:32:09 +00:00
Felix Fietkau 9d8f81149f fix the path to the build dir for host packages
SVN-Revision: 14998
2009-03-23 18:33:40 +00:00
Felix Fietkau 3616727c87 fix HOST_QUILT override
SVN-Revision: 14996
2009-03-23 18:32:58 +00:00
Felix Fietkau 24dee6de52 speed up quilt imports
SVN-Revision: 14987
2009-03-23 12:02:02 +00:00
Felix Fietkau 9b96b24e32 fix quilt variable and stampfile usage for host builds
SVN-Revision: 14910
2009-03-17 03:21:52 +00:00
Felix Fietkau ddcfaeb1e5 move host build in packages into a separate namespace: package/<name>/host/<target> this allows dependencies between host and target packages, and saves unnecessary host builds for packages that contain both variants
SVN-Revision: 14905
2009-03-17 02:20:34 +00:00
Felix Fietkau 431c9267b4 replace a few unnecessary $(shell) calls
SVN-Revision: 14739
2009-03-03 14:55:53 +00:00
Felix Fietkau 127296bc45 speed up metadata scanning a lot by avoiding unnecessary shell commands and make recursions
SVN-Revision: 14734
2009-03-03 13:54:29 +00:00
Felix Fietkau f684d0a47b allow a separate patch directory for host patches
SVN-Revision: 14630
2009-02-22 23:54:17 +00:00
Felix Fietkau bc6fcb0067 eliminate redundancy by creating the quilt_used stampfile in the right place
SVN-Revision: 14620
2009-02-22 17:50:31 +00:00
Felix Fietkau e7b01c6aa1 fix missing change from r14610
SVN-Revision: 14617
2009-02-22 16:49:21 +00:00
Felix Fietkau 7eb1589875 build system refactoring in preparation for allowing packages to do host-build steps
SVN-Revision: 14610
2009-02-22 04:37:20 +00:00
Nicolas Thill 1f5c64d436 prevent quilt from loading any configuration file (closes: #4520)
SVN-Revision: 14351
2009-02-02 07:41:01 +00:00
John Crispin 3ec3f111ff if quilt failed whilst patching, no output was shown
SVN-Revision: 14178
2009-01-25 17:28:11 +00:00
Mirko Vogt 35e3dbab79 do not ignore exit codes of quilt anymore (by nbd)
SVN-Revision: 14149
2009-01-22 22:01:39 +00:00
Felix Fietkau 40b5e7a30d fix prepare error with brcm-2.4 and missing files/ (thx, thepeople)
SVN-Revision: 13021
2008-10-21 19:26:36 +00:00
Felix Fietkau 1e570a9288 change the way ./files* and the generic kernel files are applied. ./files now applies to *ALL* kernel versions, and is copied along with ./files-* - this gets rid of quite a bit of redundancy in the extra kernel drivers.
SVN-Revision: 13010
2008-10-18 21:43:30 +00:00
Felix Fietkau beb83c1e59 add function names to quilt-generated patch files to make patches more readable
SVN-Revision: 12938
2008-10-10 01:44:55 +00:00
Felix Fietkau ab8c8b019f enable quilt by default for the kernel tree
SVN-Revision: 12400
2008-08-27 14:14:00 +00:00
Imre Kaloz 40a175150e upstream style quilt refresh
SVN-Revision: 11350
2008-06-04 13:10:52 +00:00
Imre Kaloz 83072a149a override user/system specific quilt configuration
SVN-Revision: 11295
2008-05-30 13:51:06 +00:00
Felix Fietkau 2448cb8a15 add optional version suffix to kernel files/ directories
SVN-Revision: 10972
2008-04-28 22:01:14 +00:00
Felix Fietkau 03354353af clean up reject files after copying target/linux/*/files to the kernel tree
SVN-Revision: 10722
2008-04-03 18:37:30 +00:00
Felix Fietkau 2cb6cbf061 fix quilt apply for packages that change STAMP_*
SVN-Revision: 9531
2007-11-10 22:51:02 +00:00
Felix Fietkau 4af66e8866 fix accidental double slash in prefixed quilt patchsets
SVN-Revision: 9166
2007-10-07 00:16:50 +00:00
Felix Fietkau 5f87e72dae fix quilt patch check
SVN-Revision: 9121
2007-10-04 17:58:12 +00:00
Felix Fietkau 7d179076ca separate series file fixup from quilt check to avoid series file breakages after fixing a broken patch stack with quilt
SVN-Revision: 9120
2007-10-04 15:32:55 +00:00
Tim Yardley 458ce0cb5c fix quilt integration
SVN-Revision: 9100
2007-10-02 21:54:22 +00:00
Felix Fietkau e2f7a60283 fixes for refresh/update handling
SVN-Revision: 9063
2007-09-29 04:29:11 +00:00
Felix Fietkau d1933f9761 move a stampfile to make it easier to override the patch template
SVN-Revision: 9062
2007-09-29 03:39:57 +00:00
Felix Fietkau 5f1d42ea7c refactor quilt patching code
SVN-Revision: 9061
2007-09-29 03:28:03 +00:00
Felix Fietkau 03543ec4a4 proper series file support for regular packages
SVN-Revision: 9059
2007-09-29 00:25:38 +00:00