Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can anyone tell me how to create a cd which when booted from will automatically run a script I choose? I am trying to read the contents of the RAM before the system entirely boots so it must be lightweight too. I can get a light linux distro but how do I add the script to run when booting is done from the cd?

I am working with some old laptops which don't support booting from USB 2.0 hard disks. So i need to boot from a cd.

Any help will be appreciated.

Thanks in advance.

share|improve this question
    
I don't really have a complete answer for this so I'll just comment. What you need to do is crack into the initrd image and manipulate it to do what you want. initrd is actually a small kernel image into memory that loads another kernel with the full operating system. It is a minimalist system that provides the basic resources but it can be manipulated to do more. It's no easy task but it's do-able. Google around. –  Evan Plaice Mar 16 '11 at 5:11
    
@EvanPlaice: initrd is not a small kernel, it is just a collection of tools that get loaded by the (normal)kernel before the filesystems are mounted. depending on what you want to do it is not really hard to write your own initscript, changing an allready existing initrd might be somewhat harder though, but still no rocketscience to open it, they are only compressed files (eg gzip). –  Baarn Feb 14 '12 at 21:52
    
@ryan if you need a lightweight linux distro with high configurability i would take a look at archlinux, gentoo or linuxfromscratch. i ordered that list by the amount of braindamage you are willing to take. there should be plenty of guides on creating your own liveCD for each of the systems. –  Baarn Feb 14 '12 at 21:55
    
@WalterMaier-Murdnelch When I say Kernel read it as, throwaway filesystem which isn't a whole lot different than a lightweight distro that's loaded to a ramdisk on boot. All the standard initrd does is load the utilities necessary to load another OS from disk. To see what an initrd image is made of, take a look at: ibm.com/developerworks/linux/library/l-initrd/index.html. YBDMV (Your Brain Damage May Vary). –  Evan Plaice Feb 14 '12 at 22:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.