]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2007-2024 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.12 | |
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 | |
35 | ||
36 | ifeq "$(BUILD_ARCH)" "x86_64" | |
37 | BUILD_PC = 1 | |
38 | endif | |
39 | ||
40 | BUILD_EFI = $(EFI) | |
41 | ||
42 | DIR_APP_PC = $(DIR_APP)-pc | |
43 | DIR_APP_EFI = $(DIR_APP)-efi | |
44 | ||
45 | # Don't use our CFLAGS for boot code | |
46 | export HOST_CFLAGS = $(CFLAGS) | |
47 | export HOST_LDFLAGS = $(LDFLAGS) | |
48 | ||
49 | CONFIGURE_ARGS = \ | |
50 | --prefix=/usr \ | |
51 | --sysconfdir=/etc \ | |
52 | --disable-werror | |
53 | ||
54 | ############################################################################### | |
55 | # Top-level Rules | |
56 | ############################################################################### | |
57 | ||
58 | objects = $(DL_FILE) \ | |
59 | unifont-7.0.03.pcf.gz | |
60 | ||
61 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
62 | unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz | |
63 | ||
64 | $(DL_FILE)_BLAKE2 = a678f7fafb945d325c8cf47aa086f48357a8f6335b762f77038c30a3896b3b05491598d9931d5335841d224fffcbe4a9a43ca1479057c1f1ce52b8d2a952c431 | |
65 | unifont-7.0.03.pcf.gz_BLAKE2 = fb96c1786fcc8c77796c90ce30a2b7d544013bd62cedbf7b027e1894fe75cdbd2044717796cb0e3150db1457fcb58076491d9c0b855621b652fb9a52c0793469 | |
66 | ||
67 | install : $(TARGET) | |
68 | ||
69 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
70 | ||
71 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
72 | ||
73 | b2 : $(subst %,%_BLAKE2,$(objects)) | |
74 | ||
75 | ############################################################################### | |
76 | # Downloading, checking, b2sum | |
77 | ############################################################################### | |
78 | ||
79 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
80 | @$(CHECK) | |
81 | ||
82 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
83 | @$(LOAD) | |
84 | ||
85 | $(subst %,%_BLAKE2,$(objects)) : | |
86 | @$(B2SUM) | |
87 | ||
88 | ############################################################################### | |
89 | # Installation Details | |
90 | ############################################################################### | |
91 | ||
92 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
93 | @$(PREBUILD) | |
94 | @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) | |
95 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.06-remove_os_prober_disabled_warning.patch | |
96 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.02_disable_vga_fallback.patch | |
97 | cd $(DIR_APP) && [ ! -e grub-core/extra_deps.lst ] && echo 'depends bli part_gpt' > grub-core/extra_deps.lst | |
98 | cd $(DIR_APP) && autoreconf -vfi | |
99 | ||
100 | # Install unifont | |
101 | cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz | |
102 | ||
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) | |
108 | cd $(DIR_APP_EFI) && make install | |
109 | endif | |
110 | ||
111 | ifeq "$(BUILD_PC)" "1" | |
112 | cp -r $(DIR_APP) $(DIR_APP_PC) | |
113 | cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \ | |
114 | --with-platform=pc --disable-efiemu CFLAGS= LDFLAGS= | |
115 | cd $(DIR_APP_PC) && make $(MAKETUNING) | |
116 | cd $(DIR_APP_PC) && make install | |
117 | ||
118 | # Install empty configuration file | |
119 | -mkdir -pv /boot/grub | |
120 | touch /boot/grub/grub.cfg | |
121 | endif | |
122 | ||
123 | # Install our own helpers | |
124 | install -v -m 755 $(DIR_SRC)/config/grub2/00_cloud \ | |
125 | /etc/grub.d | |
126 | ||
127 | # Install background image | |
128 | -mkdir -pv /boot/grub | |
129 | install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png | |
130 | ||
131 | # Install default configuration | |
132 | -mkdir -pv /etc/default | |
133 | install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub | |
134 | ||
135 | @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI) | |
136 | @$(POSTBUILD) |