grub: xfs: Accept filesystem with sparse inodes
[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
5dd9140a 101 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.02_disable_vga_fallback.patch
848ac690 102 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-2.02-xfs-accept-filesystem-with-sparse-inodes.patch
5dd9140a 103
308af080
MT
104 # Install unifont
105 cp -v $(DIR_DL)/unifont-7.0.03.pcf.gz $(DIR_APP)/unifont.pcf.gz
784cd5cb 106
308af080
MT
107ifeq "$(BUILD_EFI)" "1"
108 cp -r $(DIR_APP) $(DIR_APP_EFI)
109 cd $(DIR_APP_EFI) && ./configure $(CONFIGURE_ARGS) \
110 --with-platform=efi CFLAGS= LDFLAGS=
111 cd $(DIR_APP_EFI) && make $(MAKETUNING)
784cd5cb 112 cd $(DIR_APP_EFI) && make install
784cd5cb
MT
113endif
114
308af080
MT
115ifeq "$(BUILD_PC)" "1"
116 cp -r $(DIR_APP) $(DIR_APP_PC)
117 cd $(DIR_APP_PC) && ./configure $(CONFIGURE_ARGS) \
118 --with-platform=pc CFLAGS= LDFLAGS=
119 cd $(DIR_APP_PC) && make $(MAKETUNING)
120 cd $(DIR_APP_PC) && make install
cd1a2927 121
308af080 122 # Install empty configuration file
f5bfed65
MT
123 -mkdir -pv /boot/grub
124 touch /boot/grub/grub.cfg
308af080
MT
125endif
126
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)