Differences

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

howto:install_debian 2008/04/10 00:21 howto:install_debian 2017/12/04 17:26 current
Line 1: Line 1:
 +**WARNING**: This procedure is horrible.  For a "real" native Debian installation, take a look at http://www.cyrius.com/debian/orion/d-link/dns-323/install.html .
 +
This page described how to get Debian natively running on your This page described how to get Debian natively running on your
DNS-323. DNS-323.
-NOTE: If you follow this procedure, the DNS-323 will no longer run it's+NOTE: If you follow this procedure, the DNS-323 will no longer run its
normal operation.  It will only run debian.  The function can be restored, normal operation.  It will only run debian.  The function can be restored,
details at the end. details at the end.
Line 17: Line 19:
  * A running Debian system   * A running Debian system
  * Fast Internet access (not strictly required, but very helpful)   * Fast Internet access (not strictly required, but very helpful)
-  * Running kermit from http://www.columbia.edu/kermit.  Note that you can use minicom, but you will not be able to transfer kernels to uboot later if you don't have it.+  * Running kermit from http://www.columbia.edu/kermit (On debian just execute apt-get install ckermit and use the command kermit without the path to the executable).  Note that you can use minicom, but you will not be able to transfer kernels to uboot later if you don't have it.
You need a minimal debian image installed on a machine that can act as You need a minimal debian image installed on a machine that can act as
Line 35: Line 37:
i2:~# mkdir dns i2:~# mkdir dns
i2:~# cd dns i2:~# cd dns
-i2:~/dns# cdebootstrap -aarm etch etch ftp://ftp.us.debian.org/debian+i2:~/dns# cdebootstrap -aarm --foreign etch etch ftp://ftp.us.debian.org/debian
P: Retrieving Release.gpg P: Retrieving Release.gpg
P: Retrieving Release P: Retrieving Release
Line 44: Line 46:
. .
P: Extracting util-linux P: Extracting util-linux
-E: Couldn't install system due to errors!''+P: Writing hosts 
 +P: Writing resolv.conf 
 +I: Second stage installer is available as /sbin/cdebootstrap-foreign or /sbin/init
</code> </code>
-The error at the end is normal. Now make some normal devices.+The "--foreign" option tell cdebootstrap to only perform unpacking action of the needed packages. All the operations that need to be executed on the destination machine will be executed after the first booting by executing the "fake" init. 
 + 
 + 
 +Now create the rtc and ttyS0 devices as to prevent some errors
<code> <code>
-i2:~/dns# cd etch/dev +i2:~# cd etch/dev 
-i2:~/dns/etch/dev# /sbin/MAKEDEV generic-arm +i2:~/dns/etch/dev# MAKEDEV rtc 
-i2:~/dns/etch/dev# /sbin/MAKEDEV md+i2:~/dns/etch/dev# mknod ttyS0 c 4 64
</code> </code>
-These following for the flash driver. You really do not want to +Set up fstab: 
-overwrite mtdblock4, since that is uboot, so we make it read-onlyAs + 
-long as you have a serial port and uboot, you can recover the device.+<code> 
 +i2:~/dns/etch/etc# vi fstab 
 +</code> 
 + 
 +Let's use: 
 + 
 +<file> 
 +# <file system> <mount point>          <type> <options>    <dump>  <pass> 
 +#/dev/sda1      none                    swap    sw              0      0 
 +#/dev/sdb1      none                    swap    sw              0      0 
 +proc            /proc                  proc    defaults        0      0 
 +#/dev/md0        /                      ext3    defaults        0      2 
 +</file> 
 + 
 +You can add other stuff later, but that will be enough to get you 
 +goingWe will uncomment these once we get them on the disk. 
 + 
 +And prepare the nfs export
