<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>Fun with ones and zeros - hyper-v</title>
<description><![CDATA[Barry's notes on computer software and hardware]]></description>
<link>/blog/tags/hyper-v</link>
<lastBuildDate>Wed, 13 May 2026 12:20:47 -0700</lastBuildDate>
<item>
<title>Rebuilding Hyper-V Linux Integration Components for a kernel upgrade</title>
<link>/blog/entries/rebuilding-hyper-v-linux-integration-components-ke</link>
<pubDate>Wed, 13 Apr 2011 10:58:00 -0700</pubDate>
<author>bp@barryp.org (Barry Pederson)</author>
<description><![CDATA[<body><p>At work I've been running RedHat Enterprise Linux (RHEL) 5.6 on top of a Windows Server 2008 R2 Hyper-V host, with
Linux Integration Components (LinuxIC) installed.  </p>
<p>That all worked fine until I did a <code>yum update</code> on RHEL to pick up a new kernel and tried to reboot.  The new kernel
panicked, saying it couldn't find my LVM volume groups.  Fortunately, the old kernel was still on the menu and booted OK.<br>
Turns out the new kernel for whatever reason wouldn't see the virtual disks for that machine.</p>
<p>OK, so I needed to rebuild LinuxIC for the new kernel while running the old kernel, how to do that?  The Makefile and
various scripts that come with LinuxIC basically builds for and installs on the currently running kernel.  Fortunately
I came across <a href="http://techie.org/Blog/2011/03/20/hyper-v-upgrading-kernel-on-an-centos-guest-os/">this post</a> showing a trick of replacing <code>/bin/uname</code> with a fake version that shows the kernel
version number you want to build for.  Tried that and was back in business.</p>
<p>I think this would work too, without messing with the original <code>/bin/uname</code>:  create a directory somewhere, say '/tmp/fake_uname' and stick this file in it with the name <code>uname</code>  (changing the "echo" line with the installed kernel version number you want to build for.</p>
<div class="source"><pre><span></span><span class="c1">#/bin/sh case $1 in -r) echo "2.6.18-238.9.1.el5" ;; *) exec /bin/uname $1 ;; esac</span>
</pre></div>
<p>Then build and install your Linux IC with the <code>/tmp/fake_uname</code> prepended to your PATH as in</p>
<pre><code>PATH=/tmp/fake_uname:$PATH make
PATH=/tmp/fake_uname:$PATH make install</code></pre>
<p>When the LinuxIC build calls <code>uname</code> it finds the fake version first, and if the argument is <code>-r</code> shows you desired version number, otherwise falls back to the real <code>uname</code>.</p></body>]]></description>
</item>
</channel>
</rss>