2000-11-06 21:32:09

by Richard B. Johnson

[permalink] [raw]
Subject: linux 2.4.0-test9


Linux 2.4.0-test9 can be built and booted via initrd when running
a 2.2.17 kernel.

However when running, the new kernel 2.4.0-test9, can't be used to
make a usable initrd ram disk. The result being that 2.4.0-test9
can't, itself, build an "initrd" bootable system.

Before everybody screams that I don't know what I'm doing, let me
assure you that I know that the two kernels put their modules in
different directories and the new directory scheme seems to require
the latest and greatest version of modutils.

I have two ways of building an initial RAM disk (they both use
scripts, not provided with any distribution). One uses the loop-device
and the other uses the RAM disk directly. Because of previous
problems, on some kernel versions, with the loop device (it was
being mucked with for encription), I exclusively use the RAM disk
to build initrd.

Therefore, the problem seems to be that 2.4.0-test9 has a problem
with the RAM Disk.


Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.



2000-11-06 21:40:30

by Richard Rak

[permalink] [raw]
Subject: Re: linux 2.4.0-test9

I don't have any problems building initrd images here (using
RAMDISKs). Can I take a look at your scripts and see what is going on?

"Richard B. Johnson" wrote:
>
> Linux 2.4.0-test9 can be built and booted via initrd when running
> a 2.2.17 kernel.
>
> However when running, the new kernel 2.4.0-test9, can't be used to
> make a usable initrd ram disk. The result being that 2.4.0-test9
> can't, itself, build an "initrd" bootable system.
>
> Before everybody screams that I don't know what I'm doing, let me
> assure you that I know that the two kernels put their modules in
> different directories and the new directory scheme seems to require
> the latest and greatest version of modutils.
>
> I have two ways of building an initial RAM disk (they both use
> scripts, not provided with any distribution). One uses the loop-device
> and the other uses the RAM disk directly. Because of previous
> problems, on some kernel versions, with the loop device (it was
> being mucked with for encription), I exclusively use the RAM disk
> to build initrd.
>
> Therefore, the problem seems to be that 2.4.0-test9 has a problem
> with the RAM Disk.
>
> Cheers,
> Dick Johnson
>
> Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).
>
> "Memory is like gasoline. You use it up when you are running. Of
> course you get it all back when you reboot..."; Actual explanation
> obtained from the Micro$oft help desk.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> Please read the FAQ at http://www.tux.org/lkml/

--
Richard Rak
([email protected])
Software Engineer
A+ Certified Service Technician

New Team - Renewed Focus: Corel ushers in a new era!
To learn more, please visit http://www.corel.com


Attachments:
richardr.vcf (298.00 B)
Card for Richard Rak

2000-11-06 22:12:29

by Richard B. Johnson

[permalink] [raw]
Subject: Re: linux 2.4.0-test9

On Mon, 6 Nov 2000, Richard Rak wrote:

> I don't have any problems building initrd images here (using
> RAMDISKs). Can I take a look at your scripts and see what is going on?
>

Here is the script to boot off a hard disk.



#!/bin/bash
#
# This installs the kernel on a system that requires an initial
# RAM Disk and with an initial SCSI driver.
#

