baslinux AT lists.ibiblio.org
Subject: Baslinux mailing list
List archive
Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression
- From: baslinux AT lists.ibiblio.org
- To: baslinux AT lists.ibiblio.org
- Subject: Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression
- Date: Thu, 25 Oct 2007 22:31:24 +0000 (UTC)
On Thu, 25 Oct 2007, baslinux AT lists.ibiblio.org wrote:
I figured out how to customize BasicLinux 3.5 floppy edition, improve
compression, add some desired packages, and increase space in RAM disk.
Sindi asked how to add ftp client, ftp server and vfat drivers to
BasicLinux floppy and recompress everything. Indeed, she was right,
after using upx we have additonal
space, but I suggest upx 3.0 (with upx 1.x your can not compress
busybox, while upx 2.x had problem with programs linked with libc5).
Even zimage can
be compressed with this version.
Tutorial follows.
Samir
Can you provide a upx 3 compiled for libc5?
I can compile one for BL2 glibc 2.2.5.
#Boot on "big computer" with modern Linux and recent upx (3.01)
I use BL for everything. It is as modern as I want to make it.
installed. I use Debian 4. You need to have installed commands
# fdformat, upx, unzip, lilo, mkfs, mount, umount, wget. Also your
All but upx are in BL3.50 already. I don't see lilo in the loop > ext2 version but it is on the floppy.
computer needs about 30 megabytes free on hard disk,
# floppy drive and prepare two floppy diskettes.
#Go to your home directory, sayMy home directory is /root
mkdir /bl350upx instead
cd /home/sindiWhat is this about?
su
#Create few subdirectories:
mkdir /home/sindi/fdbaslin
mkdir /home/sindi/fdbaslin/rawfloppy1
mkdir /home/sindi/fdbaslin/editingfloppy1
mkdir /home/sindi/fdbaslin/unpackedfloppy2
#Change to:
cd /home/sindi/fdbaslin
#Download Basiclinux floppy edition and place it to /home/sindi/fdbaslin
wget
http://distro.ibiblio.org/pub/linux/distributions/baslinux/bl3-50fd.zip
#Unzip it:
unzip bl3-50fd.zip
#Copy the files you want to add to /home/sindi/fdbaslin
cp /home/any/ftp /home/sindi/fdbaslin
cp /home/any/ftp /home/sindi/fdbaslin
#You should have (for example) files disk1.img, disk2.tgz, ftpd,
ftpd.conf, ftp, ntfs.o and vfat.o in
#the directory /home/sindi/fdbaslin
#First, let us make changes to floppy 2. Let us unpack it
cd /home/sindi/fdbaslin/unpackedfloppy2
gunzip ../disk2.tgz
tar -xvf ../disk2.tar
#Floppy 2 is unpacked. Let us try to upx compress, something
cd usr/bin
# warning no slash before usr!
upx *
cd ..
cd X11/bin
upx *
#Now, we will add modules for ntfs and vfat
mkdir /home/sindi/fdbaslin/unpackedfloppy2/lib/modules/2.2.26/fs
cd /home/sindi/fdbaslin/unpackedfloppy2/lib/modules/2.2.26/fs
cp /home/sindi/fdbaslin/ntfs.o .
cp /home/sindi/fdbaslin/vfat.o .
# You can also delete some files. For example if you do not need links
you can type here
# rm /home/sindi/fdbaslin/usr/bin/lin*
#We have finished with modules, and we can add some application
programs, for example ftp client (by the way, I took it from Slackware 3)
cd /home/sindi/fdbaslin/unpackedfloppy2/usr/bin
cp /home/sindi/fdbaslin/ftp .
# and why not compress it
upx ftp
#So we have finished with modification of the second floppy. Let us
repack it
cd /home/sindi/fdbaslin/unpackedfloppy2
tar -cf ../disk2.tar *
# The tar file is reduced from 2926080 to in this case 2007040 bytes
#Now, gzip it
gzip ../disk2.tar
mv ../disk2.tar.gz ../disk2.tgz
#Hmm, disk2 is now 1375446 bytes, it is less than previous 1405907 even
when we added two drivers and ftp # client.
#We no longer need directory unpackedfloppy2
su
cd /home/sindi/fdbaslin
rm unpackedfloppy2 -r
#Let us create second floppy
fdformat /dev/fd0
mkfs -t vfat /dev/fd0
#Repeat formating until you find prefect floppy, and if it is OK, you
can copy the second disk
I format my DOS disks with DOS. Never tried with linux.
mount /dev/fd0 /mnt/floppyWhat is this about?
cp disk2.tgz /mnt/floppy
umount /dev/fd0
#Congratulations, second floppy is remastered. Eject it.
echo Replace the floppy and press ctrlD
cat
#Now, let us remaster first floppy
This is the tricky one. It might be enough just to redo the second disk to add a few programs and modules after upxing what is there.
#We wish to compress everything and add ftp server.
cd /home/sindi/fdbaslin
mount -o loop disk1.img /home/sindi/fdbaslin/rawfloppy1
cd rawfloppy1
ls
#You will see: boot.b, disk1.gz, map and zimage
#Upx can compress even Linux kernels, and therefore we can gain 50 kilobytes
cp zimage ..
upx ../zimage
mv ../zimage .
#We can try to remaster disk1.gz
cp disk1.gz ..
gunzip ../disk1.gz
#Now we can go inside
mount -o loop ../disk1 /home/sindi/fdbaslin/editingfloppy1
cd /home/sindi/fdbaslin/editingfloppy1
ls
#Oh, now we have access to the most of files. OK, let us upx them
cd /home/sindi/fdbaslin/editingfloppy1/bin
upx busybox
cd ../sbin
upx *
cd ../usr/bin
upx *
#Warning, I do not give warranty that upx-ed programs will work,
#if it fails repeat this step, but compress only desired.
Most of /usr/bin is busybox.
I would probably omit microcom (it won't work at my account and I have only used it to play with when I set up one computer as a terminal via nullmodem cable) and readmail (I don't download mail) eznet ldd file (what is this for?). Do scripts such as wp and pkg compress well?
upx 1.24 produced a upx-ed links-0.95 that appears to work well.
180K instead of 380K. That makes a huge difference. One could add Arena.
234K upx'ed. Do not try to strip a upx'ed file. What else would you add?
#Of course, you can delete some programs you do not want to have on the
first floppy.
#For example, if you do not need microcom
# rm /home/sindi/fdbaslin/editingfloppy1/bin/microcom
How did you guess?
#Now, let us add ftp daemon
cd /home/sindi/fdbaslin/editingfloppy1/sbin
cp /home/sindi/fdbaslin/ftpd .
cd /home/sindi/fdbaslin/editingfloppy1/etc
cp /home/sindi/fdbaslin/ftpd.conf .
#Because we added ftp client in the second floppy we need also to update
services file
echo "ftp 21/tcp" >>services
I already have this in /etc/services in BL2.
I have no BL3 /etc/services. You did not mention needing a services
to run ftp in BL3. If I try, I get ftp: ftp/tcp: unknown service.
Can you set up your ftp.tgz package to also add the above line to services in BL3 (perhaps making 'services' first) and not to add it in BL2 since it is there? Will pkg run doinstall.sh?
I just made a BL3 /etc/services consisting of
ftp 21/tcp
and ftp still is not working in BL3.
I chrooted there, exited, and chrooted back again to test.
Does this ftp work for you in BL3.50?
#Everything is added. And something is deleted. We need to ensure good
compressability. Enter
df
# and see how many available blocks there are in
/home/sindi/fdbaslin/editingfloppy1 mount.
# Say, it is 2411 blocks. We need to create big empty file
dd if=/dev/zero of=/home/sindi/fdbaslin/editingfloppy1/empty bs=1024
count=2411
#Disk is currently full. Now unmount it to flush the empty file
cd /home/sindi/fdbaslin
umount disk1
# Now, we will remount to delete the empty file.
mount -o loop disk1 /home/sindi/fdbaslin/editingfloppy1
cd editingfloppy1
rm empty
df
# The compressed image is free again. But empty sectors are zeroed
ensuring good compression. Now we can unmount it again
cd /home/sindi/fdbaslin
umount disk1
# And compress
gzip disk1
# Compare the sizes
ls disk1.gz -l
ls rawfloppy1/disk1.gz -l
#If the first disk1.gz is smaller than second one, it is excellent!
# Otherwise, you must remaster first floppy from the begining and delete
more files.
# Now, replace the disk1.gz to raw image
cp disk1.gz rawfloppy1
# Finalize modification of the first floppy
umount rawfloppy1
# Insert the diskette and low level format it
fdformat /dev/fd0
# If it has not bad sectors save image to floppy
dd if=disk1.img of=/dev/fd0
# First floppy is created. But, we need to update LILO Linux loader
# because we reordered the files and it needs to know where they are.
# First, we will mount the created floppy
mount /dev/fd0 /home/sindi/fdbaslin/rawfloppy1
# Create the file /home/sindi/fdbaslin/lilo-initrd.conf as follows:
echo boot=/dev/fd0 >/home/sindi/fdbaslin/lilo-initrd.conf
echo install=/home/sindi/fdbaslin/rawfloppy1/boot.b
>>/home/sindi/fdbaslin/lilo-initrd.conf
echo map=/home/sindi/fdbaslin/rawfloppy1/map
>>/home/sindi/fdbaslin/lilo-initrd.conf
echo delay=100 >>/home/sindi/fdbaslin/lilo-initrd.conf
echo compact >>/home/sindi/fdbaslin/lilo-initrd.conf
echo image=/home/sindi/fdbaslin/rawfloppy1/zimage
>>/home/sindi/fdbaslin/lilo-initrd.conf
echo " label=linux" >>/home/sindi/fdbaslin/lilo-initrd.conf
echo " root=/dev/ram0" >>/home/sindi/fdbaslin/lilo-initrd.conf
echo " initrd=/home/sindi/fdbaslin/rawfloppy1/disk1.gz"
>>/home/sindi/fdbaslin/lilo-initrd.conf
# Now, update LILO on the floppy
lilo -C /home/sindi/fdbaslin/lilo-initrd.conf
# Finally unmount the LILO diskette:
umount /dev/fd0
# And, if you wish to keep the image file
cd /home/sindi/fdbaslin
dd if=/dev/fd0 of=disk1.img
# Cleaning up
rm /home/sindi/fdbaslin/rawfloppy1 -r
rm /home/sindi/fdbaslin/editingfloppy1 -r
rm /home/sindi/fdbaslin/unpackedfloppy2 -r
rm /home/sindi/fdbaslin/disk1
rm /home/sindi/fdbaslin/lilo-initrd.conf
# Reboot the computer and try changed BasicLinux
This will be an education. Please post the instructions at your site.
I might just try modifying disk2.tgz first. I understand why Steven did not want to make the 2-floppy version until any bugs were removed (such as dead DNS server numbers).
-----------------------
BasicLinux mailing list
-----------------------
http://www.basiclinux.com.ru
http://www.ibiblio.org/pub/linux/distributions/baslinux/
------------------------------------
To exit, send subject=unsubscribe to
baslinux-request AT lists.ibiblio.org
keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
-
[BL] Remastering BASIC Linux Floppy edition, with UPX compression,
baslinux, 10/25/2007
-
Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression,
baslinux, 10/25/2007
- Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression, baslinux, 10/25/2007
-
Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression,
baslinux, 10/25/2007
- Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression, baslinux, 10/26/2007
-
Re: [BL] Remastering BASIC Linux Floppy edition, with UPX compression,
baslinux, 10/25/2007
Archive powered by MHonArc 2.6.24.