]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/grub
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / lfs / grub
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2023 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.06
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 = 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417
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
96 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.06-remove_os_prober_disabled_warning.patch
97 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.02_disable_vga_fallback.patch
98 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-Use-zifencei-on-riscv.patch
99 cd $(DIR_APP) && autoreconf -vfi
100
101 # Install unifont
102 cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz
103
104 ifeq "$(BUILD_EFI)" "1"
105 cp -r $(DIR_APP) $(DIR_APP_EFI)
106 cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \
107 --with-platform=efi CFLAGS= LDFLAGS=
108 cd $(DIR_APP_EFI) && make $(MAKETUNING)
109 cd $(DIR_APP_EFI) && make install
110 endif
111
112 ifeq "$(BUILD_PC)" "1"
113 cp -r $(DIR_APP) $(DIR_APP_PC)
114 cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \
115 --with-platform=pc --disable-efiemu CFLAGS= LDFLAGS=
116 cd $(DIR_APP_PC) && make $(MAKETUNING)
117 cd $(DIR_APP_PC) && make install
118
119 # Install empty configuration file
120 -mkdir -pv /boot/grub
121 touch /boot/grub/grub.cfg
122 endif
123
124 # Install our own helpers
125 install -v -m 755 $(DIR_SRC)/config/grub2/00_cloud \
126 /etc/grub.d
127
128 # Install background image
129 -mkdir -pv /boot/grub
130 install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png
131
132 # Install default configuration
133 -mkdir -pv /etc/default
134 install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub
135
136 @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI)
137 @$(POSTBUILD)