export VER=$1
RAMDISK_DEVICE=/dev/ram0
RAMDISK_MOUNT=/tmp/Ramdisk
DISKSIZE=1500
SYS=/usr/src/linux-${VER}/arch/i386/boot/bzImage
MAP=/usr/src/linux-${VER}/System.map
if [ "$1" = "" ] ;
then
echo "Usage:"
echo "make_ramdisk <version>"
exit 1
fi
if [ ! -f ${SYS} ] ;
then
echo "File not found, ${SYS}"
exit 1
fi
if [ ! -f ${MAP} ] ;
then
echo "File not found, ${MAP}"
exit 1
fi
if ! depmod -a ${VER} ;
then
echo "This won't work! There are some unresolved symbols."
exit 1
fi
umount ${RAMDISK_DEVICE} 2>/dev/null
umount ${RAMDISK_MOUNT} 2>/dev/null
mkdir ${RAMDISK_MOUNT} 2>/dev/null
dd if=/dev/zero of=${RAMDISK_DEVICE} bs=1k count=${DISKSIZE}
mke2fs -q ${RAMDISK_DEVICE} ${DISKSIZE}
mount ${RAMDISK_DEVICE} ${RAMDISK_MOUNT}
rmdir ${RAMDISK_MOUNT}/lost+found
mkdir ${RAMDISK_MOUNT}/dev
mkdir ${RAMDISK_MOUNT}/etc
mkdir ${RAMDISK_MOUNT}/lib
mkdir ${RAMDISK_MOUNT}/bin
mknod ${RAMDISK_MOUNT}/dev/null c 1 3
mknod ${RAMDISK_MOUNT}/dev/ram0 b 1 0
mknod ${RAMDISK_MOUNT}/dev/ram1 b 1 1
mknod ${RAMDISK_MOUNT}/dev/tty0 c 4 0
mknod ${RAMDISK_MOUNT}/dev/tty1 c 4 1
mknod ${RAMDISK_MOUNT}/dev/tty2 c 4 2
mknod ${RAMDISK_MOUNT}/dev/tty3 c 4 3
mknod ${RAMDISK_MOUNT}/dev/tty4 c 4 4
ln -s /dev/tty0 ${RAMDISK_MOUNT}/dev/systty
ln -s /dev/tty0 ${RAMDISK_MOUNT}/dev/console
ln -s /dev/ram1 ${RAMDISK_MOUNT}/dev/ram
ln -s / ${RAMDISK_MOUNT}/dev/root
cp /bin/ash.static ${RAMDISK_MOUNT}/bin/sh
cp /sbin/insmod.static ${RAMDISK_MOUNT}/bin/insmod
#cp /sbin/modprobe-static ${RAMDISK_MOUNT}/bin/modprobe
cp /lib/modules/${VER}/kernel/drivers/scsi/BusLogic.o ${RAMDISK_MOUNT}/lib
cp /lib/modules/${VER}/kernel/drivers/scsi/scsi_mod.o ${RAMDISK_MOUNT}/lib
cp /lib/modules/${VER}/kernel/drivers/scsi/sd_mod.o ${RAMDISK_MOUNT}/lib
echo "#!/bin/sh" >${RAMDISK_MOUNT}/linuxrc
echo "/bin/insmod /lib/scsi_mod.o" >>${RAMDISK_MOUNT}/linuxrc
echo "/bin/insmod /lib/BusLogic.o" >>${RAMDISK_MOUNT}/linuxrc
echo "/bin/insmod /lib/sd_mod.o" >>${RAMDISK_MOUNT}/linuxrc
chmod +x ${RAMDISK_MOUNT}/linuxrc
df ${RAMDISK_MOUNT}
sync
umount ${RAMDISK_MOUNT}
rmdir ${RAMDISK_MOUNT}
dd if=${RAMDISK_DEVICE} bs=1k count=${DISKSIZE} | gzip >/boot/initrd-${VER}
cp ${SYS} /boot/vmlinuz-${VER}
cp ${MAP} /boot/System.map-${VER}
rm -rf /boot/System.map
ln -s /boot/System.map-${VER} /boot/System.map
psupdate
#
echo >/boot/message
echo " Booting Linux version ${VER}" >>/boot/message
echo " Hit tab key to see alternatives" >>/boot/message
echo " This machine will self-destruct in 15 seconds" >>/boot/message
echo >>/boot/message
#
lilo -C - <<EOF
#
# Lilo boot-configuration script.
#
boot = /dev/sda
message = /boot/message
compact
delay = 15 # optional, for systems that boot very quickly
vga = normal # force sane state

image = /boot/vmlinuz-${VER}
root = current
label = new
initrd = /boot/initrd-${VER}

image = /vmlinuz
root = current
label = linux

image = /vmlinuz
root = /dev/sdc3
label = maint

image = /vmlinuz
root = /dev/sdb1
label = maint-su
append="init=/bin/bash"

image = /vmlinuz.old
root = current
label = linux_old

other = /dev/sda1
table = /dev/sda
label = dos
EOF


Here is a script to boot off a floppy.

#!/bin/bash
#
# This installs the kernel on a system that requires an initial
# RAM Disk and with an initial SCSI driver.
#

