<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>codemonkey.org.uk &#187; initramfs</title>
	<atom:link href="http://www.codemonkey.org.uk/tag/initramfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codemonkey.org.uk</link>
	<description>Dave Jones' Linux &#38; opensource stuff.</description>
	<lastBuildDate>Sat, 03 Jul 2010 23:33:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>An annoying kernel packaging bug.</title>
		<link>http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/</link>
		<comments>http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 23:32:25 +0000</pubDate>
		<dc:creator>davej</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dracut]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[initramfs]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://www.codemonkey.org.uk/?p=275</guid>
		<description><![CDATA[The kernel rpm package creates an initramfs file that gets dropped in /boot at install time. Creation of this file is the responsibility of dracut (or mkinitrd in older releases), called from the kernels %post script. Because we want removal of a kernel to also remove its associated initrd file (or else /boot would fill [...]<p><a href="http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/">An annoying kernel packaging bug.</a> is a post from: <a href="http://www.codemonkey.org.uk">codemonkey.org.uk</a></p>



No related posts.]]></description>
			<content:encoded><![CDATA[<p>The kernel rpm package creates an initramfs file that gets dropped in /boot at install time. Creation of this file is the responsibility of dracut (or mkinitrd in older releases), called from the kernels %post script. Because we want removal of a kernel to also remove its associated initrd file (or else /boot would fill up), we used to list the initramfs file in rpms database as a %ghost file owned by the kernel.</p>
<p>For a long time, this hasn&#8217;t been a problem.  Now that dracut creates more feature-heavy initramfs files, people were noticing that they were running out of space in /boot during the installation of the kernel rpm. People were asking <a href="https://bugzilla.redhat.com/show_bug.cgi?id=530778">&#8220;why doesn&#8217;t rpm check for sufficient diskspace before it tries to install ?&#8221;</a>  Well, it does.  The problem is that for %ghost files, it has no way of knowing how big they are going to be.</p>
<p>So for Fedora 12, we ended up with an ugly hack. Instead of listing the file as a ghost, we create a 20MB empty file, owned by the kernel, which gets overwritten during %post by dracut with the real initramfs.</p>
<p>The big problem with this, is that it destroys the possibility for deltarpms to work. (It also guarantees that signature verification using rpm&#8217;s database will fail)</p>
<p>Something better needs to happen, but at this stage, I&#8217;m not entirely sure what that will be. </p>
<p><a href="http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/">An annoying kernel packaging bug.</a> is a post from: <a href="http://www.codemonkey.org.uk">codemonkey.org.uk</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dracut status</title>
		<link>http://www.codemonkey.org.uk/2009/02/02/dracut-status/</link>
		<comments>http://www.codemonkey.org.uk/2009/02/02/dracut-status/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 18:59:13 +0000</pubDate>
		<dc:creator>davej</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dracut]]></category>
		<category><![CDATA[early-init]]></category>
		<category><![CDATA[initramfs]]></category>
		<category><![CDATA[initrd]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[mkinitrd]]></category>

		<guid isPermaLink="false">http://www.codemonkey.org.uk/?p=133</guid>
		<description><![CDATA[I figured I&#8217;d drop a quick &#8216;howto&#8217; to get up and running with dracut, the shiny new initramfs creation tool. Right now, it&#8217;s still very Fedora-centric, with a few hardcoded assumptions in there, so it&#8217;ll likely fall over on other distros, but most of those are silly things like pathnames, which I&#8217;m sure we&#8217;ll eventually [...]<p><a href="http://www.codemonkey.org.uk/2009/02/02/dracut-status/">Dracut status</a> is a post from: <a href="http://www.codemonkey.org.uk">codemonkey.org.uk</a></p>



Related posts:<ol><li><a href='http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/' rel='bookmark' title='Permanent Link: An annoying kernel packaging bug.'>An annoying kernel packaging bug.</a> <small>The kernel rpm package creates an initramfs file that gets...</small></li>
<li><a href='http://www.codemonkey.org.uk/2010/03/29/spot-shell-bug/' rel='bookmark' title='Permanent Link: Spot the shell bug.'>Spot the shell bug.</a> <small>This is bugging me. I&#8217;m missing something obvious here, and...</small></li>
<li><a href='http://www.codemonkey.org.uk/2009/09/16/bootinit-miniconf-plumbers-week/' rel='bookmark' title='Permanent Link: boot/init miniconf at plumbers next week.'>boot/init miniconf at plumbers next week.</a> <small>I&#8217;m MC&#8217;ing the boot/init miniconf next week at the Linux...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I figured I&#8217;d drop a quick &#8216;howto&#8217; to get up and running with dracut, the shiny new initramfs creation tool. Right now, it&#8217;s still very Fedora-centric, with a few hardcoded assumptions in there, so it&#8217;ll likely fall over on other distros, but most of those are silly things like pathnames, which I&#8217;m sure we&#8217;ll eventually come to some agreement over.</p>
<p>So to begin with, clone the git repo from git://fedorapeople.org/~katzj/dracut.git   (This will move soon, as Jeremy asked me to take over the lead on dracut, but until there&#8217;s additional changes, go there).</p>
<p>After a brief cloning, you&#8217;ll be left with a dracut directory containing a bunch of interesting files..</p>
<p>&#8216;dracut&#8217; is the shell script that will actually generate an initramfs image.  It sources the &#8216;dracut-functions&#8217; script to do some of the trickier things like working out module dependancies.  This script will eventually get called by the kernel during its build process as part of &#8216;make initramfs&#8217;.</p>
<p>dracut.spec is an RPM spec file, handy for testing on Fedora systems until we get the kernel bits hooked up.</p>
<p>&#8216;init&#8217; is the actual init script that ends up in the initramfs.<br />
It achieves quite a lot in its 119 lines.</p>
<ul>
<li>Sets up device nodes</p>
<li>starts up udev
<li>figures out from the command line what kind of root device we&#8217;re expecting
<li>waits for it to show up in /dev, and mounts it
<li>mounts /proc and /sys
<li>If anything goes wrong at all during mounting of the root filesystem, it drops you to a shell.
<li>If plymouth is present, it starts it, so it can show splash screens, or prompt for an encrypted disk password etc.
<li>Right now it&#8217;s also loading the default selinux policy, though there seems to be agreement that the right place for this to happen is in the real rootfs, in /sbin/init.
</ul>
<p>There&#8217;s a makefile that will install things in the right places if you&#8217;re on a Fedora system. (libexec, ugh).  If you don&#8217;t do this, you can still run dracut directly from the checked out tree, by passing it the option -l</p>
<p>rules.d contains two udev rules. One which scans for LVM volumes when it gets a notification that a new block device has been added to the system, and another which handles encrypted block devices should one show up.  Both of these rules are not shining examples of how this should be done, and could use improving.</p>
<p>&#8216;switch_root&#8217; is the sole surviving piece of &#8216;nash&#8217;. Its job is fairly simple. Switch to new root directory and start init from that new root.  Right now, we&#8217;re calling the nash tool from the existing mkinitrd implementation.  The code for the replacement of this currently lives at http://pjones.fedorapeople.org/mkstart/usr/lib/mkstart/switchroot.c  It is hoped that this will get included as a util-linux utility soon, so that nash can finally be put to rest.</p>
<p>Finally there&#8217;s all the usual things you&#8217;d expect to see in a project, COPYING, HACKING, README and a healthy looking TODO.</p>
<p>The interesting parts (the shell scripts) are currently only just over 600 lines, making it a fairly easy to understand project.   Removing some of the redhat&#8217;isms is definitely one of the things that needs to happen before it can be headed upstream.  I hope to get around to trying it out on some other distros later this week.</p>
<p>So with the overview out of the way..  Run the generator directly, with a target filename as a parameter. (Remember to specify -l unless you&#8217;ve done &#8216;make install&#8217;), and you should get a compressed cpio archive created in the name you chose.</p>
<p>Currently, dracut supports root on raw disks (/dev/sda), lvm (/dev/mapper&#8230;), and mounting root by label or uuid.<br />
If you have a more esoteric rootfs setup, such as root-on-nfs, right now it&#8217;ll fail horribly.</p>
<p>That&#8217;s the quick braindump that should be enough to get people playing with it.  There is a very low traffic mailing list initramfs at vger.kernel.org,  (send &#8216;subscribe initramfs&#8217; to majordomo@vger to get subscribed).</p>
<p><a href="http://www.codemonkey.org.uk/2009/02/02/dracut-status/">Dracut status</a> is a post from: <a href="http://www.codemonkey.org.uk">codemonkey.org.uk</a></p>


<p>Related posts:<ol><li><a href='http://www.codemonkey.org.uk/2009/12/10/annoying-kernel-packaging-bug/' rel='bookmark' title='Permanent Link: An annoying kernel packaging bug.'>An annoying kernel packaging bug.</a> <small>The kernel rpm package creates an initramfs file that gets...</small></li>
<li><a href='http://www.codemonkey.org.uk/2010/03/29/spot-shell-bug/' rel='bookmark' title='Permanent Link: Spot the shell bug.'>Spot the shell bug.</a> <small>This is bugging me. I&#8217;m missing something obvious here, and...</small></li>
<li><a href='http://www.codemonkey.org.uk/2009/09/16/bootinit-miniconf-plumbers-week/' rel='bookmark' title='Permanent Link: boot/init miniconf at plumbers next week.'>boot/init miniconf at plumbers next week.</a> <small>I&#8217;m MC&#8217;ing the boot/init miniconf next week at the Linux...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codemonkey.org.uk/2009/02/02/dracut-status/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
