Skip to content

Building instructions  #1

Open
Open

Description

@febs

As per the reddit thread, I am writing about the project here.

Thanks for it in the first place.
I would like to fiddle with the project but I am not much into embedded computing.
Would it be possible to kindly provide a quick howto about how to actually build an image with buildroot and retroarch?

I personally have some experience building the Linux kernel and with "make menuconfig" for what it's worth.

My objective would be to build this for the raspberry pi 4 (that thing you wrote on reddit about lowering the boot time down to 2 seconds is so sexy 😉) and for an odd board using an Allwinner A13 SoC.

Thank you so much for any help.

Activity

  1. aduskett commented on Feb 21, 2021

    @aduskett
    Collaborator

    Hey! Sorry about the late reply! I've been incredibly busy with a new job.

    I decided to change how everything is built by using docker containers. Check out the develop branch, which should have a much better readme.md file on how to get going.

    I can test with an RPI4 a bit later as well!

  2. febs commented on Feb 22, 2021

    @febs
    Author

    Thank you very much for your reply, I'll look into that.

  3. aduskett commented on Feb 22, 2021

    @aduskett
    Collaborator

    Thank you very much for your reply, I'll look into that.

    No worries! I actually did a ton of work this weekend to get Dracut whipped into shape!
    I also updated Buildroot to the latest version along with retroarch. Today I am going to do some testing with the RPI4 as well!

  4. aduskett commented on Feb 28, 2021

    @aduskett
    Collaborator

    Thank you very much for your reply, I'll look into that.

    For what it's worth, the develop branch now has a raspberrypi4 and raspberrypi3 config

  5. febs commented on Mar 2, 2021

    @febs
    Author

    Thank you!

  6. aduskett commented on Mar 2, 2021

    @aduskett
    Collaborator

    Thank you!

    No worries! I also just pushed a new init system for docker. I need to add a readme for the env.json file, but now you can specify fragments to apply to the config before building.

  7. Roet-Ivar commented on Jan 6, 2025

    @Roet-Ivar

    Hi @aduskett ! Is there a way to know if the build is making any progress, mine seems to be stuck here forever? (I'm using WSL2)
    image

  8. aduskett commented on Jan 7, 2025

    @aduskett
    Collaborator

    Hi @Roet-Ivar !

    I just pushed a massive update that does the following:

      - New build system using make
      - Updated retroarch to 1.20.0
      - Updated retroarch assets to 1.19.0
      - Updated readme.md
      - Uses Docker for building
      - Updated README.md
      - X86 KMS uses kernel 6.12
      - Updated buildroot to 2024.02.9
      - Removed Dracut and Plymouth
    

    TLDR: run make build and see if that works now. I have only tested building in Linux, so I'm not sure if WSL2 will work! I hope so!

    Thanks!

    Adam

  9. aduskett commented on Jan 7, 2025

    @aduskett
    Collaborator

    Hi @Roet-Ivar

    I am bad at reading! Sorry about that!

    Can you provide your .json file perchance?
    Thanks!

    Adam

  10. Roet-Ivar commented on Jan 7, 2025

    @Roet-Ivar

    @aduskett thanks for still supporting this project!
    I made a build manually which seems to spit out an sdcard-image for the pi3.

    My problem now is that I'm trying to make it for the pi zero 2w which seem to require a custom config.
    I saw that the original buildroot project have a config if that helps?

  11. aduskett commented on Jan 7, 2025

    @aduskett
    Collaborator

    @Roet-Ivar No worries at all!

    Take a look at the rpi3.json file in the top-level docker/ directory for an example of how to apply new configs.
    You will need to make a rpi2w.json file and copy a base-level defconfig to retroroot/configs to get everything to start building!

  12. Roet-Ivar commented on Jan 8, 2025

    @Roet-Ivar

    @aduskett I've put together what I think is the correct config for building against a raspberry pi zero 2w, if I get it to work I could make a pull request.

    From a clean pull inside WSL2 of the repo I'm faced with this error, maybe it doesn't work on WSL2 and docker-compose-v2.
    (people suggest /r line endings, but I didn't pull the repo from windows git)

    username:/mnt/c/Users/NIJ/Code/retroroot$ sudo make build
    APPLY_CONFIGS=false \
    VERBOSE=false \
    ENV_FILES="x86_64.json" \
    EXIT_AFTER_BUILD=true \
    NO_BUILD=false \
    CLEAN_AFTER_BUILD=false \
    docker compose up --abort-on-container-exit
    [+] Running 1/0
     ✔ Container buildroot-retroroot  Created                                                                          0.0s
    Attaching to buildroot-retroroot
    buildroot-retroroot  | /usr/bin/env: 'bash\r': No such file or directory
    buildroot-retroroot  | /usr/bin/env: use -[v]S to pass options in shebang lines
    buildroot-retroroot exited with code 127
    Aborting on container exit...
    [+] Stopping 1/0
     ✔ Container buildroot-retroroot  Stopped                                                                          0.0s
    make: *** [Makefile:40: build] Error 127
    
    

    EDIT: I'm currently making a manual docker container build (with "docker compose" v1 instead of "docker-compose" v2) from the latest branch using the instructions from the develop branch. I'll make an update post when tested.

  13. Roet-Ivar commented on Jan 8, 2025

    @Roet-Ivar

    @aduskett Now it boots from the pi zero 2w, but stops at the login screen after the rainbow splash. Login in as root I can't find any packages for retroarch so I guess it skipped some packages. The config.txt and cmdline.txt didn't seem to have got included from the rpi3 board config I copied over either for some reason.

    By manually adding the parameters from rpi3 config and cmdline I now have a 3s boot to login screen without any rainbow or text, which is cool. I'll make an ubuntu boot drive to see if I can re-build it as per your instructions.

    Any ideas?

  14. 9 remaining items

  15. Roet-Ivar commented on Jan 9, 2025

    @Roet-Ivar

    I noticed a few other options missing. I'll push in a few minutes after I confirm everything builds. Again, no guarantee on actual booting, as I don't have a Z2W to test with :\

    Don't worry, we had it booting before with my configs (I have still them stashed to compare with), it just lacked all the good stuff :) I really appreciate your time btw!

  16. aduskett commented on Jan 9, 2025

    @aduskett
    Collaborator

    @Roet-Ivar No worries. I pushed another fix. There were several missing config options. I also cleaned up some post-build and post-image scripts.

  17. aduskett commented on Jan 9, 2025

    @aduskett
    Collaborator

    You may have to remove the retroroot/output/raspberrypizero2w/ directory (rm -rf retroroot/output/raspberrypizero2w/) and rebuild from scratch. Fortunately, subsequent rebuilds are much faster thanks to ccache.

  18. Roet-Ivar commented on Jan 9, 2025

    @Roet-Ivar

    @aduskett
    The automatic build did not experience any errors of what I could see from the logout, when testing it the pi did not show any signs of life (blinking leds) which tells me the boot partition is not read correctly.

    So I checked the SD-card in windows first to see what the boot partition looked like but it never shows, weirdly windows tells me that I has a "signature collision" (this also happens for the x86_64 auto build), this doesn't happen if I build it manually inside the docker container:
    image
    (Note: I've removed the other partitions in this example)

    So I looked in gparted from my ubuntu-install:
    image

    The boot partition is there, but maybe gets corrupt in the automatic build process?

    The data-partition is containing an empty RetroArch folder structure, not sure if that is meant to be manually updated later?
    image

    My next test would be to merge my changes on-top of your rpiz2w branch to see if it makes any difference.

  19. Roet-Ivar commented on Jan 11, 2025

    @Roet-Ivar

    @aduskett
    it seems like my changes didn't matter much since the first partition with the config.txt and cmdline.txt doesn't work after the autobuild.

    However, in order to get a working boot partition building manually inside docker works:

    make build
    sudo docker-compose up -d && sudo docker exec -ti buildroot-retroroot /bin/bash
    make rasperrypizero2w_defconfig
    make
    

    Retrieve and burn sdcard.img from buildroot/output folder inside docker, doing this seem to give me a small ~150mb image that boots.

  20. Roet-Ivar commented on Jan 12, 2025

    @Roet-Ivar

    @aduskett Sorry for my monologues!
    I finally found that the issue
    TLDR GPT instead of MBR (which the pi wants).

    The non-booting "auto-builder" gives us a GPT partition table with the boot partition which is flagged as ESP:
    Screenshot from 2025-01-12 19-15-18

    When building manually as described earlier we end up with msdos aka MBR partition table instead, boot flagged LBA
    Screenshot from 2025-01-12 19-08-58

    Any chance to easily change partition table type to MBR instead of GPT for raspberry pi in the builder?

  21. aduskett commented on Jan 13, 2025

    @aduskett
    Collaborator

    no worries on the multiple posts. I don't think it's the gpt partition scheme, but probably the uboot setup instead of a standard setup. I need to get a RPI3 to test (as that would ensure that the rpi3 and zwl2 both work) but man, 50 euros is tough to swallow!

  22. aduskett commented on Jan 13, 2025

    @aduskett
    Collaborator

    @Roet-Ivar I guess I could buy a RPIZ2W, but finding one for 15 euros is going to be tough!

  23. Roet-Ivar commented on Jan 13, 2025

    @Roet-Ivar

    @aduskett I don't think you should buy a board just for this, you put in enough work as it is :)
    If you ever feel like making something for me to test later on just let me know, otherwise you could probably close this issue.

    Thank you very much for you patience! ❤️

  24. aduskett commented on Jan 13, 2025

    @aduskett
    Collaborator

    @Roet-Ivar No worries! On a side-note, I am waiting for a debug cable for the RPI5 which should arrive sometime next week. Then I can get that booting at least!

  25. Roet-Ivar commented on Jan 13, 2025

    @Roet-Ivar

    @aduskett Cool I wonder how fast that could boot!
    Mainly I'm looking for a replacement or a substitute for my TangNano-20K, it has almost instant boot and runs a nesTang core. Downsides, no save states and no filters, no native bluetooth.

    I've read that a rapsberry pi 3 or similar could boot into something like emulationstation/RetroArch in 3 seconds.

  26. aduskett commented on Jan 13, 2025

    @aduskett
    Collaborator

    @Roet-Ivar I'll let you know how fast the RPI5 boots when I get the cable next week. Probably around 5 seconds or so. First boot will take longer as the data/ partition will expand automatically on first boot, but otherwise it should be pretty quick.

  27. Roet-Ivar commented on Jan 15, 2025

    @Roet-Ivar

    @aduskett hi again. I just wanted to check something with you that I don't understand:
    genimage.cfg describing two partitions rootfsa rootfsb built on the same image with the same uuid, is this by design?
    image
    (This would explain why windows is confused by the partitions)

  28. aduskett commented on Jan 20, 2025

    @aduskett
    Collaborator

    @Roet-Ivar Hey! Sorry! I took a long weekend. The partition type UUID is from https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ which after looking at this further, should be b921b045-1df0-41c3-af44-4c6f280d3fae !

    The uuid itself is calculated from the rootfs.ext4 file found in the retroroot/output/raspberrypizero2w/images/ directory.
    The reason for two identical rootfs partitions is A/B updating with the mender program!

  29. Roet-Ivar commented on Feb 4, 2025

    @Roet-Ivar

    Hi! Do I understand you correctly that both rootfsa and rootfsb should be changed to use uuid
    b921b045-1df0-41c3-af44-4c6f280d3fae? I've testing out recalbox and batocera these last weeks, while they're nice it takes way too long to boot, 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions