Back to Home

Install Firebird on D-Link DNS-325

firebird · linux · arm

Install Firebird on D-Link DNS-325

I had a “budget” idea to use the existing NAS D-Link DNS-325 as a backup DBMS (as a temporary solution in case of failure). The organization is small + continuous production + lack of an on-call specialist, but this is only for entry.

Solving this issue, I spent a lot of time searching for the necessary information, which prompted me to write this publication.

Since the Linux device on board this device, the task looked quite solvable. From the box, the device is controlled via a web interface and has rather limited capabilities; the list of applications available for installation is not impressive .

1. I wondered about connecting via telnet or SSH and the further possibility of installing software


The publication from my beloved Habr - "A wheelbarrow for pumping - we configure and expand the capabilities of D-Link DNS-325 " helped me in this . According to the instructions in it, it was possible to configure access via SSH, as well as configure additional repositories (Optware) for installing the software. Unfortunately, Optware firebird could not be found in the repositories.

2. Attempts to install Firebird


Because the device uses an ARM processor with the architecture ARMV5TEL, at that time there was no architecture support for Firebird 2.5. I still decided to try installing directly on the device from the source from here: Firebird 2.5 . Recommended Autogen.sh refused to install with a message about an unknown architecture. Only the configuration stage of “configure” was able to go to hand-to-hand, after which “make” threw out errors, the description of which (+ search) made it clear that you could not do without editing the source.

There were 2 solutions left: cross-compilation for the necessary architecture or the use of already existing compiled packages for the specified architecture, which were found in the debian repositories. I searched for information on both solutions, and in my opinion it was easier to install debian using the debootstrap tool . Another advantage of this solution is the ability to access the debian repository, which has a lot more software than Optware.

3. Installing debian wheezy using the debootstrap tool


Because debootstrap itself is also missing in Optware repositories; I will prepare the debian system image on ubuntu installed on the virtual machine.

Install debootstrap (with insufficient privileges do not forget about sudo):

apt-get install debootstrap -y
apt-get clean

We create the image and pack it in the archive:

debootstrap --foreign --arch armel wheeze debian "http://ftp.ru.debian.org/debian"
tar -czf debian.tar.gz debian

Next, the resulting debian.tar.gz archive must be copied to the NAS in any way, as an option through shared folders. Next, we connect to the NAS via SSH, for example, using PUTTY and do the following.

Unpack the archive, mount the device files from the current NAS system, deploy the system:

tar -xf debian.tar.gz
mount -o bind /dev ./debian/dev
mount -o bind /proc ./debian/proc
grep -v rootfs /proc/mounts > ./debian/etc/mtab 
chroot ./debian/ /bin/bash 
/debootstrap/debootstrap --second-stage 
exit 

Copy the network settings from the current NAS system:

cp /etc/hosts ./debian/etc/hosts 
cp /etc/resolv.conf ./debian/etc/resolv.conf
hostname > ./debian/etc/hostname 

Now that you have a real Debian system on disk, chroot it:

mount -o bind /dev ./public/debian/dev 
mount -o bind /proc ./debian/proc 
grep -v rootfs /proc/mounts > ./debian/etc/mtab 
chroot ./debian/ /bin/bash

Update the repository and installed software:

wget http://files.satware.com/synology/chroot/sources.list -O /etc/apt/sources.list 
apt-get update -y 
apt-get upgrade -y 
apt-get dist-upgrade -y

4. Install Firebird:


apt-get install Firebird2.5-superclassic -y
dpkg-reconfigure firebird2.5-superclassic

Configure:

Enable Firebird server? => Yes
Password for SYSDBA? => your_password

Exit debian to the main system:

exit

It remains to create a script to start / stop the Firebird server. Download the script:

wget http://files.satware.com/synology/ipkg/S80firebird.sh

We fix the path to the debian folder, I have "/ mnt / HD / HD_a2 / home / debian", the current directory can be viewed with the pwd command:

vi S80firebird.sh

Copy the file to the autorun scripts folder, set the launch rights:

mkdir -p /opt/etc/init.d
mv S80firebird.sh /opt/etc/init.d/
chmod +x /opt/etc/init.d/S80firebird.sh

To start / stop the Firebird server, respectively:

/opt/etc/init.d/S80firebird.sh start
/opt/etc/init.d/S80firebird.sh stop

All is ready! After rebooting, Firebird server will be launched on our NAS on the default port - 3050, you can connect.

Related Links


Wheelbarrow for pumping - configure and expand the capabilities of D-Link DNS-325
Firebird SQL auf Synology Diskstation installieren
Installing Debian GNU / Linux from Unix / Linux

Read Next