Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CentOS 5.5 installation with the stock CentOS 5.5 kernel. I have modified the init script in the initrd, commenting out some unneeded modules, lowering the interval time of the "stabilized" command , etc.

My question is, what will happen in the future when Yum updates the kernel? Will my initrd modifications make it into the initrd of the new kernel?

share|improve this question

No, your changes won't be in the new initrd. The CentOS kernel packages have a post-script that runs /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install 2.6.18-238.1.1.el5 (an example from the RHEL5 kernel I have installed).

The command will run mkinitrd, which will build a new initrd, and the changes that you made to the previous initrd won't be created there, unless you've also changed the mkinitrd script or its files (or you patched nash or something like that).

share|improve this answer
Ok, thanks that is what I needed to know! – Lars Feb 6 '11 at 18:37
This modified initrd is part of a cloning script for automating installation of about 100 workstations of various age and hardware. I could disable kernel updates, but not if the newer kernel fixes security issues. Questions: 1) How frequently do kernel updates address security holes? 2) If I do have to update the kernel on these workstation in the future, I plan to write a script that does something along these lines: a) Let yum update the kernel b) Run a script that unpacks, updates and re-packs initrd in each station. Thoughts on this? – Lars Feb 6 '11 at 18:48
@Lars: My guess would be that kernel upgrades very rarely are for security reasons. But don't take my word for that. – Falmarri Feb 6 '11 at 19:49
@Lars: 1.) Actually, nearly every RHEL5/CentOS5 kernel update I've seen has been because of some security fix in the kernel. 2.) You might benefit from patching the scripts that generate the initrd rather than running something that unpacks/repacks the initrd after the original scripts do their job. Look through /sbin/mkinitrd to find the stabilize commands. – jsbillings Feb 6 '11 at 21:05
@jsbillings: 1) Ok, that's a pain...; 2) Ok, but if yum updates the mkinitrd script in the future, would my changes there not get lost as well? Also, unpacking an initrd, running a simple perl script to massage the init script and then packing it back up again seems easier (and keeps my custom stuff decoupled from the standard CentOS stuff). I guess either way works, as long as it gets the job done... By the way, could you elaborate on the how stabilize command relates to this? (I know very little about it, except that it delays boot by 15 seconds, which seems excessive) – Lars Feb 7 '11 at 2:33

Your Answer


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.