]>
Commit | Line | Data |
---|---|---|
cd1a2927 | 1 | ############################################################################### |
cd1a2927 | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
7086c362 | 4 | # Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> # |
70df8302 MT |
5 | # # |
6 | # This program is free software: you can redistribute it and/or modify # | |
cd1a2927 | 7 | # it under the terms of the GNU General Public License as published by # |
70df8302 | 8 | # the Free Software Foundation, either version 3 of the License, or # |
cd1a2927 MT |
9 | # (at your option) any later version. # |
10 | # # | |
70df8302 | 11 | # This program is distributed in the hope that it will be useful, # |
cd1a2927 MT |
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 # | |
70df8302 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # |
cd1a2927 | 18 | # # |
cd1a2927 MT |
19 | ############################################################################### |
20 | ||
21 | ############################################################################### | |
22 | # Definitions | |
23 | ############################################################################### | |
24 | ||
25 | include Config | |
26 | ||
26553bec | 27 | VER = 2.06 |
cd1a2927 MT |
28 | |
29 | THISAPP = grub-$(VER) | |
f5bfed65 | 30 | DL_FILE = $(THISAPP).tar.xz |
c7845ac1 | 31 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 MT |
32 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
33 | TARGET = $(DIR_INFO)/$(THISAPP) | |
6cf219c4 | 34 | SUP_ARCH = aarch64 x86_64 |
b62f71f7 MT |
35 | |
36 | ifeq "$(BUILD_ARCH)" "x86_64" | |
37 | BUILD_PC = 1 | |
38 | endif | |
39 | ||
40 | BUILD_EFI = $(EFI) | |
784cd5cb | 41 | |
308af080 MT |
42 | DIR_APP_PC = $(DIR_APP)-pc |
43 | DIR_APP_EFI = $(DIR_APP)-efi | |
7fbbd2ae | 44 | |
308af080 MT |
45 | # Don't use our CFLAGS for boot code |
46 | export HOST_CFLAGS = $(CFLAGS) | |
47 | export HOST_LDFLAGS = $(LDFLAGS) | |
cd1a2927 | 48 | |
784cd5cb MT |
49 | CONFIGURE_ARGS = \ |
50 | --prefix=/usr \ | |
51 | --sysconfdir=/etc \ | |
308af080 | 52 | --disable-werror |
784cd5cb | 53 | |
cd1a2927 MT |
54 | ############################################################################### |
55 | # Top-level Rules | |
56 | ############################################################################### | |
57 | ||
ed8977a1 SS |
58 | objects = $(DL_FILE) \ |
59 | unifont-7.0.03.pcf.gz | |
cd1a2927 MT |
60 | |
61 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
ed8977a1 | 62 | unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz |
cd1a2927 | 63 | |
9a7e4d85 PM |
64 | $(DL_FILE)_BLAKE2 = 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417 |
65 | unifont-7.0.03.pcf.gz_BLAKE2 = fb96c1786fcc8c77796c90ce30a2b7d544013bd62cedbf7b027e1894fe75cdbd2044717796cb0e3150db1457fcb58076491d9c0b855621b652fb9a52c0793469 | |
cd1a2927 MT |
66 | |
67 | install : $(TARGET) | |
68 | ||
69 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
70 | ||
71 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
72 | ||
9a7e4d85 | 73 | b2 : $(subst %,%_BLAKE2,$(objects)) |
cd1a2927 MT |
74 | |
75 | ############################################################################### | |
9a7e4d85 | 76 | # Downloading, checking, b2sum |
cd1a2927 MT |
77 | ############################################################################### |
78 | ||
79 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
80 | @$(CHECK) | |
81 | ||
82 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
83 | @$(LOAD) | |
84 | ||
9a7e4d85 PM |
85 | $(subst %,%_BLAKE2,$(objects)) : |
86 | @$(B2SUM) | |
cd1a2927 MT |
87 | |
88 | ############################################################################### | |
89 | # Installation Details | |
90 | ############################################################################### | |
91 | ||
92 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
93 | @$(PREBUILD) | |
784cd5cb | 94 | @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) |
784cd5cb | 95 | |
bbe7cb55 | 96 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.06-remove_os_prober_disabled_warning.patch |
7086c362 | 97 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.02_disable_vga_fallback.patch |
9b346558 | 98 | cd $(DIR_APP) && autoreconf -vfi |
5dd9140a | 99 | |
308af080 MT |
100 | # Install unifont |
101 | cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz | |
784cd5cb | 102 | |
308af080 MT |
103 | ifeq "$(BUILD_EFI)" "1" |
104 | cp -r $(DIR_APP) $(DIR_APP_EFI) | |
105 | cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \ | |
106 | --with-platform=efi CFLAGS= LDFLAGS= | |
107 | cd $(DIR_APP_EFI) && make $(MAKETUNING) | |
784cd5cb | 108 | cd $(DIR_APP_EFI) && make install |
784cd5cb MT |
109 | endif |
110 | ||
308af080 MT |
111 | ifeq "$(BUILD_PC)" "1" |
112 | cp -r $(DIR_APP) $(DIR_APP_PC) | |
113 | cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \ | |
452d2b6e | 114 | --with-platform=pc --disable-efiemu CFLAGS= LDFLAGS= |
308af080 MT |
115 | cd $(DIR_APP_PC) && make $(MAKETUNING) |
116 | cd $(DIR_APP_PC) && make install | |
cd1a2927 | 117 | |
308af080 | 118 | # Install empty configuration file |
f5bfed65 MT |
119 | -mkdir -pv /boot/grub |
120 | touch /boot/grub/grub.cfg | |
308af080 MT |
121 | endif |
122 | ||
1e848ad3 | 123 | # Install our own helpers |
ff54a798 | 124 | install -v -m 755 $(DIR_SRC)/config/grub2/00_cloud \ |
21e0da66 | 125 | /etc/grub.d |
1e848ad3 | 126 | |
308af080 | 127 | # Install background image |
b62f71f7 | 128 | -mkdir -pv /boot/grub |
3ef5dd98 | 129 | install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png |
cd1a2927 | 130 | |
308af080 | 131 | # Install default configuration |
f5bfed65 MT |
132 | -mkdir -pv /etc/default |
133 | install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub | |
10af520f | 134 | |
308af080 | 135 | @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI) |
cd1a2927 | 136 | @$(POSTBUILD) |