Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: Horscht on March 13, 2009, 07:55:14 PM

Title: Usage of the database tool
Post by: Horscht on March 13, 2009, 07:55:14 PM
Hi

I just set up a build environment for Rockbox on my virtual ubuntu machine.

I was also successfully build the database tool (located in tools/database), which sopsedly allows me to create the database for my ipod on my PC. But there are 2 quirks I am having with it:

1. I have no clue how to use it. "make" created a linux binaray called database. It doesn't have a help swtich or any usage instructions. I don't know how to use it.

2. My primary OS is Windows XP Pro SP3. I'd like to be able to have the tool for windows. How would I be able to build an exe for Win?

thanks in advance

Horscht
Title: Re: Usage of the database tool
Post by: saratoga on March 13, 2009, 07:58:02 PM
Take a look at the code and see what it does?
Title: Re: Usage of the database tool
Post by: bluebrother on March 14, 2009, 03:33:11 AM
2. My primary OS is Windows XP Pro SP3. I'd like to be able to have the tool for windows. How would I be able to build an exe for Win?
There are two options:
1. use a cross compiler
2. build on windows

I guess building with MinGW should work though I haven't tested.
Title: Re: Usage of the database tool
Post by: Horscht on March 14, 2009, 03:35:56 PM
obviously, I fail to do either of those. Cygwin gave only errors, and I don't have a clue how I would compile the tool using minigw in ubuntu (I already installed minigw, but I don't know how to get "make" to use it)
Title: Re: Usage of the database tool
Post by: konkon on March 18, 2009, 06:52:53 AM
The tools/database can not build using by Cygwin, MinGW.
Therefore, it cannot execute on Windows.

If the database tool build (or execute) on Windows, you must use FS#9371.
Title: Re: Usage of the database tool
Post by: Horscht on March 20, 2009, 09:00:56 PM
what would I need to build "on windows" if cygwin doesn't work?
do I simply select the c file in some IDE and compile it?
Title: Re: Usage of the database tool
Post by: konkon on March 22, 2009, 01:15:40 AM
In the execution of the binary file, Cygwin is unnecessary.
(Cygwin is necessary only for building the database tool.)

 
Title: Re: Usage of the database tool
Post by: Horscht on March 22, 2009, 08:20:38 AM
thank you, konkon

I was sucessfully able to build this on Windows using mingw/msys.

I lready was able to create a database, the tool seems to work nicely. I like it, thank you!
Title: Re: Usage of the database tool
Post by: dip on March 22, 2009, 06:59:05 PM
Horscht, could you please be so kind to post a copy of the windows binary of the database tool and a short description how to use it. That would be great!
Title: Re: Usage of the database tool
Post by: Horscht on March 23, 2009, 12:37:37 AM
download (http://horscht.googlepages.com/songdb.zip)

usage instructions can be viewed launching this tool in commandline without any arguments.
Title: Re: Usage of the database tool
Post by: dip on March 23, 2009, 03:56:32 AM
Thanks a lot, I will try it.

Is there a more comprehensive documenentation explaining the command line parameters? I don't understand the meaning of the "commit" and the "append" parameter (compared to update).

And if you have specified the Rockbox root-path do you additionally have to specify the rockbox-directory and the song-directory parameter?
Title: Re: Usage of the database tool
Post by: konkon on March 23, 2009, 05:01:50 AM
>Is there a more comprehensive documenentation explaining the command line parameters?
>I don't understand the meaning of the "commit" and the "append" parameter (compared to update).

About -m(--mode):

create: Build database newly.

update: The file not registered in the database is added to the database. And the deleted file is deleted from the database.
 
commit: The database_tmp.tcd file is changed into database_0.tcd, ..., database_8.tcd, and database_idx.tcd files.

append: The file not registered in the database is added to the database.  But the deleted file is not deleted from the database.


>And if you have specified the Rockbox root-path do you additionally have to specify the rockbox-directory and the song-directory parameter?

e.g.
the player connects H:\\
Rockbox firmware storage directory: H:\\.rockbox
music storage directory H:\\music

Then
songdb -r H: -d .rockbox -s /music -m create


Please look at readme.txt about other options.
Title: Re: Usage of the database tool
Post by: Horscht on March 23, 2009, 03:22:30 PM
right, I should have included your readme in the first place, that was rude, sorry.

I'll update the file to include it.

EDIT: songdb.zip now also includes the readme, for completeness sake (also credits)