---+!! The Simple Guide To Compiling In Linux %TOC% --- ---++ Notice! *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.* --- ---++ Introduction 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. It's written 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. A few remarks on notations: items in _italics_ should be replaced with an appropriate entry. For example, _username_ means to put your User Name there; most people make it their first name, without any capitalization. (Occasionally, _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 may also be used to highlight the exact name of something, such as a menu. A tip: 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. ---++ Getting Ready 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 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 ~*. Once you've confirmed you have room, open a terminal window. In newer versions of Ubuntu, with Unity, search for the application "Terminal" and open it. You'll be presented with a simple prompt, reading something like "user@ubuntudesktop". One more check. Type *pwd* and press Enter. It should say */home/username* on the next line. If it doesn't, type *cd* and press Enter. ---++ Getting Started 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. After that, we need to install a few more things. Type *sudo apt-get install automake bison build-essential ccache flex libc6-dev libgmp3-dev libmpfr-dev libsdl1.2-dev libtool texinfo* 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. Most users will want ARM and only need to compile *a*. If you are unsure, type *s m a i r* to compile all archs. 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. ---++ Compiling 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* - 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. 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 <strong>make </strong>(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! ---++ Troubleshooting If you receive the error: * "ROCKBOXDEV: libtool is required for this script to work." * "ROCKBOXDEV: Please install libtool and re-run the script." Do: *sudo ln -s /usr/bin/libtoolize /usr/bin/libtool* ---++ More information/ Going Further 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). Happy hacking!
ore topic actions
r29 - 06 Oct 2015 - 13:23:51 -
Copyright © by the contributing authors.