
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.funtoo.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;feed=atom&amp;action=history</id>
		<title>Grub-install - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.funtoo.org/index.php?title=Grub-install&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;action=history"/>
		<updated>2013-05-22T15:55:46Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2579&amp;oldid=prev</id>
		<title>Brantgurga: I corrected a typo.</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2579&amp;oldid=prev"/>
				<updated>2010-11-15T18:02:48Z</updated>
		
		<summary type="html">&lt;p&gt;I corrected a typo.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:02, 15 November 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 411:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 411:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;exit 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;exit 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Grub finally uses the information about needed modules to create an image using &amp;lt;code&amp;gt;grub-mkimage&amp;lt;/code&amp;gt;. The initial &amp;lt;code&amp;gt;boot.img&amp;lt;/code&amp;gt; file is then modified to point to the &amp;lt;code&amp;gt;core.img&amp;lt;/code&amp;gt; file that was just generated. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Thatr &lt;/del&gt;image is then installed to the desired installation device with &amp;lt;code&amp;gt;grub-setup&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Grub finally uses the information about needed modules to create an image using &amp;lt;code&amp;gt;grub-mkimage&amp;lt;/code&amp;gt;. The initial &amp;lt;code&amp;gt;boot.img&amp;lt;/code&amp;gt; file is then modified to point to the &amp;lt;code&amp;gt;core.img&amp;lt;/code&amp;gt; file that was just generated. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;That &lt;/ins&gt;image is then installed to the desired installation device with &amp;lt;code&amp;gt;grub-setup&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Grub]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:Grub]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:version:1.11a:oldid:2578:newid:2579 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brantgurga</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2578&amp;oldid=prev</id>
		<title>Brantgurga: I placed this into the Grub category.</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2578&amp;oldid=prev"/>
				<updated>2010-11-15T00:39:11Z</updated>
		
		<summary type="html">&lt;p&gt;I placed this into the Grub category.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:39, 15 November 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 412:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 412:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Grub finally uses the information about needed modules to create an image using &amp;lt;code&amp;gt;grub-mkimage&amp;lt;/code&amp;gt;. The initial &amp;lt;code&amp;gt;boot.img&amp;lt;/code&amp;gt; file is then modified to point to the &amp;lt;code&amp;gt;core.img&amp;lt;/code&amp;gt; file that was just generated. Thatr image is then installed to the desired installation device with &amp;lt;code&amp;gt;grub-setup&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Grub finally uses the information about needed modules to create an image using &amp;lt;code&amp;gt;grub-mkimage&amp;lt;/code&amp;gt;. The initial &amp;lt;code&amp;gt;boot.img&amp;lt;/code&amp;gt; file is then modified to point to the &amp;lt;code&amp;gt;core.img&amp;lt;/code&amp;gt; file that was just generated. Thatr image is then installed to the desired installation device with &amp;lt;code&amp;gt;grub-setup&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Grub]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brantgurga</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2577&amp;oldid=prev</id>
		<title>Brantgurga: I finished up about what grub-install is doing.</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2577&amp;oldid=prev"/>
				<updated>2010-11-15T00:15:20Z</updated>
		
		<summary type="html">&lt;p&gt;I finished up about what grub-install is doing.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:15, 15 November 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; ;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; ;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;esac&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;esac&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Set up the location where Grub will be installed.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;grubdir=${bootdir}/`echo grub | sed ${transform}`&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;grubdir=${bootdir}/`echo grub | sed ${transform}`&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 247:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 250:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;These blocks ensure that grub components are installed.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Create the GRUB directory if it is not present.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Create the GRUB directory if it is not present.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;test -d &amp;quot;$bootdir&amp;quot; || mkdir &amp;quot;$bootdir&amp;quot; || exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;test -d &amp;quot;$bootdir&amp;quot; || mkdir &amp;quot;$bootdir&amp;quot; || exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 266:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 271:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; $grub_mkdevicemap --device-map=$device_map $no_floppy || exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; $grub_mkdevicemap --device-map=$device_map $no_floppy || exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This creates the device map by calling &amp;lt;code&amp;gt;grub-mkdevicemap&amp;lt;/code&amp;gt;. That program will create a mapping from the Grub device names to the Linux device nodes.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Make sure that there is no duplicated entry.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Make sure that there is no duplicated entry.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 274:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 282:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This does some sanity checks on the device map file in case it has been manually corrected in an erroneous way.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Copy the GRUB images to the GRUB directory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Copy the GRUB images to the GRUB directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 299:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 310:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This copies grub components and its localization files to the [[The_Root_Filesystem#.2Fboot_:_Static_files_of_the_boot_loader|boot]] directory.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Write device to a variable so we don't have to traverse /dev every time.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Write device to a variable so we don't have to traverse /dev every time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 326:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 340:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;modules=&amp;quot;$modules $disk_module&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;modules=&amp;quot;$modules $disk_module&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;modules=&amp;quot;$modules $fs_module $partmap_module $devabstraction_module&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;modules=&amp;quot;$modules $fs_module $partmap_module $devabstraction_module&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Since Grub is modular, it needs the modules that allow it to recognize the boot directory. Consequently, it uses the &amp;lt;code&amp;gt;grub-probe&amp;lt;/code&amp;gt; command to determine the modules necessary and adds them to the modules list in an appropriate order. Once it can recognize the boot directory, Grub can dynamically load modules as necessary and read its configuration file.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 373:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 390:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; prefix_drive=`$grub_probe --target=drive --device ${grub_device}`&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; prefix_drive=`$grub_probe --target=drive --device ${grub_device}`&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Partitions can be moved around or initialized in a different order, so Grub wants to identify filesystems by their UUIDs. It also can load from a drive different from where it is installed. It does further probing to determine if the UUID module will be needed and includes it with the other modules.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 391:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 411:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;exit 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;exit 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Grub finally uses the information about needed modules to create an image using &amp;lt;code&amp;gt;grub-mkimage&amp;lt;/code&amp;gt;. The initial &amp;lt;code&amp;gt;boot.img&amp;lt;/code&amp;gt; file is then modified to point to the &amp;lt;code&amp;gt;core.img&amp;lt;/code&amp;gt; file that was just generated. Thatr image is then installed to the desired installation device with &amp;lt;code&amp;gt;grub-setup&amp;lt;/code&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:version:1.11a:oldid:2576:newid:2577 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brantgurga</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2576&amp;oldid=prev</id>
		<title>Brantgurga: I annotated a bit more of what grub-install is doing.</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2576&amp;oldid=prev"/>
				<updated>2010-11-14T22:52:33Z</updated>
		
		<summary type="html">&lt;p&gt;I annotated a bit more of what grub-install is doing.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 22:52, 14 November 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 184:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 184:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This block ensures that a destination device was specified to &amp;lt;code&amp;gt;grub-install&amp;lt;/code&amp;gt; as an argument.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# If the debugging feature is enabled, print commands.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# If the debugging feature is enabled, print commands.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 191:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 196:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; setup_verbose=&amp;quot;--verbose&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; setup_verbose=&amp;quot;--verbose&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This block makes &amp;lt;code&amp;gt;grub-install&amp;lt;/code&amp;gt; more verbose if grub was built with debugging enabled.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Initialize these directories here, since ROOTDIR was initialized.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Initialize these directories here, since ROOTDIR was initialized.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:version:1.11a:oldid:2575:newid:2576 --&gt;
&lt;/table&gt;</summary>
		<author><name>Brantgurga</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2575&amp;oldid=prev</id>
		<title>Brantgurga: I began annotating the source code.</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/index.php?title=Grub-install&amp;diff=2575&amp;oldid=prev"/>
				<updated>2010-11-14T22:39:12Z</updated>
		
		<summary type="html">&lt;p&gt;I began annotating the source code.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is an annotation about what grub-install does. This is based on the &amp;lt;code&amp;gt;=sys-boot/grub-1.98-r1&amp;lt;/code&amp;gt; version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This tells the Linux kernel that this script will be executed with &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Install GRUB on your drive.&lt;br /&gt;
# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Free Software Foundation, Inc.&lt;br /&gt;
#&lt;br /&gt;
# GRUB is free software: you can redistribute it and/or modify&lt;br /&gt;
# it under the terms of the GNU General Public License as published by&lt;br /&gt;
# the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
# (at your option) any later version.&lt;br /&gt;
#&lt;br /&gt;
# GRUB is distributed in the hope that it will be useful,&lt;br /&gt;
# but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
# GNU General Public License for more details.&lt;br /&gt;
#&lt;br /&gt;
# You should have received a copy of the GNU General Public License&lt;br /&gt;
# along with GRUB.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This section tells that this script falls under the GNU General Public License.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Initialize some variables.&lt;br /&gt;
transform=&amp;quot;s,x,x,&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prefix=/usr&lt;br /&gt;
exec_prefix=${prefix}&lt;br /&gt;
sbindir=/sbin&lt;br /&gt;
bindir=/bin&lt;br /&gt;
libdir=/lib64&lt;br /&gt;
PACKAGE_NAME=GRUB&lt;br /&gt;
PACKAGE_TARNAME=grub&lt;br /&gt;
PACKAGE_VERSION=1.98&lt;br /&gt;
target_cpu=i386&lt;br /&gt;
platform=pc&lt;br /&gt;
host_os=linux-gnu&lt;br /&gt;
font=/usr/share/grub/ascii.pf2&lt;br /&gt;
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
These are some variables set when Grub was configured for the system.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;mips-yeeloong&amp;quot; ] ; then&lt;br /&gt;
    grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`&lt;br /&gt;
else&lt;br /&gt;
    grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`&lt;br /&gt;
fi&lt;br /&gt;
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`&lt;br /&gt;
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`&lt;br /&gt;
grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`&lt;br /&gt;
rootdir=&lt;br /&gt;
grub_prefix=`echo /boot/grub | sed ${transform}`&lt;br /&gt;
modules=&lt;br /&gt;
&lt;br /&gt;
install_device=&lt;br /&gt;
no_floppy=&lt;br /&gt;
force_lba=&lt;br /&gt;
recheck=no&lt;br /&gt;
debug=no&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] ; then&lt;br /&gt;
    disk_module=biosdisk&lt;br /&gt;
elif [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;br /&gt;
    disk_module=&lt;br /&gt;
else&lt;br /&gt;
    disk_module=ata&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Further variables were initialized some of which were done so in a platform-dependent manner such as &amp;lt;code&amp;gt;disk_module&amp;lt;/code&amp;gt; being set to &amp;lt;code&amp;gt;biosdisk&amp;lt;/code&amp;gt; on i386-pc systems.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Usage: usage&lt;br /&gt;
# Print the usage.&lt;br /&gt;
usage () {&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
Usage: grub-install [OPTION] install_device&lt;br /&gt;
Install GRUB on your drive.&lt;br /&gt;
&lt;br /&gt;
  -h, --help              print this message and exit&lt;br /&gt;
  -v, --version           print the version information and exit&lt;br /&gt;
  --modules=MODULES       pre-load specified modules MODULES&lt;br /&gt;
  --root-directory=DIR    install GRUB images under the directory DIR&lt;br /&gt;
                          instead of the root directory&lt;br /&gt;
  --grub-setup=FILE       use FILE as grub-setup&lt;br /&gt;
  --grub-mkimage=FILE     use FILE as grub-mkimage&lt;br /&gt;
  --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap&lt;br /&gt;
  --grub-probe=FILE       use FILE as grub-probe&lt;br /&gt;
  --no-floppy             do not probe any floppy drive&lt;br /&gt;
  --recheck               probe a device map even if it already exists&lt;br /&gt;
  --force                 install even if problems are detected&lt;br /&gt;
EOF&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] ; then&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
  --disk-module=MODULE    disk module to use&lt;br /&gt;
EOF&lt;br /&gt;
fi&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;mips-yeeloong&amp;quot; ] ; then&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
  --font=FILE             font file to use&lt;br /&gt;
EOF&lt;br /&gt;
fi&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
&lt;br /&gt;
INSTALL_DEVICE can be a GRUB device name or a system device filename.&lt;br /&gt;
&lt;br /&gt;
grub-install copies GRUB images into /boot/grub (or /grub on NetBSD and&lt;br /&gt;
OpenBSD), and uses grub-setup to install grub into the boot sector.&lt;br /&gt;
&lt;br /&gt;
If the --root-directory option is used, then grub-install will copy&lt;br /&gt;
images into the operating system installation rooted at that directory.&lt;br /&gt;
&lt;br /&gt;
Report bugs to &amp;lt;bug-grub@gnu.org&amp;gt;.&lt;br /&gt;
EOF&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This sets up the usage message that &amp;lt;code&amp;gt;grub-install&amp;lt;/code&amp;gt; prints if it doesn't understand what arguments it was given.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Check the arguments.&lt;br /&gt;
for option in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
    case &amp;quot;$option&amp;quot; in&lt;br /&gt;
    -h | --help)&lt;br /&gt;
	usage&lt;br /&gt;
	exit 0 ;;&lt;br /&gt;
    -v | --version)&lt;br /&gt;
	echo &amp;quot;grub-install (GNU GRUB ${PACKAGE_VERSION})&amp;quot;&lt;br /&gt;
	exit 0 ;;&lt;br /&gt;
    --modules=*)&lt;br /&gt;
	modules=`echo &amp;quot;$option&amp;quot; | sed 's/--modules=//'` ;;&lt;br /&gt;
    --font=*)&lt;br /&gt;
	font=`echo &amp;quot;$option&amp;quot; | sed 's/--font=//'` ;;&lt;br /&gt;
    --root-directory=*)&lt;br /&gt;
	rootdir=`echo &amp;quot;$option&amp;quot; | sed 's/--root-directory=//'` ;;&lt;br /&gt;
    --grub-setup=*)&lt;br /&gt;
	grub_setup=`echo &amp;quot;$option&amp;quot; | sed 's/--grub-setup=//'` ;;&lt;br /&gt;
    --grub-mkimage=*)&lt;br /&gt;
	grub_mkimage=`echo &amp;quot;$option&amp;quot; | sed 's/--grub-mkimage=//'` ;;&lt;br /&gt;
    --grub-mkdevicemap=*)&lt;br /&gt;
	grub_mkdevicemap=`echo &amp;quot;$option&amp;quot; | sed 's/--grub-mkdevicemap=//'` ;;&lt;br /&gt;
    --grub-probe=*)&lt;br /&gt;
	grub_probe=`echo &amp;quot;$option&amp;quot; | sed 's/--grub-probe=//'` ;;&lt;br /&gt;
    --no-floppy)&lt;br /&gt;
	no_floppy=&amp;quot;--no-floppy&amp;quot; ;;&lt;br /&gt;
    --recheck)&lt;br /&gt;
	recheck=yes ;;&lt;br /&gt;
    --disk-module=*)&lt;br /&gt;
	if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] ; then&lt;br /&gt;
           disk_module=`echo &amp;quot;$option&amp;quot; | sed 's/--disk-module=//'`&lt;br /&gt;
        fi ;;&lt;br /&gt;
    # This is an undocumented feature...&lt;br /&gt;
    --debug)&lt;br /&gt;
	debug=yes ;;&lt;br /&gt;
    -f | --force)&lt;br /&gt;
        setup_force=&amp;quot;--force&amp;quot; ;;&lt;br /&gt;
    -*)&lt;br /&gt;
	echo &amp;quot;Unrecognized option \`$option'&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
	usage&lt;br /&gt;
	exit 1&lt;br /&gt;
	;;&lt;br /&gt;
    *)&lt;br /&gt;
	if test &amp;quot;x$install_device&amp;quot; != x; then&lt;br /&gt;
	    echo &amp;quot;More than one install_devices?&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
	    usage&lt;br /&gt;
	    exit 1&lt;br /&gt;
	fi&lt;br /&gt;
	install_device=&amp;quot;${option}&amp;quot; ;;&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This section parses the command line arguments and sets variables appropriately.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for make_system_path_relative_to_its_root()&lt;br /&gt;
. ${libdir}/grub/grub-mkconfig_lib&lt;br /&gt;
&lt;br /&gt;
if test &amp;quot;x$install_device&amp;quot; = x &amp;amp;&amp;amp; test &amp;quot;${target_cpu}-${platform}&amp;quot; != &amp;quot;mips-yeeloong&amp;quot;; then&lt;br /&gt;
    echo &amp;quot;install_device not specified.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    usage&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# If the debugging feature is enabled, print commands.&lt;br /&gt;
setup_verbose=&lt;br /&gt;
if test $debug = yes; then&lt;br /&gt;
    set -x&lt;br /&gt;
    setup_verbose=&amp;quot;--verbose&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Initialize these directories here, since ROOTDIR was initialized.&lt;br /&gt;
case &amp;quot;$host_os&amp;quot; in&lt;br /&gt;
netbsd* | openbsd*)&lt;br /&gt;
    # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub&lt;br /&gt;
    # instead of /boot/grub.&lt;br /&gt;
    grub_prefix=`echo /grub | sed ${transform}`&lt;br /&gt;
    bootdir=${rootdir}&lt;br /&gt;
    ;;&lt;br /&gt;
*)&lt;br /&gt;
    # Use /boot/grub by default.&lt;br /&gt;
    bootdir=${rootdir}/boot&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
grubdir=${bootdir}/`echo grub | sed ${transform}`&lt;br /&gt;
device_map=${grubdir}/device.map&lt;br /&gt;
&lt;br /&gt;
grub_probe=&amp;quot;${grub_probe} --device-map=${device_map}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Check if GRUB is installed.&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;br /&gt;
    set $grub_setup dummy&lt;br /&gt;
    if test -f &amp;quot;$1&amp;quot;; then&lt;br /&gt;
        :&lt;br /&gt;
    else&lt;br /&gt;
        echo &amp;quot;$1: Not found.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
set $grub_mkimage dummy&lt;br /&gt;
if test -f &amp;quot;$1&amp;quot;; then&lt;br /&gt;
    :&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;$1: Not found.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
set $grub_mkdevicemap dummy&lt;br /&gt;
if test -f &amp;quot;$1&amp;quot;; then&lt;br /&gt;
    :&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;$1: Not found.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Create the GRUB directory if it is not present.&lt;br /&gt;
test -d &amp;quot;$bootdir&amp;quot; || mkdir &amp;quot;$bootdir&amp;quot; || exit 1&lt;br /&gt;
test -d &amp;quot;$grubdir&amp;quot; || mkdir &amp;quot;$grubdir&amp;quot; || exit 1&lt;br /&gt;
&lt;br /&gt;
# If --recheck is specified, remove the device map, if present.&lt;br /&gt;
if test $recheck = yes; then&lt;br /&gt;
    rm -f $device_map&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Create the device map file if it is not present.&lt;br /&gt;
if test -f &amp;quot;$device_map&amp;quot;; then&lt;br /&gt;
    :&lt;br /&gt;
else&lt;br /&gt;
    # Create a safe temporary file.&lt;br /&gt;
    test -n &amp;quot;$mklog&amp;quot; &amp;amp;&amp;amp; log_file=`$mklog`&lt;br /&gt;
&lt;br /&gt;
    $grub_mkdevicemap --device-map=$device_map $no_floppy || exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Make sure that there is no duplicated entry.&lt;br /&gt;
tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \&lt;br /&gt;
    | sort | uniq -d | sed -n 1p`&lt;br /&gt;
if test -n &amp;quot;$tmp&amp;quot;; then&lt;br /&gt;
    echo &amp;quot;The drive $tmp is defined multiple times in the device map $device_map&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy the GRUB images to the GRUB directory.&lt;br /&gt;
for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img ${grubdir}/efiemu??.o; do&lt;br /&gt;
    if test -f $file &amp;amp;&amp;amp; [ &amp;quot;`basename $file`&amp;quot; != menu.lst ]; then&lt;br /&gt;
	rm -f $file || exit 1&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do&lt;br /&gt;
    cp -f $file ${grubdir} || exit 1&lt;br /&gt;
done&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;br /&gt;
    for file in ${pkglibdir}/*.img ${pkglibdir}/efiemu??.o; do&lt;br /&gt;
	if test -f $file; then&lt;br /&gt;
	    cp -f $file ${grubdir} || exit 1&lt;br /&gt;
	fi&lt;br /&gt;
    done&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy gettext files&lt;br /&gt;
mkdir -p ${grubdir}/locale/&lt;br /&gt;
for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do&lt;br /&gt;
    if test -f &amp;quot;$file&amp;quot;; then&lt;br /&gt;
        cp -f &amp;quot;$file&amp;quot; ${grubdir}/locale/&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# Write device to a variable so we don't have to traverse /dev every time.&lt;br /&gt;
grub_device=`$grub_probe --target=device ${grubdir}`&lt;br /&gt;
&lt;br /&gt;
if ! test -f ${grubdir}/grubenv; then&lt;br /&gt;
    $grub_editenv ${grubdir}/grubenv create&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Create the core image. First, auto-detect the filesystem module.&lt;br /&gt;
fs_module=`$grub_probe --target=fs --device ${grub_device}`&lt;br /&gt;
if test &amp;quot;x$fs_module&amp;quot; = x -a &amp;quot;x$modules&amp;quot; = x; then&lt;br /&gt;
    echo &amp;quot;Auto-detection of a filesystem module failed.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    echo &amp;quot;Please specify the module with the option \`--modules' explicitly.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Then the partition map module.  In order to support partition-less media,&lt;br /&gt;
# this command is allowed to fail (--target=fs already grants us that the&lt;br /&gt;
# filesystem will be accessible).&lt;br /&gt;
partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2&amp;gt; /dev/null`&lt;br /&gt;
&lt;br /&gt;
# Device abstraction module, if any (lvm, raid).&lt;br /&gt;
devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}`&lt;br /&gt;
&lt;br /&gt;
# The order in this list is critical.  Be careful when modifying it.&lt;br /&gt;
modules=&amp;quot;$modules $disk_module&amp;quot;&lt;br /&gt;
modules=&amp;quot;$modules $fs_module $partmap_module $devabstraction_module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1&lt;br /&gt;
if [ &amp;quot;x${relative_grubdir}&amp;quot; = &amp;quot;x&amp;quot; ] ; then&lt;br /&gt;
    relative_grubdir=/&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
prefix_drive=&lt;br /&gt;
config_opt=&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;x${devabstraction_module}&amp;quot; = &amp;quot;x&amp;quot; ] ; then&lt;br /&gt;
    if [ x&amp;quot;${install_device}&amp;quot; != x ]; then&lt;br /&gt;
      if echo &amp;quot;${install_device}&amp;quot; | grep -qx &amp;quot;(.*)&amp;quot; ; then&lt;br /&gt;
        install_drive=&amp;quot;${install_device}&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        install_drive=&amp;quot;`$grub_probe --target=drive --device ${install_device}`&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
      install_drive=&amp;quot;`echo ${install_drive} | sed -e s/,[0-9]*[a-z]*//g`&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    grub_drive=&amp;quot;`$grub_probe --target=drive --device ${grub_device}`&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Strip partition number&lt;br /&gt;
    grub_drive=&amp;quot;`echo ${grub_drive} | sed -e s/,[0-9]*[a-z]*//g`&amp;quot;&lt;br /&gt;
    if [ &amp;quot;$disk_module&amp;quot; = ata ] ; then&lt;br /&gt;
        # generic method (used on coreboot and ata mod)&lt;br /&gt;
        uuid=&amp;quot;`$grub_probe --target=fs_uuid --device ${grub_device}`&amp;quot;&lt;br /&gt;
        if [ &amp;quot;x${uuid}&amp;quot; = &amp;quot;x&amp;quot; ] ; then&lt;br /&gt;
          echo &amp;quot;UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
          exit 1&lt;br /&gt;
        fi&lt;br /&gt;
        echo &amp;quot;search.fs_uuid ${uuid} root &amp;quot; &amp;gt; ${grubdir}/load.cfg&lt;br /&gt;
	echo 'set prefix=($root)'&amp;quot;${relative_grubdir}&amp;quot; &amp;gt;&amp;gt; ${grubdir}/load.cfg&lt;br /&gt;
	config_opt=&amp;quot;-c ${grubdir}/load.cfg &amp;quot;&lt;br /&gt;
        modules=&amp;quot;$modules search_fs_uuid&amp;quot;&lt;br /&gt;
    elif [ &amp;quot;x${grub_drive}&amp;quot; != &amp;quot;x${install_drive}&amp;quot; ] ; then&lt;br /&gt;
        uuid=&amp;quot;`$grub_probe --target=fs_uuid --device ${grub_device}`&amp;quot;&lt;br /&gt;
        if [ &amp;quot;x${uuid}&amp;quot; = &amp;quot;x&amp;quot; ] ; then&lt;br /&gt;
          echo &amp;quot;You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
          exit 1&lt;br /&gt;
        fi&lt;br /&gt;
        echo &amp;quot;search.fs_uuid ${uuid} root &amp;quot; &amp;gt; ${grubdir}/load.cfg&lt;br /&gt;
	echo 'set prefix=($root)'&amp;quot;${relative_grubdir}&amp;quot; &amp;gt;&amp;gt; ${grubdir}/load.cfg&lt;br /&gt;
	config_opt=&amp;quot;-c ${grubdir}/load.cfg &amp;quot;&lt;br /&gt;
        modules=&amp;quot;$modules search_fs_uuid&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
else&lt;br /&gt;
    prefix_drive=`$grub_probe --target=drive --device ${grub_device}`&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;i386-pc&amp;quot; ] || [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;sparc64-ieee1275&amp;quot; ] ; then&lt;br /&gt;
    $grub_mkimage ${config_opt} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1&lt;br /&gt;
&lt;br /&gt;
    # Now perform the installation.&lt;br /&gt;
    $grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \&lt;br /&gt;
        ${install_device} || exit 1&lt;br /&gt;
elif [ &amp;quot;${target_cpu}-${platform}&amp;quot; = &amp;quot;mips-yeeloong&amp;quot; ] ; then&lt;br /&gt;
    $grub_mkimage ${config_opt} -f ${font} -d ${pkglibdir} -O elf --output=/boot/grub.elf --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1&lt;br /&gt;
else&lt;br /&gt;
    $grub_mkimage ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Installation finished. No error reported.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bye.&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Brantgurga</name></author>	</entry>

	</feed>