Bug#464938: d-i on i386 with 16 MiB RAM (using swap)

2008-02-10 Thread trosos
Using bzip2 doesn't save RAM, but it saves space on the root floppy.
(If you add all three ide modules on it, you would normally (using gzip)
end up with image bigger than 1.44 MB).

Therefore I suggest to compress initrd on the root floppy with bzip2,
which claims for using a bzip2 decompressor on the boot floppy,
insted of the gzip one.


Best regards,
Tomas Tintera

  Original message 
 From: Joey Hess [EMAIL PROTECTED]
 Date: 10.2.2008 03:20:01

 Tomas Tintera wrote:
  1. We need
   ide/ide-core.ko,
   ide/ide-disk.ko and
   ide/ide-generic.ko
  modules on 2nd (root) floppy (in initrd) in order to get
  HDDs work. The space for it can be made by bzipping 2nd
  floppy's initrd instead of gzipping it. Also the following
  lines must be added to modules.dep in initrd on the 2nd
  floppy:
 
 This, and adding a swapon option make sense (in the limited situations
 where the system can be preconfigured with a swap partition).
 
  2. We need to use a bzip2 decompressor on 1st (boot) floppy
  instead of zcat. We can use micro-bunzip
  (http://www.landley.net/code/micro-bunzip.c (version 3.0,
  which is smaller than 4.1)), with the patch in
  the attachment, statically linked with klibc.
 
 You lost me here. How does using bzip2 save memory? The floppy image
 is decompressed into a ramdisk.



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



Bug#464938: d-i on i386 with 16 MiB RAM (using swap)

2008-02-09 Thread Tomas Tintera
Sorry, the init.diff in the report was corrupt, sending right version.


Tomas Tintera

--- smazat/init	2008-02-09 19:45:04.0 +0100
+++ a/init	2008-02-09 20:31:20.0 +0100
@@ -209,14 +209,14 @@
 
 	echo -n Loading..
 	# pipe_progress adds dots to the above line while there is
-	# activity. But we must be sure to catch errors from the zcat.
+	# activity. But we must be sure to catch errors from the micro-bunzip.
 	# Hard to do in a pipeline..
-	echo 0  /tmp/zcat_failure
+	echo 0  /tmp/bunzip_failure
 	cd mnt
-	(zcat ../floppy/initrd.gz || echo 1  /tmp/zcat_failure ) | cpio -i -V || abort failed to extract initrd (may be out of space on ram disk)
+	(micro-bunzip ../floppy/initrd.bz2 || echo 1  /tmp/bunzip_failure ) | cpio -i -V || abort failed to extract initrd (may be out of space on ram disk)
 	cd ..
 
-	if [ `cat /tmp/zcat_failure` = 0 ]; then
+	if [ `cat /tmp/bunzip_failure` = 0 ]; then
 		LOADED=1
 	else
 		echo install media seems to be bad! 2


Bug#464938: d-i on i386 with 16 MiB RAM (using swap)

2008-02-09 Thread Joey Hess
Tomas Tintera wrote:
 1. We need
  ide/ide-core.ko,
  ide/ide-disk.ko and
  ide/ide-generic.ko
 modules on 2nd (root) floppy (in initrd) in order to get
 HDDs work. The space for it can be made by bzipping 2nd
 floppy's initrd instead of gzipping it. Also the following
 lines must be added to modules.dep in initrd on the 2nd
 floppy:

This, and adding a swapon option make sense (in the limited situations
where the system can be preconfigured with a swap partition).

 2. We need to use a bzip2 decompressor on 1st (boot) floppy
 instead of zcat. We can use micro-bunzip
 (http://www.landley.net/code/micro-bunzip.c (version 3.0,
 which is smaller than 4.1)), with the patch in
 the attachment, statically linked with klibc.

You lost me here. How does using bzip2 save memory? The floppy image
is decompressed into a ramdisk.

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#464938: d-i on i386 with 16 MiB RAM (using swap)

2008-02-09 Thread Tomas Tintera
Package: debian-installer
Version: 20070308
Severity: wishlist
Tags: patch

d-i for i386 on floppies works currently only with
32 MiB RAM, which is unnecessarily much. (Sometimes one
needs to install Debian e.g. on 16 MiB machines.)

This number can be reduced by activating swap as soon as
possible.

Assume that the machine have a prepared swap partition.

I found how to change the d-i floppies (without increasing
its number) in order to work with 16 MiB. The changes to
apply against the current lenny's d-i floppies (which are
now almost identical to those for etch) for i386 follows:

1. We need
 ide/ide-core.ko,
 ide/ide-disk.ko and
 ide/ide-generic.ko
