33a8d749c7d67b0054c03a8695e7a7a21046bbfb
[librewrt/.git] / bright-ben / libre_flag_r3.patch
1 Index: toolchain/kernel-headers/Makefile
2 ===================================================================
3 --- toolchain/kernel-headers/Makefile   (revisión: 22294)
4 +++ toolchain/kernel-headers/Makefile   (copia de trabajo)
5 @@ -18,7 +18,13 @@
6  PKG_VERSION:=$(LINUX_VERSION)
7  PKG_SOURCE:=$(LINUX_SOURCE)
8  PKG_SOURCE_URL:=$(LINUX_SITE)
9 -HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
10 +
11 +ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
12 +  HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(shell echo $(LINUX_VERSION) | cut -d"-" -f1 -)
13 +else
14 +  HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
15 +endif
16 +
17  PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
18  LINUX_DIR := $(HOST_BUILD_DIR)
19  FILES_DIR := 
20 Index: include/kernel.mk
21 ===================================================================
22 --- include/kernel.mk   (revisión: 22294)
23 +++ include/kernel.mk   (copia de trabajo)
24 @@ -31,8 +31,13 @@
25      FILES_DIR ?= $(foreach dir,$(wildcard ./files ./files-$(KERNEL_PATCHVER)),"$(dir)")
26    endif
27    KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
28 -  LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
29 +  ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
30 +    LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(shell echo $(LINUX_VERSION) | cut -d"-" -f1 -)
31 +  else
32 +    LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
33 +  endif
34  
35 +
36    MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
37    TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
38  
39 @@ -41,11 +46,19 @@
40    LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
41    TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,)
42    ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE)),)
43 -    LINUX_SITE:=@KERNEL/linux/kernel/v$(KERNEL)$(TESTING)
44 +        ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
45 +      LINUX_SITE:=@KERNEL_LIBRE/download/releases/$(LINUX_VERSION)
46 +    else
47 +      LINUX_SITE:=@KERNEL/linux/kernel/v$(KERNEL)$(TESTING)
48 +    endif
49    endif
50  
51    ifneq ($(TARGET_BUILD),1)
52 -    PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
53 +        ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
54 +      PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(shell echo $(PKG_VERSION) | cut -d"-" -f1 -))
55 +    else
56 +      PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
57 +    endif
58    endif
59  endif
60  
61 Index: include/kernel-defaults.mk
62 ===================================================================
63 --- include/kernel-defaults.mk  (revisión: 22294)
64 +++ include/kernel-defaults.mk  (copia de trabajo)
65 @@ -33,12 +33,22 @@
66    KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
67  endif
68  
69 +ifneq ($(CONFIG_ON_SITE_DEBLOB),)
70 +  CURRENT_DIR:=$(shell pwd)
71 +  define Kernel/Free
72 +       @echo "Deblobing kernel sources at $(LINUX_DIR)"
73 +       cd $(LINUX_DIR) && $(SCRIPT_DIR)/deblob/deblob-$(shell echo $(LINUX_VERSION) | cut -d"." -f1,2,3 -) &&  cd $(CURRENT_DIR)
74 +  endef
75 +endif
76 +
77 +
78  # defined in quilt.mk
79  Kernel/Patch:=$(Kernel/Patch/Default)
80  ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
81    ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
82      define Kernel/Prepare/Default
83         bzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
84 +       $(Kernel/Free)
85         $(Kernel/Patch)
86         touch $(LINUX_DIR)/.quilt_used
87      endef
88 Index: include/download.mk
89 ===================================================================
90 --- include/download.mk (revisión: 22294)
91 +++ include/download.mk (copia de trabajo)
92 @@ -11,7 +11,7 @@
93  define dl_method
94  $(strip \
95    $(if $(2),$(2), \
96 -    $(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% ftp://% http://% file://%,$(1)),default, \
97 +    $(if $(filter @GNOME/% @GNU/% @KERNEL/% @KERNEL_LIBRE/% @SF/% ftp://% http://% file://%,$(1)),default, \
98        $(if $(filter git://%,$(1)),git, \
99          $(if $(filter svn://%,$(1)),svn, \
100            $(if $(filter cvs://%,$(1)),cvs, \
101 Index: target/linux/x86/Makefile
102 ===================================================================
103 --- target/linux/x86/Makefile   (revisión: 22294)
104 +++ target/linux/x86/Makefile   (copia de trabajo)
105 @@ -12,7 +12,11 @@
106  FEATURES:=squashfs jffs2 ext2 vdi vmdk pcmcia targz
107  SUBTARGETS=generic olpc xen_domu ep80579 net5501
108  
109 -LINUX_VERSION:=2.6.32.16
110 +ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
111 +       LINUX_VERSION:=2.6.32.16-libre1
112 +else
113 +       LINUX_VERSION:=2.6.32.16
114 +endif
115  
116  include $(INCLUDE_DIR)/target.mk
117  
118 Index: target/linux/xburst/Makefile
119 ===================================================================
120 --- target/linux/xburst/Makefile        (revisión: 22294)
121 +++ target/linux/xburst/Makefile        (copia de trabajo)
122 @@ -12,7 +12,11 @@
123  FEATURES:=jffs2 targz ubifs audio
124  SUBTARGETS:=qi_lb60 n516 n526
125  
126 -LINUX_VERSION:=2.6.34.1
127 +ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
128 +       LINUX_VERSION:=2.6.34.1-libre
129 +else
130 +       LINUX_VERSION:=2.6.34.1
131 +endif
132  
133  DEVICE_TYPE=other
134  
135 Index: scripts/download.pl
136 ===================================================================
137 --- scripts/download.pl (revisión: 22294)
138 +++ scripts/download.pl (copia de trabajo)
139 @@ -143,6 +143,8 @@
140                 push @mirrors, "http://ftp.de.kernel.org/pub/$1";
141                 push @mirrors, "ftp://ftp.fr.kernel.org/pub/$1";
142                 push @mirrors, "http://ftp.fr.kernel.org/pub/$1";
143 +       } elsif ($mirror =~ /^\@KERNEL_LIBRE\/(.+)$/) {
144 +               push @mirrors, "http://www.fsfla.org/svnwiki/selibre/linux-libre/$1";
145      } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
146                 push @mirrors, "http://ftp.gnome.org/pub/GNOME/sources/$1";
147                 push @mirrors, "http://ftp.unina.it/pub/linux/GNOME/sources/$1";
148 Index: Config.in
149 ===================================================================
150 --- Config.in   (revisión: 22294)
151 +++ Config.in   (copia de trabajo)
152 @@ -118,6 +118,12 @@
153  
154  endmenu
155  
156 +
157 +config USE_LIBRE_KERNEL
158 +       bool "Use only 100% free software"
159 +       depends TARGET_x86 || TARGET_xburst
160 +       default y
161 +
162  menu "Global build settings"
163  
164         config ALL
165 @@ -293,6 +299,11 @@
166                 help
167                   Compiler cache; see http://ccache.samba.org/
168  
169 +       config ON_SITE_DEBLOB
170 +               bool "Deblob Linux kernel on site" if DEVEL
171 +               depends TARGET_x86 || TARGET_xburst
172 +               default n
173 +
174         config EXTERNAL_KERNEL_TREE
175                 string "Use external kernel tree" if DEVEL
176                 default ""