]> 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-2021 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)_MD5 = cf0fd928b1e5479c8108ee52cb114363
65 unifont-7.0.03.pcf.gz_MD5 = f6903ac8c1caeeb30c1e9a2975028401
66
67 install : $(TARGET)
68
69 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
70
71 download :$(patsubst %,$(DIR_DL)/%,$(objects))
72
73 md5 : $(subst %,%_MD5,$(objects))
74
75 ###############################################################################
76 # Downloading, checking, md5sum
77 ###############################################################################
78
79 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
80 @$(CHECK)
81
82 $(patsubst %,$(DIR_DL)/%,$(objects)) :
83 @$(LOAD)
84
85 $(subst %,%_MD5,$(objects)) :
86 @$(MD5)
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) && 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)