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