source: branches/1.5/kernel/make.d/kernel.rul @ 555

Last change on this file since 555 was 555, checked in by dennis, 7 years ago

Preparing new release new version of SALI

  • Property svn:keywords set to Id
File size: 3.5 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 555 2013-03-06 08:57:54Z 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.2
24        LINUX_IMAGE = $(LINUX_DIR)/arch/x86_64/boot/bzImage
25        LINUX_TARGET = bzImage
26endif
27
28ifeq ($(ARCH),ppc64)
29        LINUX_VERSION = 2.6.36.4
30        LINUX_IMAGE = $(LINUX_DIR)/arch/powerpc/boot/zImage
31        LINUX_TARGET = zImage
32endif
33
34LINUX_DIR               := $(SRC_DIR)/linux-$(LINUX_VERSION)
35LINUX_TARBALL   := linux-$(LINUX_VERSION).tar.bz2
36LINUX_URL               := ftp://ftp.sara.nl/pub/sali/sources/$(LINUX_TARBALL)
37LINUX_INFO              := http://kernel.org
38
39LINUX_CONFIG    := $(KERNEL_PATCH_DIR)/linux.$(ARCH).config
40
41## names for kernel patch files can be of 2 forms:
42##  1) patches that apply to all architectures
43##       linux.all.XX<name>.patch
44##  2) patch applies to a subset of arches
45##    linux.<arch1>,<arch2>,...,<archN>.XX<name>.patch
46LINUX_PATCHES = $(sort $(shell find $(KERNEL_PATCH_DIR) \
47                                    -name "linux.$(ARCH).*.patch" -o \
48                                    -name "linux.all.*.patch" -o \
49                                    -name "linux.$(ARCH),*.*.patch" -o \
50                                    -name "linux.*,$(ARCH),*.*.patch" -o \
51                                    -name "linux.*,$(ARCH).*.patch"))
52ALL_SOURCE += $(SRC_DIR)/$(LINUX_TARBALL)
53
54PHONY += kernel_list_patches
55kernel_list_patches:
56        @echo $(LINUX_PATCHES)
57
58# install the kernel that autoinstall clients will boot from during
59# autoinstallation
60PHONY += install_kernel
61install_kernel: $(LINUX_IMAGE)
62        mkdir -p $(BOOT_BIN_DEST)
63        $(SI_INSTALL) -m 644 $(LINUX_IMAGE) \
64            $(BOOT_BIN_DEST)/kernel
65        $(SI_INSTALL) -m 644 $(LINUX_CONFIG) \
66            $(BOOT_BIN_DEST)/config
67
68# build the kernel that autoinstall clients will boot from during
69# autoinstallation
70PHONY += kernel
71kernel: $(LINUX_IMAGE) modules
72
73$(LINUX_IMAGE): $(SRC_DIR)/patched_kernel-stamp
74        $(MAKE) -j$(NCPUS) -C $(LINUX_DIR) $(LINUX_TARGET)
75
76PHONY += patched_kernel-stamp
77patched_kernel-stamp:   $(SRC_DIR)/patched_kernel-stamp
78
79$(SRC_DIR)/patched_kernel-stamp:        $(SRC_DIR)/$(LINUX_TARBALL) \
80                                        $(LINUX_CONFIG) $(LINUX_PATCHES)
81        rm -rf $(LINUX_DIR)
82        @echo -n Extracting kernel source...
83        (cd $(SRC_DIR) && tar xjf $(LINUX_TARBALL))
84        @echo done
85        cd $(LINUX_DIR) && \
86          $(foreach patch, $(LINUX_PATCHES), \
87            echo -n Applying `basename $(patch)`... && cat $(patch) | patch -s -p1 && echo done. &&) /bin/true
88        cp -a $(LINUX_CONFIG) $(LINUX_DIR)/.config
89        perl -pi -e "s/^EXTRAVERSION =\s*(\S*)\s*\n/EXTRAVERSION = \1-sali_v$(VERSION)\n/" $(LINUX_DIR)/Makefile
90        $(MAKE) -C $(LINUX_DIR) oldconfig
91        touch $(SRC_DIR)/patched_kernel-stamp
92
93PHONY += get_kernel_source
94get_kernel_source:      $(SRC_DIR)/$(LINUX_TARBALL)
95
96$(SRC_DIR)/$(LINUX_TARBALL):
97        [ -d $(SRC_DIR) ] || mkdir -p $(SRC_DIR)
98        $(GETSOURCE) $(LINUX_URL) $(SRC_DIR)
99
100PHONY += modules
101modules:        $(SRC_DIR)/modules_build-stamp
102
103$(SRC_DIR)/modules_build-stamp: $(LINUX_IMAGE)
104        $(MAKE) -j$(NCPUS) -C $(LINUX_DIR) modules
105        touch $(SRC_DIR)/modules_build-stamp
106
107PHONY += kernel_clean
108kernel_clean:
109        rm -rf $(LINUX_DIR)
110        rm -f $(SRC_DIR)/patched_kernel-stamp
111        rm -f $(SRC_DIR)/modules_build-stamp
Note: See TracBrowser for help on using the repository browser.