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.

20 comments

  1. git clone git://github.com/RetroPie-Setup
    =fatal: remote error:
    Repository not found.

    fatal: remote error:
    Repository not found.

  2. 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.

    • 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.

  3. @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. Does this mean using a SNES controller with your GPIO adapter no longer works 'out of the box' with this script? or am i missing the point..?

    • 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?

      • 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

      • 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?

      • You need to swap data1 and data2 in https://github.com/petrockblog/SNESDev-RPi/blob/master/src/main.c#L321 and then re-compile SNESDev and then copy the new binary to /usr/local/bin via cp "$rootdir/supplementary/SNESDev-Rpi/bin/SNESDev" /usr/local/bin/.

      • 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.

      • 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.

      • 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.

      • Sounds good to me!

        I would just use jstest (and not ES) to test the joystick inputs.

      • 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 :(

      • Glad to hear that it is finally working for you :-)

  5. How important are steps 21 to 24? It seems to be running just fine without them. If I skip them, will I run into any problems?

    • 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.

  6. 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 :)

Leave a Reply

%d bloggers like this: