LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   HOWTO - Install Slackware14 in 32MB memory with no CD or netboot (http://www.linuxquestions.org/questions/slackware-14/howto-install-slackware14-in-32mb-memory-with-no-cd-or-netboot-4175418129/)

OldHolborn 07-22-2012 04:19 PM

HOWTO - Install Slackware14 in 32MB memory with no CD or netboot
 
OK, so you want to install slackware on that old machine, but...

a) it's so old that it doesn't support booting from CD (it doesn't even have USB so scratch that idea too!) ***Try isolinux/sbootmgr***
b) in the case of my old laptop I can have either the floppy drive OR the cddrive plugged in but not both and it won't boot from cd (it also doesn't like my homeburnt cds)
c) doesn't do network boot
d) it has only 32MB of memory

Fear not!

Now we know slackware13.37 can "run" on as little as 20MB of memory, if we can just get it installed!

Note - This is all being done on Current as of 20120721, kernel 3.2.23

What to do?

1) Cheat! Move the hard drive to a newer machine and install, build a minimal kernel and then put it back into the old machine.
2) Be patient, very patient... start with an old version say 11.0 and install using the floppies from that, building a small kernel at each step before upgrading to the next version (I tried this - it took about 3 weeks to get to 13.37)
3)Think different!

Grab Virtualbox, it will save a lot of pain! Create 2 new machines, one for building your kernel, one for testing your install

On your test "box"

With the huge.s kernel we can install with 128MB (hugesmp still barfed with this amount) and run once installed with 40MB.

If you see
hrtimer: interrupt took XXXXXXXns
The kernel is worried that it's taking too long to respond to hardware events
It's generally because we are getting too close to the limit!

Look at the output of free
Mem: 25376

That means the kernel itself is using up 14MB of memory, I know from another machine that with a tailored kernel this can go down to about 4 !

****************************************************************

Once we we have a kernel we can run with we can then look at working on the install so...

We need a kernel that boots in as little memory as possible!
cd /usr/src/linux
mv .config .config_slackware
menuconfig

[General setup]
Local version
Optimize for size

[Processor type and features]
SMP off
386
Generic off
High memory off
Math Emulation on
Timer 100Hz

[Power management and ACPI options]
APM on

[Bus options (PCI etc)]
ISA on

[Networking support]
[Networking options]
ipv6 off
netfilter off
RF switch subsystem support off

[Device drivers]
raid & lvm off
Macintosh off
[Network device support]
[Ethernet driver support]
select your card, clear the others
FDDI off
Wireless LAN off *****
sound off
USB off
[X86 platform specific]
Eee PC off


[File systems]
ext2 & ext3 on
fuse on

[Kernel hacking]
Testcase for NX off

[Security options]
selinux off

*****
After switching Wireless LAN off go back and
[Networking support]
Wireless off

build and copy it over to your test box and boot

free: 34572
a big increase - but look at the increase in free/cache, lots more available!

ok, let's drop the available memory again!

Booting in 26Meg! ok, now we are getting somewhere - that old box is starting to look usable!


*******************************************************************

Let's get started on the installer :)

Make a copy in a new tree of isolinux, kernels and slackware, this will be your install set

Using the instructions in /isolinux check that you can create a working, booting cd/dvd, yet another Virtualbox... (128MB memory)

On our real box, cdrom is not bootable but our goal at this stage is an easy way of making sure it all works before we move to floppies/network installs

ok so far?

Right, start hacking away at your discsets, byebye emacs, kde*, x*, everything except a,n and l* (at time of writing, 20120721 we need zlib from l (reported), nothing else) as much to speed up testing as anything at this point... but we'll be putting this on an old machine and old machines have small hard disks, think MB not GB...

in kernels create a new folder for your fresh kernel, edit isolinux.cfg and add it

build another dvd, test your new kernel (128MB but 96 now works too :))

Look at top... 60MB used, that's the ramdisk that our rootfs is loaded into, remember that ramdisk=1 in isolinux.cfg? If we can get rid of that...

But first - once we have installed it, it will use the stock kernels so we need to replace the stock kernels in discset a with our shrunken one.
use the package scripts in source/k/packageing-x86

replace the stock kernels & modules in a with your new ones, remember to change tagfile to reflect the new names

rebuild your cd/dvd and test it again, all the way through. you should now be booting the dvd with your new kernel and finishing the install with your new kernel all neatly installed

Before we break out the floppies we have one more thing to do. Bzip2 uses a lot more memory to decompress than gzip, so let's change all those packages to tgz. From the man page xz looks to use even more.


for I in *txz; do unxz $I; done

for I in *tar ; do A=`echo $I | sed 's/.tar$/.tgz/'` ; gzip $I -c > $A ; done

rm *.tar

make another disc and test again!

**********************************************************************

OK, time to break out the floppies! you need 4 and your Slackware 11.0 cd1

Why slack11? It has the last of the kernels that fitted on a floppy (2.4 series kernel)

bare.i, install.1, install.2, network.dsk

When fdisking your drive, also create a 60MB ish partition BUT DO NOT USE IT (yet) (remember in the olden days, it was hda not sda)

Install via nfs slack 11.0 discsets a,n

All installed and happy? Reboot into your fresh Slack11 install

NFS mount your Slack14 install set (the one we kept testing on the cd)

ext2 format that 60MB partition, mount it under /test

don't go into it yet, we need to unzip the initrd.img from the cd

zcat /MYNFSMOUNT/MYSLACK/isolinux/initrd.img > myrootdisk

cd /test

cpio -iv < /root/myrootdisk

you should now have something that looks a lot like your root directory, it is! Instead of loading it into a ramdisk and using lots of our very precious memory we'll use it as a normal root partition

We are nearly there :)

copy in that kernel, system.map and config we tested so much.

Now, so that lilo can find it both before and after boot we need to be a bit sneaky

from within /test mkdir test

cd into /test/test and

ln -s ../vmlinuz vmlinuz

now edit lilo.conf, add a new section to point to your new root, using its hda partition number and /test/vmlinuz

if you have don't already, add timeout = 50 near the top

lilo !

ok?

reboot!

as soon as the lilo prompt comes up select your new kernel and hit TAB not enter, we need to change the parameters a bit.

boot: Linux-3.2.23 root=/dev/sda3 rw

NOTE both sda (not hda) and rw (normally we want root partions mounted ro but not this time)

Ready??? ok

<enter>

:)

*********************************************************************

You may want to repartion to get rid of the old dos partion compatability, that's fine, just delete the partitions around your temporary root and recreate - fdisk will will allow for your not deleted partion, run partprobe to update the partion table. after installing Slack14 you can delete this partiton and reuse it.

With only 32Meg of memory you will definitely need some swap space, don't go too mad though - keeping track of swapspace uses memory so keep it about to 64MB, max 128MB

Enjoy

mrclisdue 07-22-2012 05:08 PM

Impressive! There's renewed hope that I can eventually install slack on a potato or Queen Elisabeth I's pocket watch.

cheers,

OldHolborn 07-27-2012 06:04 PM

Update

That potato is getting closer...

Now doing the install in 20MB :)

A lot of kernel choppery - but still with
NFS client,
choice of ext2 or ext3,
can read CDs and DVDs,
fat and fat32 support

Only error message on booting the installer is it complaining about not being able to start the device mapper - not planning on using lvm though!

Seem to be running into a wall at 19/20MB setup space for the kernel (reports 15 on building), after booting it uses a lot less space, but it needs that 19/20 just to boot.

Need to chop a lot more - I'm aiming for a 16MB install

Any hints, tips, links etc are very welcome

wildwizard 07-27-2012 07:32 PM

Quote:

Originally Posted by OldHolborn (Post 4739701)
Any hints, tips, links etc are very welcome

I did some testing a while back without tweaking anything and it required about 80MB (My memory is a bit rusty on the exact amount)

The fact you got it working without issue on 32MB is bloody impressive.

I don't know if your attempt to push it into 16MB is either determination or insanity but good luck.

OldHolborn 07-28-2012 04:30 AM

1 Attachment(s)
Determined insanity :D

