Thursday, February 17, 2005

 

Trimming down Woody

During install:
  1. rm -r /target/tmp/* after kernel and modules install, before installing base
  2. cd /target/var/cache/apt/packages; rm * after packages are installed (be sure to do it on proper time)
I got debian woody down to 62 MB by:
  1. only installed the base system, didn't run tasksel
  2. 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),
  3. apt-get install localepurge; localepurge
  4. apt-get clean
  5. apt-get --purge remove man.* dhcp-client groff-base ipchains nano ppp.* tasksel base-config modconf
  6. rm -r /usr/share/{doc*,man*,info,locale} /usr/doc /usr/lib/gconv # remove docs etc
  7. using syslog to log to a remote host (alternative: use agressive log removal strategy)
  8. building a custom static kernel (no modules, /lib/modules was a whopping 12 MB)
Other things to consider:
  1. strip all binaries
What I did to setup and secure the box after install:
  1. echo -e 'map! jj \033' > /root/.exrc # make vi more carpal-friendly
  2. firewall: transfered the firewall scripts from another box
  3. 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)
  4. apt-get install wget ssh sudo
  5. DNS serving: compiled ucspi-tcp, daemontools, djbdns and zonenotify in another box and installed these, also compiled and installed dnsmasq from testing.
  6. 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.
  1. download Computer Setup/VP and PC Diagnostics from http://h18007.www1.hp.com/support/files/Deskpro/us/locate/4_71.html
  2. create the required disks in DOS or Windows
  3. set the password jumper on the motherboard to enabled position.
  4. enter BIOS setup with the disks just created (note that you only need disks #2 and #3)
  5. choose Security Management
  6. enable Power-on Password and then enable Network server mode
  7. now you can remove the keyboard
Note that you have to enter the password to enable the keyboard. There will generally be no password prompt, just type the letters in and press [enter], if you get it right you'll be able to use the keyboard again.
 

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.
  1. fdisk /dev/hdc and create a throw-away Linux partition (say, 100MB), don't forget to make the partition active
  2. mke2fs /dev/hdc1
  3. mount /dev/hdc1 /mnt
  4. cd /mnt
  5. 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}
  6. for grub:
    1. grub-install --root-directory=/mnt /dev/hdc
    2. echo "(hd0) /dev/hdc" > /mnt/boot/grub/device.map
    3. echo "title Woody install
      root (hd0,0)
      kernel /linux.bin
      initrd /root.bin
      boot" > /mnt/boot/grub/menu.lst
    4. grub-install --root-directory=/mnt /dev/hdc # reinstall grub with right settings
    5. 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).
  7. for lilo:
    1. cp /boot/{map,boot.b} /mnt/boot/
    2. 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
    3. lilo -C /mnt/boot/lilo.conf
  8. put hdb into a new box (as hda), Debian stable install will start upon boot
  9. note that you can safely erase/remove the partition that contains the boot files
Good luck, and leave me comments.

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:
  1. 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}
  2. 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
  3. 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
  4. Debian setup will start
Leave me comments and remember -- use the instructions at your own risk.

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:
  1. apt-get install foomatic-bin foomatic-filters cupsys alien dpkg-dev
  2. apt-get source gs-afpl (valid for gs-afpl-8.14, 8.15 should Just Work(TM) )
  3. cd gs-afpl-8.14/src
  4. wget -o `mktemp` -O - http://voxel.dl.sourceforge.net/sourceforge/epsonepl/ghostscript-8.00-ijs-ht.patch | patch
  5. cd ..; dpkg-make
  6. cd ..; dpkg -i gs-afpl_8.14-3_i386.deb
  7. dpkg-reconfigure foomatic-filters, choose gs_afpl
  8. wget http://voxel.dl.sourceforge.net/sourceforge/epsonepl/epsoneplijs-0.4.0-1.fc2.i386.rpm
  9. alien epsoneplijs-0.4.0-1.fc2.i386.rpm
  10. dpkg -i epsoneplijs_0.4.0-2_i386.deb
  11. if you want, you can save epsoneplijs_0.4.0-2_i386.deb and gs-afpl_8.14-3_i386.deb for later use

This page is powered by Blogger. Isn't yours?