Need help to build Grub2 for Raspberry PI 3B

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

Need help to build Grub2 for Raspberry PI 3B

Postby muhaha » Thu Jul 11, 2019 6:01 pm

I am trying to build grub2 for the Raspberry PI 3B and I was wondering if anyone had attempted to do this on ArchLinux before? So far I am trying to modify the grub package from ArchLinux x86_64 to build the package.

It all started because I saw this interesting video from openSUSE
https://www.youtube.com/watch?v=bNL1pd-rwCU
and it got me thinking that it should be possible to get the PI to boot into a zfs root partition and this way give me boot environments :)

I already got zfs working, that was surprisingly easy, but grub is giving me problems so any help or suggestions would be appreciated :)
muhaha
 
Posts: 1
Joined: Thu Jul 11, 2019 5:41 pm

Re: Need help to build Grub2 for Raspberry PI 3B

Postby tomty89 » Wed Oct 02, 2019 9:29 am

I applied this to grub-git from AUR:
$this->bbcode_second_pass_code('', '
diff --git a/PKGBUILD b/PKGBUILD.new
index 65c67c0..01ef90e 100644
--- a/PKGBUILD
+++ b/PKGBUILD.new
@@ -12,15 +12,17 @@ _grub_emu_build="1"
[[ "${CARCH}" == "x86_64" ]] && _target_arch="x86_64"
[[ "${CARCH}" == "i686" ]] && _target_arch="i386"

-_build_platforms="i386-pc ${_target_arch}-efi"
-[[ "${CARCH}" == "x86_64" ]] && [[ "${_ia32_efi_in_arch_x64}" == "1" ]] && _build_platforms+=" i386-efi"
-[[ "${_grub_emu_build}" == "1" ]] && _build_platforms+=" ${_target_arch}-emu"
+#_build_platforms="i386-pc ${_target_arch}-efi"
+#[[ "${CARCH}" == "x86_64" ]] && [[ "${_ia32_efi_in_arch_x64}" == "1" ]] && _build_platforms+=" i386-efi"
+#[[ "${_grub_emu_build}" == "1" ]] && _build_platforms+=" ${_target_arch}-emu"
+
+_build_platforms="aarch64-efi"

pkgname="grub-git"
-pkgver=2.04.rc1.r19.g4e7b5bb3b
+pkgver=2.04.r17.gff3e91be9
pkgrel=1
pkgdesc="GNU GRand Unified Bootloader (2)"
-arch=('x86_64' 'i686')
+arch=('aarch64')
url="https://www.gnu.org/software/grub/"
license=('GPL3')
depends=('device-mapper' 'freetype2' 'fuse2' 'gettext')
@@ -113,15 +115,16 @@ build() {
# This results in an incorrect configuration and only by adding -O2
# to CPPFLAGS does this problem seem to be worked around.
../configure --with-platform="${_arch##*-}" \
- --target="${_arch%%-*}" \
+ --host="${_arch%%-*}-linux-gnu" \
+ --target="${_arch%%-*}-linux-gnu" \
--prefix="/usr" \
--sbindir="/usr/bin" \
--sysconfdir="/etc" \
--enable-boot-time \
--enable-cache-stats \
--enable-device-mapper \
- --enable-grub-mkfont \
- --enable-grub-mount \
+ --disable-grub-mkfont \
+ --disable-grub-mount \
--enable-mm-debug \
--enable-nls \
--disable-silent-rules \

')

and then
$this->bbcode_second_pass_code('', 'MAKEPKG_CONF=/home/tom/makepkg.conf makepkg -C -s')
worked. /home/tom/makepkg.conf is the copied from the ArchLinuxARM for rpi3.

P.S. This is for cross compiling on x86-64 btw. So get aarch64-linux-gnu-gcc. If you are building on the pi changes after the `arch=` line aren't even necessary.
tomty89
 
Posts: 8
Joined: Sun Jan 06, 2019 5:30 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 2 guests