DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

#26 2010-01-08 10:56:03

From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: Debian squeeze chroot on DNS-321 HOWTO

Zombie wrote:


debootstrap --arch=armel --verbose --foreign squeeze ./squeeze
tar cf squeeze.tar squeeze

and after transferring squeeze.tar, on the target:


cd /mnt/HD_a2
tar xf squeeze.tar
chroot /mnt/HD_a2/squeeze /bin/bash
/debootstrap/debootstrap --second-stage

However, the chroot step segfaults for me. I'm using firmware 1.0.8.


file squeeze/bin/ls
squeeze/bin/ls: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Is that because this is a 2.6.12 kernel? Does armel even work (still)?

I have the same (seg faults).



#27 2010-01-08 10:59:57

From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: Debian squeeze chroot on DNS-321 HOWTO

Did a quick scan of the bug report, and I think the problem applies to both cdebootstrap and debootstrap.



#28 2010-02-27 21:26:29

New member
Registered: 2010-02-27
Posts: 2

Re: Debian squeeze chroot on DNS-321 HOWTO

Has anyone been able to chroot to squeeze w/ armel on DNS-323?  It seems like all the successes so far are on the DNS-321. 

I wonder if the kernel that came with the DNS-323 isn't compatible with armel somehow.



#29 2010-02-27 23:58:58

New member
Registered: 2010-02-27
Posts: 2

Re: Debian squeeze chroot on DNS-321 HOWTO

According to http://wiki.debian.org/ArmEabiHowto


You need to enable the following options to enable both EABI and OLDABI


Anyone know if it's possible to see if the DNS-323 has those options enabled?



#30 2010-07-16 08:56:32

New member
Registered: 2010-07-16
Posts: 1

Re: Debian squeeze chroot on DNS-321 HOWTO


DNS-321 will not chroot to etch and lenny file systems, trying to chroot produces various errors:

1. Illegal instruction
2. Unable to find "xxx"

DNS-321 "will" chroot to a squeeze directory, this has been verified.

Here's what works:

DNS-321 firmware version 1.03

Phase I: install fonz fun_plug 0.5 on DNS-321

# goal is to enable telnet, so you can chroot later
# copy the fun_plug script and fun_plug ffp tarball to /mnt/HD_a2 and restart the DNS-321

Phase II: from an Ubuntu 9.04 server instance on another machine, pc or virtual machine

# goal is to run debootstrap from a debian lenny environment, Ubunto 9.04 is essentially lenny
# this packs up squeeze but does not install it, installation will be completed later on the DNS-321
# the ubuntu server cd rom is only 697 MB, not 4.5 GB like the dvd for desktop, the smaller cd is all you need to set up a minimal Ubuntu/lenny environment
# since installation is not attempted the armel tar execution never takes place on the x86 platform and the debootstrap process completes normally on Ubuntu/lenny

# apt-get install debootstrap
# debootstrap --arch=armel --verbose --foreign squeeze ./squeeze
# tar cf squeeze.tar squeeze
# gzip squeeze.tar

Phase III: smb copy or scp copy squeeze.tar.gz to the DNS-321 Volume _1 share /mnt/HD_a2

# goal is to telnet to the DNS-321 then unpack and install in a DNS-321 kernel environment, mount devices and then chroot into the debian environment

# telnet (address of the DNS-321, no password is required)

# cd /mnt/HD_a2
# gunzip squeeze.tar.gz
# tar xf squeeze.tar
# chroot /mnt/HD_a2/squeeze /bin/bash
# /debootstrap/debootstrap --second-stage

# put the following in a script and (chmod +x script)

export CHROOT=/mnt/HD_a2/squeeze
mount -o bind  /dev  $CHROOT/dev
mount -o bind  /proc $CHROOT/proc
mount -o bind  /sys  $CHROOT/sys
mount -o bind  /tmp  $CHROOT/tmp
mount -t devpts none $CHROOT/dev/pts
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
cp /etc/hosts $CHROOT/etc/hosts
export PS1="[\u@DNS-321: \w]"
chroot $CHROOT $*

