]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> # | |
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 | VER = 2.02 | |
28 | ||
29 | THISAPP = grub-$(VER) | |
30 | DL_FILE = $(THISAPP).tar.xz | |
31 | DL_FROM = $(URL_IPFIRE) | |
32 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
33 | TARGET = $(DIR_INFO)/$(THISAPP) | |
34 | SUP_ARCH = aarch64 x86_64 i586 | |
35 | ||
36 | # Build for which platforms? | |
37 | ifeq "$(BUILD_ARCH)" "i586" | |
38 | BUILD_PC = 1 | |
39 | endif | |
40 | ||
41 | ifeq "$(BUILD_ARCH)" "x86_64" | |
42 | BUILD_PC = 1 | |
43 | endif | |
44 | ||
45 | BUILD_EFI = $(EFI) | |
46 | ||
47 | DIR_APP_PC = $(DIR_APP)-pc | |
48 | DIR_APP_EFI = $(DIR_APP)-efi | |
49 | ||
50 | # Don't use our CFLAGS for boot code | |
51 | export HOST_CFLAGS = $(CFLAGS) | |
52 | export HOST_LDFLAGS = $(LDFLAGS) | |
53 | ||
54 | CONFIGURE_ARGS = \ | |
55 | --prefix=/usr \ | |
56 | --sysconfdir=/etc \ | |
57 | --disable-werror | |
58 | ||
59 | ############################################################################### | |
60 | # Top-level Rules | |
61 | ############################################################################### | |
62 | ||
63 | objects = $(DL_FILE) \ | |
64 | unifont-7.0.03.pcf.gz | |
65 | ||
66 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
67 | unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz | |
68 | ||
69 | $(DL_FILE)_MD5 = 8a4a2a95aac551fb0fba860ceabfa1d3 | |
70 | unifont-7.0.03.pcf.gz_MD5 = f6903ac8c1caeeb30c1e9a2975028401 | |
71 | ||
72 | install : $(TARGET) | |
73 | ||
74 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
75 | ||
76 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
77 | ||
78 | md5 : $(subst %,%_MD5,$(objects)) | |
79 | ||
80 | ############################################################################### | |
81 | # Downloading, checking, md5sum | |
82 | ############################################################################### | |
83 | ||
84 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
85 | @$(CHECK) | |
86 | ||
87 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
88 | @$(LOAD) | |
89 | ||
90 | $(subst %,%_MD5,$(objects)) : | |
91 | @$(MD5) | |
92 | ||
93 | ############################################################################### | |
94 | # Installation Details | |
95 | ############################################################################### | |
96 | ||
97 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
98 | @$(PREBUILD) | |
99 | @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) | |
100 | ||
101 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.02_disable_vga_fallback.patch | |
102 | ||
103 | # Install unifont | |
104 | cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz | |
105 | ||
106 | ifeq "$(BUILD_EFI)" "1" | |
107 | cp -r $(DIR_APP) $(DIR_APP_EFI) | |
108 | cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \ | |
109 | --with-platform=efi CFLAGS= LDFLAGS= | |
110 | cd $(DIR_APP_EFI) && make $(MAKETUNING) | |
111 | cd $(DIR_APP_EFI) && make install | |
112 | endif | |
113 | ||
114 | ifeq "$(BUILD_PC)" "1" | |
115 | cp -r $(DIR_APP) $(DIR_APP_PC) | |
116 | cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \ | |
117 | --with-platform=pc CFLAGS= LDFLAGS= | |
118 | cd $(DIR_APP_PC) && make $(MAKETUNING) | |
119 | cd $(DIR_APP_PC) && make install | |
120 | ||
121 | # Install empty configuration file | |
122 | -mkdir -pv /boot/grub | |
123 | touch /boot/grub/grub.cfg | |
124 | endif | |
125 | ||
126 | # Install background image | |
127 | -mkdir -pv /boot/grub | |
128 | install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png | |
129 | ||
130 | # Install default configuration | |
131 | -mkdir -pv /etc/default | |
132 | install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub | |
133 | ||
134 | # Disable hardening. | |
135 | paxctl -Cmpes /usr/sbin/grub-bios-setup /usr/sbin/grub-probe | |
136 | paxctl -Cmpexs /usr/bin/grub-script-check | |
137 | ||
138 | @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI) | |
139 | @$(POSTBUILD) |