This is an old revision of the document!
Install Debian Sarge - by Mike Gore
Please feel free to update, cleanup or correct this page
What is this?
This document shows how to setup Debian on the DNS-323
requisites
you should already have Telnet access to your device
base system
You have two options to proceed. You can either download a preconfigured image or create your own.
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)
or: create a minimal image
You will need a Debian Linux x86 system to create the install image. (My system is a Ubuntu Dapper x86 system)
Make sure you have cdebootstrap smbfs installed
apt-get install cdebootstrap smbfs
Note - I called my DNS-323 “disk”
We will now mount the DNS-323 on the host Debian system. Your system has to be formatted with an admin password. I will use disk for the DNS-323 and /mnt for the mount points in this document - you can use whatever you like.
mount -t cifs //disk/Volume_1 /mnt -o username=admin
Or use the IP address of the DNS-323
mount -t cifs //10.0.0.1/Volume_1 /mnt -o username=admin
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 This process will create an ARM debian environment under a directory called sarge
cdebootstrap -aarm sarge sarge ftp://ftp.debian.org/debian
For the current stable (etch) you should use the following When you use this line, you should replace all “sarge” texts with “etch”.
cdebootstrap -aarm etch etch ftp://ftp.debian.org/debian
Archive the sarge directory we created with the bootstrap
tar cf sarge.tar sarge
Copy this tar file to /mnt/HD_a2 (Update 20 jan 2008, Stefan: The /HD_a2 is not needed because we mounted /Volume_1 in /mnt)
cp sarge.tar /mnt
finalizing installation
note: you don't need to do the following steps using the etch tar from above…
*update by Richard (23rd Dec 07) - yes you do…
# On the host x86 system reboot the DNS-323 using the web interface
# Telnet to the DNS-323 telnet disk
Note We are now logged into the DNS-323
# CD to the hard disk we just copied everything to
cd /mnt/HD_a2
# At this point, you should untar the {sarge,etch}.tar file that you made above
./lnx_bin/busybox3 tar -xf sarge.tar
# Replace sarge.tar with etch.tar above if you built an etch install
# chroot into the partly bootstrapped sarge debian root
./lnx_bin/busybox3 chroot sarge /bin/bash
# At this point you should have a shell in the new debian root
# Fix the broken packages caused by the failed cdebootstrap - above Note - 08 dec 2007 by Chris - I think before proceeding you want to be sure that /proc, /dev, and friends all contain 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.
*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.
cd /var/cache/bootstrap
dpkg --force-all -i libc6*deb
dpkg --force-all -i dpkg*deb
dpkg --force-all -i libc6*deb
# repeat next step several times until no more errors
(if you are using the downloaded sarge package the .deb files are located in ”/var/cache/apt/archives” not in ”/var/cache/bootstrap”!)
dpkg -iGREB .
# 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
customizing
# Edit your /etc/resolv.conf so that the system can find the Debian servers: See this sample
# Edit your /etc/apt/sources.list so that includes some servers. For instance:
deb http://ftp1.ca.debian.org/debian stable main contrib non-free deb http://security.debian.org stable/updates main contrib non-free
# Update packages
apt-get install debian-archive-keyring apt-get update apt-get dist-upgrade
# make root password
passwd root
# Go nuts installing packages
apt-get install gcc apt-get install make apt-get install unzip apt-get install flex bison apt-get install g++
# etc ….
Create a **fun_plug** script
If you would like Debian to automatically begin after it is installed, you will need to add some commands to your startup (fun_plug) script.
Download the Debian Fun Plug Script here
Copy this fun_plug to /mnt we assume you still have the DNS-323 mounted On the DNS-323
cd /mnt/HD_a2 chmod 755 fun_plug
Create a linuxrc script Download the Debian linuxrc Script here
Copy this linuxrc to /mnt (we assume you still have the DNS-323 mounted* On the DNS-323
cd /mnt/HD_a2/sarge chmod 755 linuxrc
# Note: be sure to install both the linuxrc script *and* the fun_plug script before rebooting!
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)
A: Try inserting “env -i” in the chroot command as such: chroot etch env -i /bin/bash