How do I successfully edit an initramfs / initrd?
I have an interesting problem that I pose to the community.
Here's the short version of my question: I need to edit an initrd in order to make a change to a file in a LiveCD. I do the following commands to edit the initrd. Here dtk_3.5.1_27_Linux.iso is the LiveCD and the initrd is located on isolinux/SA.2 on the LiveCD Code:
# first i get my initrd out of the ISO Kernel panic - not syncing: No init found. Try passing init= option to kernel. Now the SA.2 initrd has an init script in the root of the image. I've reextracted it to be sure that its there. The entry in isolinux/isolinux.cfg on the LiveCD is the following Code:
# Modify this if dtk files are on modified dtk CD. Did I miss an option or command in all this? Is what I'm trying to do even possible? -------------------------------------------------------------- Here's the long version of my question with all the background: I need to use the Dell Deployment Toolkit for my job. located here: http://support.us.dell.com/support/d...&fileid=461457 Documentation here: http://support.dell.com/support/edoc...f/OMDTUGMR.pdf Apparently the way it works is that you have to extract the contents of the iso into a folder, then make the changes to the isolinux/isolinux.cfg on the CD based on how you want it to find a script, that you've written, that you want to run. Based on which preset you made the default in isolinux.cfg, the /bin/start-stage3.sh script in the LiveCD's init image on startup will run the script accordingly. Then you reburn the CD contents to a new ISO. (The documentation gives the mkisofs command to run) The script that you use when mounted and run from that LiveCD makes use of tools in the ISO to deploy things I guess (I just need it to run a few commands so I can change the BIOS boot order on a machine non-interactively). Then you boot into the CD or ISO on the target system and its supposed to run it. So one of the options in the isolinux.cfg is cdrom. In that one, when you're making changes to the ISO and its files, you add the script that you want to it and then during the LiveCD's startup, /bin/start-stage3.sh will mount that CD to /opt/dell/toolkit/systems/ then your script which is at the root of the CD will be run. The isolinux.cfg looks like the following: Code:
# Modify this if dtk files are on modified dtk CD. I tried the stuff at the top of the story in an attempt to make the change to the initrd and that's why I'm getting the init error also at the top of the story. Kernel panic - not syncing: No init found. Try passing init= option to kernel. The reason I even mention the long version of this story is to ask whether I should even be doing this? The LiveCD also has the RPMs for the tools that I need so if I could make a LiveCD via some other method and incorporate those tools would that be better? If so, which would be the easiest method to apply to try to do that? |
I think the problem may be that iso9660 is a read only file system, so saving the new initrd file may be failing. After mounting the image, you may need to copy the contents to a directory, and use that directory to build a new iso image, after replacing the init file. Also, don't change the name of the initrd file. The menu.lst file contains the name of the file.
|
You should omit the "-depth" option in your "find" command. See filesystems/ramfs-rootfs-initramfs.txt in your kernel documentation, to wit:
Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:55 PM. |