Creating the RetroPie SD-card Image: A Recipe

RetroPie SD-card Image: A Recipe

An SD-card image of a RetroPie installation was recently made available. This post describes the individual steps taken in order to create such an image. While it serves me to ensure that no steps are forgotten during future updates, this post provides also an insight into the individual steps for people with interest in this topic.

As always, you are invited to make suggestions or comments to further improve the RetroPie Image! Especially the set of packages to be removed can still be optimized I think.

And here it is, the step-by-step recipe for creating the RetroPie Image:

  1. Download and copy the Raspbian image on SD card
  2. The raspi-config script automatically starts on first boot. From here, expand the root file system
  3. Then reboot
  4. Login as user “pi” and run
    sudo apt-get update
    sudo apt-get install -y git dialog
  5. Fetch the latest version of the RetroPie Setup Script with
    cd
    git clone git://github.com/petrockblog/RetroPie-Setup
  6. Start the RetroPie Script
    cd RetroPie-Setup
    sudo ./retropie_setup.sh
  7. Select “binaries-based installation” in RetroPie Script and press ENTER
  8. Check message dialogs at the end of binaries-based installation.
  9. Select “Setup” in RetroPie Script and press ENTER
  10. Set EmulationStation to start on boot.
  11. Set SNESDev to start on boot and to poll the button and game pads. (There are reports that game pad configurations override keyboard settings, so that the settings for game pads are not set as default anymore. If you want to use a joystick or game pad, you have to manually configure it.)
  12. Enable splashscreen on boot.
  13. Install and configure SAMBA.
  14. Install USB-ROM-Copy service.
  15. Install GPIO gamepad drivers (added 04.05.2013)
  16. Exit the RetroPie Setup Script and run
    sudo raspi-config
  17. Set overclock to preset ‘Medium’The following steps are only needed, if you want to create an SD card image yourself. I post them here to make the generation of the RetroPie image more transparent:
  18. Reboot
  19. Configure EmulationStation game pad input
  20. Testing of all emulators with at least one ROM
  21. Exit Emulation Station
  22. Remove unnecessary packages via
    cd
    chmod +x ./RetroPie-Setup/tools/prepareSDCardimage.sh
    sudo ./RetroPie-Setup/tools/prepareSDCardimage.sh
  23. Please note that the dd command, which is also used in the following, is a very powerful command that is able to break your system! If you are unsure about it, you can have a look at this article, that explains its use for RPi SD card handling. But now the explanation of the next step:
    Shutdown the RPi, use another computer to create an SD-card image, e.g., with

    dd if=/dev/disk3 bs=2m of=RetroPieImage_verX.img
  24. Compress the image into ZIP format with
    zip -9 RetroPieImage_verX.zip RetroPieImage_verX.img
  25. Create SHA1 checksum with
    shasum RetroPieImage_verX.zip
  26. (Upload the image.)

And that’s it.

22 thoughts on “Creating the RetroPie SD-card Image: A Recipe

  1. Alex says:

    I am a beginner when it comes to this stuff, but I am trying to create a copy of a retropie image that I already setup and has roms uploaded. Is that possible with these steps or is there some way that it can be done?

    Thank you

  2. mattgrimley says:

    Hey, first off – thanks for the awesome resource :)
    I had mixed results building on top of Raspbian with the scripts (but not enough knowledge to understand if user error or reportable issues) – however.. The downloaded image worked perfectly.

    I was trying to get it to work in Berryboot (which requires a squashfs image), but i running into issues booting it up.. I was wondering if anyone else had specifically converted and used the image file with Berryboot?

    Cheers :)

    • petRockBlog says:

      Steps 21 to 24 really are only necessary, if you want to create an CD card image file. If you just want a “recipe” for getting a standard RetroPie installation, you can skip these steps.

    • petRockBlog says:

      If you are using the GPIO adapter you just need to go into the “setup” menu of the RetroPie Script and enable SNESDev to poll the pads and the button, nothing more. I hope that this is a good compromise for those that are not using a game pad and for those using a game pad. What is your opinion?

      • Michael Forcer says:

        I agree it’s a good compromise. I’ve installed SNESDev-RPi manually following instructions on the github page.. i went into retup on the retropie script chose the option you said, restarted the Pi but still not working for some reason… any ideas on this one? ps, the button on the GPIO adapter is working

      • Michael Forcer says:

        I’ve figured it out. i ran jstest ../js0 and got nothing, then ran jstest ../js01 and it worked.. so it looks like controller 1 is set as controller 2. i’ll try and change this manually in the retroarch config file.

        potential bug in snesdev?

      • Michael Forcer says:

        Is it only those lines that need changing? eg:

        if (get_rpi_revision()==1){
        pads.clock = RPI_GPIO_P1_19;
        pads.strobe = RPI_GPIO_P1_23;
        pads.data2 = RPI_GPIO_P1_05;
        pads.data1 = RPI_GPIO_P1_07;
        } else {
        pads.clock = RPI_V2_GPIO_P1_19;
        pads.strobe = RPI_V2_GPIO_P1_23;
        pads.data1 = RPI_V2_GPIO_P1_05;
        pads.data2 = RPI_V2_GPIO_P1_07;
        }

        cant seem to get it working.

      • petRockBlog says:

        You might need to stop the SNESDev service with “sudo service SNESDev stop”. Otherwise the “cp …” Command might not be able to overwrite the old SNESDev binary.

      • Michael Forcer says:

        I think i tried that but will try it again tomorrow. the full steps i taken were:

        – git cloned SNESDev-RPi, edited /src/main.c
        – changed these 2 around like so:
        pads.data2 = RPI_GPIO_P1_05;

        pads.data1 = RPI_GPIO_P1_07;

        – went into RetroPie-Setup and disabled ‘load SNESDev on boot’

        – stopped the service

        – make clean

        – make

        – cp /bin/SNESDev /usr/local/bin/

        – start the service

        – back into RetroPie-Setup, poll pads and button

        – restarted Pi for good measure

        Does this sound correct? I will go over it again tomorrow.

      • Michael Forcer says:

        hasn’t worked :( .. i done the steps above and i don’t get a response from /js0 or /js1 when using jstest … if i compile it without making that change then it works fine on js1… is those 2 lines definitely the only change:

        pads.data2 = RPI_GPIO_P1_05;

        pads.data1 = RPI_GPIO_P1_07;

        same issue here: https://github.com/petrockblog/SNESDev-RPi/issues/11 problem for me is i don’t have a second controller :(

  3. Rowan de Graaf says:

    @petrockblog:disqus Not to be a precise arse about it,

    But maybe you could tell people how to determine what device to use the DD if of on ^^

    We both know people are cloning their usb drive or their porn folder right now. ;p

  4. Keschy says:

    Hi,

    I’d like to translate your ‘recipe’ in German und publish it on my website. Would that be okay with you?

    And of course i would set a link to your post.

    • petRockBlog says:

      Hi Keschy,
      thanks for asking!
      Von mir aus kannst Du gerne den Artikel ins Deutsche übersetzen :-)
      Please provide a link to the original post here and state that it is a translation of the post here.

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.