<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Olivier's Blog - Computers</title>
    <link>http://www.olivierhill.ca/</link>
    <description>Because they listen to me</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2.1 - http://www.s9y.org/</generator>
    <ttl>60</ttl>

    <image>
        <url>http://www.olivierhill.ca/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Olivier's Blog - Computers - Because they listen to me</title>
        <link>http://www.olivierhill.ca/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Update VMware tools before reboot</title>
    <link>http://www.olivierhill.ca/archives/62-Update-VMware-tools-before-reboot.html</link>
            <category>Computers</category>
    
    <comments>http://www.olivierhill.ca/archives/62-Update-VMware-tools-before-reboot.html#comments</comments>
    <wfw:comment>http://www.olivierhill.ca/wfwcomment.php?cid=62</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.olivierhill.ca/rss.php?version=2.0&amp;type=comments&amp;cid=62</wfw:commentRss>
    

    <author>nospam@example.com (Olivier Hill)</author>
    <content:encoded>
    I have searched the web and couldn&#039;t think of a simpler way to do this.&lt;br /&gt;
&lt;br /&gt;
When you upgrade your kernel, all modules that were installed by the VMware tools will be missing in the new &lt;code&gt;/lib/modules&lt;/code&gt; directory. To reinstall those, you need to reboot first and then re-run the VMware tools. Problems arise if you need the modules prior to the next reboot (ie: if you are doing weird pvscsi on root partition for example).&lt;br /&gt;
&lt;br /&gt;
Out of the box, the VMware tools cannot regenerate modules and initrd for a kernel different than the running one. If you are upgrading the same distribution to a different patch level (RHEL 5 system to a bugfix kernel), chances are that the same modules will work, you just have to install them at the new location.&lt;br /&gt;
&lt;br /&gt;
Tricking the VMware tools software into installing some place else works very well in that case.&lt;br /&gt;
&lt;br /&gt;
This snippet is very RedHat specific, but could be adjusted for any distro. Main points include the uname hack, running a depmod and rebuilding initrd image.&lt;br /&gt;
&lt;br /&gt;
It is important to note that the tools do run depmod, but not specifying a kernel version, hence defaulting to the running kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
# Get latest kernel installed&lt;br /&gt;
VERSION=&quot;$(rpm -qa kernel | sort -r | head -n 1 | sed &#039;s/kernel-//&#039;)&quot;&lt;br /&gt;
&lt;br /&gt;
# uname hack (because VMware Tools are stupid)&lt;br /&gt;
mv /bin/uname{,.orig} &amp;&amp;amp;&lt;br /&gt;
cat &gt; /bin/uname &lt;&lt; EOF &amp;&amp;amp;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec /bin/uname.orig &quot;\$@&quot; | sed &#039;s/2.6.[^ ]*/${VERSION}/&#039;&lt;br /&gt;
EOF&lt;br /&gt;
chmod 0755 /bin/uname&lt;br /&gt;
&lt;br /&gt;
# Launch VMware Tools install&lt;br /&gt;
/usr/bin/vmware-config-tools.pl -d&lt;br /&gt;
&lt;br /&gt;
# Remove our uname hack&lt;br /&gt;
mv /bin/uname{.orig,}&lt;br /&gt;
&lt;br /&gt;
# Redo what VMware missed&lt;br /&gt;
depmod -a $VERSION&lt;br /&gt;
mkinitrd -f /boot/initrd-$VERSION.img $VERSION&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Tested on RHEL 5.4 upgrading to a security fix kernel, works like a charm. 
    </content:encoded>

    <pubDate>Fri, 14 May 2010 12:54:25 -0400</pubDate>
    <guid isPermaLink="false">http://www.olivierhill.ca/archives/62-guid.html</guid>
    
</item>

</channel>
</rss>