Re: Creating an initrd

2001-05-09 Thread will trillich
On Tue, May 08, 2001 at 08:32:01PM -0700, Alvin Oga wrote:
 mkinitrd  ...
 
 or take an existing initrd.gz file...decompress it
 into /dev/ram  or /dev/loop
   
 than change the kernel to your version, add your libs/commands
 and other stuff you want in the initrd to make your system
 bootable
 
 and compress that /dev/loop image into  your_initrd.gz   and add that
 as your initrd image in lilo
 
 or so goes the simplified 3-line howto...

um, point the way or name the doc, if you would.

 either way...you need to make sure you have minixfs and /dev/ram enabled
 in your kernel to be able to create initrd files

eh?

 i created a full system in about 2.5Mb that expands into 8-16Mb of 
 linux hierachy that runs in memory ( /dev/ramxx )
   ( put that on a 4Mb flash and you've got a nice firewall ?? )

ding ding ding! you've got my attention... that's almost
precisely what i'd like to accomplish. can you do that with
debian?

 you can try tomsrtbt too but, its bash is too small as is its libraries

do you have a more fleshed-out documentation trail of making a
uncompress-onto-ramdisk-during-boot system?

-- 
DEBIAN NEWBIE TIP #3 from Will Trillich [EMAIL PROTECTED] 
:
Wondering how to find WHICH PACKAGE CONTAINS x-y-or-z? Just enter
dpkg -S part/of/path and you'll get a list of all packages that
affect paths like that. For an example, try dpkg -S http.

Also see http://newbieDoc.sourceForge.net/ ...



Re: Creating an initrd

2001-05-09 Thread Stefan Srdic
Alvin Oga wrote:

 hi stefan...

 mkinitrd  ...

 or take an existing initrd.gz file...decompress it
 into /dev/ram  or /dev/loop

 than change the kernel to your version, add your libs/commands
 and other stuff you want in the initrd to make your system
 bootable

 and compress that /dev/loop image into  your_initrd.gz   and add that
 as your initrd image in lilo

 or so goes the simplified 3-line howto...

 either way...you need to make sure you have minixfs and /dev/ram enabled
 in your kernel to be able to create initrd files

 i created a full system in about 2.5Mb that expands into 8-16Mb of
 linux hierachy that runs in memory ( /dev/ramxx )
 ( put that on a 4Mb flash and you've got a nice firewall ?? )

 you can try tomsrtbt too but, its bash is too small as is its libraries

 have fun
 alvin

I though that its possible to use the ext2 filesystem to use with initrd? Is 
there
an advantage of using the minixfs filesystem over the ext2 filesytem in this
application?

Anyway, I just want to make an initrd so that I can have etx2 and ReiserFS 
support
compiled as modules and also load a frame buffer module at boot time.

Most of this can be done through mkinitrd, the configuration file are a little
complicated though.


Stef



Re: Creating an initrd - micro-howto

2001-05-09 Thread Alvin Oga

hi ya will

there is no initrd howto that i could find...

those docs i did find in google searches were out of date
and incomplete in terms of getting a flash disk that you can boot
into  /dev/ram0

-- lets assume that tomsrtbt is too small on the 1.77Mb floppy
   and cdrom is too much hassle to make to boot into /dev/ram ???

we can take it offline to get you a working initrd
( am assumign you have another pc that we can debug it on

c ya
alvin


more expanded micro-initrd Flash howto ( from vague recollection of memory)
===
am assuming you wanna boot from floppy or better if
booting from 4Mb flash to be on /dev/hda on the target

A1.  Get a spare PC...
A2.  boot it normally...
A3.  install the kernel you wanna be using and compile it
 and boot until you got the bootable kernel 
A4.  make a boot floppy
A5.  boot the floppy if it works...good...now we can start


B0.  Move things around so that you are using ONLY /dev/hdb for
 your own development system
- use /dev/hda as your flash device on your cev box
and/or it will be the only disk on your target firewall

B1.  change/update your kernel to support initrd
- turn on mimixfs
- turn on /dev/ram
- turn on /dev/loop  ( better than /dev/ram ?? )
- you will be tweeking /dev/ram to support 8MB or 16Mb
  since /lib/libc-2.* is how big ???
- /lib /boot /root /bin /sbin /etc must all fit in /dev/ram0
- keep playing with your kernel till you can 

B2.  make ANOTHER boot floppy
- something you can play with

B3.  make some ram devices

dd if=/dev/zero of=/dev/ram0 bs=1k count=8192
dd if=/dev/zero of=/dev/ram1 bs=1k count=8192

#
# you're gonna be tweek -i to cram more bytes into the ram device
#
mke2fs -m 0 -i 2000 /dev/ram0
mke2fs -m 0 -i 2000 /dev/ram1

mount /dev/ram0 /mnt/ram0
mount /dev/ram1 /mnt/ram1

B4.  Start putting what is required to boot your server
 into the initrd file
#
# make a script that does this
# 
#
#
# i forgot where mkinitrd puts its stuff
#   - check your fs -- makes it easy
#
#   - using mkinitrd helps solve some directory
#   and copy problem but i forgot where it put stuff
#
# mkinitrd
#

-- lets do things the had way

#
# the boot FLOPPY  that DOES work...
#
mount /dev/fd0 /mnt/floppy
=
= you should be able to see the guts of your boot floppy
=

#   
# make some directories for /var/log /tmp 
mkdir /mnt/ram0/tmp /mnt/ram0/usr/tmp
chmod 1777 /mnt/ram0/tmp /mnt/ram0/usr/tmp
...
mkdir /var/log
mkdir /var/run
mkdir /var/spool


#
# Copy the contents from the working bootable floppy
# to your new boot media that we gonna create
#
# remember the boot floppy assume /dev/hda1 or /dev/sda1
# for root... we are gonna use /dev/ram0
#
cp -par /mnt/floppy/bin /mnt/ram0/bin
cp -par /mnt/floppy/etc /mnt/ram0/etc
cp -par /mnt/floppy/dev /mnt/ram0/dev
cp -par /mnt/floppy/lib /mnt/ram0/lib
cp -par /mnt/floppy/boot /mnt/ram0/boot
cp -par /mnt/floppy/sbin /mnt/ram0/sbin
- fix /mnt/ram0/etc/fstab to point to /dev/hdaxx


be sure to add/copy your basic/favorite commands into /mnt/ram0:
bash, ls, ping, route, ifconfig, ps, top, dd,
mount, cp, mv, etc..etc..
#
# copy other non-critical, would be nice ot have commands
# into/mnt/ram1
#

#
# now lets create your initrd file
#
dd if=/dev/ram0 of=/tmp/initrd.test bs=1k
gzip /tmp/initrd.test.gz
#
dd if=/dev/ram1 of=/tmp/initrd.extra bs=1k
gzip /tmp/initrd.extra.gz
#
cp -p /tmp/initrd.test.gz /boot
cp -p /tmp/initrd.extra.gz /boot
#
# the kernel you want should already be in /boot
#

B5.  Create a temporary lilo.Test.conf file
#
# Create a boot media that boots into /dev/ram0
#
#
# on the development machine, the flash is /dev/hda
#
boot=/dev/hda
#
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
#   
# Create a bootable flash disk
#
image=/boot/vmlinuz-2.4.2
label=linux-2.4.2-FLASH
read-only
#
# the flash disk will be hda on the target firewall
root=/dev/hda1
#
initrd=/boot/initrd.test.gz
#
# end of 

Re: Creating an initrd - minixfs

2001-05-09 Thread Alvin Oga

 
  either way...you need to make sure you have minixfs and /dev/ram enabled
  in your kernel to be able to create initrd files
 
 
 I though that its possible to use the ext2 filesystem to use with initrd? Is 
 there
 an advantage of using the minixfs filesystem over the ext2 filesytem in this
 application?

i forgot where in the process i turn on/off minixfs and mkinitrd ...
but i used both...and had less problems making a bootable flash when
i did have minifs on.. .( think its needed for using /dev/ram or /dev/loop
devices or for mkinitrd to work ?? donno...
- didnt go back and start over to see ...
c ya
alvin



Re: Creating an initrd

2001-05-09 Thread Herbert Xu
Sean 'Shaleh' Perry [EMAIL PROTECTED] wrote:

 Fairly easy to make, biggest snag is you really have to be root to make them
 properly.

If you're building a cramfs or romfs image, then root is unnecessary as
fakeroot works just fine.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Re: Creating an initrd

2001-05-09 Thread Herbert Xu
Joey Hess [EMAIL PROTECTED] wrote:

 Well there is a package in unstable called mkcramfs that makes initrds
 for debian, and it is supported by kernel packages for unstable.

Actually, mkcramfs just makes a cramfs image.  It's initrd-tools that
contains mkinitrd which makes initrd images.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Re: Creating an initrd

2001-05-09 Thread Andrew Suffield
On Wed, May 09, 2001 at 07:18:02PM +1000, Herbert Xu wrote:
 Joey Hess [EMAIL PROTECTED] wrote:
 
  Well there is a package in unstable called mkcramfs that makes initrds
  for debian, and it is supported by kernel packages for unstable.
 
 Actually, mkcramfs just makes a cramfs image.  It's initrd-tools that
 contains mkinitrd which makes initrd images.

mkinitrd makes a specific kind of initrd, which is pointless in most cases
unless you are trying to design a generic system (say for a boot floppy or
something) which can handle lots of different types of hardware. Mostly,
it's better to include the offending drivers in the kernel itself. A more
sensible use of an initrd is to preconfigure things that are needed to load
the root filesystem, like the lvm...

-- 
Andrew Suffield [EMAIL PROTECTED]


pgpRtp5rHDZcw.pgp
Description: PGP signature


Re: Creating an initrd

2001-05-09 Thread Karsten M. Self
on Wed, May 09, 2001 at 12:09:38AM -0600, Stefan Srdic ([EMAIL PROTECTED]) 
wrote:

 I though that its possible to use the ext2 filesystem to use with
 initrd?  Is there an advantage of using the minixfs filesystem over
 the ext2 filesytem in this application?

minixfs is reputed to have lower overhead, though I haven't reearched or
tested this myself.  I believe it has to do with root reserved and
superblocks.  You can build a few images at 1400 x 1024 bytes and format
them with minix, ext2fs, and msdos/vfat to see what the relative merits
are.   I've always formatted RAM and floppy w/ minixfs rather than ext2
when using a non-DOS filesystem.

Cheers.

-- 
Karsten M. Self kmself@ix.netcom.comhttp://kmself.home.netcom.com/
 What part of Gestalt don't you understand?   There is no K5 cabal
  http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org


pgp7QkW11TcQS.pgp
Description: PGP signature


RE: Creating an initrd

2001-05-08 Thread Sean 'Shaleh' Perry

On 08-May-2001 Stefan Srdic wrote:
 I've compiled the 2.4.3 kernel on my patato box. I'm interrested in
 creating my own initial RAM disk (initrd) to speed up my boot process.
 
 Does anybody know of any good HOW-TO's on initrd's?
 
 Does anybody have some insight to share?
 

Fairly easy to make, biggest snag is you really have to be root to make them
properly.

You need a /dev populated with enough entries for the hardware you care about. 
Other than that the file system can contain whatever you want/need.

I think I started seeing issues around 5 - 8 mb sized initrd files.



Re: Creating an initrd

2001-05-08 Thread Joey Hess
Stefan Srdic wrote:
 I've compiled the 2.4.3 kernel on my patato box. I'm interrested in
 creating my own initial RAM disk (initrd) to speed up my boot process.
 
 Does anybody know of any good HOW-TO's on initrd's?
 
 Does anybody have some insight to share?

Well there is a package in unstable called mkcramfs that makes initrds
for debian, and it is supported by kernel packages for unstable.

-- 
see shy jo



RE: Creating an initrd

2001-05-08 Thread Alvin Oga

hi stefan...

mkinitrd  ...

or take an existing initrd.gz file...decompress it
into /dev/ram  or /dev/loop

than change the kernel to your version, add your libs/commands
and other stuff you want in the initrd to make your system
bootable

and compress that /dev/loop image into  your_initrd.gz   and add that
as your initrd image in lilo

or so goes the simplified 3-line howto...

either way...you need to make sure you have minixfs and /dev/ram enabled
in your kernel to be able to create initrd files

i created a full system in about 2.5Mb that expands into 8-16Mb of 
linux hierachy that runs in memory ( /dev/ramxx )
( put that on a 4Mb flash and you've got a nice firewall ?? )


you can try tomsrtbt too but, its bash is too small as is its libraries

have fun
alvin


On Tue, 8 May 2001, Sean 'Shaleh' Perry wrote:

 
 On 08-May-2001 Stefan Srdic wrote:
  I've compiled the 2.4.3 kernel on my patato box. I'm interrested in
  creating my own initial RAM disk (initrd) to speed up my boot process.
  
  Does anybody know of any good HOW-TO's on initrd's?
  
  Does anybody have some insight to share?
  
 
 Fairly easy to make, biggest snag is you really have to be root to make them
 properly.
 
 You need a /dev populated with enough entries for the hardware you care 
 about. 
 Other than that the file system can contain whatever you want/need.
 
 I think I started seeing issues around 5 - 8 mb sized initrd files.
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]