I was working on putting Woody on a Toshiba Satellite T2100CS laptop for a 
while.  It has a 486, but I don't know what speed.  It has 8 MB of ram.  I got 
interrupted but made some progress at it.  I have some tips.

First, test your memory by booting of a memtest86 boot floppy:

http://www.memtest86.com/

Once you have Linux installed you can leave memtest86 as an alternative kernel 
that you can choose with LILO or Grub.

Surprisingly, my circa-1994 Toshiba passes memtest86's tests with no errors. 
They don't build them like they used to.

What you need to do is make a custom minimal kernel and ramdisk, and copy 
Woody's ramdisk image over to your drive and copy the files out onto a 
filesystem that won't be needed for installation (/home will work).  Do all of 
your partitioning and filesystem formatting using your minimal install disk. 
Then boot of your minimal kernel again but use the partition where you copied 
the woody ramdisk image as your root partition.

I tried using a couple of the mini-distros as described in the 4mb laptops HOWTO 
but for various reasons it didn't work for me.  So I decided I would roll my own 
distro for this purpose.  But as I said I'm not done yet, when I am I will write 
up a howto and maybe provide a compact ramdisk image.

http://www.tldp.org/HOWTO/4mb-Laptops.html

also see:

http://www.tldp.org/HOWTO/mini/Small-Memory/index.html


What you will want to do is learn how to make your own ramdisk image, and if you 
haven't already learned how, you will want to build a custom kernel.

You can either make a LILO floppy or a SYSLINUX floppy that boots with the 
kernel parameters for loading a ramdisk image and prompting the user to insert 
the disk with the image on it.  Sorry, I forget the parameters but look in 
/usr/src/linux/Documentation

Start by putting all of the files you will need for a minimal linux installation 
in a subdirectory that has the usual subdirectories that go in / - etc, bin, 
usr, dev and so on.  This will later be copies to the ramdisk image.

Create device files in your ramdisk's dev directory just for the devices you 
will need to use, like the hard disk, console and so on.

Don't create device files you don't need as each one requires an inode in your 
ramdisk's filesystem which I think will take up 1k of ram or so.  On the gnu 
parted ramdisk, I found something like 3 megabytes of device file inodes for all 
manner of raid controllers and network adapters.  That makes the disk more 
flexible but also makes it so it can't boot on a low-mem system.

Probably a good source of information for building ramdisks like this would be

http://www.linuxfromscratch.org/

You will need some shared libraries, especially glibc.  Sometimes people save 
space by using glibc 5 instead of 6.  Alternatively you can use a tool that 
deletes all the subroutines from all your shared libraries that aren't used 
(even indirectly) by any of your programs.  I know there are commercial tools 
for that from embedded linux vendors but I don't know if there is such a Free tool.

The main user programs you will want are mke2fs or the equivalent 
filesystem-makers for the filesystems you will want to lay down, a partitioning 
utility, tar and an ftp client, and mount and of course a shell.  There may be 
other programs you need for your system operation, I think that ld is required 
to do dynamic linking.  I haven't got that far yet.  Oh yeah, you will need 
modutils unless you compile your kernel without module support and build 
everything in, which isn't that bad an idea for this kind of thing.

Consider using busybox:

http://www.busybox.net/

I'm not sure if busybox provides a shell but if it doesn't use one of the 
smaller shells like ash instead of bash.  You might also want a compact text 
editor like nano but this shouldn't be necessary.

You will need support in your kernel for TCP/IP networking and for the ethernet 
adapter you will use, and you will need pcmcia-cs if you are using a PCMCIA 
ethernet adapter.  Alternatively you can set up a PPP server on another linux 
box and use a null modem cable to get everything via PPP, in which case you will 
also need the PPP software.

