perlsynology (1)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
perlsynology - Perl 5 on Synology DSM systemsDESCRIPTION
Synology manufactures a vast number of Network Attached Storage (The
Since it is based on Linux, the
There is an active user community that provides many software packages for the Synology
This document describes various features of Synology
Setting up the build environment
As- *
-
Using your favourite browser open the DSMmanagement page and start the Package Center.
- *
- If you want to smoke test Perl, install "Perl".
- *
-
In Settings, add the following Package Sources:
www.cphub.net packages.quadrat4.de
- *
- Still in Settings, in Channel Update, select Beta Channel.
- *
- Press Refresh. In the left panel the item ``Community'' will appear. Click it. Select ``Bootstrap Installer Beta'' and install it.
- *
-
Likewise, install ``iPKGui Beta''.
The application window should now show an icon for iPKGui.
- *
-
Start iPKGui. Install the packages "make", "gcc" and "coreutils".
If you want to smoke test Perl, install "patch".
The next step is to add some symlinks to system libraries. For example, the development software expect a library "libm.so" that normally is a symlink to "libm.so.6". Synology only provides the latter and not the symlink.
Here the actual architecture of the Synology system matters. You have to find out where the gcc libraries have been installed. Look in /opt for a directory similar to arm-none-linux-gnueab or powerpc-linux-gnuspe. In the instructions below I'll use powerpc-linux-gnuspe as an example.
- *
-
On the DSMmanagement page start the Control Panel.
- *
-
Click Terminal, and enable SSHservice.
- *
- Close Terminal and the Control Panel.
- *
- Open a shell on the Synology using ssh and become root.
- *
-
Execute the following commands:
cd /lib ln -s libm.so.6 libm.so ln -s libcrypt.so.1 libcrypt.so ln -s libdl.so.2 libdl.so cd /opt/powerpc-linux-gnuspe/lib (or /opt/arm-none-linux-gnueabi/lib) ln -s /lib/libdl.so.2 libdl.so
Compiling Perl 5
When the build environment has been set up, building and testing Perl is straightforward. The only thing you need to do is download the sources as usual, and add a file Policy.sh as follows:
# Administrivia. perladmin="your.email@goes.here" # Install Perl in a tree in /opt/perl instead of /opt/bin. prefix=/opt/perl # Select the compiler. Note that there is no 'cc' alias or link. cc=gcc # Build flags. ccflags="-DDEBUGGING" # Library and include paths. libpth="/lib" locincpth="/opt/include" loclibpth="/lib"
You may want to create the destination directory and give it the right permissions before installing, thus eliminating the need to build Perl as a super user.
In the directory where you unpacked the sources, issue the familiar commands:
./Configure -des make make test make install
Known problems
ConfigureNo known problems yet
Build
- Error message No error definitions found.
-
This error is generated when it is not possible to find the local
definitions for error codes, due to the uncommon structure of the
Synology file system.
This error was fixed in the Perl development git for version 5.19, commit 7a8f1212e5482613c8a5b0402528e3105b26ff24.
Failing tests
- ext/DynaLoader/t/DynaLoader.t
-
One subtest fails due to the uncommon structure of the Synology file
system. The file "/lib/glibc.so" is missing.
WARNING:Do not symlink "/lib/glibc.so.6" to "/lib/glibc.so" or some system components will start to fail.
Smoke testing Perl 5
If building completes successfully, you can set up smoke testing as described in the Test::Smoke documentation.For smoke testing you need a running Perl. You can either install the Synology supplied package for Perl 5.8.6, or build and install your own, much more recent version.
Note that I could not run successful smokes when initiated by the Synology Task Scheduler. I resorted to initiating the smokes via a cron job run on another system, using ssh:
ssh nas1 wrk/Test-Smoke/smoke/smokecurrent.sh
Local patches
When local patches are applied with smoke testing, the test driver will automatically request regeneration of certain tables after the patches are applied. The Synology supplied Perl 5.8.6 (at least on the
You can prevent regeneration by adding the setting
'flags' => 0,
to the smoke config, or by adding another patch that inserts
exit 0 if $] == 5.008006;
in the beginning of the "regen.pl" program.
Adding libraries
The above procedure describes a basic environment and hence results in a basic Perl. If you want to add additional libraries to Perl, you may need some extra settings.For example, the basic Perl does not have any of the
LD_LIBRARY_PATH=/lib:/opt/lib export LD_LIBRARY_PATH
This setting needs to be in effect while Perl is built, but also when the programs are run.