On Thursday 30 September 2010 16:32:09 Mark Knecht wrote: > Am I fooling myself in thinking that for a very simple hardware > system, maybe just an EXT2 boot, EXT3 / and a swap partition, that for > this specific machine the init scripts might be reduced to something > like 10-20 bash commands which get me to the bash command line where > as root I could use the system?
I's'll have to review the links posted earlier. When I was upgrading Smoothwall to use udev and initramfs, I didn't find much of anything of any use to guide me, so I puzzled my way through it, brute force. The simplest method of getting a root shell is to: ------------------ cat <<END >/init #! /bin/sh bash </dev/tty1 >/dev/tty1 2>/dev/tty1 END chmod +x /init ------------------- But this might not give you job control (it definitely won't in early userspace), and you won't have any daemons started (udev, etc.) This is how I started on my trek to set up initramfs (the official Smoothwall still uses initrd). It was a journey of 3-4 months slogging through the bog of early userspace, getting mired in how to properly create an initramfs to begin with (that bit could be documented better; there's one and only one way to do it outside of having the kernel build do it for you). The next hard part was doing the pivot_root to switch from rootfs to the mounted hard drive. klibc wasn't too hard for the first iteration using kernel 2.6.26. But when I switched to 2.6.32, klibc simply would not build. Ever. And I could never find any reason for it. In sheer desparation, I tried 2.6.33; it finally built. And that klibc works fine with 2.6.32. The next bother was figuring out how to make udev work. Its parser is absolutely unforgiving; worse, its error messages aren't really that helpful. But I got it to work. The last thing that I haven't yet gotten to work smoothly are shells in early userspace. The aforementioned job control doesn't work and other things don't quite work as expected. I may yet try a sysvinit in the initramfs, if I can figure out how to roll it over to the proper sysvinit on the hard drive. Basically, what this all says is, "There be dragons here. You may be on your own; as trepid as Search & Rescue are, even they are reticent to fly into the dragon's lair." But do post when 10 lb. bricks fall on your toes. I'll chime in with what I've learned in the last 16 months. Smoothwall was based on a very early version of LFS (I believe), and I used LFS as a guide to update many of the core packages. My tidbits won't be a one-to-one match with LFS, but I think the different perspective will be useful. N -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
