Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Automatic RB build from SVN. Script in BASH
« previous next »
  • Print
Pages: [1]

Author Topic: Automatic RB build from SVN. Script in BASH  (Read 4150 times)

Offline siwy

  • Member
  • *
  • Posts: 6
Automatic RB build from SVN. Script in BASH
« on: February 12, 2008, 11:57:43 AM »
I have written a small script in BASH (requires sed but everyone has it) which builds rockbox automaticly from subversion.

Some instructions:
copy the text below (beginning from #!/bin/bash), paste it into notepad and (as root) save as /usr/bin/rb. make it executable by 'chmod +x /usr/bin/rb'

you also have to change some things. first of all edit MOUNT_DIR, SVN_DIR and BUILD_DIR. second of all run 'svn up rockbox' manually, look at the last line and notice how many non-numeric characters there are (counting from the end to the beginning) . eg. my last line looks like follows: "W wersji 16290." So there is only 1 non-numeric character from the end which is "." Understood? Now, you have to change value -6 in this line: "SVN=${SVN: -6: 5}" If you have 0 non-numeric charcter it has to be -5, if you have 1 (like me) it has to be -6,  if you have 2 it has to be -7 and so on. That's all. Enjoy.


It works only if you have all the development enviroment set. I mean you have RB source code, build folder and cross-compilers.

This code is published under wtfpl-2 license.

#!/bin/bash

#It works only if you have been set development enviroment up earlier

#Configuration of the enviroment
MOUNT_DIR="/media/IAUDIO"
SVN_DIR="/home/mati/rockbox"
BUILD_DIR="/home/mati/rockbox/build"

#Checks if there is any RockBox on the player
if [ ! -e $MOUNT_DIR/.rockbox/rockbox-info.txt ]
   then
      echo "Please mount your DAP on $MOUNT_DIR."
      exit 1
fi

#Checks version of RockBox in SVN
cd $SVN_DIR
SVN=$( svn up  | sed -n '$p' )
SVN=${SVN: -6: 5}   #These parameters depend on language of Subversion
                  #you are using

FILE=$( grep 'Version: r' $MOUNT_DIR/.rockbox/rockbox-info.txt )
FILE=${FILE: 10: 5}   #These parameters depend on language of Subversion
                     #you are using

if [ "$SVN" = "$FILE" ]
   then
      echo 'Your Rockbox is up-to-date.'
      exit 0
   else
      cd $BUILD_DIR
      echo -e "31\nN\n" | ../tools/configure #Set type of your DAP here
      make -j 3 #Set it properly to boost performance
      make tar
      tar xvf ./rockbox.tar -C $MOUNT_DIR
      echo -e "\nSuccessfully updated from $FILE to $SVN."
      exit 0
fi

echo 'Unknown error!'
exit 1
« Last Edit: March 14, 2008, 10:01:05 AM by siwy »
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Automatic RB build from SVN. Script in BASH
« Reply #1 on: February 12, 2008, 01:09:23 PM »
Thanks for making this - I'm sure a lot of novice builders will appreciate it.

However - it doesn't belong in the forums - please move it into the wiki where it will be findable forever :)
Logged

Read The Manual Please

Offline siwy

  • Member
  • *
  • Posts: 6
Re: Automatic RB build from SVN. Script in BASH
« Reply #2 on: February 12, 2008, 01:35:51 PM »
I'm glad to hear it. please report if it works or doesn't.
Logged

Offline NicolasP

  • Developer
  • Member
  • *
  • Posts: 195
Re: Automatic RB build from SVN. Script in BASH
« Reply #3 on: February 12, 2008, 06:18:52 PM »
Quite a nice script, yes. Maybe this could even go in the tools/ directory in SVN!
Logged

Offline siwy

  • Member
  • *
  • Posts: 6
Re: Automatic RB build from SVN. Script in BASH
« Reply #4 on: March 14, 2008, 10:05:00 AM »
UPDATE
finally the script above is correct and works properly, makes no problems and is more verbose.
You don't need to test it, just use it!
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4384
Re: Automatic RB build from SVN. Script in BASH
« Reply #5 on: March 20, 2008, 05:25:22 AM »
I think a sensible place would be in the SimpleGuideToCompiling wiki page in the "Compiling the Source Code" section.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Automatic RB build from SVN. Script in BASH
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.029 seconds with 18 queries.