DBPUtils Script


Wally

I am a banana!
Joined
Jan 31, 2006
Messages
3,220
Age
37
Location
Melbourne, Australia
Hey,

I've been fine tuning a suite of stuff to assist with packing, unpacking and even options to batch unpack DBPs in preparation for the Pyra given that I've repetitively done this task over and over then slaeshjag makes a major change and I have deleted all the source files RIP me.

Software requirements for package: any *nix based install with squashfs-tools installed.


Install Instructions:

Place into executable location.

Commands:

dbputils:

--unpack DBPNAME.dbp (Unpacks a DBP into the same directory)

--batch-unpack unpacks all DBPS in the current directory

--pack Packs a DBP up

This requires folders called dbpdata / meta / icons to be placed into a folder and the command to be executed from the root folder, a scripts folder can also be created for launch scripts / config files and this will also read from that

--batch-pack
Implemented as of 0.5, you can now batch pack DBPS as long as they are in the same directory

--pnd-unpack

Added support for Squashfs based PND unpacking. Legacy ISO support won't be added for now as it requires other tools.

--dbp-generate

Implemented basic Folder requirements for a DBP with a blank default.desktop.
Future build may contain a blank default.desktop example


Possible GUI (Not really familiar with GUIS yet)

Pandora ISO Support

Support generation of default.desktop and additional desktop files.


Feel free to place any suggestions for addition later.

Version History:
0.1 - Begun by adding pack, unpack, batch unpack and configuring core functions

0.2 - Added PND unpack and fixed batch-unpack execution path

0.3 Removed scripts folder in DBP-Pack, fixed PND extract and gave it it's own function, renamed all game data stuff to dbpdata, commented on functions.

0.4 Fixed chmod cmd to check only for folder (whoops!), cleaned up code for readability, added $HOME/DBP Folder creation and check for existing DBP (Program will exit for now), added error checking and tested logic( Please let me know if it fails). Fixed consistency using http://www.shellcheck.net (Isn't that wonderful?)

0.5 Added support for batch packing, DBP template generation and tidied up script

0.1 View attachment dbputils

0.2 View attachment dbputils

0.3 View attachment dbputils

0.4 View attachment dbputils

0.5 DBPUtils.txt
 

Attachments

  • dbputils.txt
    4.9 KB · Views: 647
Last edited:
Maybe an option dedicated to run on Pyra/OMAP5, which (packs and) runs the app through the dbp system.

Useful when building/debugging an app on the device, avoiding the need of manually package, then manually run it.
 
There's still some manual involvement in building a package but I guess some of it could be automated somewhat. I'll consider it for later, it'd be similar to sebt3's thingy though.
 
Updated to include PND unpack and fix logic for batch-unpack

Not really sure on how I can get PXML / Icons if people haven't included them inside the PND/ Not going to support the legacy ISO system just yet. It's on my TODO list for later as it requires other software.
 
Last edited by a moderator:
You need to put in some contingencies if someone enters a flag, but omits the the rest, I notice that the script continues on when I use the pack option but forgot the rest. Ex: dbputils --pack 
Error handling is important when dealing with a script that moves and deletes things.
 
0.4 is out:

Notes: 

Fixed chmod script to only apply permissions to dbpdata folder

Added error checking

Added check for mksquashfs

Added usage instructions per tool

Cleaned up code so it's readable.

Fixed up consistency with this amazing tool (http://www.shellcheck.net)

Added check for existing dbp.


Download from original post

EDIT: Fixed, updated.
 
Last edited by a moderator:
Had a bit of a hiatus from this as things got pretty busy everywhere!


I started looking at how I can go about doing PND2DBP to make things easier for people and I have a semi-working solution at the moment.


Basically I extract the PND into a DBP structure, putting icons into correct location


Grab the PXML File (thanks to zLoud for the script) from the pnd itself rather than use the one inside (as I can then move it into a location I want and name it what I want)


Look inside the PXML and try and match up stuff to put into a "default.desktop" file which is partially successful at the moment. I am seeing double entries for things but I have a solution which i can work with and implement this further later.


Pretty much all the person has to do manually is do consistency checks (Version info mainly), make their game scripts unique, configure additional desktop files (which is also scripted in now if you wish to do it that way), ensure the icons are correct and update the binary then run the dbputils --pack command


I'll look at releasing it when it feels stable enough.
 
So you mean this tool can make all PNDs on the a Pandora work on the PYRA automatically?

I doubt it; softfloat vs hardfloat and other library dependencies will hinder functionality. I guess It could make some of the packaging steps easier for people that made PNDs...
 
Last edited by a moderator:
After discussing with other developers. I have decided to take a different approach to this and won't be releasing PND2DBP.
 
Updated DBP Utils :)

0.5
[+] Added support for batch packing of DBPS (useful if you have many DBPS in one directory that you want to pack all at once.
[+] Recognise OSX as an OS and tidy up ._ files using built in utility, dot_clean
[+] Add support for generating basic DBP Folder structure

[-] Removed PND2DBP .. for now

[~] Tidy up script so it looks nicer.
[~] Fix a little bit of logic for some of the scripts.
 
Sweet. I notice it's not very explanatory in how to be used, and if you use e.g. dbputils --dbp-templates it tells you rather unhelpfully ' Folder already exists'. Might be friendlier if you checked if $2 was set and tell the user to add a folder argument if not.
 
You test it on a PC ?
Yes, works fine in OSX and Linux.. Also works on the devboard if you install libz and squashfs ;)

Sweet. I notice it's not very explanatory in how to be used, and if you use e.g. dbputils --dbp-templates it tells you rather unhelpfully ' Folder already exists'. Might be friendlier if you checked if $2 was set and tell the user to add a folder argument if not.

Good idea, that was sorta rushed out and it's not very complete :)
 
Back
Top