<code> <code>
-i2:~/dns/etch/dev# mknod mtdblock0 b 31 0 
-i2:~/dns/etch/dev# mknod mtdblock1 b 31 1 
-i2:~/dns/etch/dev# mknod mtdblock2 b 31 2 
-i2:~/dns/etch/dev# mknod mtdblock3 b 31 3 
-i2:~/dns/etch/dev# mknod mtdblock4 b 31 4 
-i2:~/dns/etch/dev# chmod 660 mtdblock* 
-i2:~/dns/etch/dev# chmod 440 mtdblock4 
-i2:~/dns/etch# pwd 
-/root/dns/etch 
i2:~/dns/etch# vi /etc/exports i2:~/dns/etch# vi /etc/exports
</code> </code>
Line 101: Line 116:
---------------------------------------------------- ----------------------------------------------------
</code> </code>
 +
 +Note: Before to connect correctly to the nas, i need to execute on the kermit command line these two command, "set flow xon/xoff" and "set stop-bits 1". Personally i prefer minicom as you don't need kermit if you dont'have to upload a binary file, and minicom give me less difficulties than kermit.
Now power the system on, and quickly type the space then "1" keys. Now power the system on, and quickly type the space then "1" keys.
Line 136: Line 153:
<code> <code>
-Marvell>>setenv bootargs root=/dev/nfs nfsroot=192.168.27.126:/root/dns/etch ip=dhcp console=ttyS0,115200 init=/bin/sh+Marvell>>setenv bootargs root=/dev/nfs nfsroot=192.168.27.126:/root/dns/etch ip=dhcp console=ttyS0,115200
Marvell>> bootm FF820000 Marvell>> bootm FF820000
## Booting image at ff820000 ... ## Booting image at ff820000 ...
Line 164: Line 181:
Memory policy: ECC disabled, Data cache writeback Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists Built 1 zonelists
-Kernel command line: root=/dev/nfs nfsroot=192.168.27.126:/root/dns/etch ip=dhcp console=ttyS0,115200 init=/bin/sh+Kernel command line: root=/dev/nfs nfsroot=192.168.27.126:/root/dns/etch ip=dhcp console=ttyS0,115200
. .
. .
Line 178: Line 195:
Looking up port of RPC 100003/2 on 192.168.27.126 Looking up port of RPC 100003/2 on 192.168.27.126
Looking up port of RPC 100005/1 on 192.168.27.126 Looking up port of RPC 100005/1 on 192.168.27.126
-VFS: Mounted root (nfs filesystem). +VFS: Mounted root (nfs filesystem).                                                  
-Freeing init memory: 112K+Freeing init memory: 112K                                                            
 +Adding `local diversion of /sbin/init to /sbin/init.REAL'                             
 +tar: ./postinst: time stamp 2007-01-07 12:14:28 is 212388557.923672 s in the future   
 +tar: ./preinst: time stamp 2007-01-07 12:14:28 is 212388557.863465 s in the future   
 +</code>
-sh-3.1# +If the device is new and you never have set the clock, you will probably have some little problem due to a wrong clock setting. If not, just don't execute the related command. 
 + 
 +Now check frequently in "dns/etch/etc" if the file inittab as been extracted, and as soon as you find it edit the file as follow 
 + 
 +<code> 
 +i2:~/dns/etch/etc# vi inittab
</code> </code>
-Now we are ready to clean up debian.+Find the line that says: 
 +<code> 
 +#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 
 +</code>
 +and turn it into:
<code> <code>
-sh-3.1# cd /var/cache/bootstrap +T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 
-sh-3.1# export PATH +</code>;
-sh-3.1# mount -t proc proc /proc +
-warning: can't open /etc/fstab: No such file or directory +
-sh-3.1# dpkg --force-all -i libc6*deb +
-Selecting previously deselected package libc6. +
-(Reading database ... 0 files and directories currently installed.) +
-Unpacking libc6 (from libc6_2.3.6.ds1-13etch2_arm.deb) ... +
-dpkg: libc6: dependency problems, but configuring anyway as you request: +
- libc6 depends on tzdata; however: +
-  Package tzdata is not installed. +
-Setting up libc6 (2.3.6.ds1-13etch2) ...+
-sh-3.1# dpkg --force-all -i dpkg*deb +Wait until cdebootstrap have terminated it's work. This will take some times.
-Selecting previously deselected package dpkg. +
-dpkg: regarding dpkg_1.13.25_arm.deb containing dpkg, pre-dependency problem: +
- dpkg pre-depends on coreutils (>= 5.93-1) +
-dpkg: warning - ignoring pre-dependency problem ! +
-(Reading database ... 306 files and directories currently installed.) +
-Unpacking dpkg (from dpkg_1.13.25_arm.deb) ... +
-dpkg: dpkg: dependency problems, but configuring anyway as you request: +
- dpkg depends on coreutils (>= 5.93-1); however: +
-  Package coreutils is not installed. +
-Setting up dpkg (1.13.25) ...+
-sh-3.1# dpkg --force-all -i libc6*deb +<code> 
-(Reading database ... 532 files and directories currently installed.) +Removing `local diversion of /sbin/init to /sbin/init.REAL' 
-Preparing to replace libc6 2.3.6.ds1-13etch2 (using libc6_2.3.6.ds1-13etch2_arm.deb) ... +INIT: version 2.86 booting 
-Unpacking replacement libc6 ... +Activating swap...done. 
-dpkg: libc6: dependency problems, but configuring anyway as you request+Setting the system clock.. 
- libc6 depends on tzdata; however+Cleaning up ifupdown.... 
- Package tzdata is not installed+Loading kernel modules...FATAL: Could not load /lib/modules/2.6.12.6-arm1/modules.dep: No such file or directory 
-Setting up libc6 (2.3.6.ds1-13etch2) ...+Loading device-mapper support. 
 +Checking file systems...fsck 1.40-WIP (14-Nov-2006) 
 +done. 
 +Setting kernel variables...done. 
 +Mounting local filesystems...done. 
 +Activating swapfile swap...done. 
 +Setting up networking.... 
 +Configuring network interfaces...done
 +INIT: Entering runlevel:
 +Starting system log daemon: syslogd. 
 +Starting kernel log daemon: klogd. 
 +* Not starting internet superserver: no services enabled
 +Starting periodic command scheduler: crond. 
 + 
 +Debian GNU/Linux 4.0 lynk ttyS0
