Compile application for AS1002T

Share your awesome tips and tricks here.

Moderator: Lillian.W@AST

Post Reply
sandro_rocha
Posts: 76
youtube meble na wymiar Warszawa
Joined: Wed Feb 05, 2020 10:49 am

Compile application for AS1002T

Post by sandro_rocha »

Hello. I would like to know how to compile a program for the AS1002T, create the apk so that it can be installed on the NAS. I am in need of native versions of certain applications (Sonarr, Radarr, Bazarr, Jackett). Some have Docker versions in the store and you can install them via Docker but the Docker for my NAS (AS1002T) is not reliable and weighs heavily on the hardware. I looked at the pdf available in the development guide but it is all very confusing. I have already compiled some programs on Linux but the Asustor encapsulation system was not clear to me. Is it possible to compile the programs already with the necessary libraries and create the apk? I need help with that.
User avatar
father.mande
Posts: 1810
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: Compile application for AS1002T

Post by father.mande »

Hi,

You have multiple solutions ... (apkg creation is aftr the compile part)
1) use the cross-compile tools provide by Asustor (available in dev. corner web site)
... for : 100% compatible with NAS libraries and tools
... cons. : use old library (as A.D.M.) , add difficulty to cross-compile, need a complete management by user
2) use Entware (based on Openwrt) and follow documentation (how add a package)
... for : use new library (2.27) don't impact directly A.D.M. delivery, you can include start and stop WITHOUT the need to write an APKG
... cons. : local gcc, include are sometimes limited
3) use a chroot of a modern Linux (ex. Ubuntu 20.04 L.T.S.) ... build in minutes ... an easy +++ solution
... for : perhaps no need to compile ... package (ppa) can exist. Update is include and library maintains up to date (apt management tool for Ubuntu), possibility to limit access to the full NAS to prevent any access not approved.
... Cons. : ... hum! nothing, except to remember to solve miss formed kernel number (4.14.x .. so x is not accepted by some libraries and tools) workaround exist and is easy BUT 4.14.x is for x86 series
4) chroot in namespace (+ cgroup for resource management) ... it's like a container ... idem but with a more separate things like mount, ipc, etc. ... T.B.C. is possible vs. Kernel version
... idem as previous chroot but for expert possibility to go up to start systemd ... so nearest possibility for native program to a V.M. BUT complex +++
Docker can be used ... but you LOST the hands on some parts, you are dependent of the provider and NO security if for ex. cryptomining is included or malware to add bad in some file used externally to the docker
container)

APKG is easy to build, a documentation is available in "dev. corner" web site with example ... and ANY APKG installed is a good source of possibilities and configuration.

Philippe
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
sandro_rocha
Posts: 76
Joined: Wed Feb 05, 2020 10:49 am

Re: Compile application for AS1002T

Post by sandro_rocha »

father.mande wrote:Hi,

You have multiple solutions ... (apkg creation is aftr the compile part)
1) use the cross-compile tools provide by Asustor (available in dev. corner web site)
... for : 100% compatible with NAS libraries and tools
... cons. : use old library (as A.D.M.) , add difficulty to cross-compile, need a complete management by user
2) use Entware (based on Openwrt) and follow documentation (how add a package)
... for : use new library (2.27) don't impact directly A.D.M. delivery, you can include start and stop WITHOUT the need to write an APKG
... cons. : local gcc, include are sometimes limited
3) use a chroot of a modern Linux (ex. Ubuntu 20.04 L.T.S.) ... build in minutes ... an easy +++ solution
... for : perhaps no need to compile ... package (ppa) can exist. Update is include and library maintains up to date (apt management tool for Ubuntu), possibility to limit access to the full NAS to prevent any access not approved.
... Cons. : ... hum! nothing, except to remember to solve miss formed kernel number (4.14.x .. so x is not accepted by some libraries and tools) workaround exist and is easy BUT 4.14.x is for x86 series
4) chroot in namespace (+ cgroup for resource management) ... it's like a container ... idem but with a more separate things like mount, ipc, etc. ... T.B.C. is possible vs. Kernel version
... idem as previous chroot but for expert possibility to go up to start systemd ... so nearest possibility for native program to a V.M. BUT complex +++
Docker can be used ... but you LOST the hands on some parts, you are dependent of the provider and NO security if for ex. cryptomining is included or malware to add bad in some file used externally to the docker
container)

APKG is easy to build, a documentation is available in "dev. corner" web site with example ... and ANY APKG installed is a good source of possibilities and configuration.

Philippe
Although I have already compiled some programs on Linux, I am not knowledgeable about the system enough to try options 1 and 2 and option 4 seems confusing. However I was interested in option 3. Would it be like installing the Ubuntu package manager on Asustor? It is possible? If you can do it with apt or something, it would be of great help. How can I do this?
User avatar
father.mande
Posts: 1810
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: Compile application for AS1002T

Post by father.mande »

Hi,
sandro_rocha wrote: Although I have already compiled some programs on Linux, I am not knowledgeable about the system enough to try options 1 and 2 and option 4 seems confusing. However I was interested in option 3. Would it be like installing the Ubuntu package manager on Asustor? It is possible? If you can do it with apt or something, it would be of great help. How can I do this?
Hum! I don't have time to do an How-to ... but APKG using this exist, so can be used as an example
The process is :
1 using Entware or any Linux Debian/Ubuntu system (V.M., real, etc.) generate with debootstrap an Ubuntu environment (foreign with second-stage) for your CPU architecture (x86, x86_64, armhf, aarxh64 (arm64)) ... armhf for AS1002T
2 save it and transfer to the NAS then extract (if you use zip or gzip or ... ) ... and do debootstrap second-stage if require
3 create a short script to mount the minimum points require (/dev /dev/pts /sys /proc AND eventually shm and a shared resource used by A.D.M. to facilitate exchange between chroot and A.D.M.)
4 copy network env in etc of chroot (hostname, resolv.conf) ... chroot use same I.P. as A.D.M. and same ports list (so take care of already used port)
5 update the sources.list (source for Ubuntu package) if needed (get it on the Web or from a real Ubuntu system)
6 enter in the chroot and do what you want using apt, apt-get, apt-cache, etc. add also add-apt-repository in "software-properties-common" package (for external ppa)
7 integrate WHEN ALL WORKS ... in an APKG or using any autorun mechanism.

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Tips & Tricks”