So when you get your ramdisk filesystem's files in place, use "du" to see how 
big it is in kilobytes.  Then create a file full of zeroes that is somewhat 
larger than that (but not by too much) and use mke2fs to make a filesystem on 
it.  Mount the filesystem image with the loopback driver (you will need loopback 
support in the kernel you're preparing this on) and use tar to copy your 
prepared files into the filesystem image:

cd floppy-tree
du
(tells you how big)
cd ..
dd if=/dev/zero of=image.dat bs=1024 count=a-little-bigger-than-du-said-you-need
mke2fs image.dat
(but read mke2fs' man page - use 1k blocks)
mount -o loop image.dat /mnt
cd floppy-tree
tar cvf - . | ( cd /mnt ; tar xf - )
sync
umount /mnt

now you compress the ramdisk image and dd it to a floppy:

gzip image.dat
ls -l image.dat.gz
(if it's not less than 1440k you have a problem)
dd if=image.dat.gz of=/dev/hd0 bs=10240
sync

Now make a boot floppy with your custom kernel configured with only the support 
for hardware and kernel software you will need for formatting your drive and 
ftp'ing over a couple files.

Boot off the boot floppy, put in your custom ramdisk.  The amount of ram your 
ramdisk will take up will be the size of the image.dat file you created earlier, 
this plus the memory for the kernel should be less than the physical ram in your 
machine.  You will also need some physical ram for your user programs, more than 
you might otherwise because you won't have a swap device.

If it doesn't work, try to make your ramdisk image smaller.  What counts is the 
size of the image.dat file above, rather than the size of the files in it.  Keep 
in mind that each file and directory occupies an inode, and that a symbolic link 
takes up an inode and a filesystem block for the text of the filename it is 
linked to.  I think hard links (ln without the -s option) will take up less 
space in your ramdisk as they only require the space for the filename in their 
directory's inode.

Also try making your kernel smaller.  It doesn't matter whether you gzip or 
bzip2 the kernel, what counts is the size of the running kernel's code and data. 
  But likely you can make the most difference with the least effort by 
customizing your ramdisk.

Now format your hard drive.  Be sure to provide enough swap space, probably 
several times the size of your RAM.  There will be the least wasted space if 
there is only a root filesystem, but to install this way you need at least one 
filesystem that won't be used in the installation, so make a filesystem also 
that will later be used for /home.  Alternatively you can have several 
partitions if you are very careful about planning for your space, perhaps by 
trying a test installation on a faster desktop machine to see how much space 
everything needs.

I like to have /, swap, /tmp, /var, /usr and /home partitions on larger 
machines, mainly to avoid having much filesystem activity in /.  That reduces 
the danger of filesystem corruption, and at some point I'll figure out how to 
work with a read-only root filesystem.

GNU parted is quite versatile in what it will do with disks but it may be larger 
than you want, but give it a try:

http://www.gnu.org/software/parted/

Now mount the partition you will use for /home in /mnt.  FTP the ramdisk image 
from woody's floppy set and put it in /mnt.  If you gunzipped it before you ftp 
it you won't need gunzip on your ramdisk.  Note that you will need to rename the 
ramdisk image before you can gunzip it.

mount the ramdisk image:

mv /mnt/root.bin /mnt/root.gz
gunzip /mnt/root.gz
mkdir /woody-ramdisk
mount -o loop /mnt/root /woody-ramdisk

cd /woody-ramdisk
tar cvf - . | ( cd /mnt ; tar xf - )
sync
cd /
umount /woody-ramdisk
umount /mnt
sync
reboot

(So you'll also want umount, sync and reboot on your ramdisk!)

Boot off your minimal kernel again, but this time use the partition you copied 
woody's ramdisk files to as your root.

Do your install.  But don't use the stock kernel woody provides, either use the 
same kernel as you used for your minimal bootdisk, or make another custom kernel 
for production use that only has what you need.

However, it is important that you build the same version of the kernel as 
woody's installer uses.  That's because the installer will put in a bunch of 
modules that won't load into your kernel if they're not the same version.  You 
can upgrade your kernel and modules together after the install if you want.

I suggest using SYSLINUX to make your boot disk because you can edit the kernel 
parameters with any text editor on Linux, DOS or Windows without having to 
rewrite the whole floppy like you would with a LILO floppy.

http://syslinux.zytor.com/

Also not you can use ISOLINUX to make a boot CD.  If you don't quite know what 
you're doing, you can use SYSLINUX to make a boot CD too, but it's better to use 
ISOLINUX.

I learned much of this making a boot CD for my other laptop, a Compaq Presario 
1800T.  I wanted to resize the partitions using GNU parted, but the parted 
bootdisk wouldn't load my ramdisk floppy because I have an IDE floppy.  I 
haven't found a way to load ramdisk floppies using my floppy drive (which is an 
LS-120 Superdisk, it also takes 100 MB floppies) so I muddled my way through 
creating a boot CD with GNU parted on it.

Mike
-- 
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
[EMAIL PROTECTED]

      Tilting at Windmills for a Better Tomorrow.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to