The kernel is also now small enough to fit on a floppy, potentially bringing back the possibility of a pure floppy install.

14MB of the 47MB unpacked initrd.img being modules means a lot can be chopped out there, so kernel+ramdisk should fit easily in 64MB memory even without chopping busybox etc.

Have attached the .config for the 20MB installer kernel as a starting point for anyone wanting to have a go/review/tweak etc

OldHolborn 07-29-2012 05:24 AM

Single floppy install in 26MB memory
 
1 Attachment(s)
*Single floppy install in 26MB memory*

In short, boot your kernel from floppy and NFS mount initrd.img as your root partition

We'll strip down a kernel to the barest minimum so that it fits on a floppy.
It contains drivers for harddisk, network card and enough of a network stack
to boot the machine as a diskless station and not much else.
Use that to boot the machine, loading over the network the unpacked initrd as
the root partion.
From there the installer runs as normal, installing your discsets with
the exception of the kernel packages in (a) which will be replaced as they
are too big to boot in so little memory.

Attached is the .config (config2.txt) for the boot kernel, the main changes
from the one previously posted is the switching back on of DHCP and NFS root
code, a change of network card and the addition of a kernel command line,
this you *will* need to edit to point at your NFS root.

An explanation of the kernel command line can be found in
/usr/src/linux/Documentation/filesystems/nfs/nfsroot.txt

Insert your floppy and
/usr/src/linux# make bzdisk

This is your boot floppy

*****

Setting up of the NFS server.

create a empty file 100MB in size
dd if=/dev/zero of=slack_install_root_file bs=512k, count=200

mount it loopback (this makes the file look like a partition)
losetup /dev/loop0 slack_install_root_file

format that "partition"
mkfs.ext2 /dev/loop0

make your mount point (this we will export later)
mkdir /slack_install_root

and mount our new partition there
mount /dev/loop0 /slack_install_root

unzip initrd.img from /isolinux on the cd
zcat initrd.img > myrootdsk

extract that into our newly mounted partition
cd /slack_install_root
cpio -iv < myrootdsk

To export this via NFS add to /etc/exports
/slack_install_root 192.168.0.0/255.255.255.0(rw,no_root_squash)

and to your /etc/hosts.allow
portmap: 192.168.0.0/255.255.255.0
mountd: 192.168.0.0/255.255.255.0

and start/restart your NFS server
/etc/rc.d/rc.nfsd start

*****

DHCP - on booting the floppy assign it an IP number so that it can talk NFS

read AlienBob's PXE howto, it gives a good description of what we are doing
with the exception that we skip the tftp part*

A *very* minimal dhcpd.config, replace 0A:1B etc with your MAC address

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.96 192.168.0.111;
}

host pxetest {
hardware ethernet 0A:1B:2C:3D:4E:5F;
fixed-address 192.168.0.97;
}

then start the dhcp server
dhcpd -4 eth0 &

and that's it! Good to go, boot your floppy now

*****

You'll still want a better, slim but more functional, kernel as part of the
normal install, follow the steps in the first post for replacing the discset
kernel

Notes
If you are doing this several times, give the installer a clean workspace
each time - on the NFS server -
cd /slack_install_root && rm * -r (careful now!!!)
cpio -iv < myrootdsk

*There are other ways of doing this, for example using a pxe boot floppy from
etherboot.org and loading the kernel by tftp. It also works but memory use
balloned, suspect I was loading it into a ramdisk. The deciders for doing it
this way were
a) everything needed this way is already part of slackware
b) where the heck does in.tftpd do its logging???

ljones0 03-24-2014 06:01 PM

Intresting :-) and I managed to run sw14 in 32mb with about 5mb free. Trying to get it to run as well from usb. That seems to be working (just...!) but there is just one problem.

What kernel options should I choose for IDE (pata) hard drive detection? Can't get the kernel to see any IDE hard drives at all!

EDIT: May have this all working, some files here.

ljones

jefro 03-24-2014 08:31 PM

I'd have made a gpxe/ipxe boot floppy but there is always more than one way to crack a nut.

Makes me remember ZipSlack installs in UMSDOS.


All times are GMT -5. The time now is 05:36 AM.