2003-08-16 23:41:56

by Garrett Kajmowicz

[permalink] [raw]
Subject: Initramfs confusion

I am just begining to test out 2.6 with an eye on use by X-terminals without
hard drives or NFS. As such I am quite enthusiastic about initramfs. After
much stumbling around I created a root image that I would like to test,
compiled into kernel and created image.

I am doing testing under VMWare with 2.88 MB floppy images (for testing
purposes), but lilo is barfing trying to write to a regular file as a raw
device (doesn't know how to handle device 0x0700).

I cannot use a real floppy because I do not have any 2.88 MB floppies

Any suggestions?

Thanks for the help.

Garrett Kajmowicz
[email protected]


2003-08-19 14:55:28

by Rob Landley

[permalink] [raw]
Subject: Re: Initramfs confusion

On Saturday 16 August 2003 19:40, Garrett Kajmowicz wrote:
> I am just begining to test out 2.6 with an eye on use by X-terminals
> without hard drives or NFS. As such I am quite enthusiastic about
> initramfs. After much stumbling around I created a root image that I would
> like to test, compiled into kernel and created image.
>
> I am doing testing under VMWare with 2.88 MB floppy images (for testing
> purposes), but lilo is barfing trying to write to a regular file as a raw
> device (doesn't know how to handle device 0x0700).
>
> I cannot use a real floppy because I do not have any 2.88 MB floppies
>
> Any suggestions?
>
> Thanks for the help.
>
> Garrett Kajmowicz
> [email protected]

Here's a big cut and paste from a script of mine that does a lot of this gorp
automatically while creating a bootable CD image.

Let me know if I missed something from the snip. (I do remember there was
some head scratching back when I was first figuring this out... :)

There are a number of assumptions baked into this script (I.E. earlier on an
empty directory named sub (I.E. the sub directory) was created for use as a
mount point, that sort of thing. Shouldn't be too hard to figure out...)

Rob

echo === "Create a 2.88 meg floppy image (CD emulates floppy when booting)..."

rm -f floppy.img &&
dd if=/dev/zero of=floppy.img bs=512 count=5760 &&

echo === Format and mount it... &&

mke2fs -N 24 -m 0 -F floppy.img &&
tune2fs -c 0 -i 0 floppy.img &&
losetup /dev/loop7 floppy.img &&
mount /dev/loop7 sub &&

echo === Write lilo.conf for bootable CD... &&

rm -rf sub/lost+found &&
cat > sub/lilo.conf << EOF &&
boot=/dev/loop7
disk=/dev/loop7
bios=0x00
cylinders=80
heads=2
sectors=36
install=/boot.b
map=/map
backup=/dev/null
compact
geometric
image=/bzImage
label=linux
root=/dev/loop7
initrd=ramdisk.img.gz
read-write
EOF

echo === "Copy other data (kernel, ramdisk, dev, etc)..." &&

cat /boot/boot.b > sub/boot.b &&
cat /boot/vmlinuz > sub/bzImage &&
mv ramdisk.img.gz sub &&
mkdir sub/dev &&
cp -R /dev/{null,loop7} sub/dev &&
mkdir sub/tmp &&

echo === Run lilo to make image bootable.... &&

lilo -v -C lilo.conf -r sub &&
umount sub &&
losetup -d /dev/loop7

if [ $? -ne 0 ]; then exit 1; fi



> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


2003-08-21 03:56:28

by H. Peter Anvin

[permalink] [raw]
Subject: Re: Initramfs confusion

Followup to: <[email protected]>
By author: Garrett Kajmowicz <[email protected]>
In newsgroup: linux.dev.kernel
>
> I am just begining to test out 2.6 with an eye on use by X-terminals without
> hard drives or NFS. As such I am quite enthusiastic about initramfs. After
> much stumbling around I created a root image that I would like to test,
> compiled into kernel and created image.
>
> I am doing testing under VMWare with 2.88 MB floppy images (for testing
> purposes), but lilo is barfing trying to write to a regular file as a raw
> device (doesn't know how to handle device 0x0700).
>
> I cannot use a real floppy because I do not have any 2.88 MB floppies
>

I suggest using SYSLINUX instead for floppies.

-hpa
--
<[email protected]> at work, <[email protected]> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

2003-08-21 10:34:59

by Miles Bader

[permalink] [raw]
Subject: Re: Initramfs confusion

Rob Landley <[email protected]> writes:
> Here's a big cut and paste from a script of mine that does a lot of
> this gorp automatically while creating a bootable CD image.

I've no idea what the original poster really wants, but your script
seems to use initrd, not initramfs (which is much nicer than initrd in
theory).

-Miles
--
Occam's razor split hairs so well, I bought the whole argument!

2003-08-22 00:50:31

by Rob Landley

[permalink] [raw]
Subject: Re: Initramfs confusion

On Thursday 21 August 2003 06:33, Miles Bader wrote:
> Rob Landley <[email protected]> writes:
> > Here's a big cut and paste from a script of mine that does a lot of
> > this gorp automatically while creating a bootable CD image.
>
> I've no idea what the original poster really wants, but your script
> seems to use initrd, not initramfs (which is much nicer than initrd in
> theory).

The script was done for 2.4, where initramfs wasn't an option. (I mentioned
it being old, and a bit crufty.)

The original poster was saying they were having trouble creating a 2.88 floppy
image, which is most of what that script snippet does. (The bit that
actually creates the root ramdisk that floppy uses was earlier in the script,
and not included in the snip. I believe the script just had a line to copy
the ramdisk file onto the floppy image...)

> -Miles

Rob