Cross compile TestDisk for Synology NAS

From CGSecurity
Jump to: navigation, search

En.png English It.png Italiano


To compile TestDisk & PhotoRec for a Synology NAS on a Linux computer,

CS/RS407, DS207+, DS107+ Marvell 5281 ARM Little Endian 2.6

  • Download the corresponding toolchain files, example gcc343_glibc232_88f5281.tar.gz
  • Install the tool chain

as root,

tar xpzf gcc343_glibc232_88f5281.tar.gz -C /usr/local
  • Create symbolic links for the tool chain
sudo ln -s /usr/local/arm-marvell-linux-gnu/bin/arm-marvell-linux-gnu-gcc /usr/local/bin
sudo ln -s /usr/local/arm-marvell-linux-gnu/bin/arm-marvell-linux-gnu-ld /usr/local/bin
sudo ln -s /usr/local/arm-marvell-linux-gnu/bin/arm-marvell-linux-gnu-ranlib /usr/local/bin
  • Download and decompress TestDisk & PhotoRec
wget -N http://www.cgsecurity.org/testdisk-6.12.tar.bz2
tar xjf testdisk-6.12.tar.bz2
  • Compilation
cd testdisk-6.12
./compile.sh arm-marvell-linux-gnu

Synology DS-409 Slim

Let's gather the information

  • Synology 409slim / CPU: Marvell 6281 / ARCH: ARM / Little Endian
  • Linux Version: 2.6.24
  • DSM Version: 3.2-1922
  • DSM Tool Chain: gcc421_glibc25_88f628x.tgz

Now we have everything to start.

  • Download the corresponding tool chain: gcc421_glibc25_88f628x.tgz
  • Install the tool chain

as root,

tar xpzf gcc421_glibc25_88f628x.tgz -C /usr/local
  • Create symbolic links for the tool chain
sudo ln -s /usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc /usr/local/bin/
sudo ln -s /usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ld /usr/local/bin/
sudo ln -s /usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ranlib /usr/local/bin/
sudo ln -s /usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-strip /usr/local/bin/
  • Download and decompress TestDisk & PhotoRec source code
wget -N http://www.cgsecurity.org/testdisk-6.12.tar.bz2
tar xjf testdisk-6.12.tar.bz2
  • Compilation
cd testdisk-6.12
./compile.sh arm-none-linux-gnueabi