Re: [RFC]: d-i, /dev, busybox
On Mon Feb 12, 2001 at 08:25:15PM -0800, David Whedon wrote:
> My goal is to make debian-installer create the files in /dev on boot, and I
> would also like to use busybox's linuxrc-init-inittab feature because it is
> clean and fairly standard. There are a couple ways we can do this, all have
> drawbacks, I know this is a solved problem so I'm looking for advice, someone to
> poitn out something I missed.
>
> I've gotten Methods A and B to work so there aren't any hidden problems with
> them as far as I know.
Is the goal to end up with a ramdisk that contains the installer?
How about the following variant on A:
* boot with load_ramdisk=1 initrd=debian.gz root=/dev/ram0
* kernel loads debian.gz initrd into mem and mounts it
initrd contains the installer initrd, with a mimimal
set of devices in /dev, just in case...
null ram@ ram0 ram1 tty tty1 zero
* /linuxrc runs and looks something like the following:
#!/bin/sh
# Yet another mess by Erik Andersen <andersee@debian.org>
# Build ramdisks to overlay the underlying filesystem
# This allows the underlying filesystem to not need
# a zillion inodes so less space gets wasted.
echo -n "Building ramdisk: "
# fit /dev/* inodes into 96k (leaves 6k free w/1041 devices)
dd if=/dev/zero of=/dev/ram1 bs=1k count=96
/sbin/mkfs.minix -n30 -i 1200 /dev/ram1 96
mount /dev/ram1 /mnt -t minix -o rw
# copy what few /dev entries we have into the ramdisk
cp -a /dev/* /mnt
umount /dev/ram1
# Now overlay our ramdisk onto /dev
mount /dev/ram1 /dev -t minix -o rw
# create all the device special file nodes we need in /dev
/etc/init.d/makedevs
* /linuxrc exits
* Kernel mounts up /, but since we told the kernel
at boot time that / is /dev/ram0, well and lo and
behold, sitting on /dev/ram0 is the initrd that just ran.
The kernel doesn't care, it mounts it up as usual.
/dev/ram1 is is still mounted on /dev
* /sbin/init runs and finds /dev fully populated.
Feel free to adjust the basic recipe to taste...
-Erik
--
Erik B. Andersen email: andersee@debian.org, andersen@lineo.com
--This message was written using 73% post-consumer electrons--
Reply to: