]> git.ipfire.org Git - ipfire-3.x.git/blob - lfs/grub
Fixed description of grub and gzip.
[ipfire-3.x.git] / lfs / grub
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 PKG_NAME = grub
28 PKG_VER = 0.97
29 PKG_REL = 0
30
31 THISAPP = $(PKG_NAME)-$(PKG_VER)
32 DL_FILE = $(THISAPP).tar.gz
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34
35 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
36
37 MAINTAINER =
38 GROUP = System/Boot
39 EXTRA = no
40 DEBUG = no
41 DEPS =
42
43 URL = http://www.gnu.org/software/grub/
44 LICENSE = GPLv2+
45 SHORT_DESC = Grand Unified Boot Loader.
46
47 define LONG_DESC
48 GRUB (Grand Unified Boot Loader) is an experimental boot loader \
49 capable of booting into most free operating systems - Linux, FreeBSD, \
50 NetBSD, GNU Mach, and others as well as most commercial operating \
51 systems.
52 endef
53
54 CFLAGS =
55 CXXFLAGS =
56
57 ###############################################################################
58 # Top-level Rules
59 ###############################################################################
60
61 objects = $(DL_FILE) \
62 grub-0.94-i2o.patch \
63 grub-0.95-moreraid.patch \
64 grub-0.93-special-device-names.patch \
65 grub-0.95-splash-error-term.patch \
66 grub-0.95-xpmjunk.patch \
67 grub-0.93-graphics-bootterm.patch \
68 grub-0.91-splashimagehelp.patch \
69 grub-0.95-graphics.patch \
70 $(THISAPP)-disk_geometry-1.patch \
71 grub-0.93-configfile.patch \
72 $(THISAPP)-256byte_inode-1.patch \
73 grub-0.94-installcopyonly.patch \
74 $(THISAPP)-install.in.patch
75
76 download: $(objects)
77
78 info:
79 $(DO_PKG_INFO)
80
81 install: $(OBJECT)
82
83 package:
84 @$(DO_PACKAGE)
85
86 $(objects):
87 @$(LOAD)
88
89 ###############################################################################
90 # Installation Details
91 ###############################################################################
92
93 $(OBJECT): $(objects)
94 @$(PREBUILD)
95 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
96 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-disk_geometry-1.patch
97 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.95-graphics.patch
98 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.91-splashimagehelp.patch
99 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.93-graphics-bootterm.patch
100 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.95-xpmjunk.patch
101 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.95-splash-error-term.patch
102 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.93-special-device-names.patch
103 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.95-moreraid.patch
104 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.94-i2o.patch
105 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.93-configfile.patch
106 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-256byte_inode-1.patch
107 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-install.in.patch
108 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grub-0.94-installcopyonly.patch
109
110 cd $(DIR_APP) && autoconf
111
112 cd $(DIR_APP) && \
113 CC="gcc -fno-stack-protector -fno-pic -fno-pie -nopie" \
114 ./configure \
115 $(CONFIGURE_ARCH) \
116 --prefix=/usr
117
118 cd $(DIR_APP) && make -j $(PRALLELISM)
119 cd $(DIR_APP) && make install
120
121 sed -e "s/pkgdatadir/pkglibdir/g" -i /usr/sbin/grub-install
122
123 mkdir -vp /boot/grub
124
125 for i in $(DIR_SRC)/config/bootloader/{grub.conf,splash.xpm.gz}; do \
126 [ -f $$i ] && cp -vf $$i /boot/grub; \
127 done
128
129 ifeq "$(EMB)" "1"
130 # Enable serial console on embedded build
131 sed -e "s/^#serial/serial/" \
132 -e "s/@SERIAL@/console=ttyS0,9600n8/g" \
133 -i /boot/grub/grub.conf
134 else
135 # Remove the placeholder @SERIAL@ on non-embedded build
136 sed -e "s/@SERIAL@//g" \
137 -i /boot/grub/grub.conf
138 endif
139
140 # Grub uses anonymous mapping and will be killed by PaX.
141 # The following command changes Grub's PaX flags:
142 paxctl -spm /usr/sbin/grub
143
144 @rm -rf $(DIR_APP)
145 @$(POSTBUILD)