modules on 2nd (root) floppy (in initrd) in order to get
HDDs work. The space for it can be made by bzipping 2nd
floppy's initrd instead of gzipping it. Also the following
lines must be added to modules.dep in initrd on the 2nd
floppy:

/lib/modules/2.6.18-5-486/kernel/drivers/ide/ide-core.ko:
/lib/modules/2.6.18-5-486/kernel/drivers/ide/ide-disk.ko: 
/lib/modules/2.6.18-5-486/kernel/drivers/ide/ide-core.ko
/lib/modules/2.6.18-5-486/kernel/drivers/ide/ide-generic.ko: 
/lib/modules/2.6.18-5-486/kernel/drivers/ide/ide-core.ko

2. We need to use a bzip2 decompressor on 1st (boot) floppy
instead of zcat. We can use micro-bunzip
(http://www.landley.net/code/micro-bunzip.c (version 3.0,
which is smaller than 4.1)), with the patch in
the attachment, statically linked with klibc.

Then /bin/zcat (in initrd on 1st floppy) is useless and may
be replaced with /bin/micro-bunzip.
The file /init in initrd on 1st floppy must be changed in
order to work with micro-bunzip (the patch is in the
attachment).

3. We need to take the user the possibility to tell the
installer where the swap partition is. We can specify the
new kernel boot option (swapon= (eg. swapon=/dev/hda5)). For
that purpose, I wrote a new script for 2nd floppy which
checks that option, installs appropriate modules and
activates swap (S04swapon, in the attachment (to add in the
2nd floppy's initrd into the directory
/lib/debian-installer-startup.d,
without execution permission)).

4. We can change /lib/debian-installer-startup.d/S15lowmem
in initrd on 2nd floppy so that it takes account of swap
(patch is in the attachment).


Works fine with 16 MiB RAM, maybe also 8 MiB.

Nevertheless, d-i package seems rather complicated to me,
and I haven't found how to change it's sources in order to
produce the floppies that I described above. I would be glad
if you could make these changes to d-i or tell me what can I
do.


With regards,
Tomas trosos Tintera

--- init-orig   2008-02-09 19:45:04.0 +0100
+++ init2008-02-09 20:31:20.0 +0100
@@ -209,14 +209,14 @@

echo -n Loading..
# pipe_progress adds dots to the above line while there is
-   # activity. But we must be sure to catch errors from the zcat.
+   # activity. But we must be sure to catch errors from the micro-bunzip.
# Hard to do in a pipeline..
-   echo 0  /tmp/zcat_failure
+   echo 0  /tmp/bunzip_failure
cd mnt
-   (zcat ../floppy/initrd.gz || echo 1  /tmp/zcat_failure ) | cpio -i -V || abort failed to extract initrd (may be out of space on ram disk)
+   (micro-bunzip ../floppy/initrd.bz2 || echo 1  /tmp/bunzip_failure ) | cpio -i -V || abort failed to extract initrd (may be out of space on ram disk)cd ..

-   if [ `cat /tmp/zcat_failure` = 0 ]; then
+   if [ `cat /tmp/bunzip_failure` = 0 ]; then
LOADED=1
else
echo install media seems to be bad! 2
swapdev=
for word in $(cat /proc/cmdline); do
if [ ${word%%=*} = swapon ]; then
swapdev=${word#swapon=}
fi
done

if [ -n $swapdev ]; then
echo Trying to load generic IDE modules in order to activate swap
modprobe ide-disk /dev/null 21 || true
modprobe ide-generic /dev/null 21 || true

# Wait 30 seconds for hard disk to wake up
echo -n Waiting for $swapdev to be created ...
i=6;
while [ $i -ge 0 ]; do
if [ -b $swapdev ]; then
echo
swapon $swapdev || true
break;
fi
if [ $i = 0 ]; then
echo -e \nCould not swap on $swapdev - not a block 
device. 2
break;
fi
i=$(($i - 1))
sleep 5  # in seconds
echo -n .
done
fi
--- micro-bunzip.c-orig 2007-09-30 15:11:11.0 +0200
+++ micro-bunzip.c  2007-09-30 15:47:58.0 +0200
@@ -511,5 +511,5 @@
 int main(int argc, char *argv[])
 {
char *c=uncompressStream(0,1);
-   fprintf(stderr,\n%s\n, c ? c : Completed OK);
+   if (c) fprintf (stderr, %s\n, c);
 }
--- S15lowmem-orig 2008-02-09 19:11:45.0 +0100
+++ S15lowmem  2007-09-29 18:44:51.0 +0200
@@ -4,7 +4,11 @@
 if [ $ram =  ]; then