Running headless in Linux and modifying initrd
Updated: 21 May 2010 | 6 comments
This issue has been solved. See solution.
I have many blade computers that I need to sanitize the disks on using "gdisk /dodwipe". These blades are headless (no video). They communicate via Ethernet and through the serial port. I created a Linux USB key using Ghost Boot Wizard. It is unusable in its current form because there is no way to communicate through the serial port. I modified the syslinux.cfg by adding console=tty0 console=ttyS0,9600 to the APPEND line. I can now see the kernel boot but the first thing it tries to do after booting the kernel and loading the RAM disk is to start up X. At that point i lose I?O.
I would like to modify initrd so that i can change /etc/inittab. I can't mount it using a loopback like I usually can.
How can I modify initrd?
Discussion Filed Under:
Comments
Running headless in Linux and modifying initrd
Hi Dave,
The GSS Linux preOS is built using Thinstation. The complete source code is available from ftp://ftp.symantec.com/public/english_us_canada/pr....
The inittab is a SquashFS filesystem image. (Version 3.3 I think)
You should be able to use unsquashfs to extract the data from initrd, edit the initrd, then squashfs it all up again. Or if you download the source you could rebuild the initrd from scratch.
Hope this helps. Let me know how you get on.
Cheers,
David.
LinuxSoftware
Running headless in Linux and modifying initrd ... followup
Just to let you know, I tested editing the inittab using the unsquashfs-edit-mksquashfs method, and it worked perfectly.
BTW: the default root password is "password". And (you probably know this, but) to be able to log in as root from a serial terminal you need to add the tty to /etc/securetty.
The steps I did were:
LinuxSoftware
Running headless in Linux and modifying initrd ... thank you
David,
Thanks for working this out and for the precise details on how to do accomplish it. It works perfectly!! The only problem I ran into was that I initially used "unsquashfs" and "mksquashfs" version 4.0 utilities. They produce an "initrd" file file that is incompatible with the Symantec-supplied kernel. I built version 3.4 of those utilities and they created a compatible version of initrd. I wouldn't have thought of this version incompatibility if you hadn't mentioned that you were using version 3.3.
Thanks again for sharing your expertise! As a possible enhancement it would be nice to get a headless mode by simply modifying a data file such as syslinux and have the kernel generate the correct inittab and securetty files.
Running headless in Linux and inserting a boot time script
david,
How do I insert a script that i would like to run prior to login? I can't figure out what the boot process is. This kernel does not appear to use /etc/rc to boot. I am used to inserting a script into /etc/rc3.d (or 5) but this does not seem to be the case.
Can you tell me how to do this using Thinstation? Thank you.
Dave
re:Running headless in Linux and inserting a boot time script
David,
My misunderstanding. Ignore my previous post. I put the script into /etc/rc5.d in the "initrd" file and the script runs fine at boot time. Thanks again for all of your help.
You're welcome
Glad it is working for you.
LinuxSoftware
Would you like to reply?
Login or Register to post your comment.