x86_64: provide grub-efi (i386-efi) [release 2.12-6mamba;Sat Nov 23 2024]

This commit is contained in:
Silvan Calarco 2024-11-27 00:59:51 +01:00
parent eeca92bca8
commit fc104cf426

167
grub.spec
View File

@ -5,7 +5,7 @@
Name: grub Name: grub
Epoch: 2 Epoch: 2
Version: 2.12 Version: 2.12
Release: 5mamba Release: 6mamba
Summary: A Multiboot boot loader derived from GRUB, the GRand Unified Bootloader Summary: A Multiboot boot loader derived from GRUB, the GRand Unified Bootloader
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
@ -95,9 +95,11 @@ This package contains the efi boot files needed to boot according to EFI standar
%debug_package %debug_package
%prep %prep
%setup -q -n grub-%{majver} %setup -q -c -a0
#-D -T #% setup -q -D -T
#:<< _EOF #:<< _EOF
mv grub-%{version} grub
cd grub
%patch 1 -p1 %patch 1 -p1
%patch 3 -p1 %patch 3 -p1
%patch 9 -p1 %patch 9 -p1
@ -121,85 +123,115 @@ sh ./linguas.sh
# 2.12: workaround for *** No rule to make target '../grub-core/extra_deps.lst', needed by 'syminfo.lst' # 2.12: workaround for *** No rule to make target '../grub-core/extra_deps.lst', needed by 'syminfo.lst'
touch grub-core/extra_deps.lst touch grub-core/extra_deps.lst
%ifarch x86_64 %{ix86}
cd ..
cp -a grub grub-efi-i386
cp -a grub grub-efi-x86_64
%endif
%build %build
#:<< _EOF #:<< _EOF
CONFIGURE_OPTIONS="
--prefix=%{_prefix}
--bindir=%{_bindir}
--sbindir=%{_bindir}
--mandir=%{_mandir}
--infodir=%{_infodir}
--datarootdir=%{_datadir}
--sysconfdir=%{_sysconfdir}
--libdir=%{_prefix}/lib
--enable-mm-debug
--enable-nls
--enable-device-mapper
--enable-cache-stats
--enable-boot-time
--enable-grub-mkfont
--enable-grub-mount
--disable-silent-rules
--disable-werror
CFLAGS=
CXXFLAGS=
FFLAGS=
"
cd grub
# WARNING: build requires ld.bfd; ld.gold produces not working binary # WARNING: build requires ld.bfd; ld.gold produces not working binary
%configure \ ./configure \
%ifarch x86_64 %{ix86} %ifarch x86_64 %{ix86}
--with-platform="pc" \ --with-platform="pc" \
--target="i386" \ --target="i386" \
%endif %endif
--libdir=%{_prefix}/lib \
%ifarch x86_64 %ifarch x86_64
--enable-efiemu \ --enable-efiemu \
%else %else
--disable-efiemu \ --disable-efiemu \
%endif %endif
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-boot-time \
--enable-grub-mkfont \
--enable-grub-mount \
--enable-libzfs \ --enable-libzfs \
--disable-silent-rules \ ${CONFIGURE_OPTIONS}
--disable-werror \
CFLAGS= \
CXXFLAGS= \
FFLAGS=
# don't use % make because unset *FLAGS are needed # don't use % make because unset *FLAGS are needed
make make
cd ..
#_EOF
%ifarch x86_64 %{ix86}
# i386-efi
cd grub-efi-i386
#export EFI_ARCH=i586-openmamba-linux-gnu
export EFI_ARCH=i386
./configure \
--disable-efiemu \
--enable-boot-time \
--with-platform=efi \
--target=${EFI_ARCH} \
%ifarch %{ix86}
--enable-libzfs \
%endif
${CONFIGURE_OPTIONS}
#--host=%{_host_arch} TARGET_CC="%{_host}-gcc"
make
#-j1 CFLAGS="-Wno-error %{optflags} -Os -m32" LDFLAGS_PLATFORM="-m32"
# x86_64-efi
cd ../grub-efi-x86_64
#export EFI_ARCH=x86_64-openmamba-linux-gnu
export EFI_ARCH=x86_64
./configure \
--disable-efiemu \
--enable-boot-time \
--with-platform=efi \
--target=${EFI_ARCH} \
%ifarch x86_64
--enable-libzfs \
%endif
${CONFIGURE_OPTIONS}
make -j1 CFLAGS="-Wno-error"
%endif
## Generate Latin-1, Latin Extended A+B, Arrows, Box and Block characters: ## Generate Latin-1, Latin Extended A+B, Arrows, Box and Block characters:
#./grub-mkfont --output=unifont.pf2 --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f unifont.bdf #./grub-mkfont --output=unifont.pf2 --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f unifont.bdf
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall %makeinstall -C grub
# Build EFI grub (x86_64 build disabled for now because it requires lib32-libdevmapper) %find_lang grub || touch %{name}.lang
%ifarch %{ix86}
%ifarch x86_64 %{ix86}
# i386-efi # i386-efi
make clean cd grub-efi-i386
rm -f *.d
export EFI_ARCH=i586-openmamba-linux-gnu
./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_prefix}/lib \
--with-platform=efi --target=${EFI_ARCH}
#--host=%{_host_arch} TARGET_CC="%{_host}-gcc"
make -j1 CFLAGS="-Wno-error %{optflags} -Os -m32" LDFLAGS_PLATFORM="-m32"
ARCHOUT=i386-efi ARCHOUT=i386-efi
install -d %{buildroot}%{_prefix}/lib/grub/${ARCHOUT} install -d %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}
cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_libdir}/grub/${ARCHOUT}/ cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}/
#./grub-mkimage -o bootia32.efi -O ${ARCHOUT} -p /efi/boot -d ./grub-core part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot linux echo help gfxterm gettext png efi_gop efi_uga #./grub-mkimage -o bootia32.efi -O ${ARCHOUT} -p /efi/boot -d ./grub-core part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot linux echo help gfxterm gettext png efi_gop efi_uga
#`find . -name *.mod | xargs | sed -e 's/.mod//g'` #`find . -name *.mod | xargs | sed -e 's/.mod//g'`
#% makeinstall #% makeinstall
#cp bootia32.efi %{buildroot}%{_prefix}/lib/grub/ #cp bootia32.efi %{buildroot}%{_prefix}/lib/grub/
# x86_64-efi # x86_64-efi
make clean cd ../grub-efi-x86_64
rm -f *.d
export EFI_ARCH=x86_64-openmamba-linux-gnu
./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_prefix}/lib \
--with-platform=efi --target=${EFI_ARCH}
make -j1 CFLAGS="-Wno-error"
ARCHOUT=x86_64-efi
install -d %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}
cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}/
#./grub-mkimage -o bootx64.efi -O ${ARCHOUT} -p /efi/boot -d ./grub-core part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot linux echo help gfxterm gettext png efi_gop efi_uga
#`find . -name *.mod | xargs | sed -e 's/.mod//g'`
#% makeinstall
#cp bootx64.efi %{buildroot}%{_prefix}/lib/grub/
%endif
%ifarch x86_64
make clean
rm -f *.d
export EFI_ARCH=x86_64-openmamba-linux-gnu
./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_prefix}/lib \
--with-platform=efi
make -j1 CFLAGS="-Wno-error"
ARCHOUT=x86_64-efi ARCHOUT=x86_64-efi
install -d %{buildroot}%{_prefix}/lib/grub/${ARCHOUT} install -d %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}
cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}/ cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_prefix}/lib/grub/${ARCHOUT}/
@ -212,13 +244,13 @@ cp grub-core/{*.mod,*.lst,*.img,*.sh,*.lst} %{buildroot}%{_prefix}/lib/grub/${AR
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub
install -D -m0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/grub install -D -m0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/grub
cat > %{buildroot}%{_sbindir}/update-grub << _EOF cat > %{buildroot}%{_bindir}/update-grub << _EOF
#!/bin/bash #!/bin/bash
cp -f /boot/grub/grub.cfg /boot/grub/grub.cfg.old cp -f /boot/grub/grub.cfg /boot/grub/grub.cfg.old
%{_sbindir}/grub-mkconfig $@ > /boot/grub/grub.cfg %{_sbindir}/grub-mkconfig $@ > /boot/grub/grub.cfg
exit $? exit $?
_EOF _EOF
chmod +x %{buildroot}%{_sbindir}/update-grub chmod +x %{buildroot}%{_bindir}/update-grub
install -d -m0755 %{buildroot}/boot/grub install -d -m0755 %{buildroot}/boot/grub
install -d -m0755 %{buildroot}/boot/efi install -d -m0755 %{buildroot}/boot/efi
@ -226,8 +258,6 @@ install -d -m0755 %{buildroot}/boot/efi
# Provide a simple sbat.csv required for EFI with secure boot support # Provide a simple sbat.csv required for EFI with secure boot support
sed -e "s/%%PKGVER%/%{epoch}:%{version}-%{release}/" < %{SOURCE7} > %{buildroot}%{_datadir}/grub/sbat.csv sed -e "s/%%PKGVER%/%{epoch}:%{version}-%{release}/" < %{SOURCE7} > %{buildroot}%{_datadir}/grub/sbat.csv
%find_lang grub || touch %{name}.lang
rm -f %{buildroot}%{_infodir}/dir rm -f %{buildroot}%{_infodir}/dir
%post %post
@ -320,16 +350,16 @@ fi
%{_bindir}/grub-render-label %{_bindir}/grub-render-label
%{_bindir}/grub-script-check %{_bindir}/grub-script-check
%{_bindir}/grub-syslinux2cfg %{_bindir}/grub-syslinux2cfg
%{_sbindir}/grub-bios-setup %{_bindir}/grub-bios-setup
%{_sbindir}/grub-install %{_bindir}/grub-install
%{_sbindir}/grub-macbless %{_bindir}/grub-macbless
%{_sbindir}/grub-mkconfig %{_bindir}/grub-mkconfig
%{_sbindir}/grub-ofpathname %{_bindir}/grub-ofpathname
%{_sbindir}/grub-reboot %{_bindir}/grub-reboot
%{_sbindir}/grub-set-default %{_bindir}/grub-set-default
%{_sbindir}/grub-sparc64-setup %{_bindir}/grub-sparc64-setup
%{_sbindir}/grub-probe %{_bindir}/grub-probe
%{_sbindir}/update-grub %{_bindir}/update-grub
%dir /boot/grub %dir /boot/grub
%dir %{_datadir}/grub %dir %{_datadir}/grub
%{_datadir}/grub/ascii.h %{_datadir}/grub/ascii.h
@ -350,7 +380,7 @@ fi
%{_mandir}/man1/grub*.1.gz %{_mandir}/man1/grub*.1.gz
%{_mandir}/man8/grub*.8.gz %{_mandir}/man8/grub*.8.gz
%{_datadir}/info/grub.info.gz %{_datadir}/info/grub.info.gz
%doc AUTHORS COPYING %doc grub/AUTHORS grub/COPYING
#% doc ChangeLog NEWS README THANKS TODO #% doc ChangeLog NEWS README THANKS TODO
%files theme-starfield %files theme-starfield
@ -358,11 +388,11 @@ fi
%dir %{_datadir}/grub/themes/starfield %dir %{_datadir}/grub/themes/starfield
%{_datadir}/grub/themes/starfield/* %{_datadir}/grub/themes/starfield/*
%ifarch %{ix86} aarch64 %ifarch %{ix86} aarch64 x86_64
%files efi %files efi
%defattr(-,root,root) %defattr(-,root,root)
%dir /boot/efi %dir /boot/efi
%ifarch %{ix86} %ifarch x86_64 %{ix86}
%dir %{_prefix}/lib/grub/i386-efi %dir %{_prefix}/lib/grub/i386-efi
%{_prefix}/lib/grub/i386-efi/* %{_prefix}/lib/grub/i386-efi/*
%endif %endif
@ -381,6 +411,9 @@ fi
%endif %endif
%changelog %changelog
* Sat Nov 23 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 2.12-6mamba
- x86_64: provide grub-efi (i386-efi)
* Sun Oct 27 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 2.12-5mamba * Sun Oct 27 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 2.12-5mamba
- provide a simple sbat.csv file to be used to generate EFI images with secure boot support - provide a simple sbat.csv file to be used to generate EFI images with secure boot support
- update unifont to 16.0.01 - update unifont to 16.0.01