source: trunk/kernel/make.d/kernel.rul @ 567

Last change on this file since 567 was 567, checked in by dennis, 8 years ago

Last software update changes, trunk is working again

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1#
2#   vi: filetype=make:
3#
4#   2004.07.26  Brian Elliott Finley
5#   - added perl bit to change EXTRAVERSION automatically.
6#   2004.10.08  Brian Elliott Finley
7#   - add bit for yellow dog linux (YDL) kernel
8#   2005.07.12  Brian Elliott Finley
9#       - upgrade kernel version for x86_64 and ia64 to 2.6.10
10#         patch submitted by Erich Focht
11#
12# SVN Info:
13#       $Id: kernel.rul 567 2013-04-18 14:09:11Z dennis $
14#       $URL: https://subtrac.sara.nl/oss/svn/sali/trunk/make.d/kernel.rul $
15
16ifeq ($(ARCH),i386)
17        LINUX_VERSION = 3.1.4
18        LINUX_IMAGE = $(LINUX_DIR)/arch/i386/boot/bzImage
19        LINUX_TARGET = bzImage
20endif
21
22ifeq ($(ARCH),x86_64)
23        LINUX_VERSION = 3.8.8
24        LINUX_IMAGE = $(LINUX_DIR)/arch/x86_64/boot/bzImage
25        LINUX_TARGET = bzImage
26endif
27
28LINUX_DIR               := $(SRC_DIR)/linux-$(LINUX_VERSION)
29LINUX_TARBALL   := linux-$(LINUX_VERSION).tar.bz2
30LINUX_URL               := ftp://ftp.sara.nl/pub/sali/sources/$(LINUX_TARBALL)
31LINUX_INFO              := http://kernel.org
32LINUX_FIRMWARE_GIT := http://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
33
34LINUX_CONFIG    := $(KERNEL_PATCH_DIR)/linux.$(ARCH).config
35
36## names for kernel patch files can be of 2 forms:
37##  1) patches that apply to all architectures
38##       linux.all.XX<name>.patch
39##  2) patch applies to a subset of arches
40##    linux.<arch1>,<arch2>,...,<archN>.XX<name>.patch
41LINUX_PATCHES = $(sort $(shell find $(KERNEL_PATCH_DIR) \
42                                    -name "linux.$(ARCH).*.patch" -o \
43                                    -name "linux.all.*.patch" -o \
44                                    -name "linux.$(ARCH),*.*.patch" -o \
45                                    -name "linux.*,$(ARCH),*.*.patch" -o \
46                                    -name "linux.*,$(ARCH).*.patch"))
47ALL_SOURCE += $(SRC_DIR)/$(LINUX_TARBALL)
48
49PHONY += kernel_list_patches
50kernel_list_patches:
51        @echo $(LINUX_PATCHES)
52
53# install the kernel that autoinstall clients will boot from during
54# autoinstallation
55PHONY += install_kernel
56install_kernel: $(LINUX_IMAGE)
57        mkdir -p $(BOOT_BIN_DEST)
58        $(SI_INSTALL) -m 644 $(LINUX_IMAGE) \
59            $(BOOT_BIN_DEST)/kernel
60        $(SI_INSTALL) -m 644 $(LINUX_CONFIG) \
61            $(BOOT_BIN_DEST)/config
62
63# build the kernel that autoinstall clients will boot from during
64# autoinstallation
65PHONY += kernel
66kernel: $(LINUX_IMAGE) modules
67
68$(LINUX_IMAGE): $(SRC_DIR)/patched_kernel-stamp
69        $(MAKE) -j$(NCPUS) -C $(LINUX_DIR) $(LINUX_TARGET)
70
71PHONY += patched_kernel-stamp
72patched_kernel-stamp:   $(SRC_DIR)/patched_kernel-stamp
73
74$(SRC_DIR)/patched_kernel-stamp:        $(SRC_DIR)/$(LINUX_TARBALL) \
75                                        $(LINUX_CONFIG) $(LINUX_PATCHES)
76        rm -rf $(LINUX_DIR)
77        @echo -n Extracting kernel source...
78        (cd $(SRC_DIR) && tar xjf $(LINUX_TARBALL))
79        @echo done
80        @echo -n Adding extra firmwares from git...
81        cd $(LINUX_DIR) && \
82          $(foreach patch, $(LINUX_PATCHES), \
83            echo -n Applying `basename $(patch)`... && cat $(patch) | patch -s -p1 && echo done. &&) /bin/true
84        cp -a $(LINUX_CONFIG) $(LINUX_DIR)/.config
85        perl -pi -e "s/^EXTRAVERSION =\s*(\S*)\s*\n/EXTRAVERSION = \1-sali_v$(VERSION)\n/" $(LINUX_DIR)/Makefile
86        $(MAKE) -C $(LINUX_DIR) oldconfig
87        touch $(SRC_DIR)/patched_kernel-stamp
88
89PHONY += get_kernel_source
90get_kernel_source:      $(SRC_DIR)/$(LINUX_TARBALL)
91
92$(SRC_DIR)/$(LINUX_TARBALL):
93        [ -d $(SRC_DIR) ] || mkdir -p $(SRC_DIR)
94        $(GETSOURCE) $(LINUX_URL) $(SRC_DIR)
95        (cd $(SRC_DIR) && git clone $(LINUX_FIRMWARE_GIT))
96        (rm -rf $(SRC_DIR)/linux-firmware/.git* $(SRC_DIR)/linux-firmware/Makefile)
97        (rm -rf $(SRC_DIR)/linux-firmware/usbdux/*dux)
98        (find $(SRC_DIR)/linux-firmware -name "*.asm" |xargs rm -rf)
99        (rm -rf $(SRC_DIR)/linux-firmware/WHENCE $(SRC_DIR)/linux-firmware/WHENCE* $(SRC_DIR)/linux-firmware/LICENCE.*)
100
101PHONY += modules
102modules:        $(SRC_DIR)/modules_build-stamp
103
104$(SRC_DIR)/modules_build-stamp: $(LINUX_IMAGE)
105        $(MAKE) -j$(NCPUS) -C $(LINUX_DIR) modules
106        touch $(SRC_DIR)/modules_build-stamp
107
108PHONY += kernel_clean
109kernel_clean:
110        rm -rf $(LINUX_DIR)
111        rm -f $(SRC_DIR)/patched_kernel-stamp
112        rm -f $(SRC_DIR)/modules_build-stamp
Note: See TracBrowser for help on using the repository browser.