Wiki > Main > LinuxSimpleGuideToCompiling (compare)
Difference: LinuxSimpleGuideToCompiling (r22 vs. r21)
This guide was written with Ubuntu users in mind, and can be performed as written in most versions of Ubuntu 8.04, 9.04, 10.04, 10,10, 11.04 and 11.10. Debian. Users of other Linux distributions may have to modify these instructions or perform additional steps in order to successfully compile Rockbox.
This guide was written for new users. Its purpose is to guide users through the steps to acquire a copy of the source code and build their own copy of Rockbox. I will do my best to write instructions with the assumption that the user has virtually NO familiarity with Linux at all; but that they DO have a few basic computer skills in place. Also, the only distribution of Linux the author has used is Ubuntu - specifically, versions 7.04 and 7.10. Users of Debian-based distributions should be able to follow these instructions almost exactly; and users of other distros shouldn't have any problems either, so long as they know how to open a terminal window.
Oh, by the way, if something is in italics, replace it with something appropriate. For example, username means to put your User Name there; most people make it their first name, without any capitalization. (Note: sometimes username might not be in italics, but it should still be replaced.) If something is bold, it usually means you should type it in EXACTLY as shown, punctuation and all. It also means that this is the exact name of something, such as a menu.
One more thing: If you highlight something in a window, then switch to the terminal window, clicking the mouse wheel will copy what you highlighted and put it on the terminal. This will make it easy to make sure you enter the right commands.
First things first: make sure that you have at least a free gigabyte or so of space on your hard drive (or Linux partition, if you partitioned your hard drive). In Ubuntu, this is easy to check: open any file browser window (like your Home folder: click on Places at the top, then click Home Folder) and make sure no files are selected, then read the bottom of the window: "Free space: [some number]".
Okay, so you've got some space. Let's open a terminal window: At the top of the screen, click on Applications. Mouse over Accessories, then click on Terminal. A window (mostly white) will pop up. It should say username_@_computername; for example, mine says michael@CarrDesktop.
Let's check something. Type pwd and press Enter. It should say /home/username on the next line. If it doesn't, type cd and press Enter.
Okay, now the fun begins.
Get the subversion package, so that you can easily download the rockbox source from the svn repository: sudo apt-get install subversion
Now type (or copy) this into the terminal and press Enter: svn co svn://svn.rockbox.org/rockbox/trunk rockbox
Wait a while. This command will download the entire Rockbox source code, which can take a long time depending on the speed of your Internet connection. There's about 50 MB to download, so over a slower connection figure on it taking up to an hour. On faster connections it should only take a few minutes.
Okay, so it's done downloading. We need to make a few more preparations now. Type sudo apt-get install build-essential libc6-dev texinfo libgmp3-dev libmpfr-dev and wait for a few more things to be downloaded.
Now, type cd rockbox/tools. Type chmod +x rockboxdev.sh, then type sudo ./rockboxdev.sh. You will be asked to choose the platform you want to compile for. If you are unsure, type s m a e i. This will prepare your computer to be able to build for all Rockbox targets. However, this will take much longer to prepare than a single platform, so if you know your target, just type the corresponding letter and continue.
Type cd ~/rockbox. The last line in your terminal should read username@computername:~/rockbox$ . Type mkdir build (mkdir means "make directory"), then type cd build . Your current line should say username@computername:~/rockbox/build$ Now type ../tools/configure - and make sure you include those two periods.
A table of ALL the devices Rockbox supports will come up, and each device will have a number beside it. Simply type the number for the device you want to make a build for. I use a Sansa c200, so I would type 52.
Next, you'll see a few choices for the type of build you'd like to make. Let's make a normal build: type n. Wait for a few seconds. When it says "Created makefile", type make (or make -j for a multicore system) and wait. Type make zip to prepare a rockbox.zip and wait a little more. That's your build, ready to install onto a real device. Use it like you would for a manual update (that is, unzip its contents into the root of your device, overwriting old files if necessary). When it's done, congratulations! You've compiled your own copy of Rockbox, and made a .zip file like the one you download from the website!
When you're ready to take these skills further and apply patches, take a look at http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling#Adding_Patches . Just be careful about which ones you add. Many patches break things.
You can consider compiling a simulator, too. Read more here: http://www.rockbox.org/twiki/bin/view/Main/UiSimulator
If you want, you can read the tutorial at http://www.linuxcommand.org/index.php and learn how to use the command line to the fullest.
One last thing: It's a good idea to update your copy of the subversion every once in a while. Just open a terminal and type cd rockbox, then svn update. Your copy of the sources will be updated (and if you've applied patches, the program will try to keep them in, so you won't have to repatch).
r29 - 06 Oct 2015 - 13:23:51 - HaydenPearceRevision r22 - 28 Nov 2011 - 23:47 - MichaelCarr
Revision r21 - 30 Jul 2011 - 14:47 - HaydenPearce
Copyright © by the contributing authors.