Wiki > Main > LinuxSimpleGuideToCompiling (compare)
Difference: LinuxSimpleGuideToCompiling (r24 vs. r23)
This guide was written with Ubuntu users in mind, and can be performed as written in most versions of Ubuntu and 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 We have done our best to write instructions with the assumption that the user has virtually NO familiarity with Linux at all; 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 A few remarks on notations: items is in italics, replace it should be replaced with something appropriate. an appropriate entry. For example, usernamemeans to put your User Name there; most people make it their first name, without any capitalization. (Note: (Occasionally, 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 exactly as shown, punctuation and all. It may also means that this is be used to highlight the exact name of something, such as a menu.
One more A tip: 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 and make sure no files are selected, then read the bottom of the window: "Free space: [some number]". You might also open a terminal and type "df -h". 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, Once so you've got some space. Let's confirmed you have room, open a terminal window: At the top window. In newer versions of Ubuntu, with Unity, search for the screen, click on Applications. Mouse over Accessories, then click on Terminal. A window (mostly white) will application "Terminal" and open it. You'll be presented with a simple prompt, reading something like "user@ubuntudesktop". 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 git package, so that you can easily download the rockbox source from the git repository: sudo apt-get install git
Now type (or copy) this into the terminal and press Enter: git clone git://git.rockbox.org/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 ALLthe 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 source tree every once in a while. Just open a terminal and type cd rockbox, then git pull --rebase. 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).
r28 - 28 Sep 2014 - 19:08:07 - MichaelCarrRevision r24 - 18 May 2012 - 19:48 - MichaelCarr
Revision r23 - 24 Jan 2012 - 12:32 - MarcinBukat
Copyright © by the contributing authors.