-sh-3.1# dpkg -iGREB .+lynk login:
</code> </code>
-The above will ask questions and generate a lot of output.  Continue +If you modify "inittab" too late you will not find the login prompt, and you'll have to repeat the boot process. Only the boot process using the same method as before, getting the u-boot prompt and setting the bootargs variable.
-re-running this command until you don't get any errors. It will tell +
-you at the end of the run if there were errors.  It took 4 times for +
-me to get this to be 100% clean.+
-It gave an error at the end about /var/mail already existing.  I had +When you get the login prompt login as "root", and first of all set the clock to an acceptable date.
-to 'rm /var/mail' after the 3rd time to get it to run clean.+
<code> <code>
-sh-3.1# cd /etc +192:~# date --set 2008-10-17
-sh-3.1# vi inittab+
</code> </code>
-Find the line that says:+Create the remaining needed devices
<code> <code>
-#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100+192:~# cd /dev 
 +192:/dev# MAKEDEV generic-arm 
 +192:/dev# MAKEDEV md
</code> </code>
-and turn it into:+These following for the flash driver.  You really do not want to 
 +overwrite mtdblock4, since that is uboot, so we make it read-only.  As 
 +long as you have a serial port and uboot, you can recover the device.
<code> <code>
-T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100+192:/dev# mknod mtdblock0 b 31 0 
 +192:/dev# mknod mtdblock1 b 31 1 
 +192:/dev# mknod mtdblock2 b 31 2 
 +192:/dev# mknod mtdblock3 b 31 3 
 +192:/dev# mknod mtdblock4 b 31 4 
 +192:/dev# chmod 660 mtdblock* 
 +192:/dev# chmod 440 mtdblock4
