Creating an app bin

From WikiDLXTV
Revision as of 11:16, 9 June 2011 by RMerlin (Talk | contribs) (Rewritten, and updated for XML manifest)

Jump to: navigation, search


App.bin files are a way to install new applications under WDLXTV. They can be installed on any plugged USB drive, or on a remote network share through NETMOUNT (for advanced users only!). The easiest method to install them under WDLXTV 0.5.0 is to access the Addons Manager through the WDTV webend. Users of older WDLXTV versions have to manually download the app.bin file, copy it to their plugged USB disk, then reboot to enable it.

Structure of an app.bin

app.bin consists of a filesystem (either cramfs or ext3) located inside a file.

When creating a custom app.bin you should follow these guidelines:

  • binaries should be placed in bin/ or sbin/ and not in usr/bin and usr/sbin
  • libraries should be placed in lib/ and not in usr/lib
  • modules should be placed in lib/modules/
    • Since WDLXTV it is no longer required to supply a modules.dep file - WDLXTV will take care of calling depmod for you when the app.bin is loaded.
  • etc/init.d/ contains the init scripts that will be called when the system boots & reboots
    • init.d scripts are start'd when the system boots and when /sbin/resume is executed
    • init.d scripts are stop'd when /sbin/suspend is executed (/sbin/reboot executes /sbin/suspend)
    • init.d scripts should contain at the minimum start and stop cases
    • only SXX scripts are executed during rcS

Here is an example structure:


(See #XML Description file and #Other important files for an explanation of the application.xml, README and version files).

After is mounted by /bin/crazymount at /apps/test-app/ the following things happen:

  • /apps/test-app/bin and /apps/test-app/sbin are added to PATH
  • /apps/test-app/lib is added to
  • ldconfig is refreshed
  • /apps/test-app/lib/modules/ is scanned for modules and any found are symlinked into /lib/modules/
  • /apps/test-app/etc/init.d/S10test-app-init is symlinked into /tmp/init.d for execution by rcS/suspend/resume

Now /apps/test-app/usr/bin and /apps/test-app/usr/sbin both contain binaries...but those two locations are not scanned, therefore binaries in both locations will not be available without full path.

There are two kernel modules inside of, here is the contents of /apps/test-app/lib/modules/
/lib/modules/ /lib/modules/

This means that test-module.ko depends on test-dep.ko and therefore when test-module.ko is modprobe'd test-dep.ko will be inserted first by the system. Take note that the modules.dep file contains locations that are inside of /lib/modules/ and not /apps/test-app/lib/modules/

Creating an app.bin

Once you have your files organized and ready for bundling into an app.bin, you must decide whether your app.bin will require write access to it or not. Writable app.bin must be built using ext3, while read-only app.bins will use cramfs.

The following page has detailed information on how to build your app.bin files -

IMPORTANT: when using cramfs, you must use a 16K block size. Make sure your version of mkcramfs lets you specify a custom block size (some newer versions of it do), or that you are using a patched version of mkcramfs such as the one included in the WDLXTV's

Loading and unloading app.bin

Starting with WDLXTV 0.5.0, you can interact with an app.bin by using the /usr/bin/app-plugman-web shell command. This command lets you load or unload an app.bin without having to reboot (NOTE: you do have to start a new shell session if your app.bin is modifying the system PATH, or else your existing session won't use any PATH changes done by the app.bin). This is handy for developers to try out a new build without having to reboot the WDTV.

  usage: app-plugman-web list|listenabled|listdisabled
         app-plugman-web repolist [<repo>]
         app-plugman-web repoinfo <app.bin> [<repo>]
         app-plugman-web download <app.bin> <path> [<repo>]
         app-plugman-web enable|disable </full/path/>
         app-plugman-web load|unload </full/path/>

load and unload will allow you to dynamically load or unload your app.bin while testing it.

XML Description file

To describe your app.bin, you must include an XML description file, named application.xml. This file must be located at the root of your app.bin, and will be used by the Addons Manager and the online web repositories. Here is an example, as well as an explanation of the various entries:

<?xml version="1.0"?>
        <desc>EncFS is a Free (GPL) FUSE-based cryptographic filesystem that transparently 
              encrypts files, using an arbitrary directory as storage for the encrypted files.</desc>

The name of your application.
A description of what your application does, no more than a few sentences.
The app.bin's author name(s)
Release date, using the YYYY-MM-DD format.
App.bin version. This will be used when determining if an update is available.
The size of your app.bin (in bytes), if you need to enforce a minimum app.bin size - only needed for the ext3 format.
Which filesystem is used inside your app.bin file. Valid values are: cram (which will be read-only) and ext3 (which will be writable). This is used on the web repository to automatically generate an app.bin file out of SVN. cramfs is the default.
An URL pointing to a support website or forum post. Special chars must be replaced with HTML entities, i.e. & becomes &amp;.

The provides block contains a few entries pertaining to what your app.bin provides. These values must be set as "true" or "false".

Whether your app.bin provides any binary file
Does it provide a daemon that runs in background
Does it provide any new kernel module
Does it provide a new icon on the webend or similar web interface

The dependencies block lists various requirements for your app.bin.

Which WDTV devices are supported. Add one new <model></model> block per device. Valid values are: LIVE, PLUS, G2.
Set min to the lowest supported BaseFW (if in doubt, use 1.01.00). max can be left blank if there is no known max supported version.
Set min to lowest supported WDLXTV version. max can be left blank if there is no known max supported version.
Is WDTVExt required?
Is network access required?
Required config setting(s) (eg. APACHE=ON)
Required other app.bin(s)
The ID by which your application will be identified, with no spaces. Usually use the app's name.
The filename of your app.bin

Other important files

While not mandatory, it is strongly recommended that you also include the following files at the root of your app.bin:

Description, basic documentation, changelog, etc... This can be viewed by the end user through the Addons Manager.
File only containing the numerical version (for example "1.0.5")