Page 1 of 1

TOS 6 Native Application Development Guide

Posted: 29 Jul 2024, 12:57
by TMroy
Dear Developers,

We are excited to announce the release of TOS 6, designed to provide an enhanced user experience. In this new version, we have adopted a root filesystem fully compatible with Ubuntu 22.04 and introduced the systemd method for starting the system, launching applications, and hosting application programs. Consequently, adjustments are required for the startup method of native applications running on TOS 6. Please refer to the following guidelines to pack your native applications accordingly.

The following is the first TOS 6 application development guide released by TerraMaster to the public. There may be some deficiencies in the first version of the development guide. If you encounter problems during use, please contact our tech team and provide us with methods to reproduce the issues, code samples, and screenshots, so that we can analyze and fix them. We will continue to optimize and update the development tools, please pay attention to our updates.

https://github.com/TerraMasterOfficial/ ... -pkg-tools

Technical team contact email
[email protected]

Re: TOS 6 Native Application Development Guide

Posted: 25 Aug 2024, 17:29
by tanktarta
Hi,

I'm trying to make my first TOS app (for TOS 6 latest beta). The makeapp_x64 command completed successfully, but I cannot seem to install the package onto my NAS.

Every attempt results in .."Error! This file is incorrect and cannot be installed".

Are there any logs created anywhere on the NAS, or is there an alternative way to install such as a shell command that is a bit more helpful as to what has actually gone wrong?
Image

Re: TOS 6 Native Application Development Guide

Posted: 25 Aug 2024, 21:49
by ColaChen
tanktarta wrote: ↑25 Aug 2024, 17:29
If conditions permit, would it be convenient to connect an HDMI monitor to feedback relevant error messages and their locations? Your help would be greatly appreciated.

Re: TOS 6 Native Application Development Guide

Posted: 26 Aug 2024, 00:06
by tanktarta
I have done as instructed, but nothing at all happened during the installation process. The file uploads to 100%, but very shortly after the same error appears in the browse, but there is no output on the console.

See attached photo. Everything you see there was present before the installation attempt.

Image

Re: TOS 6 Native Application Development Guide

Posted: 26 Aug 2024, 18:12
by tanktarta
I found the problem, it was the structure of my source package, and me making assumptions about how the build tool would work.

At some point, i'd rearranged my project so that I could build it with a script to make future updates easier, and to deal with multiple versions and architecture. While doing so, I had changed the layout of my project a little.

I was trying something like this ..

Code: Select all

pkg 
   v5
      x86_64
           <package contents>
      arm64
           <package contents>
   v6
      x86_64
           <package contents>
      arm64
           <package contents>
Then for example i would do ..

Code: Select all

./makeapp_x64 -path /path/to/pkg/v6/x86_64
However it seems that makeapp does not like this, although it does not produce any errors or output to suggest this is wrong. If I change the layout to be exactly as described in the documents

Code: Select all

x64_tos6_apps
     myappid
         <package contents>
and then use ...

Code: Select all

./makeapp_x64 -path x64_tos6_apps/myappid
This package uploads and installs just fine. So it looks like it matters what the directory name is, and this is used internally somehow for something that makes the package correct.

So while it's my own fault for not following instructions to the letter, could I make the following suggestions.

1. Show better errors when uploading bad packages.
2. Make it clear that directory name matters as much as the contents.
3. Consider removing this restriction. That same ID is contained in the config.ini file as well, so why must the directory have the same name.
4. If this requirement must stay, then have makeapp check this and display an error instead of just making the package.

Thanks :)

Re: TOS 6 Native Application Development Guide

Posted: 28 Aug 2024, 16:26
by tanktarta
Another question ..

What is the replacement in TOS 6 for the "reset" and "ports" functionality of the service script in TOS 5?

In TOS 5, the development manual mentions this ..

Code: Select all

#If the reset value in config.ini is true, please add this method:
service_reset() {

}

#If the app occupies the system port, please add this method:
service_getport() {

}
But with TOS 6 using systemd there is no service script.

Re: TOS 6 Native Application Development Guide

Posted: 04 Oct 2024, 22:52
by MikeTaku
TMroy wrote: ↑29 Jul 2024, 12:57 Dear Developers,

We are excited to announce the release of TOS 6, designed to provide an enhanced user experience. In this new version, we have adopted a root filesystem fully compatible with Ubuntu 22.04 and introduced the systemd method for starting the system, launching applications, and hosting application programs. Consequently, adjustments are required for the startup method of native applications running on TOS 6. Please refer to the following guidelines to pack your native applications accordingly.

The following is the first TOS 6 application development guide released by TerraMaster to the public. There may be some deficiencies in the first version of the development guide. If you encounter problems during use, please contact our tech team and provide us with methods to reproduce the issues, code samples, and screenshots, so that we can analyze and fix them. We will continue to optimize and update the development tools, please pay attention to our updates.

https://github.com/TerraMasterOfficial/ ... -pkg-tools

Technical team contact email
[email protected]
Just saw this thread,
Can you please tell me that what changes developers need to make for their native applications to run properly on the new TOS 6 system?

Re: TOS 6 Native Application Development Guide

Posted: 25 Jan 2025, 13:04
by sumit02
Hi everyone, I’m new to TOS 6 and find the updates like Ubuntu 22.04 support and systemd quite interesting. I want to know what changes developers need to make for their apps to work well on TOS 6. Can anyone share some simple tips or advice?
Thanks.

Re: TOS 6 Native Application Development Guide

Posted: 14 Jun 2026, 01:13
by dmncstech
First post in the forums.... hope its the right place.

There is a WireGuard module that is available in TOS 6.0.4 and later. I have TOS 6.0.7 . I want to enable wireguard and need the module name and the activation script would also be nice.

Thanks

Re: TOS 6 Native Application Development Guide

Posted: 14 Jun 2026, 10:38
by Phil
dmncstech wrote: ↑14 Jun 2026, 01:13 First post in the forums.... hope its the right place.

There is a WireGuard module that is available in TOS 6.0.4 and later. I have TOS 6.0.7 . I want to enable wireguard and need the module name and the activation script would also be nice.

Thanks
The WireGuard module name in TOS 6.0.7 is wireguard. You need to load the module via SSH by executing

Code: Select all

`modprobe wireguard`
, and you will need to manually create the configuration file and activation script.