Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to add some tools and not just kernel modules into the initrd (initramfs-based). Now I'm aware of how to unpack and how to pack the initrd with cpio and have even written a hook for /etc/initramfs-tools/hooks in the past to integrate a third-party kernel module. However, while the available script libraries seem to be geared towards the integration of modules, none of them seems to be for integration of other entities (in particular programs and their dependencies).

What options do I have to automate the integration of some useful tools for recovery into the initrd? I'm talking about the "rescue" system that the system drops into if it is unable to mount the root drive given to it by the boot loader.

Please note that I don't want the SquashFS approach as is used for Live-CDs because for the issue at hand it will be by far sufficient to include some relatively small tools that aid in recovery of the system (when it gets stuck in initrd and can't boot further). Also, the machines when they run into the issue that we have had in the past tend to boot into the rescue system, but there a few tools are missing to kick the system back on trail ...

share|improve this question

2 Answers 2

up vote 1 down vote accepted

man initramfs-tools

and then write a script for hooks/ containing something like

copy_exec /sbin/mdadm /sbin
share|improve this answer

Check out this article doing something similar with Busybox:

http://scaryreasoner.wordpress.com/2009/08/29/debugging-the-linux-boot-process/

share|improve this answer
    
That's exactly the way I'm aware of and I described briefly above. –  0xC0000022L May 21 '12 at 23:35
1  
Welcome to Ask Ubuntu. While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Peachy Aug 23 '12 at 15:43

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.