DBPUtils Script

Discussion in 'Pyra OS (Debian GNU/Linux)' started by Wally, Nov 6, 2015.

  1. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    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
     

    Attached Files:

    Last edited: May 17, 2016
    Tags:
    _jr_, klapse and bzar like this.
  2. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,199
    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.
     
    Wally likes this.
  3. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    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.
     
  4. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    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: Nov 6, 2015
  5. TrashyMG

    TrashyMG Sarcasm Dispenser Staff Member

    Joined:
    Jan 18, 2010
    Messages:
    10,550
    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.
     
    Wally, Neelix and levi like this.
  6. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    Yeah I was planning to do error handling :p
     
  7. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    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: Nov 7, 2015
    levi likes this.
  8. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    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.
     
  9. Hồng Thất Công

    Hồng Thất Công Đả Cẩu Bổng Pháp

    Joined:
    Dec 19, 2012
    Messages:
    4,380
    Location:
    Cái Bang
    So you mean this tool can make all PNDs on the a Pandora work on the PYRA automatically?
     
  10. TrashyMG

    TrashyMG Sarcasm Dispenser Staff Member

    Joined:
    Jan 18, 2010
    Messages:
    10,550
    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: Nov 26, 2015
    Wally likes this.
  11. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    If only you read the rest of the posts :p
     
  12. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    After discussing with other developers. I have decided to take a different approach to this and won't be releasing PND2DBP.
     
  13. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,210
    Location:
    Somewhere off the coast of the EU
    Okay, cool - but DBP utils will still be a thing, right?
     
  14. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    Yes of course :)
     
  15. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    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.
     
  16. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,199
    You test it on a PC ?
     
  17. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,210
    Location:
    Somewhere off the coast of the EU
    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.
     
    Wally likes this.
  18. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,948
    Location:
    Melbourne, Australia
    Yes, works fine in OSX and Linux.. Also works on the devboard if you install libz and squashfs ;)

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

Share This Page

Loading...