Building MNT Reform RK3588 U-Boot

I’m trying to build U-Boot using the ./build.sh script in Reform / MNT Reform RK3588 U-Boot · GitLab and I’m having trouble. I can’t access the source.mnt.re gitlab (I signed up a long time ago and didn’t get a login), so I am asking here.

Specifically, whenever I run boot_merger, I get the error:

$ ../rkbin/tools/boot_merger ./rock5b-rk3588.ini
-bash: ../rkbin/tools/boot_merger: cannot execute binary file: Exec format error

I think this suggests that the binary was not correctly compiled. Has anyone encountered this before? I am trying to package u-boot for guix in lykso/mnt-reform-nonguix - Codeberg.org, but I’m getting stuck at this step.

I should point out that I am building this on my rk3588 mnt-reform, and I’m hitting this error locally, without guix, using the ./build.sh script. build logs can be found here: ./build.sh stdout - Pastebin.com and the only thing I had to custom install was swig, which I pinned to 4.0.2 (the debian version fails to compile one of the dependencies).

1 Like

You should be able to git clone everything even without an account. What error do you see?

It is not compiled at all. It is a blob that was committed to git: rkbin/tools/boot_merger at master · rockchip-linux/rkbin · GitHub

And that file turns out to be an x86-64 executable. :frowning:

Maybe you can help improve build.sh with some lines that rebuild the boot_merger tool from source?

Sorry for not being clear – I meant that i couldn’t file an issue on the gitlab repo.
That would make a lot of sense! I don’t think a source exists for rkbin, but I can try to run under qemu and see if it works.

It is a blob that was committed to git: rkbin/tools/boot_merger at master · rockchip-linux/rkbin · GitHub

And that file turns out to be an x86-64 executable. :frowning:

Great! So then I can get past this using qemu-user:

$ sudo apt-get install qemu-user
$ qemu-amd64 ./rkbin/tools/boot_merger
********boot_merger ver 1.35********
	...

Although it looks like I have to define a variant of guix derivation : /

Maybe you can help improve build.sh with some lines that rebuild the boot_merger tool from source?

It seems like that’s not possible – I can’t find the source of rkbin and the docs don’t seem to have any build instructions. Let me know if this is wrong! If this is the case, I could add a small modification to the ./build.sh script to preface rkbin commands with qemu, depending on the system architecture.

I tried to sign up for an account on the gitlab instance a while back and I never got verified by an admin. I tried again just now. Happy to contribute the above.