final directory structure correction
[librewrt/.git] / branding / libre_flag_r2.patch
1 Index: toolchain/kernel-headers/Makefile
2 ===================================================================
3 --- toolchain/kernel-headers/Makefile   (revision 22269)
4 +++ toolchain/kernel-headers/Makefile   (working copy)
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   (revision 22269)
23 +++ include/kernel.mk   (working copy)
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  (revision 22269)
64 +++ include/kernel-defaults.mk  (working copy)
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 (revision 22269)
91 +++ include/download.mk (working copy)
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   (revision 22269)
104 +++ target/linux/x86/Makefile   (working copy)
105 @@ -12,8 +12,16 @@
106  FEATURES:=squashfs jffs2 ext2 vdi vmdk pcmcia targz
107  SUBTARGETS=generic olpc xen_domu ep80579 net5501
108  
109 -LINUX_VERSION:=2.6.32.14
110 +ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
111 +  LINUX_VERSION:=2.6.32.14-libre1
112 +  @echo "FINDME:: LIBRE"
113 +else
114 +  LINUX_VERSION:=2.6.32.14
115 +  @echo "FINDME:: OPEN"
116 +endif
117  
118 +
119 +
120  include $(INCLUDE_DIR)/target.mk
121  
122  $(eval $(call BuildTarget))
123 Index: target/linux/xburst/Makefile
124 ===================================================================
125 --- target/linux/xburst/Makefile        (revision 22269)
126 +++ target/linux/xburst/Makefile        (working copy)
127 @@ -12,7 +12,13 @@
128  FEATURES:=jffs2 targz ubifs audio
129  SUBTARGETS:=qi_lb60 n516 n526
130  
131 -LINUX_VERSION:=2.6.34.1
132 +ifneq ($(CONFIG_USE_LIBRE_KERNEL),)
133 +  LINUX_VERSION:=2.6.32.14-libre1
134 +  @echo "FINDME:: LIBRE"
135 +else
136 +  LINUX_VERSION:=2.6.32.14
137 +  @echo "FINDME:: OPEN"
138 +endif
139  
140  DEVICE_TYPE=other
141  
142 Index: scripts/download.pl
143 ===================================================================
144 --- scripts/download.pl (revision 22269)
145 +++ scripts/download.pl (working copy)
146 @@ -143,6 +143,8 @@
147                 push @mirrors, "http://ftp.de.kernel.org/pub/$1";
148                 push @mirrors, "ftp://ftp.fr.kernel.org/pub/$1";
149                 push @mirrors, "http://ftp.fr.kernel.org/pub/$1";
150 +       } elsif ($mirror =~ /^\@KERNEL_LIBRE\/(.+)$/) {
151 +               push @mirrors, "http://www.fsfla.org/svnwiki/selibre/linux-libre/$1";
152      } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
153                 push @mirrors, "http://ftp.gnome.org/pub/GNOME/sources/$1";
154                 push @mirrors, "http://ftp.unina.it/pub/linux/GNOME/sources/$1";
155 Index: Config.in
156 ===================================================================
157 --- Config.in   (revision 22269)
158 +++ Config.in   (working copy)
159 @@ -118,6 +118,15 @@
160  
161  endmenu
162  
163 +
164 +config USE_LIBRE_KERNEL
165 +       bool "Use Libre-Linux kernel"
166 +       default y
167 +
168 +config ON_SITE_DEBLOB
169 +       bool "Deblob Linux kernel on site"
170 +       default n
171 +
172  menu "Global build settings"
173  
174         config ALL