Thursday, February 17, 2005
Trimming down Woody
During install:
- rm -r /target/tmp/* after kernel and modules install, before installing base
- cd /target/var/cache/apt/packages; rm * after packages are installed (be sure to do it on proper time)
- only installed the base system, didn't run tasksel
- only listing main and no source packages in apt.sources (every package repository wastes a lot of disk space, alternatively you can turn off package caches in /etc/apt.conf),
- apt-get install localepurge; localepurge
- apt-get clean
- apt-get --purge remove man.* dhcp-client groff-base ipchains nano ppp.* tasksel base-config modconf
- rm -r /usr/share/{doc*,man*,info,locale} /usr/doc /usr/lib/gconv # remove docs etc
- using syslog to log to a remote host (alternative: use agressive log removal strategy)
- building a custom static kernel (no modules, /lib/modules was a whopping 12 MB)
- strip all binaries
- echo -e 'map! jj \033' > /root/.exrc # make vi more carpal-friendly
- firewall: transfered the firewall scripts from another box
- disabled inetd (you can't remove it as net-base depends on it):
$ update-rc.d inetd stop 20 2 3 4 5 .
(and edit /etc/inetd.conf to be sure everything is OK when it is accidenally started) - apt-get install wget ssh sudo
- DNS serving: compiled ucspi-tcp, daemontools, djbdns and zonenotify in another box and installed these, also compiled and installed dnsmasq from testing.
- disable root login via ssh and create a sudo user with all privileges, avoid su from now on
Using Compaq Deskpro DP2000 6233MMX as a router
To enable keyboardless operation, you have to enable server mode in the BIOS.
- download Computer Setup/VP and PC Diagnostics from http://h18007.www1.hp.com/support/files/Deskpro/us/locate/4_71.html
- create the required disks in DOS or Windows
- set the password jumper on the motherboard to enabled position.
- enter BIOS setup with the disks just created (note that you only need disks #2 and #3)
- choose Security Management
- enable Power-on Password and then enable Network server mode
- now you can remove the keyboard
Installing Debian on a secondary hard disk
The recommended way of installing Debian from an already running system is debootstrap (that I personally use most of the time). FAI is also a good option. However, if you need a quick way to launch full setup from a blank drive and you have a running Linux system, the following steps are the way to go:
Assumptions: /dev/hdc is the empty drive.
Assumptions: /dev/hdc is the empty drive.
- fdisk /dev/hdc and create a throw-away Linux partition (say, 100MB), don't forget to make the partition active
- mke2fs /dev/hdc1
- mount /dev/hdc1 /mnt
- cd /mnt
- copy the kernel and inital ram disk from a Debian archive:
wget ftp://ftp.ee.debian.org/debian/dists/stable/main/disks-i386/current/{bf2.4/linux.bin,images-1.44/bf2.4/root.bin} - for grub:
- grub-install --root-directory=/mnt /dev/hdc
- echo "(hd0) /dev/hdc" > /mnt/boot/grub/device.map
- echo "title Woody install
root (hd0,0)
kernel /linux.bin
initrd /root.bin
boot" > /mnt/boot/grub/menu.lst - grub-install --root-directory=/mnt /dev/hdc # reinstall grub with right settings
- if grub fails, but you get the grub shell at boot time, enter the lines from step 6.3. manually from grub shell (you don't obviously need title).
- for lilo:
- cp /boot/{map,boot.b} /mnt/boot/
- echo "
disk=/dev/hdc bios=0x80
boot=/dev/hdc
map=/mnt/boot/map
install=/mnt/boot/boot.b
image=/mnt/linux.bin
label=woodysetup
initrd=/mnt/root.bin
" > /mnt/boot/lilo.conf - lilo -C /mnt/boot/lilo.conf
- put hdb into a new box (as hda), Debian stable install will start upon boot
- note that you can safely erase/remove the partition that contains the boot files
Friday, February 11, 2005
Migration from OpenBSD to Linux
I had an old OpenBSD 3.4 box lying around, but as it had only a 150 MB hard disk, it was quite useless. I needed to build a firewall and as Debian woody fits nicely in that space, I migrated the box to Debian.
My setup:
wd0 - a 150 MB disk
wd0a - the 150 MB OpenBSD partition
Here's how:
My setup:
wd0 - a 150 MB disk
wd0a - the 150 MB OpenBSD partition
Here's how:
- get the linux kernel and Debian setup initial ramdisk images:
$ mkdir /lin; cd /lin
$ wget ftp://ftp.ee.debian.org/debian/dists/stable/main/disks-i386/current/{bf2.4/linux.bin,images-1.44/bf2.4/root.bin} - install grub into the boot block of the hard disk (THIS WILL DESTROY THE OPENBSD BOOTLOADER AND MAY RENDER YOUR DISK UNBOOTABLE):
cd /tmp
wget ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/grub-*
tar jxf grub-*
mv share/grub/i386-freebsd/ /grub
dd if=/grub/stage1 of=/dev/wd0 bs=512 count=1
dd if=/grub/stage2 of=/dev/wd0 bs=512 skip=1 - reboot, you will land into the grub shell,
grub> root (hd0,1,a)
grub> kernel /lin/linux.bin
grub> initrd /lin/root.bin
grub> boot - Debian setup will start
Tuesday, February 08, 2005
How to get an Epson EPL-5900L working in Debian
No plug'n'play here. Neither gs-gpl nor gs-esp work. You have to patch and use gs-afpl from non-free. gs-gpl v. 8.15 should work when it is released.
Here's the general routine:
Here's the general routine:
- apt-get install foomatic-bin foomatic-filters cupsys alien dpkg-dev
- apt-get source gs-afpl (valid for gs-afpl-8.14, 8.15 should Just Work(TM) )
- cd gs-afpl-8.14/src
- wget -o `mktemp` -O - http://voxel.dl.sourceforge.net/sourceforge/epsonepl/ghostscript-8.00-ijs-ht.patch | patch
- cd ..; dpkg-make
- cd ..; dpkg -i gs-afpl_8.14-3_i386.deb
- dpkg-reconfigure foomatic-filters, choose gs_afpl
wget http://voxel.dl.sourceforge.net/sourceforge/epsonepl/epsoneplijs-0.4.0-1.fc2.i386.rpm - alien epsoneplijs-0.4.0-1.fc2.i386.rpm
- dpkg -i epsoneplijs_0.4.0-2_i386.deb
- if you want, you can save epsoneplijs_0.4.0-2_i386.deb and gs-afpl_8.14-3_i386.deb for later use