1 #############################################################
3 # Linux kernel target for the OpenWRT project
5 # patches are sorted by numbers
6 # 000 patch between linux-2.4.29 and linux-mips-cvs
8 # 1xx OpenWRT patches (diag,compressed,..)
9 # 2xx fixes for 2.4.29 integration (wl driver)
10 # 3xx kernel feature patches (squashfs,jffs2 compression,..)
11 # 4xx patches needed to integrate feature patches
13 #############################################################
16 LINUX_KARCH
:=$(shell echo
$(ARCH
) | sed
-e
's/i[3-9]86/i386/' \
22 LINUX_SITE
=http
://www.kernel.org
/pub
/linux
/kernel
/v2.4
23 LINUX_BINARY_DRIVER_SITE
=http
://openwrt.openbsd-geek.de
24 LINUX_SOURCE
=linux-
$(LINUX_VERSION
).
tar.bz2
25 LINUX_KCONFIG
=.
/linux.config
26 LINUX_PATCHES
=.
/kernel-patches
27 LINUX_KERNEL_SOURCE
=.
/kernel-source
28 LINUX_BINLOC
=arch
/$(LINUX_KARCH
)/brcm-boards
/bcm947xx
/compressed
/vmlinuz
29 # Used by pcmcia-cs and others
30 LINUX_SOURCE_DIR
=$(LINUX_DIR
)-$(LINUX_VERSION
)
32 # binary driver extracted from linksys firmware GPL sourcetree WRT54GS_3_37_2_1109_US
33 LINUX_BINARY_WL_DRIVER
=kernel-binary-wl.
tar.gz
34 LINUX_BINARY_ET_DRIVER
=kernel-binary-et.
tar.gz
36 TARGET_MODULES_DIR
=$(TARGET_DIR
)/lib
/modules
/$(LINUX_VERSION
)
38 $(DL_DIR
)/$(LINUX_BINARY_WL_DRIVER
):
39 $(WGET
) -P
$(DL_DIR
) $(LINUX_BINARY_DRIVER_SITE
)/$(LINUX_BINARY_WL_DRIVER
)
41 $(DL_DIR
)/$(LINUX_BINARY_ET_DRIVER
):
42 $(WGET
) -P
$(DL_DIR
) $(LINUX_BINARY_DRIVER_SITE
)/$(LINUX_BINARY_ET_DRIVER
)
44 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
) $(DL_DIR
)/$(LINUX_BINARY_WL_DRIVER
) $(DL_DIR
)/$(LINUX_BINARY_ET_DRIVER
)
45 -mkdir
-p
$(BUILD_DIR
)
46 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
47 ln
-sf
$(LINUX_DIR
)-$(LINUX_VERSION
) $(LINUX_DIR
)
48 # extract wlan and lan binary only driver
49 zcat
$(DL_DIR
)/$(LINUX_BINARY_WL_DRIVER
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
50 zcat
$(DL_DIR
)/$(LINUX_BINARY_ET_DRIVER
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
51 touch
$(LINUX_DIR
)/.unpacked
53 $(LINUX_DIR
)/.patched
: $(LINUX_DIR
)/.unpacked
54 $(PATCH
) $(LINUX_DIR
) $(LINUX_PATCHES
)
55 # copy kernel source which is maintained in openwrt via cvs
56 cp
-a
$(LINUX_KERNEL_SOURCE
)/* $(LINUX_DIR
)
58 cp
-a
$(BUILD_DIR
)/wl
/*.o
$(LINUX_DIR
)/drivers
/net
/wl
59 cp
-a
$(BUILD_DIR
)/et
/*.o
$(LINUX_DIR
)/drivers
/net
/et
60 touch
$(LINUX_DIR
)/.patched
62 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
63 -cp
$(LINUX_KCONFIG
) $(LINUX_DIR
)/.config
64 $(SED
) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
65 $(LINUX_DIR
)/Makefile \
66 $(LINUX_DIR
)/arch
/mips
/Makefile
67 $(SED
) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR
)/arch
/mips
/Makefile
68 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
include/linux
/version.h
69 touch
$(LINUX_DIR
)/.configured
71 $(LINUX_DIR
)/.depend_done
: $(LINUX_DIR
)/.configured
72 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) dep
73 touch
$(LINUX_DIR
)/.depend_done
75 $(LINUX_DIR
)/$(LINUX_BINLOC
): $(LINUX_DIR
)/.depend_done
76 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) $(LINUX_FORMAT
)
77 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) modules
79 $(LINUX_KERNEL
): $(LINUX_DIR
)/$(LINUX_BINLOC
)
80 cp
-fa
$(LINUX_DIR
)/$(LINUX_BINLOC
) $(LINUX_KERNEL
)
81 touch
-c
$(LINUX_KERNEL
)
83 $(LINUX_DIR
)/.modules_done
: $(LINUX_KERNEL
)
84 rm -rf
$(BUILD_DIR
)/modules
85 $(MAKE
) -C
$(LINUX_DIR
) DEPMOD
=true INSTALL_MOD_PATH
=$(BUILD_DIR
)/modules modules_install
86 touch
$(LINUX_DIR
)/.modules_done
88 $(STAGING_DIR
)/include/linux
/version.h
: $(LINUX_DIR
)/.configured
89 mkdir
-p
$(STAGING_DIR
)/include
90 tar -ch
-C
$(LINUX_DIR
)/include -f
- linux |
tar -xf
- -C
$(STAGING_DIR
)/include/
91 tar -ch
-C
$(LINUX_DIR
)/include -f
- asm |
tar -xf
- -C
$(STAGING_DIR
)/include/
93 $(TARGET_MODULES_DIR
):
94 -mkdir
-p
$(TARGET_MODULES_DIR
)
95 cp
$(LINUX_DIR
)/drivers
/net
/wl
/wl.o
$(TARGET_MODULES_DIR
)
96 cp
$(LINUX_DIR
)/drivers
/net
/et
/et.o
$(TARGET_MODULES_DIR
)
97 cp
$(LINUX_DIR
)/drivers
/net
/diag
/diag.o
$(TARGET_MODULES_DIR
)
99 linux
: $(LINUX_DIR
)/.modules_done
$(TARGET_MODULES_DIR
)
101 linux-source
: $(DL_DIR
)/$(LINUX_SOURCE
)
103 # This has been renamed so we do _NOT_ by default run this on 'make clean'
105 rm -f
$(LINUX_KERNEL
)
106 -$(MAKE
) -C
$(LINUX_DIR
) clean
109 rm -f
$(BUILD_DIR
)/openwrt-kmodules.
tar.bz2
110 rm -rf
$(LINUX_DIR
)-$(LINUX_VERSION
)
112 rm -rf
$(BUILD_DIR
)/modules
This page took 0.048665 seconds and 5 git commands to generate.