Changeset 756


Ignore:
Timestamp:
Mar 6, 2016, 8:52:45 PM (3 years ago)
Author:
amain
Message:

Simplyfiy OpenWrt patch management using quilt. Allowing debwrt rebuilds without rebuilding OpenWrt toolchain. In other words: make clean; make openwrt/update; make -j4 V=s

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/buildbot/buildep.sh

    r729 r756  
    3434                        unzip\
    3535                        apt-cacher-ng \
    36                         makedev
     36                        makedev \
     37                        quilt
    3738mkdir -p ~/dl
    3839
  • trunk/openwrt/openwrt.mk

    r751 r756  
    3333        "$(OPENWRT_PATCHES_DIR)/$(OPENWRT_BRANCH)"
    3434
    35 get_patches = \
    36         if [ ! -d "$(OPENWRT_BUILD_DIR)" ]; then exit 1; fi ; \
    37         rev=$(call get_svn_revision,$(OPENWRT_BUILD_DIR)) ; \
    38         find \
    39           $(OPENWRT_PATCH_DIRS) \
    40           -name .svn -prune -o \! -type d -printf %f/%p\\n 2>/dev/null | \
    41         gawk -F / '\
    42           BEGIN { OFS=FS } \
    43           match($$1, "^([[:digit:]]+)((-$(OPENWRT_BRANCH))|(-all))?(-([[:digit:]]*):([[:digit:]]*))?(_[^/]*)", revs) \
    44             { if(revs[6] <= '$${rev}' && (!length(revs[7]) || revs[7] >= '$${rev}')) \
    45               { $$1=revs[1] revs[8]; print } \
    46             }' | \
    47         sort $(1) | sed -e's/^[^/]\+\///'
    48 
    49 do_patches = \
    50         if [ ! -d "$(OPENWRT_BUILD_DIR)" ]; then exit 1; fi ; \
    51         $(call get_patches,$(1)) | while read patch ; \
    52         do \
    53                 patchi=$$(echo $${patch} | sed -e's!$(TOPDIR)/!!') ; \
    54                 if ! patch -b -d "$(OPENWRT_BUILD_DIR)" -p1 $(2) < "$${patch}" ; \
    55                 then \
    56                         echo ">> fail: $${patchi}" 1>&2 ; \
    57                         $(if $(FORCE_PATCH),retval=1,exit 1) ; \
    58                 else \
    59                         echo ">> success: $${patchi}" ; \
    60                 fi ; \
    61         done
     35# keep for future reference:
     36#
     37#get_patches = \
     38#       if [ ! -d "$(OPENWRT_BUILD_DIR)" ]; then exit 1; fi ; \
     39#       rev=$(call get_svn_revision,$(OPENWRT_BUILD_DIR)) ; \
     40#       find \
     41#         $(OPENWRT_PATCH_DIRS) \
     42#         -name .svn -prune -o \! -type d -printf %f/%p\\n 2>/dev/null | \
     43#       gawk -F / '\
     44#         BEGIN { OFS=FS } \
     45#         match($$1, "^([[:digit:]]+)((-$(OPENWRT_BRANCH))|(-all))?(-([[:digit:]]*):([[:digit:]]*))?(_[^/]*)", revs) \
     46#           { if(revs[6] <= '$${rev}' && (!length(revs[7]) || revs[7] >= '$${rev}')) \
     47#             { $$1=revs[1] revs[8]; print } \
     48#           }' | \
     49#       sort $(1) | sed -e's/^[^/]\+\///'
     50#
     51#do_patches = \
     52#       if [ ! -d "$(OPENWRT_BUILD_DIR)" ]; then exit 1; fi ; \
     53#       $(call get_patches,$(1)) | while read patch ; \
     54#       do \
     55#               patchi=$$(echo $${patch} | sed -e's!$(TOPDIR)/!!') ; \
     56#               if ! patch -b -d "$(OPENWRT_BUILD_DIR)" -p1 $(2) < "$${patch}" ; \
     57#               then \
     58#                       echo ">> fail: $${patchi}" 1>&2 ; \
     59#                       $(if $(FORCE_PATCH),retval=1,exit 1) ; \
     60#               else \
     61#                       echo ">> success: $${patchi}" ; \
     62#               fi ; \
     63#       done
    6264
    6365openwrt/all: openwrt/build
     
    129131        touch $@
    130132
    131 openwrt/patch/show: openwrt/checkout
    132         @$(call get_patches) | while read patch ;\
    133         do \
    134            echo $${patch}; \
    135         done
    136 
    137 openwrt/patch/force:
    138         rm -f $(TOPDIR)/openwrt/patch ; \
    139         $(MAKE) -C $(TOPDIR) openwrt/patch FORCE_PATCH=1 ; \
    140 
    141 openwrt/patch: openwrt/checkout
    142         @$(call do_patches,,-N)
    143         rm -f openwrt/unpatch
    144         touch $@
    145 
    146 openwrt/unpatch/show: openwrt/checkout
    147         @$(call get_patches,-r) | while read patch ;\
    148         do \
    149            echo $${patch}; \
    150         done
    151 openwrt/unpatch/force:
    152         rm -f $(TOPDIR)/openwrt/unpatch ; \
    153         $(MAKE) -C $(TOPDIR) openwrt/unpatch FORCE_PATCH=1 ; \
    154 
    155 openwrt/unpatch:
    156         @if [ ! -f $(TOPDIR)/openwrt/patch -a "$(FORCE_PATCH)" != 1 ]; then \
    157            echo "E: can't unpatch if patches have not previously been applied"; \
    158            exit 1; \
    159         fi
    160         @$(call do_patches,-r,-R)
     133openwrt/patches/install: openwrt/checkout
     134        mkdir $(OPENWRT_BUILD_DIR)/patches
     135        cp -ra $(OPENWRT_PATCHES_DIR)/all/* $(OPENWRT_BUILD_DIR)/patches
     136        cd $(OPENWRT_BUILD_DIR)/patches; ls -1 | sort | grep -v "^series" >series
     137        touch $@
     138
     139openwrt/patches/uninstall: openwrt/unpatch
     140        rm -rf $(OPENWRT_BUILD_DIR)/patches
     141        rm -f openwrt/patches/install
     142
     143openwrt/patch: openwrt/checkout openwrt/patches/install
     144        cd $(OPENWRT_BUILD_DIR); quilt push -a
     145        touch $@
     146
     147openwrt/unpatch: $(OPENWRT_BUILD_DIR)/patches
     148        cd $(OPENWRT_BUILD_DIR); quilt pop -a
    161149        rm -f openwrt/patch
    162         touch $@
    163150
    164151openwrt/files-copy: openwrt/patch
     
    184171        touch $@
    185172
    186 openwrt/update: openwrt/checkout openwrt/patch
    187         $(MAKE) openwrt/unpatch
     173# checkout or update openwrt
     174openwrt/update: openwrt/checkout
     175        -$(MAKE) openwrt/patches/uninstall
    188176        cd $(OPENWRT_BUILD_DIR); git pull origin master
    189177        $(MAKE) openwrt/patch
     
    233221        rm -f openwrt/merge-config
    234222
    235 .PHONY: openwrt/patch/force \
    236         openwrt/unpatch/force \
    237         openwrt/clean \
    238 
     223.PHONY: openwrt/patches/uninstall \
     224        openwrt/clean
     225
  • trunk/openwrt/patches

    • Property svn:ignore set to
      install
Note: See TracChangeset for help on using the changeset viewer.