The following is a template that can be used to quickly create apps for My Cloud OS5. It contains everything required to build a basic app, but work will be needed to create an app that’s fully functional.
Each app script file has a specific purpose, and all app script files must exist, even if they aren’t being used. The apkg.rc
file is used to configure the app during the installation process.
- The
"Package:"
section determines the app package name. It MUST match the app folder name, and it CANNOT contain any spaces. - The
"AddonShowName:"
section determines the app display name. It CAN differ from the app package name, and it CAN contain spaces.
The remaining sections are described in the My Cloud OS 5 NAS App Guide, which also includes the mksapkg
tool required to build app packages.
Required arguments will be automatically passed to scripts, where typical argument values and script execution order are shown in the examples below.
Configuration (apkg.rc):
Package: AppTemplate Version: 1.0.0 Packager: Cerberus Software Email: Homepage: Description: App template for development and testing. Icon: AppTemplate.png AddonShowName: App Template AddonIndexPage: index.php AddonUsedPort: InstDepend: InstConflict: StartDepend: StartConflict: CenterType: 1 UserControl: 0 MinFWVer: 5.27.157 MaxFWVer: IndividualFlag: 1 Hidden: off AddonDefaultPort: AddonDefaultGroup: AddonDefaultUser:
Arguments:
UPLOAD="/mnt/HD/HD_a2/Nas_Prog/_install"
INSTALL="/mnt/HD/HD_a2/Nas_Prog/AppTemplate"
Install App:
$UPLOAD/install.sh $UPLOAD $INSTALL
$INSTALL/init.sh $INSTALL
Remove App:
$INSTALL/stop.sh
$INSTALL/clean.sh
$INSTALL/remove.sh $INSTALL
Enable App:
$INSTALL/start.sh
Disable App:
$INSTALL/stop.sh
Reinstall App:
$INSTALL/stop.sh
$INSTALL/clean.sh
$INSTALL/preinst.sh $INSTALL
$INSTALL/remove.sh $INSTALL
$UPLOAD/install.sh $UPLOAD $INSTALL
$INSTALL/init.sh $INSTALL
Tool Usage:
# mksapkg-OS5 --help Usage: mksapkg-OS5 -E -s -m [model_name] Supported model_name: WDMyCloud WDMyCloudEX4100 WDMyCloudDL4100 WDMyCloudEX2100 WDMyCloudDL2100 WDMyCloudMirror MyCloudEX2Ultra MyCloudPR4100 MyCloudPR2100 WDCloud
Build App:
# cd AppTemplate; # ../mksapkg-OS5 -E -s -m MyCloudPR4100; ============================================ mksapkg-OS5 version: 2.0 ============================================ MinFWVer: [5.27.157] MaxFWVer: [] Hidden: [off] *** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. AppTemplate/ AppTemplate/stop.sh AppTemplate/apkg.rc AppTemplate/apkg.xml AppTemplate/clean.sh AppTemplate/init.sh AppTemplate/install.sh AppTemplate/preinst.sh AppTemplate/remove.sh AppTemplate/start.sh AppTemplate/include.sh AppTemplate/apkg.sign AppTemplate/web/ AppTemplate/web/desc.xml AppTemplate/web/index.php AppTemplate/web/AppTemplate.png AppTemplate/amd64/ AppTemplate/armhf/ ***[../MyCloudPR4100_AppTemplate_1.0.0.bin(11012023)] NAS type: MyCloudPR4100 module name: AppTemplate module versioin: 1.0.0 packager: Cerberus Software header length: 14485 header checksum: 9C27D845 Add-ons "../MyCloudPR4100_AppTemplate_1.0.0.bin(11012023)" create!