export VER=$1
RAMDISK_DEVICE=/dev/ram0
RAMDISK_MOUNT=/tmp/Ramdisk
RAMDISK_TMP=/mnt
DISKSIZE=1500
SYS=/usr/src/linux-${VER}/arch/i386/boot/bzImage
MAP=/usr/src/linux-${VER}/System.map
if [ "$1" = "" ] ;
then
echo "Usage:"
echo "make_ramdisk <version>"
exit 1
fi
if [ ! -f ${SYS} ] ;
then
echo "File not found, ${SYS}"
exit 1
fi
if [ ! -f ${MAP} ] ;
then
echo "File not found, ${MAP}"
exit 1
fi
if ! depmod -a ${VER} ;
then
echo "This won't work! There are some unresolved symbols."
exit 1
fi
mkdir ${RAMDISK_TMP} 2>/dev/null
umount ${RAMDISK_DEVICE} 2>/dev/null
umount ${RAMDISK_MOUNT} 2>/dev/null
mkdir ${RAMDISK_MOUNT} 2>/dev/null
dd if=/dev/zero of=${RAMDISK_DEVICE} bs=1k count=${DISKSIZE}
mke2fs -q ${RAMDISK_DEVICE} ${DISKSIZE}
mount -o loop ${RAMDISK_DEVICE} ${RAMDISK_MOUNT}
mke2fs -q /dev/fd0
mount /dev/fd0 ${RAMDISK_TMP}
rmdir ${RAMDISK_MOUNT}/lost+found
rmdir ${RAMDISK_TMP}/lost+found
mkdir ${RAMDISK_MOUNT}/dev
mkdir ${RAMDISK_MOUNT}/etc
mkdir ${RAMDISK_MOUNT}/lib
mkdir ${RAMDISK_MOUNT}/bin
mknod ${RAMDISK_MOUNT}/dev/null c 1 3
mknod ${RAMDISK_MOUNT}/dev/ram0 b 1 0
mknod ${RAMDISK_MOUNT}/dev/ram1 b 1 1
mknod ${RAMDISK_MOUNT}/dev/tty0 c 4 0
mknod ${RAMDISK_MOUNT}/dev/tty1 c 4 1
mknod ${RAMDISK_MOUNT}/dev/tty2 c 4 2
mknod ${RAMDISK_MOUNT}/dev/tty3 c 4 3
mknod ${RAMDISK_MOUNT}/dev/tty4 c 4 4
ln -s /dev/tty0 ${RAMDISK_MOUNT}/dev/systty
ln -s /dev/tty0 ${RAMDISK_MOUNT}/dev/console
ln -s /dev/ram1 ${RAMDISK_MOUNT}/dev/ram
ln -s / ${RAMDISK_MOUNT}/dev/root
cp /bin/ash.static ${RAMDISK_MOUNT}/bin/sh
cp /sbin/insmod.static ${RAMDISK_MOUNT}/bin/insmod
#cp /sbin/modprobe-static ${RAMDISK_MOUNT}/bin/modprobe
cp /lib/modules/${VER}/kernel/drivers/scsi/BusLogic.o ${RAMDISK_MOUNT}/lib
cp /lib/modules/${VER}/kernel/drivers/scsi/scsi_mod.o ${RAMDISK_MOUNT}/lib
cp /lib/modules/${VER}/kernel/drivers/scsi/sd_mod.o ${RAMDISK_MOUNT}/lib
cat >${RAMDISK_MOUNT}/linuxrc <<EOF
#!/bin/sh
/bin/insmod -f /lib/scsi_mod.o
/bin/insmod -f /lib/BusLogic.o
/bin/insmod -f /lib/sd_mod.o
EOF
chmod +x ${RAMDISK_MOUNT}/linuxrc
df ${RAMDISK_MOUNT}
sync
umount ${RAMDISK_MOUNT}
rmdir ${RAMDISK_MOUNT}
dd if=${RAMDISK_DEVICE} bs=1k count=${DISKSIZE} | gzip >${RAMDISK_TMP}/initrd-${VER}
cp ${SYS} ${RAMDISK_TMP}/vmlinuz-${VER}
cp ${MAP} ${RAMDISK_TMP}/System.map-${VER}
cp /boot/boot.b ${RAMDISK_TMP}
#
lilo -C - <<EOF
#
# Lilo boot-configuration script.
#
boot = /dev/fd0
map = ${RAMDISK_TMP}/map
install = ${RAMDISK_TMP}/boot.b
backup = /dev/null
compact
delay = 15 # optional, for systems that boot very quickly
vga = normal # force sane state
image = ${RAMDISK_TMP}/vmlinuz-${VER}
root = current
label = Linux
initrd = ${RAMDISK_TMP}/initrd-${VER}
EOF
umount ${RAMDISK_TMP}

