<?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>Bread &#38; Cup &#187; Linux</title>
	<atom:link href="http://blog.breadncup.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.breadncup.com</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 11:25:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>VMware Tool Patch for Linux Kernel 2.6.37/38</title>
		<link>http://blog.breadncup.com/2011/02/26/vmware-tool-patch-for-linux-kernel-2-6-3738/</link>
		<comments>http://blog.breadncup.com/2011/02/26/vmware-tool-patch-for-linux-kernel-2-6-3738/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 08:19:53 +0000</pubDate>
		<dc:creator>Breadncup</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[2.6.37]]></category>
		<category><![CDATA[2.6.38]]></category>
		<category><![CDATA[fusion]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware tool]]></category>

		<guid isPermaLink="false">http://blog.breadncup.com/?p=380</guid>
		<description><![CDATA[This post is not longer maintained since VMWare has announced the latest version of 3.1.3 (416484) which is able to work with the linux 2.6.38 (which is being used in Ubuntu 11.04). I&#8217;ve tested the latest version, and I&#8217;ve updated my virtual ubuntu as 11.04, and verified it works fine in everything. Thank you for <a href='http://blog.breadncup.com/2011/02/26/vmware-tool-patch-for-linux-kernel-2-6-3738/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>This post is not longer maintained since VMWare has announced the latest version of 3.1.3 (416484) which is able to work with the linux 2.6.38 (which is being used in Ubuntu 11.04). I&#8217;ve tested the latest version, and I&#8217;ve updated my virtual ubuntu as 11.04, and verified it works fine in everything. Thank you for all nice and wonderful comments and suggestions on this post.</strong></p>
<p>This is a note for patching VMware tool for linux kernel 2.6.37/38 guest OS while using VMware Fusion.</p>
<p>Here is my environment for your reference.</p>
<ul>
<li>Host OS: Mac OS 10.6.6</li>
<li>Guest OS: Ubuntu 10.10 + Kernel Updated (2.6.38)</li>
<li>VMware Fusion: 3.1.2 (332101)</li>
</ul>
<p>Since the vmware-tool in vmware fusion is not aware of the changes of the latest kernel structure, it needs to be patched in order to get correct kernel module for vmware tool such like file sharing, clipboard sharing, etc.</p>
<p>Here is the walk-through steps:</p>
<ol>
<li>Install VMware Tool</li>
<li>Copy vmware-tools-distrib directory into a local directory (say, ~/tmp/vmware-tools-distrib) by
<pre> mkdir -p ~/tmp/ &amp;&amp; tar -C ~/tmp -xvzf /media/VMware\ Tools/VMwareTools-8.4.5-332101.tar.gz</pre>
</li>
<li>
<pre> cd ~/tmp/vmware-tools-distrib/lib/modules/source</pre>
</li>
<li>
<pre>tar -xvf vmci.tar &amp;&amp; tar -xvf vmhgfs.tar &amp;&amp; tar -xvf vsock.tar</pre>
</li>
<li> copy patch files (<a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vmci-Linux-2.6.37.patch">0001-vmwaretool-vmci-Linux-2.6.37.patch</a>,  <a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vmhgfs-Linux-2.6.37.patch">0001-vmwaretool-vmhgfs-Linux-2.6.37.patch</a>, <a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vsock-Linux-2.6.37.patch">0001-vmwaretool-vsock-Linux-2.6.37.patch</a>) into ~/tmp/vmware-tools-distrib/lib/modules/source</li>
<li>
<pre> cd vmci-only &amp;&amp; git apply --ignore-whitespace ../0001-vmwaretool-vmci-Linux-2.6.37.patch &amp;&amp; cd ..</pre>
</li>
<li>
<pre> cd vmhgfs-only &amp;&amp; git apply --ignore-whitespace ../0001-vmwaretool-vmhgfs-Linux-2.6.37.patch &amp;&amp; cd ..</pre>
<ul>
<li>Caution: For now (05/07/2011), this will pass the compile error, but a segment fault error is caused while creating/removing a file on the filesystem. If I find a resolution, I will update it. (Thanks, Chris.) </li>
</ul>
</li>
<li>
<pre> cd vsock-only &amp;&amp; git apply --ignore-whitespace ../0001-vmwaretool-vsock-Linux-2.6.37.patch &amp;&amp; cd ..</pre>
</li>
<li>
<pre> rm -rf vmci.tar vmhgfs.tar vsock.tar</pre>
</li>
<li>
<pre> tar -cvf vmci.tar vmci-only &amp;&amp; tar -cvf vmhgfs.tar vmhgfs-only &amp;&amp; tar -cvf vsock.tar vsock-only</pre>
</li>
<li>
<pre> rm -rf vmci-only vmhgfs-only vsock-only</pre>
</li>
<li> Install the vmware tool by
<pre> cd ~/tmp/vmware-tools-distrib &amp;&amp; ./vmware-install.pl</pre>
</li>
</ol>
<p>Here is the patches for your references:</p>
<ol>
<li><a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vmci-Linux-2.6.37.patch">0001-vmwaretool-vmci-Linux-2.6.37.patch</a>:
<pre class="brush: diff; title: ; notranslate">
From ad10b5458d4aa6d5df7b913174185d395943ce32 Mon Sep 17 00:00:00 2001
From: YOUNGWHAN SONG &lt;breadncup@gmail.com&gt;
Date: Fri, 25 Feb 2011 22:16:19 -0800
Subject: [PATCH] Linux 2.6.37 Patch

---
 shared/compat_semaphore.h |    4 ++--
 vmci_drv.c                |   12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/shared/compat_semaphore.h b/shared/compat_semaphore.h
index c2902f0..0add974 100644
--- a/shared/compat_semaphore.h
+++ b/shared/compat_semaphore.h
@@ -28,7 +28,7 @@
 #endif

-#if defined CONFIG_PREEMPT_RT &amp;&amp; LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT &amp;&amp; LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-     #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif

diff --git a/vmci_drv.c b/vmci_drv.c
index ac64f02..14ac3b5 100644
--- a/vmci_drv.c
+++ b/vmci_drv.c
@@ -73,7 +73,7 @@ static int vmci_probe_device(struct pci_dev *pdev,
 static void vmci_remove_device(struct pci_dev* pdev);
 static int vmci_open(struct inode *inode, struct file *file);
 static int vmci_close(struct inode *inode, struct file *file);
-static int vmci_ioctl(struct inode *inode, struct file *file,
+static long vmci_ioctl(struct file *file,
                       unsigned int cmd, unsigned long arg);
 static unsigned int vmci_poll(struct file *file, poll_table *wait);
 #if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2, 6, 19)
@@ -93,7 +93,7 @@ static struct file_operations vmci_ops = {
    .owner   = THIS_MODULE,
    .open    = vmci_open,
    .release = vmci_close,
-   .ioctl   = vmci_ioctl,
+   .unlocked_ioctl   = vmci_ioctl,
    .poll    = vmci_poll,
 };

@@ -496,9 +496,8 @@ vmci_close(struct inode *inode,  // IN
  *-----------------------------------------------------------------------------
  */

-static int
-vmci_ioctl(struct inode *inode,  // IN
-           struct file *file,    // IN
+static long
+vmci_ioctl(struct file *file,    // IN
            unsigned int cmd,     // IN
            unsigned long arg)    // IN
 {
@@ -506,10 +505,12 @@ vmci_ioctl(struct inode *inode,  // IN
    return -ENOTTY;
 #else
    int retval;
+   lock_kernel();
    VMCIGuestDeviceHandle *devHndl =
       (VMCIGuestDeviceHandle *) file-&gt;private_data;

    if (devHndl == NULL) {
+      unlock_kernel();
       return -EINVAL;
    }

@@ -669,6 +670,7 @@ vmci_ioctl(struct inode *inode,  // IN
       break;
    }

+   unlock_kernel();
    return retval;
 #endif
 }
--
1.7.4.1
</pre>
</li>
<li><a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vmhgfs-Linux-2.6.37.patch">0001-vmwaretool-vmhgfs-Linux-2.6.37.patch</a>:
<pre class="brush: diff; title: ; notranslate">
From 2d1de0f0ea3ef2fce534944431c096baed1e423b Mon Sep 17 00:00:00 2001
From: YOUNGWHAN SONG &lt;breadncup@gmail.com&gt;
Date: Fri, 25 Feb 2011 23:07:15 -0800
Subject: [PATCH] vmware:vmhgfs: Support new linux kernel 2.6.37

---
 super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/super.c b/super.c
index f6f26ff..c5627f5 100644
--- a/super.c
+++ b/super.c
@@ -70,7 +70,7 @@ struct super_operations HgfsSuperOperations = {
 #ifndef VMW_USE_IGET_LOCKED
    .read_inode    = HgfsReadInode,
 #endif
-   .clear_inode   = HgfsClearInode,
+   .evict_inode   = HgfsClearInode,
    .put_super     = HgfsPutSuper,
    .statfs        = HgfsStatfs,
 };
--
1.7.4.1
</pre>
</li>
<li><a href="http://blog.breadncup.com/files/vmwaretool-patches-01/0001-vmwaretool-vsock-Linux-2.6.37.patch">0001-vmwaretool-vsock-Linux-2.6.37.patch</a>:
<pre class="brush: diff; title: ; notranslate">
From dea787ae80d9a6267be21928efc164d0b4f1d4c6 Mon Sep 17 00:00:00 2001
From: YOUNGWHAN SONG &lt;breadncup@gmail.com&gt;
Date: Fri, 25 Feb 2011 23:13:28 -0800
Subject: [PATCH] vmwaretool:vsock:Linux-2.6.37

---
 shared/compat_semaphore.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/shared/compat_semaphore.h b/shared/compat_semaphore.h
index 802d174..0add974 100644
--- a/shared/compat_semaphore.h
+++ b/shared/compat_semaphore.h
@@ -28,7 +28,7 @@
 #endif

-#if defined CONFIG_PREEMPT_RT &amp;&amp; LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT &amp;&amp; LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif

--
1.7.4.1
</pre>
</li>
</ol>
<p>p.s. Thanks to Vyacheslav, I corrected the conditional branch definition. (03/15/2011)</p>
 <img src="http://blog.breadncup.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=380" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.breadncup.com/2011/02/26/vmware-tool-patch-for-linux-kernel-2-6-3738/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Mac OSX HFS is case-insensitive Filesystem by default.</title>
		<link>http://blog.breadncup.com/2010/04/16/mac-osx-hfs-is-case-insensitive-filesystem-by-default/</link>
		<comments>http://blog.breadncup.com/2010/04/16/mac-osx-hfs-is-case-insensitive-filesystem-by-default/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 14:25:16 +0000</pubDate>
		<dc:creator>Breadncup</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[case-insensitive]]></category>
		<category><![CDATA[case-sensitive]]></category>
		<category><![CDATA[hfs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[netfilter]]></category>
		<category><![CDATA[netfilter_ipv4]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://blog.breadncup.com/?p=278</guid>
		<description><![CDATA[To over come case-insensitive FS in Mac OS to use case-sensitive FS.]]></description>
			<content:encoded><![CDATA[<p>I am pretty new Mac OS, but my background is from Linux (Unix), so I didn&#8217;t notice that the default filesystem in Mac is case-insensitive.</p>
<p>While getting a code of linux kernel through svn, I encounter this error:</p>
<pre>A     xxxxxx/linux/netfilter_ipv4/ipt_REJECT.h
svn:  In directory  'xxxxxx/linux/netfilter_ipv4'
svn:  Can't copy  'xxxxxx/linux/netfilter_ipv4/.svn/tmp/text-base/ipt_tcpmss.h.svn-base'  to  'xxxxxx/linux/netfilter_ipv4/.svn/tmp/ipt_tcpmss.h.tmp.tmp':  No such file or directory
</pre>
<p>This problem is caused by the case-insensitive filesystem being used in MacOS. There are distinguished files, ipt_TCPMSS.h and ipt_tcpmss.h for netfilter_ipv4.</p>
<p>To solve the problem, there are two ways.</p>
<p>1. Reformat HFS entirely with case-sensitive attribute.</p>
<p>This is very painful, and would cause not running properly for a certain software like Photoshop. (<a title="Permanent Link to What a mistake: case-sensitive  HFS on my mac book" rel="bookmark" href="http://robcos.com/what-a-mistake-case-sensitive-hfs-on-my-mac-book/" target="_blank">What a mistake: case-sensitive HFS on my mac book</a>) However, this will make faster than using dmg.</p>
<p>2. Create a disk image (dmg) for the specific project with case-sensitive.</p>
<p>Using dmg would be a little bit slower, but this makes easy. Using Disk Utility, you can create a disk volume with case-sensitive attribute.</p>
 <img src="http://blog.breadncup.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=278" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.breadncup.com/2010/04/16/mac-osx-hfs-is-case-insensitive-filesystem-by-default/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Way not to use Cache in Linux</title>
		<link>http://blog.breadncup.com/2009/12/04/way-not-to-use-cache-in-linux/</link>
		<comments>http://blog.breadncup.com/2009/12/04/way-not-to-use-cache-in-linux/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 17:21:17 +0000</pubDate>
		<dc:creator>Breadncup</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.breadncup.com/?p=217</guid>
		<description><![CDATA[Introducing the way not to use cache in linux programming.]]></description>
			<content:encoded><![CDATA[<p>Here is an information not to use cache in linux while reading the kernel newbie mailing list.</p>
<blockquote><p>Hi!<br />
On 19:29 Fri 04 Dec     , Lal wrote:<br />
&gt; Dear list members,<br />
&gt;<br />
&gt; I have a question about Linux page cache. I create a 10MB file using<br />
&gt; following application code:<br />
&gt;<br />
&gt; int fd=open(&#8220;foo.txt&#8221;, O_CREAT|O_RDWR|O_SYNC);<br />
&gt; char* content=(char *)malloc(1024*1024*10);<br />
&gt; write(fd, content, 1024*1024*10);<br />
&gt; free(content); close(fd);<br />
&gt;<br />
&gt; Immediately before and after this code execution, command &#8220;free -m&#8221;<br />
&gt; shows free memory decreased by 10M and cache incresed by 10M.<br />
&gt;<br />
&gt; If I delete foo.txt, then free memory increases by 10M and cache<br />
&gt; decreases by 10M.<br />
&gt;<br />
&gt; My question is why the cache is growing even after O_SYNC flag? Even<br />
&gt; fsync does not help. But deleting file freeing the cache.</p>
<p><span style="color: #ff0000;">O_SYNC</span> does not mean &#8220;do not cache&#8221;. It means &#8220;make sure the data is written<br />
to disk. The data is kept in memory even after writing to speed up subsequent<br />
reads. If you do not want this, you can pass the <span style="color: #ff0000;">O_DICECT</span> flag. But be aware<br />
that using this can easily slow you down.<br />
Either way, if you want to write zeros to the file, make sure the buffer is<br />
initialised after malloc, e.g. via memset or bzero. If you only want to<br />
allocate a file with zeros, you can also consider using fallocate or sparse<br />
files.</p>
<p>-Michi</p></blockquote>
 <img src="http://blog.breadncup.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=217" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.breadncup.com/2009/12/04/way-not-to-use-cache-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux-powered digital picture frames</title>
		<link>http://blog.breadncup.com/2007/07/04/linux-powered-digital-picture-frames/</link>
		<comments>http://blog.breadncup.com/2007/07/04/linux-powered-digital-picture-frames/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 20:18:39 +0000</pubDate>
		<dc:creator>Breadncup</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[picutre]]></category>

		<guid isPermaLink="false">http://blog.breadncup.com/2007/07/04/linux-powered-digital-picture-frames/</guid>
		<description><![CDATA[Introducing digital picture frame using an old laptop.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thesandersens.com/blog/linux-powered-digital-picture-frame" target="_blank">Linux-powered digital picture frames</a></p>
<p>It is introducing Digital Picture Frame in home with old laptop PC using Linux OS.</p>
 <img src="http://blog.breadncup.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.breadncup.com/2007/07/04/linux-powered-digital-picture-frames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