</code> </code>
Line 253: Line 282:
<code> <code>
-sh-3.1# cd /root/ +192:# cd /root/ 
-sh-3.1# mkdir oldmtd +192:# mkdir oldmtd 
-sh-3.1# cd oldmtd/ +192:# cd oldmtd/ 
-sh-3.1# dd if=/dev/mtdblock0 of=mtd0+192# dd if=/dev/mtdblock0 of=mtd0
128+0 records in 128+0 records in
128+0 records out 128+0 records out
65536 bytes (66 kB) copied, 0.076184 seconds, 860 kB/s 65536 bytes (66 kB) copied, 0.076184 seconds, 860 kB/s
-sh-3.1# dd if=/dev/mtdblock1 of=mtd1+192:# dd if=/dev/mtdblock1 of=mtd1
128+0 records in 128+0 records in
128+0 records out 128+0 records out
65536 bytes (66 kB) copied, 0.076254 seconds, 859 kB/s 65536 bytes (66 kB) copied, 0.076254 seconds, 859 kB/s
-sh-3.1# dd if=/dev/mtdblock2 of=mtd2+192:# dd if=/dev/mtdblock2 of=mtd2
3072+0 records in 3072+0 records in
3072+0 records out 3072+0 records out
1572864 bytes (1.6 MB) copied, 1.71174 seconds, 919 kB/s 1572864 bytes (1.6 MB) copied, 1.71174 seconds, 919 kB/s
-sh-3.1# dd if=/dev/mtdblock3 of=mtd3+192:# dd if=/dev/mtdblock3 of=mtd3
12672+0 records in 12672+0 records in
12672+0 records out 12672+0 records out
6488064 bytes (6.5 MB) copied, 6.89164 seconds, 941 kB/s 6488064 bytes (6.5 MB) copied, 6.89164 seconds, 941 kB/s
-sh-3.1# dd if=/dev/mtdblock4 of=mtd4+192:# dd if=/dev/mtdblock4 of=mtd4
384+0 records in 384+0 records in
384+0 records out 384+0 records out
Line 284: Line 313:
<code> <code>
-sh-3.1# cd .. +192:# cd .. 
-sh-3.1# dd if=oldmtd/mtd3 of=olddnsfs.gz bs=64 skip=1+192:# dd if=oldmtd/mtd3 of=olddnsfs.gz bs=64 skip=1
101375+0 records in 101375+0 records in
101375+0 records out 101375+0 records out
6488000 bytes (6.5 MB) copied, 6.6507 seconds, 976 kB/s 6488000 bytes (6.5 MB) copied, 6.6507 seconds, 976 kB/s
-sh-3.1# gzip -d olddnsfs.gz+192:# gzip -d olddnsfs.gz
gzip: olddnsfs.gz: decompression OK, trailing garbage ignored gzip: olddnsfs.gz: decompression OK, trailing garbage ignored
-sh-3.1# mount -o loop olddnsfs /mnt/+192:# mount -o loop olddnsfs /mnt/
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
-sh-3.1# mkdir dns323-oldfs +192:# mkdir dns323-oldfs 
-sh-3.1# cp -a /mnt/* dns323-oldfs/ +192:# cp -a /mnt/* dns323-oldfs/ 
-</code> +192:# umount /mnt
- +
-Now reboot.  Remember, press space then "1" to stop at uboot.  We will +
-now boot with the standard init. +
- +
-<code> +
-sh-3.1# sync +
-sh-3.1# reboot -f +
-+
-+
-+
-Marvell>> setenv bootargs root=/dev/nfs nfsroot=192.168.27.126:/root/dns/etch ip=dhcp console=ttyS0,115200 +
-Marvell>> bootm FF820000 +
-## Booting image at ff820000 ... +
-</code> +
- +
-You should eventually get to the following: +
- +
-<code> +
-Debian GNU/Linux 4.0 192.168.27.54 ttyS0 +
- +
-192.168.27.54 login: +
-</code> +
- +
-Now log in as "root" +
- +
-<code> +
-192.168.27.54 login: root +
-Linux 192.168.27.54 2.6.12.6-arm1 #4 Sat Sep 8 01:23:18 CDT 2007 armv5tejl +
- +
-The programs included with the Debian GNU/Linux system are free software; +
-the exact distribution terms for each program are described in the +
-individual files in /usr/share/doc/*/copyright. +
- +
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +
-permitted by applicable law.+
</code> </code>
Line 376: Line 370:
<code> <code>
-192:/etc# cd /etc+192:/# cd /etc
192:/etc# vi rc.local 192:/etc# vi rc.local
</code> </code>
Line 397: Line 391:
</code> </code>
-Now set up fstab: 
- 
-<code> 
-192:/etc# vi fstab 
-</code> 
- 
-Let's use: 
- 
-<file> 
-# <file system> <mount point>          <type>  <options>    <dump>  <pass> 
-#/dev/sda1      none                    swap    sw              0      0 
-#/dev/sdb1      none                    swap    sw              0      0 
-proc            /proc                  proc    defaults        0      0 
-#/dev/md0        /                      ext3    defaults        0      2 
-</file> 
- 
-You can add other stuff later, but that will be enough to get you 
-going.  We will uncomment these once we get them on the disk. 
Now lets create some things on the disk.  I'll demo creating a / Now lets create some things on the disk.  I'll demo creating a /
Line 581: Line 557:
192:/initrd# cp /lib/ld-linux.so.2 lib 192:/initrd# cp /lib/ld-linux.so.2 lib
192:/initrd# cp /lib/libc.so.6 lib/ 192:/initrd# cp /lib/libc.so.6 lib/
 +192:/initrd# cp /lib/libgcc_s.so.1 lib/
192:/initrd# cp /lib/libcrypt.so.1 lib 192:/initrd# cp /lib/libcrypt.so.1 lib
192:/initrd# cp /lib/libm.so.6 lib 192:/initrd# cp /lib/libm.so.6 lib
Line 721: Line 698:
<code> <code>
-192:/etc# umount /mnt +192:/# umount /mnt 
-192:/etc# mount /dev/md0 /mnt+192:/# cd /mnt 
 +192:/mnt# mkdir hd_root nfs_root 
 +192:/mnt# mount /dev/md0 hd_root
kjournald starting.  Commit interval 5 seconds kjournald starting.  Commit interval 5 seconds
EXT3 FS on md0, internal journal EXT3 FS on md0, internal journal
EXT3-fs: mounted filesystem with ordered data mode. EXT3-fs: mounted filesystem with ordered data mode.
-192:/etc# cp -a /bin /boot /dev /etc /home /initrd /lib /media /opt /root /sbin /srv/ /usr /var /mnt +192:/mnt# mount -o bind / nfs_root 
-192:/etc# mkdir /mnt/mnt /mnt/proc /mnt/sys /mnt/tmp +192:/mnt# cp -a nfs_root/* hd_root 
-192:/etc# chmod 777 /mnt/tmp +192:/mnt# mkdir hd_root/old_root
-192:/etc# chmod +t /mnt/tmp +
-192:/etc# mkdir /mnt/old_root+
</code> </code>
Line 736: Line 713:
<code> <code>
-192:/etc# vi /mnt/etc/fstab+192:/mnt# vi hd_root/etc/fstab
</code> </code>
Line 744: Line 721:
<code> <code>
-192:/etc# vi /mnt/etc/network/interfaces+192:/mnt# vi hd_root/etc/network/interfaces
</code> </code>
Line 752: Line 729:
<code> <code>
-192:/etc# cd /root+192:/mnt# cd /root
192:~# ./make_uinitrd 192:~# ./make_uinitrd
1024+0 records in 1024+0 records in
Line 787: Line 764:
<code> <code>
192:~# dd if=/root/initrd.uImage of=/dev/mtdblock3 192:~# dd if=/root/initrd.uImage of=/dev/mtdblock3
-192:~# umount /mnt 
192:~# reboot 192:~# reboot
</code> </code>
Line 800: Line 776:
A few other things you might want to do: A few other things you might want to do:
- 
-Makes the hwclock work right: 
-<code> 
-server:~/dns323-oldfs# cd /dev 
-server:/dev# MAKEDEV rtc 
-</code> 
Provide access to the temperature sensor: Provide access to the temperature sensor:

Navigation

Personal Tools