]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/grub
syslinux: update i586 rootfile
[ipfire-2.x.git] / lfs / grub
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
20406699 4# Copyright (C) 2007-2018 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
20406699 27VER = 2.02
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)
b62f71f7 34SUP_ARCH = aarch64 x86_64 i586
f5bfed65 35
308af080 36# Build for which platforms?
b62f71f7
MT
37ifeq "$(BUILD_ARCH)" "i586"
38 BUILD_PC = 1
39endif
40
41ifeq "$(BUILD_ARCH)" "x86_64"
42 BUILD_PC = 1
43endif
44
45BUILD_EFI = $(EFI)
784cd5cb 46
308af080
MT
47DIR_APP_PC = $(DIR_APP)-pc
48DIR_APP_EFI = $(DIR_APP)-efi
7fbbd2ae 49
308af080
MT
50# Don't use our CFLAGS for boot code
51export HOST_CFLAGS = $(CFLAGS)
52export HOST_LDFLAGS = $(LDFLAGS)
cd1a2927 53
784cd5cb
MT
54CONFIGURE_ARGS = \
55 --prefix=/usr \
56 --sysconfdir=/etc \
308af080 57 --disable-werror
784cd5cb 58
cd1a2927
MT
59###############################################################################
60# Top-level Rules
61###############################################################################
62
ed8977a1
SS
63objects = $(DL_FILE) \
64 unifont-7.0.03.pcf.gz
cd1a2927
MT
65
66$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
ed8977a1 67unifont-7.0.03.pcf.gz = $(DL_FROM)/unifont-7.0.03.pcf.gz
cd1a2927 68
20406699 69$(DL_FILE)_MD5 = 8a4a2a95aac551fb0fba860ceabfa1d3
ed8977a1 70unifont-7.0.03.pcf.gz_MD5 = f6903ac8c1caeeb30c1e9a2975028401
cd1a2927
MT
71
72install : $(TARGET)
73
74check : $(patsubst %,$(DIR_CHK)/%,$(objects))
75
76download :$(patsubst %,$(DIR_DL)/%,$(objects))
77
78md5 : $(subst %,%_MD5,$(objects))
79
80###############################################################################
81# Downloading, checking, md5sum
82###############################################################################
83
84$(patsubst %,$(DIR_CHK)/%,$(objects)) :
85 @$(CHECK)
86
87$(patsubst %,$(DIR_DL)/%,$(objects)) :
88 @$(LOAD)
89
90$(subst %,%_MD5,$(objects)) :
91 @$(MD5)
92
93###############################################################################
94# Installation Details
95###############################################################################
96
97$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
98 @$(PREBUILD)
784cd5cb 99 @rm -rf $(DIR_APP) $(DIR_APP_EFI) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
784cd5cb 100
308af080
MT
101 # Install unifont
102 cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz
784cd5cb 103
308af080
MT
104ifeq "$(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)
784cd5cb 109 cd $(DIR_APP_EFI) && make install
784cd5cb
MT
110endif
111
308af080
MT
112ifeq "$(BUILD_PC)" "1"
113 cp -r $(DIR_APP) $(DIR_APP_PC)
114 cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \
115 --with-platform=pc CFLAGS= LDFLAGS=
116 cd $(DIR_APP_PC) && make $(MAKETUNING)
117 cd $(DIR_APP_PC) && make install
cd1a2927 118
308af080 119 # Install empty configuration file
f5bfed65
MT
120 -mkdir -pv /boot/grub
121 touch /boot/grub/grub.cfg
308af080
MT
122endif
123
124 # Install background image
b62f71f7 125 -mkdir -pv /boot/grub
3ef5dd98 126 install -m 644 $(DIR_SRC)/config/grub2/splash.png /boot/grub/splash.png
cd1a2927 127
308af080 128 # Install default configuration
f5bfed65
MT
129 -mkdir -pv /etc/default
130 install -m 644 $(DIR_SRC)/config/grub2/default /etc/default/grub
10af520f 131
5e00841d
MT
132 # Disable hardening.
133 paxctl -Cmpes /usr/sbin/grub-bios-setup /usr/sbin/grub-probe
134 paxctl -Cmpexs /usr/bin/grub-script-check
135
308af080 136 @rm -rf $(DIR_APP) $(DIR_APP_PC) $(DIR_APP_EFI)
cd1a2927 137 @$(POSTBUILD)