PackageManager

The PackageManager provides an easy way to install additional applications using the web interface. The “Packages” are NOT real Linux packages (like .deb, .rpm, etc.). These packages are simple .zip files to provide an easy-to-use interface (for developers).

By this everyone is capable to create “Packages” without the in-deep knowledge of powerful formats like ”.deb”.

Packages

Packages are ZIP archives, which contain bash scripts named install.sh on the top level. Everything else is free to the packager.

The bash script will be executed, when the NAS downloads and extracts the package. This script have to copy all files of the package to their designated locations. The script can do anything, including apt-get. (the PackageManager will do any preconfiguration to use apt-get)

The bash script can use the following two functions to manipulate the progress bar in the browser:

pm_util_status_progress(percentage: Integer, message: String): void

The first parameters sets the percentage [0-99], the second parameter displays a message.
pm_util_status_fail(reason: String): void

Exits the script and aborts the installation with the specified reason. Use this to exit the installation.

Example

install.sh
#!/bin/bash
 
pm_util_status_progress 25 "Starting"
sleep 3
pm_util_status_progress 50 "Alright alright"
sleep 5
pm_util_status_progress 90 "Nearly finished"
sleep 2
pm_util_status_fail "Abort"

First, the percentage will be set to 25% and a message “Starting” will be displayed. After that the script sleeps for 3 seconds, sets the percentage again and so on. Finally the installation will be aborted with the message “Abort”.

If you abort the installation, you have to delete already installed parts of the application by yourself!

The install.sh and additional files will be compressed to a Dummy.zip with the following directory structure:

Dummy.zip

| install.sh
| etc/
| etc/init.d/
| etc/init.d/yourservice.d/
| etc/init.d/yourservice.d/Dummy
| usr/
| usr/sbin/
| usr/sbin/Dummy

Repositories

Any webserver can distribute Packages. Just upload the zip files together with a repo.txt. The repo.txt has to use the following format to describe all available Packages:

<package name>###<description>###<version>###<date>###<MD5 checksum of .zip>###<filename of the .zip archive>

Example for the Dummy.zip:

Dummy###Dummy package which does nothing###1.2.3###27.06.2010###302b215a2cc98dac208271d2e567ab7d###Dummy.zip

Afterwards the URL of the directory of the repository can be added to the PackageManager.

You could leave a comment if you were logged in.