Changeset 447


Ignore:
Timestamp:
Oct 19, 2012, 6:17:51 AM (8 years ago)
Author:
ehem
Message:

Merge application of plugin patches to OpenWRT with DebWRT's application of
OpenWRT patches. Ensure plugin patches to DebWRT are removed during clean.

Location:
branches/contrib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/Makefile

    r335 r447  
    6666        @echo "Note: wait a couple of minutes before rebooting your device. It takes time to write the firmware to the flash."
    6767
    68 clean: openwrt/clean openwrt/debwrt-clean debian/package/clean debian/buildenv/clean debian/rootfs/clean config-clean
     68clean: openwrt/clean openwrt/debwrt-clean debian/package/clean \
     69  debian/buildenv/clean debian/rootfs/clean config-clean plugins/clean
    6970        @rm -f .config .config.old
    7071
  • branches/contrib/openwrt/openwrt.mk

    r445 r447  
    5252  openwrt/patch \
    5353  openwrt/files-copy \
    54   plugins/apply-openwrt \
    5554  openwrt/merge-config \
    5655  openwrt/download-link \
  • branches/contrib/plugins/README

    r436 r447  
    1313only apply one plugin.
    1414
    15 The DebWrt patches are automatically applied in sort order before
    16 make (menu)config. OpenWrt patches are automatically applied in sort order
    17 after OpenWrt has been checked out.
     15The DebWrt patches are automatically applied in `sort`-ed order before
     16make (menu)config.
     17
     18OpenWrt patches are applied at the same time as DebWrt's patches to OpenWrt.
     19Patches can be target at specific branches or ranges of revision based on
     20filename.  Refer to openwrt/patches/README for imformation on the process.
     21Note patches MUST follow the rules in openwrt/patches/README as otherwise they
     22will not be applied!
    1823
    1924plugin.mk is included by the plugins.mk Makefile.  The suggested usage is to
     
    4146Make targets to manage plugings. Normally only needed when developing a plugin. Targets:
    4247
    43   make plugins/apply             - Apply debwrt patches and show message openwrt patches are done later
    44   make plugins/apply-debwrt      - Apply debwrt patches
    45   make plugins/apply-openwrt     - Apply openwrt patches
    46   make plugins/de-apply          - De apply debwrt and openwrt patches
    47   make plugins/de-apply-debwrt   - Apply debwrt patches
    48   make plugins/de-apply-openwrt  - Apply openwrt patches
    49   make plugins/clean             - Clean up apply and de-apply states
     48  make plugins/apply   - Apply debwrt patches and show message openwrt patches are done later
     49  make plugins/remove  - Remove debwrt patches
     50  make plugins/clean   - Clean up apply and de-apply states
    5051
  • branches/contrib/plugins/plugins.mk

    r446 r447  
    2626endif
    2727
     28# include plugin.mk from each plugin (allows influence on build process
     29# without needing to patch Makefiles)
    2830$(foreach PLUGIN_IDX,$(shell seq -w $(words $(PLUGIN_LIST))),\
    2931$(eval PLUGIN_NAME:=$(word $(PLUGIN_IDX),$(PLUGIN_LIST)))\
     
    3941
    4042
    41 ##need to resolve the -p0 vs -p1 issue first
    42 ## # add the plugin patches to the list of patches to OpenWRT
    43 ## OPENWRT_PATCH_DIRS += $(wildcard $(addprefix $(TOPDIR)/plugins/,$(addsuffix /openwrt,$(PLUGIN_LIST))))
     43# add the plugin patches to the list of patches to OpenWRT
     44OPENWRT_PATCH_DIRS += $(wildcard $(addprefix $(PLUGINS_DIR)/,$(addsuffix /openwrt,$(PLUGIN_LIST))))
    4445
    4546plugins/config_plugins.in:
     
    5960        done
    6061
    61 plugins/apply: plugins/apply-debwrt
    62         @echo "note: openwrt patches in plugins will be applied after OpenWrt has been checked out."
    63         >$@
    64 
    65 plugins/de-apply: plugins/de-apply-debwrt plugins/de-apply-openwrt
    66         >$@
    67 
    68 plugins/apply-debwrt:
     62plugins/apply:
    6963        @for plugin in $(PLUGIN_LIST); do \
    7064                echo "Applying plugin '$$plugin' on DebWrt:"; \
    7165                for patch in `find $(PLUGINS_DIR)/$$plugin/debwrt -maxdepth 2 -mindepth 1 -type f -printf '%f\n' | sort`; do \
    72                         if ( echo "$$patch" | grep -q ".rpatch$$" ); then \
     66                        if [ "$${patch%.rpatch}" != "$${patch}" ]; then \
    7367                                echo "Reverse patch: $$patch"; \
    7468                                patch -R -p1 -d $(TOPDIR) <$(PLUGINS_DIR)/$$plugin/debwrt/$$patch; \
     
    7872                        fi \
    7973                done; \
    80         done
    81         >$@
     74        done; \
     75        touch $@
    8276
    83 plugins/de-apply-debwrt:
     77plugins/remove:
    8478        @for plugin in $(PLUGIN_LIST); do \
    8579                echo "De-applying plugin '$$plugin' on DebWrt:"; \
    8680                for patch in `find $(PLUGINS_DIR)/$$plugin/debwrt/ -maxdepth 1 -mindepth 1 -type f -printf '%f\n' | sort -r`; do \
    87                         if ( echo "$$patch" | grep -q ".rpatch$$" ); then \
     81                        if [ "$${patch%.rpatch}" != "$${patch}" ]; then \
    8882                                echo "Reverse patch: $$patch"; \
    8983                                patch -N -p1 -d $(TOPDIR) <$(PLUGINS_DIR)/$$plugin/debwrt/$$patch; \
     
    9387                        fi \
    9488                done; \
    95         done
    96         >$@
     89        done; \
     90        touch $@
    9791
    98 plugins/apply-openwrt:
    99         @for plugin in $(PLUGIN_LIST); do \
    100                 echo "Applying plugin '$$plugin' on OpenWrt:"; \
    101                 for patch in `find $(PLUGINS_DIR)/$$plugin/openwrt/ -maxdepth 1 -mindepth 1 -type f -printf '%f\n' | sort`; do \
    102                         patch -p1 -d $(OPENWRT_BUILD_DIR) <$(PLUGINS_DIR)/$$plugin/openwrt/$$patch; \
    103                 done; \
    104         done
    105         >$@
    106 
    107 plugins/de-apply-openwrt:
    108         @for plugin in $(PLUGIN_LIST); do \
    109                 echo "De-applying plugin '$$plugin' on OpenWrt:"; \
    110                 for patch in `find $(PLUGINS_DIR)/$$plugin/openwrt/ -maxdepth 1 -mindepth 1 -type f -printf '%f\n' | sort`; do \
    111                         patch -R -p1 -d $(OPENWRT_BUILD_DIR) <$(PLUGINS_DIR)/$$plugin/openwrt/$$patch || true ; \
    112                 done; \
    113         done
    114         >$@
    11592
    11693plugins/clean:
    117         rm -f plugins/apply
    118         rm -f plugins/apply-debwrt
    119         rm -f plugins/apply-openwrt
    120         rm -f plugins/de-apply
    121         rm -f plugins/de-apply-debwrt
    122         rm -f plugins/de-apply-openwrt
     94        [ -f plugins/apply ] && make -C $(TOPDIR) plugins/remove ; \
     95        rm -f plugins/apply plugins/remove
    12396
    12497.PHONY: plugins/list \
Note: See TracChangeset for help on using the changeset viewer.