They both work fine on 2.2.17, but fail to mount the initial ram-disk
if built while running 2.4.0-test9



Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


2000-11-07 03:15:42

by Keith Owens

[permalink] [raw]
Subject: Re: linux 2.4.0-test9

On Mon, 6 Nov 2000 16:31:23 -0500 (EST),
"Richard B. Johnson" <[email protected]> wrote:
>However when running, the new kernel 2.4.0-test9, can't be used to
>make a usable initrd ram disk. The result being that 2.4.0-test9
>can't, itself, build an "initrd" bootable system.
>
>Before everybody screams that I don't know what I'm doing, let me
>assure you that I know that the two kernels put their modules in
>different directories and the new directory scheme seems to require
>the latest and greatest version of modutils.

You also need the latest version of mkinitrd to handle the modules
directory structure.

2000-11-07 13:29:18

by Richard B. Johnson

[permalink] [raw]
Subject: Re: linux 2.4.0-test9

On Tue, 7 Nov 2000, Keith Owens wrote:

> On Mon, 6 Nov 2000 16:31:23 -0500 (EST),
> "Richard B. Johnson" <[email protected]> wrote:
> >However when running, the new kernel 2.4.0-test9, can't be used to
> >make a usable initrd ram disk. The result being that 2.4.0-test9
> >can't, itself, build an "initrd" bootable system.
> >
> >Before everybody screams that I don't know what I'm doing, let me
> >assure you that I know that the two kernels put their modules in
> >different directories and the new directory scheme seems to require
> >the latest and greatest version of modutils.
>
> You also need the latest version of mkinitrd to handle the modules
> directory structure.
>
No. I have my own script(s) that have been appropriately modified
for both test floppies and boot from the hard disk.

I have found the problem. A patch will follow after I get some
breakfast. It's an obviously-correct one too.



Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


2000-11-07 14:01:28

by Richard B. Johnson

[permalink] [raw]
Subject: Re: linux 2.4.0-test9

On Tue, 7 Nov 2000, Richard B. Johnson wrote:

> On Tue, 7 Nov 2000, Keith Owens wrote:
>
> > On Mon, 6 Nov 2000 16:31:23 -0500 (EST),
> > "Richard B. Johnson" <[email protected]> wrote:
> > >However when running, the new kernel 2.4.0-test9, can't be used to
> > >make a usable initrd ram disk. The result being that 2.4.0-test9
> > >can't, itself, build an "initrd" bootable system.
> > >
> > >Before everybody screams that I don't know what I'm doing, let me
> > >assure you that I know that the two kernels put their modules in
> > >different directories and the new directory scheme seems to require
> > >the latest and greatest version of modutils.
> >
> > You also need the latest version of mkinitrd to handle the modules
> > directory structure.
> >
> No. I have my own script(s) that have been appropriately modified
> for both test floppies and boot from the hard disk.
>
> I have found the problem. A patch will follow after I get some
> breakfast. It's an obviously-correct one too.
>

Depending upon some name-space polution, inflate was executing junk
instead of its correct memzero().

Here's the patch....

--- /usr/src/linux-2.4.0/lib/inflate.c.orig Tue Nov 7 08:52:59 2000
+++ /usr/src/linux-2.4.0/lib/inflate.c Mon Nov 6 18:01:54 2000
@@ -147,6 +147,7 @@
STATIC int inflate_dynamic OF((void));
STATIC int inflate_block OF((int *));
STATIC int inflate OF((void));
+STATIC void *memzero OF((char *, size_t));

/* The inflate algorithm uses a sliding 32 K byte window on the uncompressed
stream to find repeated byte strings. This is implemented here as a




Cheers,
Dick Johnson

Penguin : Linux version 2.4.0 on an i686 machine (799.54 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.