|
|
f725e3 |
# vim:filetype=spec
|
|
|
f725e3 |
|
|
|
f725e3 |
%global flagday 1:2.02-0.65.el7_4
|
|
|
f725e3 |
|
|
|
f725e3 |
# Modules always contain just 32-bit code
|
|
|
f725e3 |
%global _libdir %{_exec_prefix}/lib
|
|
|
f725e3 |
%global _binaries_in_noarch_packages_terminate_build 0
|
|
|
f725e3 |
#%%undefine _missing_build_ids_terminate_build
|
|
|
f725e3 |
%{expand:%%{!?buildsubdir:%%global buildsubdir grub-%{tarversion}}}
|
|
|
f725e3 |
%{expand:%%{!?_licensedir:%%global license %%%%doc}}
|
|
|
f725e3 |
|
|
|
f725e3 |
%if %{?_with_ccache: 1}%{?!_with_ccache: 0}
|
|
|
f725e3 |
%global cc_equals CC=/usr/%{_lib}/ccache/gcc
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%global cc_equals %{nil}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%global efi_cflags %(echo %{optflags} | \\\
|
|
|
f725e3 |
sed \\\
|
|
|
f725e3 |
-e 's/-O./-g3/g' \\\
|
|
|
f725e3 |
-e 's/-fstack-protector[[:alpha:]-]\\+//g' \\\
|
|
|
f725e3 |
-e 's/-Wp,-D_FORTIFY_SOURCE=[[:digit:]]\\+//g' \\\
|
|
|
f725e3 |
-e 's/--param=ssp-buffer-size=4//g' \\\
|
|
|
f725e3 |
-e 's/-mregparm=3/-mregparm=4/g' \\\
|
|
|
f725e3 |
-e 's/-fexceptions//g' \\\
|
|
|
f725e3 |
-e 's/-fasynchronous-unwind-tables//g' \\\
|
|
|
f725e3 |
-e 's/^/ -fno-strict-aliasing /' ) %{nil}
|
|
|
f725e3 |
%global legacy_cflags %(echo %{efi_cflags} | \\\
|
|
|
f725e3 |
sed \\\
|
|
|
f725e3 |
-e 's/-m64//g' \\\
|
|
|
f725e3 |
-e 's/-mcpu=power[[:alnum:]]\\+/-mcpu=power6/g' \\\
|
|
|
f725e3 |
) %{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
|
|
|
f725e3 |
%global with_efi_arch 0
|
|
|
f725e3 |
%global with_alt_efi_arch 0
|
|
|
f725e3 |
%global with_legacy_arch 0
|
|
|
f725e3 |
%global with_legacy_utils 0
|
|
|
f725e3 |
%global grubefiarch %{nil}
|
|
|
f725e3 |
%global grublegacyarch %{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
# sparc is always compiled 64 bit
|
|
|
f725e3 |
%ifarch %{sparc}
|
|
|
f725e3 |
%global target_cpu_name sparc64
|
|
|
f725e3 |
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
f725e3 |
%global legacy_target_cpu_name %{_arch}
|
|
|
f725e3 |
%global legacy_package_arch ieee1275
|
|
|
f725e3 |
%global platform ieee1275
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
# ppc is always compiled 64 bit
|
|
|
f725e3 |
%ifarch ppc ppc64 ppc64le
|
|
|
f725e3 |
%global target_cpu_name %{_arch}
|
|
|
f725e3 |
%global legacy_target_cpu_name powerpc
|
|
|
f725e3 |
%global legacy_package_arch %{_arch}
|
|
|
f725e3 |
%global legacy_grub_dir powerpc-ieee1275
|
|
|
f725e3 |
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
f725e3 |
%global platform ieee1275
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%global efi_only aarch64 %{arm}
|
|
|
f725e3 |
%global efi_arch x86_64 ia64 %{efi_only}
|
|
|
f725e3 |
%ifarch %{efi_arch}
|
|
|
f725e3 |
%global with_efi_arch 1
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%global with_efi_arch 0
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
%ifarch %{efi_only}
|
|
|
f725e3 |
%global with_efi_only 1
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%global with_efi_only 0
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
%{!?with_efi_arch:%global without_efi_arch 0}
|
|
|
f725e3 |
%{?with_efi_arch:%global without_efi_arch 1}
|
|
|
f725e3 |
%{!?with_efi_only:%global without_efi_only 0}
|
|
|
f725e3 |
%{?with_efi_only:%global without_efi_only 1}
|
|
|
f725e3 |
|
|
|
f725e3 |
### fixme
|
|
|
f725e3 |
%ifarch aarch64 %{arm}
|
|
|
f725e3 |
%global efi_modules " http linux "
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%global efi_modules " backtrace http linuxefi usb usbserial_common usbserial_pl2303 usbserial_ftdi usbserial_usbdebug "
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifarch x86_64
|
|
|
f725e3 |
%global efiarch x64
|
|
|
f725e3 |
%global target_cpu_name %{_arch}
|
|
|
f725e3 |
%global grub_target_name %{_arch}-efi
|
|
|
f725e3 |
%global package_arch efi-x64
|
|
|
f725e3 |
|
|
|
f725e3 |
%global legacy_target_cpu_name i386
|
|
|
f725e3 |
%global legacy_package_arch pc
|
|
|
f725e3 |
%global platform pc
|
|
|
f725e3 |
|
|
|
f725e3 |
%global alt_efi_arch ia32
|
|
|
f725e3 |
%global alt_target_cpu_name i386
|
|
|
f725e3 |
%global alt_grub_target_name i386-efi
|
|
|
f725e3 |
%global alt_platform efi
|
|
|
f725e3 |
%global alt_package_arch efi-ia32
|
|
|
f725e3 |
%global alt_efi_cflags %(echo %{efi_cflags} | \\\
|
|
|
f725e3 |
sed \\\
|
|
|
f725e3 |
-e 's/-m64//g' \\\
|
|
|
f725e3 |
) %{nil}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
%ifarch %{ix86}
|
|
|
f725e3 |
%global target_cpu_name %{_arch}
|
|
|
f725e3 |
%global grub_target_name %{_arch}-pc
|
|
|
f725e3 |
|
|
|
f725e3 |
%global legacy_target_cpu_name i386
|
|
|
f725e3 |
%global legacy_package_arch pc
|
|
|
f725e3 |
%global platform pc
|
|
|
f725e3 |
|
|
|
f725e3 |
%global with_legacy_arch 0
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifarch aarch64
|
|
|
f725e3 |
%global efiarch aa64
|
|
|
f725e3 |
%global target_cpu_name aarch64
|
|
|
f725e3 |
%global grub_target_name arm64-efi
|
|
|
f725e3 |
%global package_arch efi-aa64
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifarch %{arm}
|
|
|
f725e3 |
%global efiarch arm
|
|
|
f725e3 |
%global target_cpu_name arm
|
|
|
f725e3 |
%global grub_target_name arm-efi
|
|
|
f725e3 |
%global package_arch efi-arm
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
f725e3 |
%global _alt_target_platform %{alt_target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifarch %{efi_arch}
|
|
|
f725e3 |
%global with_efi_arch 1
|
|
|
f725e3 |
%global grubefiname grub%{efiarch}.efi
|
|
|
f725e3 |
%global grubeficdname gcd%{efiarch}.efi
|
|
|
f725e3 |
%global grubefiarch %{target_cpu_name}-efi
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%if 0%{?alt_efi_arch:1}
|
|
|
f725e3 |
%global with_alt_efi_arch 1
|
|
|
f725e3 |
%global grubaltefiname grub%{alt_efi_arch}.efi
|
|
|
f725e3 |
%global grubalteficdname gcd%{alt_efi_arch}.efi
|
|
|
f725e3 |
%global grubaltefiarch %{alt_target_cpu_name}-efi
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
# Figure out the right file path to use
|
|
|
f725e3 |
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifnarch %{efi_only}
|
|
|
f725e3 |
%global with_legacy_arch 1
|
|
|
f725e3 |
%global with_legacy_utils 1
|
|
|
f725e3 |
%global grublegacyarch %{legacy_target_cpu_name}-%{platform}
|
|
|
f725e3 |
%global moduledir %{legacy_target_cpu_name}-%{platform}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%global evr %{epoch}:%{version}-%{release}
|
|
|
f725e3 |
|
|
|
f725e3 |
%if %{with_legacy_arch}
|
|
|
f725e3 |
%global with_efi_common 0
|
|
|
f725e3 |
%global with_legacy_common 1
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%global with_efi_common 1
|
|
|
f725e3 |
%global with_legacy_common 0
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
%ifarch %{ix86}
|
|
|
f725e3 |
%global with_efi_arch 0
|
|
|
f725e3 |
%global with_alt_efi_arch 0
|
|
|
f725e3 |
%global with_efi_common 0
|
|
|
f725e3 |
%global with_legacy_common 1
|
|
|
f725e3 |
%global with_legacy_utils 1
|
|
|
f725e3 |
%global with_legacy_arch 0
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%if 0%{with_efi_common}
|
|
|
f725e3 |
%global common_srcdir grub-%{grubefiarch}-%{tarversion}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
%if 0%{with_legacy_common}
|
|
|
f725e3 |
%global common_srcdir grub-%{grublegacyarch}-%{tarversion}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%define define_legacy_variant() \
|
|
|
f725e3 |
%{expand:%%package %{1}} \
|
|
|
f725e3 |
Summary: Bootloader with support for Linux, Multiboot, and more \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools-minimal = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-%{1}-modules = %{evr} \
|
|
|
f725e3 |
Requires: gettext which file \
|
|
|
f725e3 |
Requires: %{name}-tools-extra = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools = %{evr} \
|
|
|
f725e3 |
Requires(pre): dracut \
|
|
|
f725e3 |
Requires(post): dracut \
|
|
|
f725e3 |
%{expand:%%description %{1}} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides support for %{1} systems. \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%{1}-%{tarversion}}}\
|
|
|
f725e3 |
%{expand:%%package %{1}-modules} \
|
|
|
f725e3 |
Summary: Modules used to build custom grub images \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
BuildArch: noarch \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
%{expand:%%description %{1}-modules} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides support for rebuilding your own grub.efi. \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%{1}-%{tarversion}}}\
|
|
|
f725e3 |
%{expand:%%package %{1}-tools} \
|
|
|
f725e3 |
Summary: Support tools for GRUB. \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
Requires: gettext os-prober which file system-logos \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools-minimal = %{evr} \
|
|
|
f725e3 |
Requires: os-prober >= 1.58-11 \
|
|
|
f725e3 |
Requires: gettext which file \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%description %{1}-tools} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides tools for support of %{1} platforms. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define define_efi_variant(p) \
|
|
|
f725e3 |
%{expand:%%package %{1}} \
|
|
|
f725e3 |
Summary: GRUB for EFI systems. \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools-minimal >= %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools-extra = %{evr} \
|
|
|
f725e3 |
Requires: %{name}-tools = %{evr} \
|
|
|
f725e3 |
%{-p:Provides: %{name}-efi = %{evr}} \
|
|
|
f725e3 |
%{-p:Obsoletes: %{name}-efi <= %{flagday}} \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%description %{1}} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides support for %{1} systems. \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%{1}-%{tarversion}}}\
|
|
|
f725e3 |
%{expand:%%package %{1}-modules} \
|
|
|
f725e3 |
Summary: Modules used to build custom grub.efi images \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
BuildArch: noarch \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
%{-p:Provides: %{name}-efi-modules = %{evr}} \
|
|
|
f725e3 |
%{-p:Obsoletes: %{name}-efi-modules <= %{flagday}} \
|
|
|
f725e3 |
%{expand:%%description %{1}-modules} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides support for rebuilding your own grub.efi. \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%package %{1}-cdboot} \
|
|
|
f725e3 |
Summary: Files used to boot removeable media with EFI \
|
|
|
f725e3 |
Group: System Environment/Base \
|
|
|
f725e3 |
Requires: %{name}-common = %{evr} \
|
|
|
f725e3 |
%{expand:%%description %{1}-cdboot} \
|
|
|
f725e3 |
%{desc} \
|
|
|
f725e3 |
This subpackage provides optional components of grub used with removeable media on %{1} systems.\
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%global do_common_setup() \
|
|
|
f725e3 |
%setup -D -q -T -a 0 -n grub-%{tarversion} \
|
|
|
f725e3 |
cd grub-%{tarversion} \
|
|
|
f725e3 |
rm -fv docs/*.info \
|
|
|
f725e3 |
cp %{SOURCE5} unifont.pcf.gz \
|
|
|
f725e3 |
cp %{SOURCE6} .gitignore \
|
|
|
f725e3 |
git init \
|
|
|
f725e3 |
echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore \
|
|
|
f725e3 |
echo '!*.[[:digit:]]' > util/.gitignore \
|
|
|
f725e3 |
git config user.email "%{name}-owner@fedoraproject.org" \
|
|
|
f725e3 |
git config user.name "Fedora Ninjas" \
|
|
|
f725e3 |
git config gc.auto 0 \
|
|
|
f725e3 |
git add . \
|
|
|
f725e3 |
git commit -a -q -m "%{tarversion} baseline." \
|
|
|
f725e3 |
git am %%{patches}
|
|
|
f725e3 |
git config --unset user.email \
|
|
|
f725e3 |
git config --unset user.name \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%global do_setup() \
|
|
|
f725e3 |
cp -al grub-%{tarversion} grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%global do_common_build() \
|
|
|
f725e3 |
cd %{common_srcdir} \
|
|
|
f725e3 |
makeinfo --info --no-split -I docs -o docs/grub-dev.info \\\
|
|
|
f725e3 |
docs/grub-dev.texi \
|
|
|
f725e3 |
makeinfo --info --no-split -I docs -o docs/grub.info \\\
|
|
|
f725e3 |
docs/grub.texi \
|
|
|
f725e3 |
makeinfo --html --no-split -I docs -o docs/grub-dev.html \\\
|
|
|
f725e3 |
docs/grub-dev.texi \
|
|
|
f725e3 |
makeinfo --html --no-split -I docs -o docs/grub.html \\\
|
|
|
f725e3 |
docs/grub.texi \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_configure() \
|
|
|
f725e3 |
./autogen.sh \
|
|
|
f725e3 |
%configure \\\
|
|
|
f725e3 |
%{cc_equals} \\\
|
|
|
f725e3 |
CFLAGS="%{2}" \\\
|
|
|
f725e3 |
TARGET_LDFLAGS=-static \\\
|
|
|
f725e3 |
--with-platform=efi \\\
|
|
|
f725e3 |
--target=%{1} \\\
|
|
|
f725e3 |
--with-grubdir=%{name} \\\
|
|
|
f725e3 |
--program-transform-name=s,grub,%{name}, \\\
|
|
|
f725e3 |
--disable-grub-mount \\\
|
|
|
f725e3 |
--disable-werror \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_build_modules() \
|
|
|
f725e3 |
make %{?_smp_mflags} ascii.h widthspec.h \
|
|
|
f725e3 |
make %{?_smp_mflags} -C grub-core \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_build_all() \
|
|
|
f725e3 |
make %{?_smp_mflags} \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_link_utils() \
|
|
|
f725e3 |
for x in grub-mkimage ; do \\\
|
|
|
f725e3 |
ln ../grub-%{1}-%{tarversion}/${x} ./ ; \\\
|
|
|
f725e3 |
done \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%ifarch x86_64 aarch64
|
|
|
f725e3 |
%define mkimage() \
|
|
|
f725e3 |
%{4}./grub-mkimage -O %{1} -o %{2}.orig \\\
|
|
|
f725e3 |
-p /EFI/%{efidir} -d grub-core ${GRUB_MODULES} \
|
|
|
f725e3 |
%{4}./grub-mkimage -O %{1} -o %{3}.orig \\\
|
|
|
f725e3 |
-p /EFI/BOOT -d grub-core ${GRUB_MODULES} \
|
|
|
f725e3 |
%{expand:%%{pesign -s -i %{2}.orig -o %{2} -a %{5} -c %{6} -n %{7}}} \
|
|
|
f725e3 |
%{expand:%%{pesign -s -i %{3}.orig -o %{3} -a %{5} -c %{6} -n %{7}}} \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
%else
|
|
|
f725e3 |
%define mkimage() \
|
|
|
f725e3 |
%{4}./grub-mkimage -O %{1} -o %{2} \\\
|
|
|
f725e3 |
-p /EFI/%{efidir} -d grub-core ${GRUB_MODULES} \
|
|
|
f725e3 |
%{4}./grub-mkimage -O %{1} -o %{3} \\\
|
|
|
f725e3 |
-p /EFI/BOOT -d grub-core ${GRUB_MODULES} \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
%endif
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_build_images() \
|
|
|
f725e3 |
GRUB_MODULES=" all_video boot btrfs cat chain configfile echo \\\
|
|
|
f725e3 |
efifwsetup efinet ext2 fat font gfxmenu gfxterm \\\
|
|
|
f725e3 |
gzio halt hfsplus iso9660 jpeg loadenv loopback \\\
|
|
|
f725e3 |
lvm mdraid09 mdraid1x minicmd normal part_apple \\\
|
|
|
f725e3 |
part_msdos part_gpt password_pbkdf2 png reboot \\\
|
|
|
f725e3 |
search search_fs_uuid search_fs_file \\\
|
|
|
f725e3 |
search_label serial sleep syslinuxcfg test tftp \\\
|
|
|
f725e3 |
video xfs" \
|
|
|
f725e3 |
GRUB_MODULES+=%{efi_modules} \
|
|
|
f725e3 |
%{expand:%%{mkimage %{1} %{2} %{3} %{4} %{5} %{6} %{7}}} \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_primary_efi_build() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
%{expand:%%do_efi_configure %%{4} %%{5}} \
|
|
|
f725e3 |
%do_efi_build_all \
|
|
|
f725e3 |
%{expand:%%do_efi_build_images %{grub_target_name} %{2} %{3} ./ %{6} %{7} %{8}}\
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_alt_efi_build() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
%{expand:%%do_efi_configure %%{4} %%{5}} \
|
|
|
f725e3 |
%do_efi_build_modules \
|
|
|
f725e3 |
%{expand:%%do_efi_link_utils %{grubefiarch}} \
|
|
|
f725e3 |
%{expand:%%do_efi_build_images %{alt_grub_target_name} %{2} %{3} ../grub-%{grubefiarch}-%{tarversion}/ %{6} %{7} %{8}} \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_legacy_build() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
./autogen.sh \
|
|
|
f725e3 |
%configure \\\
|
|
|
f725e3 |
%{cc_equals} \\\
|
|
|
f725e3 |
CFLAGS="%{legacy_cflags}" \\\
|
|
|
f725e3 |
TARGET_LDFLAGS=-static \\\
|
|
|
f725e3 |
--with-platform=%{platform} \\\
|
|
|
f725e3 |
--target=%{_target_platform} \\\
|
|
|
f725e3 |
--with-grubdir=%{name} \\\
|
|
|
f725e3 |
--program-transform-name=s,grub,%{name}, \\\
|
|
|
f725e3 |
--disable-grub-mount \\\
|
|
|
f725e3 |
--disable-werror \
|
|
|
f725e3 |
make %{?_smp_mflags} \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_alt_efi_install() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/grub/%{grubaltefiarch}/ \
|
|
|
f725e3 |
find . '(' -iname gdb_grub \\\
|
|
|
f725e3 |
-o -iname kernel.exec \\\
|
|
|
f725e3 |
-o -iname kernel.img \\\
|
|
|
f725e3 |
-o -iname config.h \\\
|
|
|
f725e3 |
-o -iname gmodule.pl \\\
|
|
|
f725e3 |
-o -iname modinfo.sh \\\
|
|
|
f725e3 |
-o -iname '*.lst' \\\
|
|
|
f725e3 |
-o -iname '*.mod' \\\
|
|
|
f725e3 |
')' \\\
|
|
|
f725e3 |
-exec cp {} $RPM_BUILD_ROOT/usr/lib/grub/%{grubaltefiarch}/ \\\; \
|
|
|
f725e3 |
find $RPM_BUILD_ROOT -iname "*.mod*" -exec chmod a-x {} '\;' \
|
|
|
f725e3 |
install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \
|
|
|
f725e3 |
install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_efi_install() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
install -m 700 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/ \
|
|
|
f725e3 |
install -m 700 -d $RPM_BUILD_ROOT/boot/grub2/ \
|
|
|
f725e3 |
make DESTDIR=$RPM_BUILD_ROOT install \
|
|
|
f725e3 |
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub.info ]; then \
|
|
|
f725e3 |
rm -f $RPM_BUILD_ROOT%{_infodir}/grub.info \
|
|
|
f725e3 |
fi \
|
|
|
f725e3 |
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info ]; then \
|
|
|
f725e3 |
rm -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info \
|
|
|
f725e3 |
fi \
|
|
|
f725e3 |
find $RPM_BUILD_ROOT -iname "*.module" -exec chmod a-x {} '\;' \
|
|
|
f725e3 |
touch $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/grub.cfg \
|
|
|
f725e3 |
ln -sf ../boot/efi/EFI/%{efidir}/grub.cfg \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg \
|
|
|
f725e3 |
install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \
|
|
|
f725e3 |
install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \
|
|
|
f725e3 |
install -D -m 700 unicode.pf2 \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/fonts/unicode.pf2\
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_legacy_install() \
|
|
|
f725e3 |
cd grub-%{1}-%{tarversion} \
|
|
|
f725e3 |
make DESTDIR=$RPM_BUILD_ROOT install \
|
|
|
f725e3 |
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub.info ]; then \
|
|
|
f725e3 |
rm -f $RPM_BUILD_ROOT%{_infodir}/grub.info \
|
|
|
f725e3 |
fi \
|
|
|
f725e3 |
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info ]; then \
|
|
|
f725e3 |
rm -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info \
|
|
|
f725e3 |
fi \
|
|
|
f725e3 |
touch ${RPM_BUILD_ROOT}/boot/%{name}/grub.cfg \
|
|
|
f725e3 |
ln -s ../boot/%{name}/grub.cfg \\\
|
|
|
f725e3 |
${RPM_BUILD_ROOT}%{_sysconfdir}/grub2.cfg \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
if [ -f $RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub2.chrp ]; then \
|
|
|
f725e3 |
mv $RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub2.chrp \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub.chrp \
|
|
|
f725e3 |
fi \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define do_common_install() \
|
|
|
f725e3 |
cd %{common_srcdir} \
|
|
|
f725e3 |
install -d -m 0755 \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_datarootdir}/locale/en\@quot \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_datarootdir}/locale/en \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_infodir}/ \
|
|
|
f725e3 |
cp -a $RPM_BUILD_ROOT%{_datarootdir}/locale/en\@quot \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_datarootdir}/locale/en \
|
|
|
f725e3 |
cp docs/grub.info $RPM_BUILD_ROOT%{_infodir}/%{name}.info \
|
|
|
f725e3 |
cp docs/grub-dev.info \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT%{_infodir}/%{name}-dev.info \
|
|
|
f725e3 |
# Ghost config file \
|
|
|
f725e3 |
install -d -m 0700 ${RPM_BUILD_ROOT}/boot/efi/EFI/%{efidir}/ \
|
|
|
f725e3 |
install -d -m 0700 ${RPM_BUILD_ROOT}/boot/grub2/ \
|
|
|
f725e3 |
install -d -m 0755 ${RPM_BUILD_ROOT}/boot/%{name}/themes/system \
|
|
|
f725e3 |
install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/default \
|
|
|
f725e3 |
install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig \
|
|
|
f725e3 |
touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub \
|
|
|
f725e3 |
ln -sf ../default/grub \\\
|
|
|
f725e3 |
${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub \
|
|
|
f725e3 |
ln -sf ../efi/EFI/%{efidir}/grubenv \\\
|
|
|
f725e3 |
$RPM_BUILD_ROOT/boot/grub2/grubenv \
|
|
|
f725e3 |
cd .. \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define define_legacy_variant_files() \
|
|
|
f725e3 |
%{expand:%%files %{1}} \
|
|
|
f725e3 |
%defattr(-,root,root,-) \
|
|
|
f725e3 |
%config(noreplace) %{_sysconfdir}/%{name}.cfg \
|
|
|
f725e3 |
%ghost %config(noreplace) /boot/%{name}/grub.cfg \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%files %{1}-modules} \
|
|
|
f725e3 |
%defattr(-,root,root) \
|
|
|
f725e3 |
%dir %{_libdir}/grub/%{2}/ \
|
|
|
f725e3 |
%{_libdir}/grub/%{2}/* \
|
|
|
f725e3 |
%exclude %{_libdir}/grub/%{2}/*.module \
|
|
|
f725e3 |
%exclude %{_libdir}/grub/%{2}/{boot,boot_hybrid,cdboot,diskboot,lzma_decompress,pxeboot}.{image,img} \
|
|
|
f725e3 |
%exclude %{_libdir}/grub/%{2}/*.o \
|
|
|
f725e3 |
%{nil}
|
|
|
f725e3 |
|
|
|
f725e3 |
%define define_efi_variant_files() \
|
|
|
f725e3 |
%{expand:%%files %{1}} \
|
|
|
f725e3 |
%defattr(-,root,root,-) \
|
|
|
f725e3 |
%config(noreplace) %{_sysconfdir}/%{name}-efi.cfg \
|
|
|
f725e3 |
%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir} \
|
|
|
f725e3 |
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{2} \
|
|
|
f725e3 |
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \
|
|
|
f725e3 |
%ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grub.cfg \
|
|
|
f725e3 |
/boot/grub2/grubenv \
|
|
|
f725e3 |
%ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grubenv \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%files %{1}-modules} \
|
|
|
f725e3 |
%defattr(-,root,root,-) \
|
|
|
f725e3 |
%dir %{_libdir}/grub/%{6}/ \
|
|
|
f725e3 |
%{_libdir}/grub/%{6}/* \
|
|
|
f725e3 |
%exclude %{_libdir}/grub/%{6}/*.module \
|
|
|
f725e3 |
\
|
|
|
f725e3 |
%{expand:%%files %{1}-cdboot} \
|
|
|
f725e3 |
%defattr(-,root,root,-) \
|
|
|
f725e3 |
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{3} \
|
|
|
f725e3 |
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \
|
|
|
f725e3 |
%{nil}
|