Testing a package compiled with spksrc for synology NAS

Read the disclaimer

Now that you've compiled a package, you can test it on a device.
See : https://dayandnightcoding.blogspot.com/2020/04/compiling-cpulimit-with-spksrc-for.html

Ways to test:

  1.  Online demo @ synology.com
  2. Using a blank device

Online demo

Synology provides online demo at https://demo.synology.com/

There's no terminal window there to my knowledge, but you can use the scheduler as a workaround.

Go to the "package center" clic "settings" and select "any publisher"


Select "manual install"


Reminder : the demo platform is x64 while writing this article.
Select your x64 compiled package. In this example : "cpulimit_x64-6.1_0.2-0.spk"

 


Now you can see your package in the "package center"


In order to test it, you can go to

  • "control panel" 
  • "task scheduler"
  • Create>scheduled task>user-defined script




Select "admin"


This is optional, you are on a disposable demo plateform


Enter the following string in the "run command" field:
cpulimit --help > /volume1/homes/admin/cpulimit-help.txt

Now the scheduled task is created, you can right click it an run it

You can navigate to

  • "file station"
  •  homes>admin



You can then right click the text file and open it in the editor.


Note : failed cross compiled executable do not execute. Having the help file displayed is a good clue everything is fine.


Blank device

reread the disclaimer

In order to perform a test, you can remove the hard drive(s) from your device and replace it with a single hard drive.
Note that every data on that test drive will be erased as the wizard will warn you. After the wizard is over, you'll have a test hard drive that you can use for your different tests.
Once the test is over, you can re-install your original drive(s) and use your production device back.

Test setup
Production setup


After boot, you'll have a device on which you'll be able to perform test.
Once the package tests are successful, you can install the package to your production device.

Install

Log to the web interface of your device

Go to the "package center" clic "settings" and select "any publisher"

 Select "manual install"

Reminder : My test platform is armada375 based
In this example : "cpulimit_armada375-6.1_0.2-0"



Now you can see your package in the "package center"


Go to "control panel" and enable the "SSH service"


You can now log in your device with SSH. You'll need a ssh compatible software (example: putty) and the IP address of you device

Synology's documentation on SSH : https://www.synology.com/en-global/knowledgebase/DSM/tutorial/General_Setup/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet


Here are the commands I used:

which cpulimit
gives you the path where the software is available system wide : /usr/local/bin/cpulimit

ls -al /usr/local/bin/cpulimit
tells you if that path is the exe itself or a symbolic link. As the "lrwxrwxrwx" string starts with "l" it is a symbolic link.
the installation creates that symbolic link and the uninstall removes it.

ls -al /usr/local/cpulimit/bin/cpulimit
The "-rwxrwxr-x" string tells you it is a file, the executable from the package.

You can now reboot your device, to ensure it starts up smoothly.

Uninstall

Let's test the uninstallation.
NOTE : As it is the moment where you remove data from your device, it is also the moment where you can brick it.

Go to the "package center" and go to the package details.
Hit the uninstall button.




Now if you go back in putty, and perform the which command, there will be no path displayed anymore.

Reboot your device, check that it load up normally and that you can log in.

You have now a fully functional package.


Popular posts from this blog

cuesplitflac : a mass flac splitting script for synology and ubuntu

Compiling "file" with spksrc for synology NAS

Compiling cpulimit with spksrc for synology NAS