]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/backports
Cleanup toolchain scripts
[ipfire-2.x.git] / lfs / backports
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2016 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VERSUFIX = ipfire$(KCFG)
28
29 VER = 4.2.6-1
30
31 THISAPP = backports-$(VER)
32 DL_FILE = $(THISAPP).tar.xz
33 DL_FROM = $(URL_IPFIRE)
34 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
36
37 #ifeq "$(BUILD_PLATFORM)" "arm"
38 CFLAGS += -fno-PIC
39 #endif
40
41 ###############################################################################
42 # Top-level Rules
43 ###############################################################################
44
45 objects = $(DL_FILE)
46
47 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
48
49 $(DL_FILE)_MD5 = 3f978eb56473d9289cf21ebbcb5aa80b
50
51 install : $(TARGET)
52
53 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
54
55 download :$(patsubst %,$(DIR_DL)/%,$(objects))
56
57 md5 : $(subst %,%_MD5,$(objects))
58
59 dist:
60 $(PAK)
61
62 ###############################################################################
63 # Downloading, checking, md5sum
64 ###############################################################################
65
66 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
67 @$(CHECK)
68
69 $(patsubst %,$(DIR_DL)/%,$(objects)) :
70 @$(LOAD)
71
72 $(subst %,%_MD5,$(objects)) :
73 @$(MD5)
74
75 ###############################################################################
76 # Installation Details
77 ###############################################################################
78
79 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
80 @$(PREBUILD)
81
82 # remove replaced kernel modules
83 rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/net/wireless/rtl818x/rtl8180/rtl8180.ko
84 rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/media
85
86 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
87 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-ipfire-build.patch
88 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-grsecurity.patch
89 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-add_usbnet_modules.patch
90 ifeq "$(BUILD_ARCH)" "x86_64"
91 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_no_dma_sgtable_on_x86_64.patch
92 endif
93
94 # DVB patches
95 cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
96
97 # Wlan patches
98 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/compat-drivers-3.8.3-ath_ignore_eeprom_regdomain.patch
99 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-iwlwifi-noibss_only_on_radar_chan.patch
100 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.37-rt2800usb_add_dlink_dwa137_usbid.patch
101 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_rt2x00usb_suppress_queue_warnings.patch
102 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-mt7601_upstream_fixes.patch
103 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_add_libertas_uap.patch
104 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1_ath10k_remove_logspam.patch
105 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-ath9k_add_missing_mask_init.patch
106
107 # smsc mac address patch for pandaboard and raspberry pi
108 ifeq "$(KCFG)" "-multi"
109 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-add_mac_addr_param.patch
110 endif
111 ifeq "$(KCFG)" "-rpi"
112 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-add_mac_addr_param.patch
113 endif
114
115 # Patches form stable linux updates
116 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports/backports-linux-upstream-1.patch
117 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports/backports-linux-upstream-2.patch
118 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports/backports-linux-upstream-3.patch
119
120 # generate config
121 cd $(DIR_APP) && make KLIB=/lib/modules/$(KVER)-$(VERSUFIX)/ allmodconfig
122
123 # Disable some settings
124 cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEVELOPER_WARNINGS=y/# CPTCFG_CFG80211_DEVELOPER_WARNINGS is not set/g" .config
125 cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_INTERNAL_REGDB=y/# CPTCFG_CFG80211_INTERNAL_REGDB is not set/g" .config
126 cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEFAULT_PS=y/# CPTCFG_CFG80211_DEFAULT_PS is not set/g" .config
127 cd $(DIR_APP) && sed -i -e "s/CPTCFG_NFC=m/# CPTCFG_NFC is not set/g" .config
128
129 ifeq "$(BUILD_ARCH)" "x86_64"
130 cd $(DIR_APP) && sed -i -e "s/CPTCFG_LIBERTAS_UAP=m/# CPTCFG_LIBERTAS_UAP is not set/g" .config
131 endif
132
133 # Disable some modules (build fail/missing symbols)
134 cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_AM437X_VPFE=m/# CPTCFG_VIDEO_AM437X_VPFE is not set/g" .config
135 cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_VIA_CAMERA=m/# CPTCFG_VIDEO_VIA_CAMERA is not set/g" .config
136 cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_XILINX=m/# CPTCFG_VIDEO_XILINX is not set/g" .config
137 cd $(DIR_APP) && sed -i -e "s/CPTCFG_IR_SUNXI=m/# CPTCFG_IR_SUNXI is not set/g" .config
138 cd $(DIR_APP) && sed -i -e "s/CPTCFG_BT_6LOWPAN=m/# CPTCFG_BT_6LOWPAN is not set/g" .config
139
140 # Disable DEBUG
141 cd $(DIR_APP) && sed -i -e "s/.*DEBUG=y/# & is not set/g" .config
142 cd $(DIR_APP) && sed -i -e "s/.*DEBUGFS=y/# & is not set/g" .config
143 cd $(DIR_APP) && sed -i -e "s/=y is not set/ is not set/g" .config
144
145 cd $(DIR_APP) && make $(MAKETUNING) KLIB=/lib/modules/$(KVER)-$(VERSUFIX)/ install
146
147 @rm -rf $(DIR_APP)
148 @$(POSTBUILD)