Changeset 491


Ignore:
Timestamp:
Nov 9, 2012, 11:37:16 PM (7 years ago)
Author:
amain
Message:

plugin: apply exit on plugin version mismatch to most of DebWrt's main targets

Location:
branches/contrib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/config/config.mk

    r487 r491  
    2222
    2323all: config/mconf/mconf
     24
     25config/check: plugins/check
    2426
    2527config/mconf/mconf:
     
    5254          >$(TOPDIR)/config/archs.in
    5355
    54 config/clean:
     56config/clean: config/check
    5557        $(MAKE) -C $(MCONF_DIR) clean
    5658
     
    6264config defconfig oldconfig menuconfig: TARGET_ARCH=
    6365
    64 config: config/mconf/conf FORCE
     66config: config/check config/mconf/conf FORCE
    6567        $(CONF) Config.in
    6668        @echo "Type make help to get a list of available DebWrt make commands"
    6769
    68 defconfig: config/mconf/conf FORCE
     70defconfig: config/check config/mconf/conf FORCE
    6971        touch .config
    7072        $(CONF) -D .config Config.in
    7173        @echo "Type make help to get a list of available DebWrt make commands"
    7274
    73 oldconfig: config/mconf/conf FORCE
     75oldconfig: config/check config/mconf/conf FORCE
    7476        $(CONF) -o Config.in
    7577        @echo "Type make help to get a list of available DebWrt make commands"
    7678
    77 menuconfig: config/mconf/mconf FORCE
     79menuconfig: config/check config/mconf/mconf FORCE
    7880        $(MCONF) Config.in
    7981        @echo "Type make help to get a list of available DebWrt make commands"
    8082
    81 .PHONY: config/clean
     83.PHONY: config/clean \
     84        config/check
    8285
  • branches/contrib/debian/buildenv/debian.mk

    r337 r491  
    4343        touch $@
    4444
    45 debian/buildenv/prepare:
     45debian/buildenv/prepare: debian/check
    4646        mkdir -p $(DEBIAN_BUILD_DIR)
    4747        # Due to various bugs in debootstrap in combination with fakechroot it is not
     
    109109        touch $@
    110110
    111 debian/buildenv/qemu-clean:
     111debian/buildenv/qemu-clean: debian/check
    112112        rm -rf $(DEBIAN_BUILD_DIR)/usr/src/qemu
    113113        rm -f debian/buildenv/qemu-prepare
    114114        rm -f debian/buildenv/qemu-build
    115115
    116 debian/buildenv/qemu-prepare:
     116debian/buildenv/qemu-prepare: debian/check
    117117        $(CHROOT) bash -c "export LC_ALL=C; apt-get -y install libglib2.0-dev"
    118118        mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/qemu
     
    129129        touch $@
    130130
    131 debian/buildenv/scratchbox-prepare:
     131debian/buildenv/scratchbox-prepare: debian/check
    132132        sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c "mkdir -p $(SB2_ARCH)-lenny"
    133133        sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c "cd $(SB2_ARCH)-lenny && sb2-init -c /usr/local/bin/qemu-$(SB2_ARCH) MIPS \"$(SB2_ARCH)-linux-gnu-gcc\""
     
    135135        sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c  "cd $(SB2_ARCH)-lenny && sb2 -eR ./debootstrap/debootstrap --second-stage"
    136136
    137 debian/buildenv/clean: debian/buildenv/qemu-clean
     137debian/buildenv/clean: debian/check debian/buildenv/qemu-clean
    138138        # sudo should not be needed if fakechroot would have worked
    139139        sudo rm -rf $(DEBIAN_BUILD_DIR)
  • branches/contrib/debian/debian.mk

    r465 r491  
    2222debian/all:
    2323
    24 debian/clean: debian/package/clean debian/buildenv/clean debian/rootfs/clean
     24debian/check: plugins/check
    2525
    26 .PHONY: debian/all debian/clean
     26debian/clean: debian/check debian/package/clean debian/buildenv/clean debian/rootfs/clean
    2727
     28.PHONY: debian/all \
     29        debian/clean \
     30        debian/check
     31
  • branches/contrib/debian/rootfs/debian.mk

    r394 r491  
    4141        @sudo cp $(ROOTFS_BUILD_DIR)/etc/resolv.conf_debwrt $(ROOTFS_BUILD_DIR)/etc/resolv.conf
    4242
    43 debian/rootfs: debian/rootfs/bootstrap         \
     43debian/rootfs: debian/check                    \
     44               debian/rootfs/bootstrap         \
    4445               debian/rootfs/unpack            \
    4546               debian/rootfs/files-install     \
     
    6970        #touch $@
    7071
    71 debian/rootfs/save:
     72debian/rootfs/save: debian/check
    7273        if [ -d /media/DEBWRT_ROOT ]; then \
    7374                sudo bash -c "tar cjf debwrt-rootfs-$(TARGET_ARCH)-$(VERSION).tar.bz2 -C /media/DEBWRT_ROOT ."; \
    7475        fi
    7576
    76 debian/rootfs/files-install: debian/rootfs/bootstrap
     77debian/rootfs/files-install: debian/check debian/rootfs/bootstrap
    7778        if [ ! -f $(ROOTFS_BUILD_DIR)/etc/init.d/rcS.debian -a -e $(ROOTFS_BUILD_DIR)/etc/init.d/rcS ]; then \
    7879                sudo mv -v $(ROOTFS_BUILD_DIR)/etc/init.d/rcS $(ROOTFS_BUILD_DIR)/etc/init.d/rcS.debian; \
     
    9192        touch $@
    9293
    93 debian/rootfs/modules-install: debian/rootfs/bootstrap
     94debian/rootfs/modules-install: debian/check debian/rootfs/bootstrap
    9495ifneq ($(DEBWRT_MODULES_ARCHIVE),)
    9596        sudo tar xof $(DEBWRT_MODULES_ARCHIVE) -C $(ROOTFS_BUILD_DIR)
     
    100101        touch $@
    101102
    102 debian/rootfs/bootstrap: debian/rootfs/clean-rootfs-dir
     103debian/rootfs/bootstrap: debian/check debian/rootfs/clean-rootfs-dir
    103104        sudo debootstrap --arch=$(TARGET_ARCH)\
    104105                     --foreign \
     
    114115        touch $@
    115116
    116 debian/rootfs/unpack: debian/rootfs/bootstrap
     117debian/rootfs/unpack: debian/check debian/rootfs/bootstrap
    117118        find $(ROOTFS_BUILD_DIR) -name "*.deb" | while read deb; do \
    118119                n=`basename $$deb`; \
     
    124125
    125126# install all available cross-compiled debwrt debian packages, except for the kernel-headers package and the cross packages
    126 debian/rootfs/debwrt-packages: debian/rootfs/bootstrap debian/package/rootfs
     127debian/rootfs/debwrt-packages: debian/check debian/rootfs/bootstrap debian/package/rootfs
    127128        ls ${INSTALL_DIR_DEBIAN_PACKAGES}/*.deb | grep -v "debwrt-kernel-headers" | grep -v "cross" | while read package; do \
    128129                pfname=`basename $$package`; \
     
    136137        touch $@
    137138       
    138 debian/rootfs/clean-rootfs-dir:
     139debian/rootfs/clean-rootfs-dir: debian/check
    139140        mkdir -p $(BUILD_DIR_BASE)
    140141        sudo rm -rf $(ROOTFS_BUILD_DIR)
    141142        touch $@
    142143
    143 debian/rootfs/post-setup: debian/rootfs/bootstrap
     144debian/rootfs/post-setup: debian/check debian/rootfs/bootstrap
    144145        sudo mkdir -p $(ROOTFS_BUILD_DIR)/etc/apt
    145146        # note: unfortunately /etc/apt/sources.list is cleaned after running second stage install
     
    150151
    151152ifeq ($(DEBIAN_ROOTFS_QEMU_2ND_STAGE),y)
    152 debian/rootfs/second-stage-qemu: debian/rootfs/bootstrap debian/buildenv/qemu-build
     153debian/rootfs/second-stage-qemu: debian/check debian/rootfs/bootstrap debian/buildenv/qemu-build
    153154        $(call qemu-prepare-enter)
    154155        sudo chroot $(ROOTFS_BUILD_DIR) /usr/sbin/PostInstall && sudo rm -f $(ROOTFS_BUILD_DIR)/usr/sbin/PostInstall
    155156        sudo rm -f $(ROOTFS_BUILD_DIR)$(QEMU_INTERPRETER)
    156157else
    157 debian/rootfs/second-stage-qemu: debian/rootfs/bootstrap
     158debian/rootfs/second-stage-qemu: debian/check debian/rootfs/bootstrap
    158159        @echo "I: Qemu 2nd stage install disabled. Second stage needs now to be performend on the target device itself."
    159160        @echo "I: Qemu 2nd stage install can be enabled using menuconfig (DEBIAN_ROOTFS_QEMU_2ND_STAGE)."
     
    161162        touch $@
    162163
    163 debian/rootfs/clean:
     164debian/rootfs/clean: debian/check
    164165        sudo rm -rf $(ROOTFS_BUILD_DIR)
    165166        rm -f debian/rootfs/debwrt-packages
  • branches/contrib/openwrt/openwrt.mk

    r481 r491  
    6565        touch $@
    6666
    67 openwrt/download:
     67openwrt/check: plugins/check
     68
     69openwrt/download: openwrt/check
    6870ifeq ("$(origin V)", "command line")
    6971        $(SCRIPT_CLEAN_EXEC) $(MAKE) -C $(OPENWRT_BUILD_DIR) download V=$(V)
     
    7476
    7577openwrt/prepare: \
     78  openwrt/check \
    7679  openwrt/checkout \
    7780  openwrt/patch \
     
    116119        done
    117120
    118 openwrt/patch/force:
     121openwrt/patch/force: openwrt/check
    119122        rm -f $(TOPDIR)/openwrt/patch ; \
    120123        make -C $(TOPDIR) openwrt/patch FORCE_PATCH=1 ; \
     
    130133           echo $${patch}; \
    131134        done
    132 openwrt/unpatch/force:
     135openwrt/unpatch/force: openwrt/check
    133136        rm -f $(TOPDIR)/openwrt/unpatch ; \
    134137        make -C $(TOPDIR) openwrt/unpatch FORCE_PATCH=1 ; \
    135138
    136 openwrt/unpatch:
     139openwrt/unpatch: openwrt/check
    137140        @if [ ! -f $(TOPDIR)/openwrt/patch ]; then \
    138141           echo "E: can't unpatch if patches have not previously been applied"; \
     
    143146        touch $@
    144147
    145 openwrt/files-copy: openwrt/patch
     148openwrt/files-copy: openwrt/check openwrt/patch
    146149        tar -C $(FILES_DIR_OPENWRT) --exclude-vcs -cpf - . | \
    147150          tar -C $(OPENWRT_BUILD_DIR) -xpf - && \
     
    154157endif
    155158
    156 openwrt/checkout: .config
     159openwrt/checkout: .config openwrt/check
    157160        mkdir -p $(OPENWRT_BUILD_DIR)
    158161        svn co -r $(OPENWRT_REVISION) $(OPENWRT_SUBVERSION) $(OPENWRT_BUILD_DIR)
     
    170173        rm -f openwrt/build
    171174
    172 openwrt/wrtclean:
     175openwrt/wrtclean: openwrt/check
    173176        -$(SCRIPT_CLEAN_EXEC) $(MAKE) -C $(OPENWRT_BUILD_DIR) clean V=$(V)
    174177
    175 openwrt/dirclean:
     178openwrt/dirclean: openwrt/check
    176179        -$(SCRIPT_CLEAN_EXEC) $(MAKE) -C $(OPENWRT_BUILD_DIR) dirclean V=$(V)
    177180
    178 openwrt/distclean:
     181openwrt/distclean: openwrt/check
    179182        -$(SCRIPT_CLEAN_EXEC) $(MAKE) -C $(OPENWRT_BUILD_DIR) distclean V=$(V)
    180183
    181 openwrt/clean:
     184openwrt/clean: openwrt/check
    182185        rm -rf $(OPENWRT_BUILD_DIR)
    183186        rm -f openwrt/checkout
     
    187190.PHONY: openwrt/patch/force \
    188191        openwrt/unpatch/force \
    189         openwrt/clean
     192        openwrt/clean \
     193        openwrt/check
    190194
  • branches/contrib/plugins/plugins.mk

    r490 r491  
    2727                                -printf '%f\n')
    2828
    29 # register target for plugin
     29# Register target
     30#
     31# $(1): target
     32# $(2): prerequisite(s)
    3033define register_target
     34$(1): $(2)
     35endef
     36
     37# Register target for plugin
     38#
     39# $(1): plugin name
     40# $(2): debwrt target
     41#
     42# Check if CONFIG_PLUGIN_<plugin_name>_ENABLE =  y
     43# Check if CONFIG_PLUGIN_<plugin_name>_UUID   == PLUGIN_<plugin_name>_UUID
     44#
     45# Register target
     46#
     47# - make plugin specific target a prerequitite of the DebWrt target
     48# - when DebWrt target is rebuild, first the plugin specic target is rebuild
     49#
     50# target: plugin/<pluging_name>/target
     51#
     52# or on UUID mismatch:
     53#
     54# target: plugin/<plugin_name>/uuid-error
     55define register_plugin_target
    3156ifeq ($(CONFIG_PLUGIN_$(call upper,$(1))_ENABLE),y)
    3257ifeq ($(call qstrip,$(CONFIG_PLUGIN_$(call upper,$(1))_UUID)),$(PLUGIN_$(call upper,$(1))_UUID))
    3358REGISTERED_TARGETS+=plugin/$(1)/$(2)
    34 $(2): plugin/$(call lower,$(1))/$(2)
     59ifeq ($(2),plugins/check)
     60$(call register_target,$(2),plugin/$(call lower,$(1))/uuid-success)
    3561else
    36 $(2): plugin/$(call lower,$(1))/uuid-error
     62$(call register_target,$(2),plugin/$(call lower,$(1))/$(2))
     63endif
     64else
     65$(call register_target,$(2),plugin/$(call lower,$(1))/uuid-error)
    3766endif
    3867endif
    3968endef
    4069
    41 # call-back for plugins: register plugin targets
     70# Call-back for plugins: register plugin targets and mandatory plugins/check target
     71#
     72# $(1): plugin name
     73# $(2): list of targets
     74#
    4275define register
    43 $(eval $(foreach target,$(2),$(eval $(call register_target,$(1),$(target)))))
     76$(eval $(foreach target,$(2) plugins/check,$(eval $(call register_plugin_target,$(1),$(target)))))
    4477endef
    4578
    46 # include a plugin, set plugin_name and target name
     79# Include a plugin
     80#
     81# $(1): plugin name
     82#
     83# Define plugin specific variables, before including and
     84# evaluating plugins/<plugin_name>/plugin.mk.
    4785define include_plugin
    4886ifndef ($(1),)
     
    5492endef
    5593
    56 # inlcude plugin.mk for each plugin
     94# Inlcude plugin.mk for each plugin
    5795$(foreach plugin,$(PLUGINS_AVAILABLE),$(eval $(call include_plugin,$(plugin))))
     96
     97plugin/%/uuid-success:
     98ifdef ($(PLUGIN_VERBOSE))
     99        @echo "Version verified for plugin $(call upper,$*)"
     100        @echo "  Configured UUID: $(PLUGIN_$(call upper,$*)_UUID) (Config.in)"
     101        @echo "  Plugin UUID    : $(CONFIG_PLUGIN_$(call upper,$*)_UUID) (plugin.mk)"
     102else
     103        true
     104endif
    58105
    59106plugin/%/uuid-error:
    60107        @echo "Version mismatch for plugin $(call upper,$*)"
    61         @echo "  Configured UUID: $(PLUGIN_$(call upper,$*)_UUID)"
    62         @echo "  Plugin UUID    : $(CONFIG_PLUGIN_$(call upper,$*)_UUID)"
     108        @echo "  Configured UUID: $(PLUGIN_$(call upper,$*)_UUID) (Config.in)"
     109        @echo "  Plugin UUID    : $(CONFIG_PLUGIN_$(call upper,$*)_UUID) (plugin.mk)"
     110        @exit 1
    63111
    64112plugins/list:
     
    83131plugins/clean:
    84132
     133plugins/check:
     134
    85135test:
    86136        @echo "Test Plugins"
     
    91141
    92142.PHONY: plugins/list \
     143        plugins/targets/registered \
     144        plugins/enabled/list \
     145        plugin/%/uuid-error \
     146        plugin/%/uuid-success \
    93147        plugins/clean \
     148        plugins/check
    94149
Note: See TracChangeset for help on using the changeset viewer.