Differences

This shows you the differences between the selected revision and the current version of the page.

howto:chroot_debian 2008/01/20 18:34 howto:chroot_debian 2017/09/06 18:38 current
Line 1: Line 1:
-===== Install Debian Sarge - by Mike Gore =====+====== Install Debian Etch - by Mike Gore and Manuel Treitinger ======
**Please feel free to update, cleanup or correct this page** **Please feel free to update, cleanup or correct this page**
-**What is this?**  +**What is this?** This document shows how to setup Debian on the DNS-323.
-  This document shows how to setup Debian on the DNS-323+
 +Note: this technique installs a Debian environment into the existing system, and does not require you to reflash or hack the NAS.
-==== requisites ===== +**All downloads/methods below are using Debian for arm. This is more or less deprecated. See [[http://dns323.kood.org/forum/viewtopic.php?id=4330|forum post]] on howto install an armel version. **
-you should already have [[Telnet]] access to your device+
-==== base system ====+ 
 + 
 + 
 +===== The easy way ===== 
 + 
 +The easiest way to get a full Debian environment is to use DebNAS. It provides a full base system with SSH enabled by default and boots automatically. As it uses chroot, it is not going to harm your device and can be uninstalled by simply deleting one file ("fun_plug") and one folder ("linux") from your first volume.  
 + 
 +**Download**: [[http://mesh.dl.sourceforge.net/sourceforge/debnas/debnas-0.5.tar.bz2]] 
 + 
 +To install: 
 +  - Ensure you have the newest firmware (1.05 or newer). 
 +  - Extract the downloaded archive 
 +  - Copy the two extracted files linux.tar and fun_plug to the root directory of your first DNS-323 volume 
 +  - Reboot the DNS-323 
 +  - The DNS-323 is going to work for several minutes now and finally reboots 
 +  - The DNS-323 automatically boots into Debian and runs the SSH - daemon 
 + 
 +You can now log in via SSH, the default password for username root is 12345678. 
 +(Be aware that (sometimes) the NAS is only accessible via IP address at this moment!) 
 + 
 + 
 +Change the password immediately with the passwd command. 
 +**Have fun!** 
 + 
 +Note: Upgrading Debian to a current distribution is going to increase performance a lot. 
 + 
 +**To upgrade to Debian Lenny :**\\  
 +''Edit /etc/apt/sources.list.d/etch.list, replacing the word etch with lenny.  
 +I also changed the mirror url to a North American mirror rather than the German one by removing the de. in the url. You may also rename the filename from etch.list to lenny.list if you feel so inclined.'' 
 +<code xml> 
 +NOTE: This does not work as written, lenny and etch are both archived, and as such, the repositories have moved. The following worked for me. 
 + 
 +deb http://archive.debian.org/debian/ lenny main non-free contrib 
 +deb http://archive.debian.org/debian-backports lenny-backports main 
 +</code> 
 + 
 + 
 +Now we need to update the repository packages listing and upgrade to lenny. You may have GPG issues which you can resolve by calling :  
 +<code bash> 
 +apt-get install debian-archive-keyring 
 +</code> 
 +Or following the guide  **Here**: [[http://linux.com/community/blogs/Debian-Upgrading-to-Lenny-ERROR-no-public-key-available-for-the-following....html]]   
 + 
 +Make sure that you have DNS nameservers listed in /etc/resolv.conf, and run : 
 + 
 + 
 +<code bash> 
 +apt-get update 
 +apt-get dist-upgrade 
 +</code> 
 + 
 +This will take a while to download and then upgrade. When it is done reboot Debian. I had to reboot using the command ‘reboot -f’. When Debian comes back up, it will be running Lenny. When it comes back up, update to make sure everything is current. 
 + 
 +<code bash> 
 +apt-get update 
 +apt-get upgrade 
 +</code> 
 +Now we have a reasonably current Linux system to play with.  
 + 
 + 
 +===== The custom way  ===== 
 + 
 + 
 +==== 1. prerequisites ===== 
 + 
 +You should already have [[Telnet]] access to your device. 
 + 
 +Or better, install ssh and disable Telnet.  See: 
 + 
 +http://www.penoycentral.net/linuxnix/configuring-ssh-and-rsync-in-dlink-dns-323/ 
 + 
 + 
 +==== 2. base system ====
You have two options to proceed. You can either download a preconfigured image or create your own. You have two options to proceed. You can either download a preconfigured image or create your own.
-=== download a minimal image ===+=== 2A. download a minimal image ===
-  * Debian Sarge 3.1 - [http://wopr.levring.nu/sarge.tar] (83Mb)  
  * Debian Etch 4.0 - [http://dev.skcserver.de/dns323/etch.tar] (169 Mb)   * Debian Etch 4.0 - [http://dev.skcserver.de/dns323/etch.tar] (169 Mb)
 +  * Debian Etch 4.0 (U.S. mirror) - [http://www.bfaber.com/dl/etch.tar]
 +
 +If you wish to use one of these, simply download it and proceed to step 3 below.
-=== or: create a minimal image ===+=== 2B. create a minimal image ===
** You will need a Debian Linux x86** system to create the install image. ** You will need a Debian Linux x86** system to create the install image.
(My system is a Ubuntu Dapper x86 system) (My system is a Ubuntu Dapper x86 system)
Line 41: Line 114:
We will now "bootstrap" an ARM debian system using our x86 debian system We will now "bootstrap" an ARM debian system using our x86 debian system
**note it will error out at the final install phase - this is just fine** **note it will error out at the final install phase - this is just fine**
-This process will create an ARM debian environment under a directory called **sarge**+This process will create an ARM debian environment under a directory called **lenny**
<code bash> <code bash>
-cdebootstrap -aarm sarge sarge ftp://ftp.debian.org/debian+cdebootstrap -aarm lenny lenny ftp://ftp.debian.org/debian
</code> </code>
-For the current stable (**etch**) you should use the following +For the oldstable (**etch**) you should use the following 
-When you use this line, you should replace all "sarge" texts with "**etch**".+When you use this line, you should replace all "lenny" texts with "**etch**".
<code bash> <code bash>
cdebootstrap -aarm etch etch ftp://ftp.debian.org/debian cdebootstrap -aarm etch etch ftp://ftp.debian.org/debian
</code> </code>
-Archive the **sarge** directory we created with the bootstrap+Archive the **lenny** (or **etch**) directory we created with the bootstrap
<code bash> <code bash>
-tar cf sarge.tar sarge+tar pcvf lenny.tar lenny
</code> </code>
-Copy this tar file to **/mnt<del>/HD_a2</del>** (Update 20 jan 2008, Stefan: The /HD_a2 is not needed because we mounted /Volume_1 in /mnt)+Copy this tar file to **/mnt**
<code bash> <code bash>
-cp sarge.tar /mnt+cp lenny.tar /mnt
</code> </code>
Line 65: Line 138:
-==== finalizing installation ==== 
-**note**: you don't need to do the following steps using the etch tar from above...+==== 3. finalizing installation ====
-*update by Richard (23rd Dec 07) - yes you do...+*update by Berry (26th March 08) - If you have firmware 1.04 then make sure to turn off Oplocks now on the web interface before you untar (Advanced / Network access)
# On the host x86 system reboot the DNS-323 using the web interface # On the host x86 system reboot the DNS-323 using the web interface
-# Telnet to the DNS-323+# Telnet or ssh to the DNS-323
telnet disk telnet disk
Line 83: Line 155:
</code> </code>
-# At this point, you should untar the {sarge,etch}.tar file that you made above+# At this point, you should untar the {lenny,etch}.tar file that you made above
<code bash> <code bash>
-./lnx_bin/busybox3 tar -xf sarge.tar+./lnx_bin/busybox3 tar -xf lenny.tar
</code> </code>
-# Replace sarge.tar with etch.tar above if you built an etch install+ 
 +Or for firmware 1.04+: 
 +<code bash> 
 +tar -xf lenny.tar 
 +</code> 
 + 
 +# Replace lenny.tar with etch.tar above if you built an etch install 
 + 
 +* Daniel (26 Oct 08) Alternatively with FFP 0.3 you may find that the correct command is: ./fun_plug.d/bin/busybox tar -xf etch.tar
# chroot into the partly bootstrapped sarge debian root # chroot into the partly bootstrapped sarge debian root
<code bash> <code bash>
-./lnx_bin/busybox3 chroot sarge /bin/bash+./lnx_bin/busybox3 chroot lenny /bin/bash
</code> </code>
 +
 +Or for firmware 1.04+:
 +<code bash>
 +chroot lenny /bin/bash
 +</code>
 +
# At this point you should have a shell in the new debian root # At this point you should have a shell in the new debian root
 +
 +*update by sm8ps (20100815): On Firmware 1.08 with the downloaded a minimal image from step 2A, none of the following was necessary. I could proceed straight to step 4.
# Fix the broken packages caused by the failed cdebootstrap - above # Fix the broken packages caused by the failed cdebootstrap - above
Line 99: Line 187:
something reasonable - for example as set up by the mount commands in the fun_plug listed at the bottom of this page. something reasonable - for example as set up by the mount commands in the fun_plug listed at the bottom of this page.
Some of the installers seem to get confused when they can't find fstab, /dev, etc. ** Some of the installers seem to get confused when they can't find fstab, /dev, etc. **
- 
*update by Richard (23rd Dec 07) I think Chris (above) is right, go through the fun_plug and type in the commands by hand. Also, do dpkg*deb first (below), then libc6. *update by Richard (23rd Dec 07) I think Chris (above) is right, go through the fun_plug and type in the commands by hand. Also, do dpkg*deb first (below), then libc6.
 +*Daniel (26 Oct 08) with FFP 0.3 it is neccessary to change the fun_plug listed at the bottom of this page to reference folder fun_plug.d/bin whenever lnx_bin occurs, and replace "busybox3" with "busybox"
 +
 +*update by Paul (18 Apr 08) This all seems much simpler with 1.04.  no need to do any of those things afaict.
<code bash> <code bash>
cd /var/cache/bootstrap cd /var/cache/bootstrap
Line 116: Line 206:
# check remaining dpkg errors if any # check remaining dpkg errors if any
-#+*update by Richard (23rd Dec 07) I had to delete /var/mail to get base_files to install properly
 +*update by Michael (20th June 08) I had to delete /var/mail in sarge.  etch was fine.
-*update by Richard (23rd Dec 07) I had to delete /var/mail to get base_files to install properly 
-==== customizing ====+ 
 + 
 +==== 4. customizing ====
# Edit your /etc/resolv.conf so that the system can find the Debian servers: See this [[howto:chroot_debian:resolv.conf|sample]] # Edit your /etc/resolv.conf so that the system can find the Debian servers: See this [[howto:chroot_debian:resolv.conf|sample]]
-# Edit your /etc/apt/sources.list so that includes some servers.  For instance:+# (for ETCH from link above) Edit your (create new) /etc/apt/apt.conf so that the system can download needed updates: 
 +<code> 
 +APT::Default-Release "etch"; 
 +</code> 
 +*Add by Vladimir Kovtun (19th Dec 08), tested well. 
 + 
 +# Add to /etc/bash.bashrc if you wish the APT-GET to use a your proxy server: 
 +<code> 
 +export http_proxy=http://192.168.1.254:8081/ 
 +export ftp_proxy=http://192.168.1.254:8081/ 
 +</code> 
 +*Add by Vladimir Kovtun (18th Dec 08), tested well. 
 + 
 +*Add by Jesper Møller (21st April 09), if you don't have a suitable proxy, be sure to fix the  fix /etc/resolv.conf to point to you DNS servers 
 + 
 +# (1) Edit your /etc/apt/sources.list so that includes some servers.  For instance:
<code> <code>
deb http://ftp1.ca.debian.org/debian stable main contrib non-free deb http://ftp1.ca.debian.org/debian stable main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free deb http://security.debian.org stable/updates main contrib non-free
</code> </code>
 +__OR__
 +
 +# (2) Edit your /etc/apt/sources.list so that includes some servers.
 +  * It's 100% needed for Debian Etch 4.0 - [http://dev.skcserver.de/dns323/etch.tar] (169 Mb)
 +<code>
 +deb http://ftp1.ca.debian.org/debian etch main contrib non-free
 +deb http://ftp1.ca.debian.org/debian etch-proposed-updates main contrib non-free
 +deb http://security.debian.org etch/updates main contrib non-free
 +</code>
 +and empty /etc/apt/sources.list/etch.conf (or simple unlink it)
 +*Update by Vladimir Kovtun (19th Dec 08), tested well.
 +
 +*update by sm8ps (20100815): As of 20100215, the support of Debian Etch has run out.
 +The above mentioned sources do not work anymore therefore.
 +The Debian archive, however, still contains the packages.
 +So for Etch one should use the following sources (and delete /etc/apt/sources.list.d/etch.list):
 +
 +<code>
 +deb http://archive.debian.org/debian-archive/debian/ etch main contrib non-free
 +deb-src http://archive.debian.org/debian-archive/debian/ etch main contrib non-free
 +</code>
 +
 +or (mdvx 19-Jan-09)
 +and empty /etc/apt/sources.list.d/etch.list
 +
# Update packages # Update packages
<code bash> <code bash>
 +apt-get update
apt-get install debian-archive-keyring apt-get install debian-archive-keyring
apt-get update apt-get update
apt-get dist-upgrade apt-get dist-upgrade
</code> </code>
- +*Update by Vladimir Kovtun (19th Dec 08), tested well - first "apt-get update" for update keys for next updates.
# make root password # make root password
<code bash> <code bash>
Line 183: Line 315:
</code> </code>
# Note: be sure to install both the linuxrc script *and* the fun_plug script before rebooting! # Note: be sure to install both the linuxrc script *and* the fun_plug script before rebooting!
 +
 +# Note 2: Make sure you create your fun_plug and script files as unix file not windows text files.  I fell for this :(
 +Added by: James Alford 2009-01-11
** Reboot the DNS-323 and test ** ** Reboot the DNS-323 and test **
-Q: What if the chroot command doesn't seem to work? (for instance when trying a: chroot etch /bin/bash)+=== Manual chroot to a Debian etch when using fonz funplug === 
 + 
 +To do a manual chroot to a "fresh" extracted Debian etch, 
 +use the following command: 
 + 
 +<code bash> 
 +env -i TERM=vt102 USER=root $SBINDIR/chroot /mnt/HD_a2/etch /bin/bash -ls 
 +</code> 
 + 
 +(Try this if you get errors such as "sh: /mnt/HD_a2/fun_plug.d/bin/ls: No such file or directory" or  
 +"dpkg - error: PATH is not set") 
 + 
 +If there are still issues like "dpkg - error: PATH is not set" export PATH into your chrooted system. First change to a bash shell of your etch/sarge by typing the previous command. The use export PATH: 
 + 
 +<code bash> 
 +env -i TERM=vt102 USER=root $SBINDIR/chroot /mnt/HD_a2/etch /bin/bash -ls 
 +etch /> export PATH 
 +</code> 
-A: Try inserting "env -i" in the chroot command as such: chroot etch env -i /bin/bash  
[[howto:crosscompile|Cross Compile Software for the DNS-323]] [[howto:crosscompile|Cross Compile Software for the DNS-323]]

Navigation

Personal Tools