lfs bootable cd hint (update)

Frank Langtind frank at langtind.org
Wed Mar 14 14:18:24 PST 2001


#Here is how I did it:

#In /lfs/dev/ I created these files (console and ram[1-16]):
mknod -m 644 console c 5 1
MAKEDEV -v ram

#console is needed to boot and ram is needed to mount ramdisk.

#Then I created a ramdisk and mounted it at /lfs/ramdisk:
mkdir /lfs/ramdisk
dd if=/dev/zero of=/dev/ram bs=1024 count=4096
mke2fs -vm0 /dev/ram 4096
mount /dev/ram /lfs/ramdisk

#In /lfs/ramdisk I created the directories tmp, dev and var and created
#the correct entries in the directories:
cd /lfs/ramdisk
mkdir tmp var dev
chmod 1777 tmp
cd dev
/lfs/dev/MAKEDEV -v generic
cd ../var
cp -R /lfs/var/* .

#In /lfs/dev I created symlinks to all devices except for console
#and ram[1-16] and created symlinks for tmp and var:
cd /lfs/dev
ln -s ../ramdisk/dev/* .
cd /lfs
rm -rf var
rm -rf tmp
ln -s ramdisk/var .
ln -s ramdisk/tmp .


#Then I umounted the ramdisk and compressed it into a file:
umount /dev/ram
dd if=/dev/ram bs=1k count=4096 | gzip > /lfs/ram_disk.gz




Then I made a boot script which uncompress the file and put it in a
ramdisk and mounted the ramdisk. This boot script is started the first
thing upon boot (after kernel of course) and do the following:

gunzip -c /ram_disk.gz | dd of=/dev/ram bs=1k count=4096
mount /dev/ram /ramdisk


I have not tested it completely yet, but it seems to work great!

Hope it helps

Frank


On Wed, 14 Mar 2001, Rudolf Floers wrote:

> > When I try to login I get an error, because the /dev directory is read-only,
> > so I can't write to /dev/tty0. Does anyone know how to solve this? Is devfs
> > a solution? I don't really know how it works... I'm going to find out _now_
> 
> hmm, i have not tried devfs yet, but it should work.
> 
> 
> if you don't want to use devfs, you can simply edit the login sources,
> works for me. i use shadow's login and it says
> 
> 	Unable to change tty /dev/ttyX: Read-only file system
> 
> if that's your problem, i'd suggest this:
> login tries to change the owner/permissions of the device file and
> exits if that fails. by commenting out the exit(1); in libmisc/chowntty.c,
> ca. line 115, you will still get the error msg, but will be able
> to login.
> 
> 
> hth,
> rudolf
> 
> 
> 


-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list