# execute the script, it "should" pop you into the debian environment and leave you as root
# you should setup the environment as you'd like when its autobooted (for example: passwd, sshd)
# then include the script name at the end of the fun_plug script


Phase IV: mount kernel handles

# goal is to enable many tools designed to work with the kernel, like ifconfig

# mount proc /proc -t proc
# mount devpts /dev/pts -t devpts

Phase V: configure the user environment

# goal is to configure a traditional TCP environment and enable apt-get

# echo "nameserver" > /etc/resolv.conf
# echo "deb http://debian.osuosl.org/debian squeeze main contrib non-free" > /etc/apt/sources.list
# apt-get update
# apt-get install debian-archive-keyring
# apt-get update
# apt-get dist-upgrade
# passwd root

Phase VI: write a fun_plug script to auto-chroot, mount kernel handles, start services

# goal is to automate the process of booting the debian squeeze environment after a normal DNS-321 restart


This is not a "native" Debian install to the hardware.

It retains the original DLINK firmware and services.

I believe the etch and lenny editions are not chroot-able because they either use older libc libraries, or older kernel-headers and hence attempt to make the wrong kernel service calls. The DNS-321 [ as of firmware 1.03 ] has a newer kernel than the DNS-323 [ as of 1.05 ]. Don't be fooled by the firmware version numbers as the DNS-323 was introduced much earlier than the DNS-321 product. The DNS-321 is newer and the firmware for each device were started at different times. Thus the DNS-323 firmware numbers are "higher" but run an older kernel version than the DNS-321 firmware numbers which are "lower" but run a newer kernel.

The DNS-323 has a 500 MHz processor, the DNS-321 has a 400 MHz processor.
The DNS-323 has a USB port for printers or external hard drives, the DNS-321 does not have a USB port.

The DNS-323 holds two 3.5 inch SATA drives.
The DNS-321 holds two 3.5 inch SATA drives but is less expensive than the DNS-323.

The DNS-321 is priced like a single drive NAS solution but has two drive bays.

Both the DNS-323 and the DNS-321 are built like tanks out of heavy aluminum, with rubber feet.

For those keeping score at home, Debian generations are sarge, etch, lenny and squeeze, with sarge being the oldest of the bunch and squeeze being the newest. There are other Debian versions, but these are the ones most interesting to the DNS-32x crowd right now. Ubuntu, Slackware and Fedora have arm distros but I don't know much about them, and I don't know if they would run on a DNS-32x. I do know the Sheeva Plug is arm based and runs Ubuntu 9.04 "Jaunty Jakalope" aka "lenny". So the Sheeva Plug would probably have problems booting or chrooting squeeze without a kernel upgrade (but the Sheeva Plug includes a dual purpose JTAG serial port as a mini-usb.. so its a lot easier to recover than the DNS devices). In theory the Fedora arm has also been made to run on the Sheeva Plug.

The Linksys UNSLUG project produced Optware which is a minimalist ipkg distro, and works on the DNS-321.

The DNS-323 and DNS-321 are members of the 10-12 MB/s category of NASes as far as I can tell. More expensive beefier NASes are five to ten times as fast, but they do cost more. At that rate, "I think" 1000x1000/10/3600/24 = about 1.15 days to fill a 1 Terrabyte hard drive.. so definitely, maybe, consider it for archival purposes rather than real time disk replacement. On the other hand, it should be able to handle PXE booting and provisioning things like most versions of Linux, Windows (XP, 2003, 2008), and perhaps Mac OSX with netboot. And it seems to work great as a partner for my Nureos SD streaming player. XP LiveCD images can boot from it.. I do mean the full versions, not the winpe or bartpe versions.

This note is a collection and summary of information targeted for the DNS-321, hopefully it will save someone else time.

Wonderful thread by the way, consider this a validation of the information from all the posters.

Last edited by jwillis84 (2010-07-19 00:07:04)



Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB