a39bf412de010974c337a25f88252c8b79681410
[openwrt/openwrt.git] / package / firmware / lantiq / dsl-vrx200-firmware-xdsl / Makefile
1 # Copyright (C) 2015 OpenWrt.org
2 # Copyright (C) 2015 Lantiq Beteiligungs GmbH & Co KG.
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=dsl_vr9_firmware_xdsl
10 PKG_VERSION:=05.07.04.03.00.06_05.07.01.08.00.01_osc
11 PKG_RELEASE:=1
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
14 PKG_MD5SUM:=4c8d9ca68dda88d3cfc0ca0fb946a63e
15 PKG_BUILD_DEPENDS:=bsdiff/host
16
17 PKG_FLAGS:=nonshared
18
19 include $(INCLUDE_DIR)/package.mk
20
21 PKG_B_NAME:=dsl_vr9_firmware_xdsl
22 PKG_B_VERSION:=05.07.03.03.00.06_05.07.01.0C.00.02_osc
23 PKG_B_SOURCE:=$(PKG_B_NAME)-$(PKG_B_VERSION).tar.gz
24
25 ANNEX_A_VER:=574306_571801
26 ANNEX_B_VER:=573306_571C02
27
28 define Download/dsl_vr9_firmware_xdsl_b
29 FILE:=$(PKG_B_SOURCE)
30 URL:=$(PKG_SOURCE_URL)
31 MD5SUM:=af5581836cbe574574590c046fe45bab
32 endef
33 $(eval $(call Download,dsl_vr9_firmware_xdsl_b))
34
35
36 define Package/dsl-vrx200-firmware-xdsl-a
37 SECTION:=firmware
38 CATEGORY:=Firmware
39 TITLE:=VRX200 / VR9 CPE xDSL Annex A firmware
40 URL:=http://www.lantiq.com/
41 DEPENDS:=@TARGET_lantiq_xrx200
42 endef
43
44 define Package/dsl-vrx200-firmware-xdsl-a/description
45 VRX200 / VR9 CPE VDSL and ADSL Annex A firmware
46 endef
47
48 define Package/dsl-vrx200-firmware-xdsl-b
49 SECTION:=firmware
50 CATEGORY:=Firmware
51 TITLE:=VRX200 / VR9 CPE xDSL Annex B firmware
52 URL:=http://www.lantiq.com/
53 DEPENDS:=@TARGET_lantiq_xrx200
54 endef
55
56 define Package/dsl-vrx200-firmware-xdsl-b/description
57 VRX200 / VR9 CPE VDSL and ADSL Annex B firmware
58 endef
59
60 define Package/dsl-vrx200-firmware-xdsl-a-patch
61 SECTION:=firmware
62 CATEGORY:=Firmware
63 TITLE:=VRX200 / VR9 CPE xDSL Annex B to Annex A firmware patch
64 URL:=http://www.lantiq.com/
65 DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-b +bspatch
66 endef
67
68 define Package/dsl-vrx200-firmware-xdsl-a-patch/description
69 Patch which between the Annex A and Annex B firmware to create the Annex A firmware.
70 endef
71
72 define Package/dsl-vrx200-firmware-xdsl-b-patch
73 SECTION:=firmware
74 CATEGORY:=Firmware
75 TITLE:=VRX200 / VR9 CPE xDSL Annex A to Annex B firmware patch
76 URL:=http://www.lantiq.com/
77 DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-a +bspatch
78 endef
79
80 define Package/dsl-vrx200-firmware-xdsl-b-patch/description
81 Patch which between the Annex A and Annex B firmware to create the Annex B firmware.
82 endef
83
84 define Build/Prepare
85 rm -rf $(PKG_BUILD_DIR)
86 mkdir -p $(PKG_BUILD_DIR)
87 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(PKG_SOURCE)
88 $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(PKG_B_SOURCE)
89 endef
90
91 define Build/Compile
92 bsdiff \
93 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER).bin \
94 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_B_VER).bin \
95 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER)_to_$(ANNEX_B_VER).bspatch
96 bsdiff \
97 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_B_VER).bin \
98 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER).bin \
99 $(PKG_BUILD_DIR)/xcpe_$(ANNEX_B_VER)_to_$(ANNEX_A_VER).bspatch
100 endef
101
102 define Package/dsl-vrx200-firmware-xdsl-a/install
103 $(INSTALL_DIR) $(1)/lib/firmware/
104 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/lib/firmware/xcpe_$(ANNEX_A_VER).LICENSE
105 $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER).bin $(1)/lib/firmware/
106 ln -s xcpe_$(ANNEX_A_VER).bin $(1)/lib/firmware/lantiq-vrx200-a.bin
107 endef
108
109 define Package/dsl-vrx200-firmware-xdsl-b/install
110 $(INSTALL_DIR) $(1)/lib/firmware/
111 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/lib/firmware/xcpe_$(ANNEX_B_VER).LICENSE
112 $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_$(ANNEX_B_VER).bin $(1)/lib/firmware/
113 ln -s xcpe_$(ANNEX_B_VER).bin $(1)/lib/firmware/lantiq-vrx200-b.bin
114 endef
115
116 define Package/dsl-vrx200-firmware-xdsl-a-patch/install
117 $(INSTALL_DIR) $(1)/lib/firmware/
118 $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_$(ANNEX_B_VER)_to_$(ANNEX_A_VER).bspatch $(1)/lib/firmware/
119 ln -s xcpe_$(ANNEX_B_VER)_to_$(ANNEX_A_VER).bspatch $(1)/lib/firmware/lantiq-vrx200-b-to-a.bspatch
120 endef
121
122 define Package/dsl-vrx200-firmware-xdsl-b-patch/install
123 $(INSTALL_DIR) $(1)/lib/firmware/
124 $(INSTALL_DATA) $(PKG_BUILD_DIR)/xcpe_$(ANNEX_A_VER)_to_$(ANNEX_B_VER).bspatch $(1)/lib/firmware/
125 ln -s xcpe_$(ANNEX_A_VER)_to_$(ANNEX_B_VER).bspatch $(1)/lib/firmware/lantiq-vrx200-a-to-b.bspatch
126 endef
127
128 $(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-a))
129 $(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-b))
130 $(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-a-patch))
131 $(eval $(call BuildPackage,dsl-vrx200-firmware-xdsl-b-patch))