From: Robert L. <rm...@te...> - 2001-12-03 01:20:23
|
It seems the prevailing method of booting and using Linux on the dreamcast involves loading the kernel image and an initrd off a CD-R (or network), loading the kernel, and booting into an initrd. The initrd never returns -- instead it typically populates the ram disk with a minimal filesystem and then mounts the gdrom elsewhere. Symlinks or other hackery link everything together. I think this approach is nonsense. A far better idea would be to boot into the kernel with your root device being your GD-ROM (ie root=/dev/gdrom on the command line) and use tmpfs for writable storage. It's pretty easy: Apply the attached patch to your kernel tree. The patch adds the gdrom to the root_dev_names array so it can be a root device. Enable CONFIG_TMPFS and disable all the initrd/ramdisk/loopback/ext2 cruft. Recompile. Have your CD filesystem setup however you would want it, this may mean merging it with your previous initrd filesystem. Upon boot, have an early SysV init script mount /var as tmpfs. Easiest would be to do `mount -a' with this in your /etc/fstab: tmpfs /var tmpfs defaults,size=4m 0 0 You can then populate it via script. An easy way would be to `cp -r /etc/var /var' although I've found I just need to create 4 or 5 directories in there -- no specific files need to be there. As for things in /etc that need to be writable, that is a design flaw but oh well. You can symlink /etc/mtab to /proc/mount. The only other thing I've come across that _has_ to be writable is /etc/resolv.conf so your DHCP client can place your nameserver there. In that case, just symlink it into /var. And that is it. You will get a smaller and faster kernel and the beauty of tmpfs (its fast, small, lives in the page cache, is dynamic, and does limit checking). If you are using boot-kernel or something else that wants an initrd.gz to load, you can just have it load an empty file (or anything). The kernel won't notice it and the memory will be used for something else. I am working on a boot loader that doesn't load initrd. Just thought I'd share...it seams a more ideal way. Robert Love |