#build steps:
1. 
#cp ./grub2-res.tar.gz /root/rpmbuild/SOURCES/
2.
rpmbuild -bb ./grub2-xcat.spec


#notes:
1.the grub2-res.tar.gz is generated by:
run the following cmd on a RHEL7-PPC64 node:
#grub2-mknetdir  --net-directory=/tftpboot/
#cd /tftpboot/boot/grub2/
#tar -czvf /tmp/grub2-res.tar.gz ./powerpc-ieee1275/




2.Please update the %version or %release when any modification is made for the files 


#riscv64:
riscv64 nodes boot through UEFI firmware and grub2 only. The file
grubriscv64.efi (Source2) is the unmodified grub2 UEFI image from the
Rocky Linux 10 riscv64 BaseOS tree (the copy used for installation media
and network boot, embedded prefix /EFI/BOOT):

  path:       BaseOS/riscv64/os/EFI/BOOT/grubriscv64.efi (Rocky Linux 10.2)
  built from: grub2-2.12-46.el10_2.rocky.0.1.src.rpm (GPL-3.0-or-later),
              the same build as grub2-efi-riscv64-2.12-46.el10_2.rocky.0.1
  sha256:     40baf4e65d20f73e6a5ec4f882d8a50450eaaf8b6688acf871824824ef0bad54

It is installed as /tftpboot/boot/grub2/riscv64-efi/grubriscv64.efi and
copied to /tftpboot/boot/grub2/grub2.riscv64 by the package scripts, which
is the boot file xCAT hands to DHCP client architecture 27 (0x001b). To
refresh it, take EFI/BOOT/grubriscv64.efi from the BaseOS tree of the EL10
release you target and record the release, source rpm and sha256 here.

#aarch64:
aarch64 nodes boot through UEFI firmware and grub2 only, like riscv64, but
the distro grubaa64.efi cannot be shipped as is: its embedded prefix points
at the distro's /EFI/<vendor> directory, so it never finds the
boot/grub2/grub.cfg-<HEXIP> that nodeset writes. The image is therefore
generated in %build with

  grub2-mkimage -O arm64-efi -p /boot/grub2 -o grubaa64.efi <modules>

(BuildRequires grub2-tools and the noarch grub2-efi-aa64-modules), the same
/boot/grub2 prefix the grub2.ppc core image uses. efi_uga is not in the
module list: it is x86 only and grub2-mkimage aborts on it for arm64-efi.
It is installed as /tftpboot/boot/grub2/aarch64-efi/grubaa64.efi and
copied to /tftpboot/boot/grub2/grub2.aarch64 by %post, which is the boot
file xCAT hands to DHCP client architecture 11 (0x000b). The openEuler
build carries no grub2-efi-aa64-modules and ships without the image.
