]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/grub
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / lfs / grub
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
ed5e80eb 4# Copyright (C) 2007-2024 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
25include Config
26
ed5e80eb 27VER = 2.12
cd1a2927
MT
28
29THISAPP = grub-$(VER)
f5bfed65 30DL_FILE = $(THISAPP).tar.xz
c7845ac1 31DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
1b6047b3 34#SUP_ARCH = aarch64 x86_64
b62f71f7
MT
35
36ifeq "$(BUILD_ARCH)" "x86_64"
37 BUILD_PC = 1
38endif
39
40BUILD_EFI = $(EFI)
784cd5cb 41
308af080
MT
42DIR_APP_PC = $(DIR_APP)-pc
43DIR_APP_EFI = $(DIR_APP)-efi
7fbbd2ae 44
308af080
MT
45# Don't use our CFLAGS for boot code
46export HOST_CFLAGS = $(CFLAGS)
47export HOST_LDFLAGS = $(LDFLAGS)
cd1a2927 48
784cd5cb
MT
49CONFIGURE_ARGS = \
50 --prefix=/usr \
51 --sysconfdir=/etc \
308af080 52 --disable-werror
784cd5cb 53
cd1a2927
MT
54###############################################################################
55# Top-level Rules
56###############################################################################
57
ed8977a1
SS
58objects = $(DL_FILE) \
59 unifont-7.0.03.pcf.gz
cd1a2927
MT
60
61$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
ed8977a1 62unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz
cd1a2927 63
ed5e80eb 64$(DL_FILE)_BLAKE2 = a678f7fafb945d325c8cf47aa086f48357a8f6335b762f77038c30a3896b3b05491598d9931d5335841d224fffcbe4a9a43ca1479057c1f1ce52b8d2a952c431
9a7e4d85 65unifont-7.0.03.pcf.gz_BLAKE2 = fb96c1786fcc8c77796c90ce30a2b7d544013bd62cedbf7b027e1894fe75cdbd2044717796cb0e3150db1457fcb58076491d9c0b855621b652fb9a52c0793469
cd1a2927
MT
66
67install : $(TARGET)
68
69check : $(patsubst %,$(DIR_CHK)/%,$(objects))
70
71download :$(patsubst %,$(DIR_DL)/%,$(objects))
72
9a7e4d85 73b2 : $(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)
bbe7cb55 95 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.06-remove_os_prober_disabled_warning.patch
7086c362 96 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub/grub-2.02_disable_vga_fallback.patch
ed5e80eb 97 cd $(DIR_APP) && [ ! -e grub-core/extra_deps.lst ] && echo 'depends bli part_gpt' > grub-core/extra_deps.lst
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
103ifeq "$(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
109endif
110
308af080
MT
111ifeq "$(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
121endif
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)