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.

Announcement

#1 2013-03-22 12:48:44

bardimnik
New member
Registered: 2013-03-22
Posts: 2

Debian Squeeze 6.0.7 - how to get out of the chroot mode at startup

Hello! My name is Dmitry.

I ask your help in solving a problem that I have a.

Here's the thing: I have a NAS-server company D-Link DNS-320, I use it to store movies music and other stuff. For some time, became interested in operating systems Linux, specifically Ubuntu and Debian. Therefore, the idea to expand the functionality used my NAS-server D-Link, the good he can. To begin, I have a script ffp version 0.7 of FONZ and used it as a torrent-rocking. But I was not able to add there Russian locale, ie move from locale = en_EN.utf8 on locale = ru_RU.utf8. It was necessary to install a Russian version of Midnight Commander. In the end, as a result of finding a solution to this issue, I came across a version of Debian Squeeze 6.0 for D-Link DNS-320, which can be downloaded here:

ftp://ftp.dlink.pl/dns/dns-320/driver_s … 110111.zip

Download this version of Debian, I installed it on my NAS-server D-Link DNS-320, and even adapted it to run and work with flash drives, formatted for Ext2. All turned out the first time - I was pleased. We managed to figure out how to add Russian repositories in / etc / sources.list, and also found on one site an article about how to change the locale to locale = en_EN.utf8 locale = ru_RU.utf8. After all this, I tried to install Midnight Commander. Oh my God! All in Russian! Cool! Well, after all this, I decided to install Transmission. It worked. But even after installing Midnight Commander, I noticed that I can not access the two disk drives that are installed in the NAS-server D-Link DNS-320. Began to search for the cause. And on one of the sites found mention of the fact that this version of Debian Squeeze 6.0, prepared for this device NAS-server D-Link DNS-320, runs through CHROOT, ie runs in stand-alone mode from which not go for the folder that contains this system. This system runs a script called fun_plug, which lies at the root of the drive Volume_1. Here are the contents of the script:

# # # # # # # # # --------- --------- Beginning of the script # # # # # # # # #

#! / Bin / sh

# Root DISK1
export DISK1 = / mnt/HD/HD_a2
export DISTDIR = squeeze

cd $ DISK1

mount - bind $ DISK1 $ DISTDIR $ DISK1
mount - bind / $ DISTDIR / mnt / root
mount - bind / dev $ DISTDIR / dev
mount - bind / sys $ DISTDIR / sys
# Mount - bind / sys / crfs $ DISTDIR / sys / crfs
# Mount - bind / web $ DISTDIR / web
mount - bind / proc $ DISTDIR / proc

cp-f / proc / mounts $ DISTDIR / etc / mtab
rm-f $ DISTDIR / etc / fstab
touch $ DISTDIR / etc / fstab
cp-f / etc / resolv.conf $ DISTDIR / etc
hostname> $ DISTDIR / etc / hostname
cp-f / etc / hosts $ DISTDIR / etc

$ DISK1 / $ DISTDIR / boot / chroot $ DISK1 / $ DISTDIR / boot / linuxrc

# # # # # # # # # End of script --------- --------- # # # # # # # # #

In connection with the above, I have a question: how to get rid of the sandbox mode in this version of Debian Squeeze 6.0.7? What you need to tweak the script to cancel the chroot run at startup? This is needed to access the contents of drives installed in the NAS-server DNS-320. I have SSH access.

Thanks in advance for meaningful answers.

Offline

 

#2 2013-03-22 19:39:40

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Debian Squeeze 6.0.7 - how to get out of the chroot mode at startup

how to get rid of the sandbox mode

You can't. 'chroot' stands for 'change root', which means the root of the filesystem is changed. Because the firmware expects (and needs) other libraries in /lib than Debian does, Debian has to have a different root, as /lib in in the root.

Your script is mangled by the copy&paste, but I think the directory /mnt/HD_a2/squeeze/ for the firmware is / for Debian. So Debian cannot see anyhing lower in the tree.

You can't avoid the 'sandbox', but you can put your shares inside it. Don't know the 320, but let's say the shares are in /mnt/HD_a2/shares. In that case you can bind-mount them inside your chroot:

Code:

mkdir -p $DISK1/$DISTDIR/mnt/shares
mount --bind /mnt/HD_a2/shares $DISK1/$DISTDIR/mnt/shares

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB