Book Reviews   Digital Libraries   Astronomy Log   Software   About  

My mini-distro
11 August 2003 14:32

12:00 pm
Today I am having fun building a Linux boot image. The overall goal I'm trying to accomplish is to create a 'mini-distribution' that I can send to any given host via PXE. The images would be booted providing serial console and ssh access, so we could use it to diagnose hardware issues. Kind of like a rescue image on steriods. So Friday I spent some time reading through the Linux Bootdisk HOWTO getting accquainted with what I would need in a basic image. Leaving work Friday, I figured the best plan of action was to put everything I wanted in the initrd that I could easily specify as a kernel param via PXE.

So I put together a simple filesystem with dd if=/dev/zero of=my_fs bs=1k count=20000, and then mke2fs myfs. I copied over the /dev files, a few /etc files, etc. and got things ready to send to the test machine via PXE. The first problem I ran into was the kernel bailing, saying "attempt to read beyond end of device". This was puzzling. A little googling for that error message indicated that I needed to use the kernel boot paramater ramdisk_size=20000. I added that and got a little farther, but now the kernel was complaining that it couldn't mount the root filesystem as it was "unable to read superblock". Hrm. I ran e2fsck on the fielsystem, and cleaned up any issues there, but still ran into the problem. More googling brought me to the Linux for PowerPC Embedded Systems HOWTO, which tells me that I need to be also specifying the kernel parameter root=/dev/ram to tell the kernel, yes, I want to use the initial ram disk as my root filesystem.

That brings me to where I am now. The kernel is complaining that it can't find init. That should be easy to fix...

12:24 pm
I made sure /sbin/init was available in my image, and also checked which libraries it needed with ldd. I copied over libc.so.6, /bin/bash to interpret /etc/rc.d/rc.sysinit, and some more required libs for bash, libtermcap.so.2 and ld-linux.so.2. Since I'm not dealing with the constraints of putting all of this on a floppy, I'm not worrying about stripping binaries or other fun stuff to reduce space usage. I also changed the root= boot param to root=/dev/ramdisk, which is a symlink to /dev/ram0, which should be the right spot. I booted up with that in place, and voila, I get init complaining about syntax errors in /etc/rc.d/rc.sysinit. Now things are really getting easy. Looks like I left a quoted string un-terminated.

12:32 pm
Wohoo! Success! My little creation booted up, has the ramdisk mounted, and greeted me with an echo line from /etc/rc.d/rc.sysinit. The rest is easy now. Just add all the binaries I need to do what we want. My co-worker says we should make the boot process run from Perl ;-). Piece of cake.


Comments

On 29 June 2007 10:23 qweqwe wrote:
qwe


Happiness
True love begins when the needs of others become more important than your own.
The practice of true love begets true happiness

Me

Daniel Hanks

I'm a system administrator working for Omniture

Interested in

perl
books
python
databases
genealogy
astronomy
digital archival
digital libraries
web applications
web infrastructure
distributed storage

among other things . . .

Storyteller


Pamela Hanks

is an excellent storyteller.

(She also happens to be my wife :-)

A storyteller makes a wonderful and unique addition to family, school, church or other group events. Schedule her for your next gathering.


Kiva.org
Kiva - loans that change lives

Recent Blog Entries

Subscribe with Bloglines
- OpenWest Conference 2014 Presentation Slides - Ansible
- OpenWest Conference 2013 Presentation Slides
- Utah Open Source Conference 2012 - Presentation slides
- E-Book Review: Data Mashups in R
- Book Review: Illustrated Guide to Astronomical Wonders
- Book Review: Wicked Cool Shell Scripts
- PLUG Presentation Slides: The Open Source Data Center
- Harnessing human computational power from computer games
- I love a good roadtrip
- FamilySearch Developers Conference 2008 presentations now available online
- FHT follow up: an idea for a mobile genealogical application
- Family history and technology: it's only getting better
- President Hinckley passes away
- December is NaBoMoReMo - National Book of Mormon Reading Month
- Family History, Photos, Blogs, and Books
- The Compact Oxford English Dictionary
- 1830s English and the Book of Mormon
- Google adds My Library feature to Book Search
- Utah Open Source Conference
- Wiki diagrammer (Steal this idea!)

All Entries . . .

LDSOSS
LDS Open Source Software
A website discussing the use of Open-source software for applications useful to those sharing values of the Latter-day Saint (Mormon) faith.

© 2009, Daniel C. Hanks