, this will create ld.so.cache for you.
Now init needs some configuration too, this is the smallest i could think of:
It won't do anything usefull, except running bash ... running bash again .... did i allready tell you it's gonna run bash ?
The last thing to must do it create some devices. The command for that is mknod.
This command will need a few parameters, like the type of device, and major/minor number of the driver. These are the commands i used:
- mknod console c 5 1
- mknod initrd b 1 250
- mknod ram0 b 1 0
- mknod ram0 b 1 1
- mknod ram0 b 1 2
- mknod ram0 b 1 3
- mknod ram0 b 1 4
- mknod ram0 b 1 5
- mknod ram0 b 1 6
- mknod ram0 b 1 7
- ln -s ram0 ramdisk
- ln -s ram ram0
- chown root:disk ram[0-7] initrd
Now i want to give booting a try, so i unmounted the image, and copy the compiled kernel and the image to the /boot directory. My router PC now uses grub as bootloader. So i had to edit the /boot/grub/menu.lst
I added this:
kernel (hd0,0)/boot/vmlinuz-2.6.4 root=/dev/ram0
And then run grub-install /dev/hda to install the bootloader.
I you boot this, and everything is correct, you will see the kernel booting, then a message from init, and a bash prompt.
There is not much you can do with it. even ls won't work. As a workaround for now, you can echo echo * which will show you the files. To navigate trough the filesystem you can use cd.
If you want to reboot, you can savely just reset the box, that's one of the advantages of a ramdisk based system.