<?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>iPUNKID &#187; kernel</title>
	<atom:link href="http://blog.punkid.org/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.punkid.org</link>
	<description>To ∞ and Beyond</description>
	<lastBuildDate>Sun, 29 Jan 2012 13:02:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>在Archlinux下编译TuxOnIce内核</title>
		<link>http://blog.punkid.org/2008/08/14/compile-tuxonice-kernel-in-archlinux/</link>
		<comments>http://blog.punkid.org/2008/08/14/compile-tuxonice-kernel-in-archlinux/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 13:01:53 +0000</pubDate>
		<dc:creator>iPUNKID</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[TuxOnIce]]></category>

		<guid isPermaLink="false">http://blog.punkid.org/?p=225</guid>
		<description><![CDATA[经Druggo的介绍，一直在我的Genbox (我的Gentoo机器名)下使用TuxOnIce内核。现在在家里的Montty (我的Archlinux机器名)下实在觉得Archlinux的预编译内核太大了，而且全部以模块方式加载启动系统时的Loading Udev Events要花去尽20秒，难以忍受。很有必要自己编译一个精简的内核，而Archlinux的AUR里正好有TuxOnIce的PKGBUILD。 先说下为什么在Archlinux下自己编译一个TuxOnIce内核: 精简内核，去掉不需要的模块，减少启动时间 AUR里的TuxOnIce打了Gentoo的内核补丁集 TuxOnIce支持休眠到swap，充分利用绰绰有余的swap空间 支持断电休眠，重新唤醒系统速度快，免去重启烦恼 步骤 先用$ yaourt kernel26-ice获取TuxOnIce的PKGBUILD，它会提示是否修改PKGBUILD文件。我打算自己配置内核选项，所以去掉PKGBUILD里那句make menuconfig的注释。 # use menuconfig, if you want to change the configuration make menuconfig yes "" &#124; make config 然后Y下去，直到出现内核配置界面。我偏向于把东西编译内核，而不是编译为模块，这样做的好处是根本不用去管该手动加载哪些模块，哪些是需要的。为了让Suspend功能运转，需要把勾选以下设置。 Power management options (ACPI, APM) ---&#62; [*] Hibernation (aka 'suspend to disk') (/dev/&#60;swap-partition&#62;) Default resume partition &#60;*&#62; Enhanced Hibernation (TuxOnIce) ---&#62; --- [...]]]></description>
			<content:encoded><![CDATA[<p>经<a href="http://blog.druggo.net/index.php?post/2008/05/01/TuxOnIce" title="TuxOnIce! 休眠到硬盘!">Druggo</a>的介绍，一直在我的Genbox (我的Gentoo机器名)下使用<a href="http://www.tuxonice.net/" title="TuxOnIce">TuxOnIce</a>内核。现在在家里的Montty (我的Archlinux机器名)下实在觉得Archlinux的预编译内核太大了，而且全部以模块方式加载启动系统时的Loading Udev Events要花去尽20秒，难以忍受。很有必要自己编译一个精简的内核，而Archlinux的AUR里正好有<a href="http://aur.archlinux.org/packages.php?ID=15224" title="kernel26-ice in AUR">TuxOnIce</a>的PKGBUILD。</p>
<p>先说下为什么在Archlinux下自己编译一个TuxOnIce内核:</p>
<ol>
<li>精简内核，去掉不需要的模块，减少启动时间</li>
<li>AUR里的TuxOnIce打了Gentoo的内核补丁集</li>
<li>TuxOnIce支持休眠到swap，充分利用绰绰有余的swap空间</li>
<li>支持断电休眠，重新唤醒系统速度快，免去重启烦恼</li>
</ol>
<p><span id="more-225"></span></p>
<h3>步骤</h3>
<p>先用<code>$ yaourt kernel26-ice</code>获取TuxOnIce的PKGBUILD，它会提示是否修改PKGBUILD文件。我打算自己配置内核选项，所以去掉PKGBUILD里那句<code>make menuconfig</code>的注释。</p>
<pre lang="bash">
# use menuconfig, if you want to change the configuration
make menuconfig
yes "" | make config
</pre>
<p>然后Y下去，直到出现内核配置界面。我偏向于把东西编译内核，而不是编译为模块，这样做的好处是根本不用去管该手动加载哪些模块，哪些是需要的。为了让Suspend功能运转，需要把勾选以下设置。</p>
<pre lang="bash">
 Power management options (ACPI, APM)  ---&gt;
   [*] Hibernation (aka 'suspend to disk')
   (/dev/&lt;swap-partition&gt;) Default resume partition
   &lt;*&gt;   Enhanced Hibernation (TuxOnIce)  ---&gt;
     ---   Image Storage (you need at least one allocator)
     &lt;*&gt;   File Allocator
     &lt;*&gt;   Swap Allocator
     ---   General Options
     &lt;*&gt;   Compression support
     &lt;*&gt;   Userspace User Interface support
     (/sbin/tuxoniceui_text) Default userui program location
     [ ]   Allow Keep Image Mode
     [*]   Replace swsusp by default
     &lt; &gt;   Cluster support  ---&gt;
     [*]   Checksum pageset2
     (25)  Default waiting time for emergency boot messages
     &lt; &gt;   Test pageflags
 Cryptographic options  ---&gt;
   &lt;*&gt;   LZF compression algorithm
</pre>
<p>其中<code>/dev/&lt;swap-partition&gt;</code>为swap分区位置，开启LZF压缩可以加快休眠/唤醒速度，不过需要耗费点CPU资源。怕啥，我PIII 667Mhz的老爷机都用上它了。</p>
<p>用多核CPU的还需要勾选这些 (与我无关)</p>
<pre lang="bash">
Kernels before 2.6.22

Processor type and features  ---&gt;
 [*] Support for hot-pluggable CPUs (EXPERIMENTAL)

Kernel 2.6.22 and after:

Processor type and features  ---&gt;
 [*] Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)
</pre>
<p>修改好config后等它自动编译吧，然后运行<code>$ sudo pacman -U kernel26-ice-2.6.26-3-i686.pkg.tar.gz</code>安装内核，其间会运行<code>mkinitcpio</code>生成initramfs，无所谓。反正都编译进kernel了，而且又是自己手动编译的，根本不需要initramfs。</p>
<p>完成后添加类似几行到<code>/boot/grub/menu.1st</code>:</p>
<pre lang="bash">
title  Arch Linux TuxOnIce
root   (hd1,0)
kernel /vmlinuz26-ice root=/dev/sdb3 ro
</pre>
<p>其中<code>(hd1,0)</code>指的是<code>/boot</code>分区，<code>/dev/sdb3</code>是<code>/</code> 分区。</p>
<p>我用的是N卡，还需要去AUR下个<code>nvidia-96xx-ice</code>的显卡驱动 (我的还是GeForce 2系列的卡)。<code>$ yaourt nvidia-96xx-ice</code>或者<code>$ yaourt nvidia-ice</code>就是了。</p>
<p>要用Suspend功能，还需要<code>$ yaourt hibernate-script</code>。然后修改<code>/etc/hibernate/blacklisted-modules</code>，把<code>nvidia</code>这行注释了，不然hibernate会报错。</p>
<p>在<code>/etc/hibernate/common.conf</code>里找到这几行，去掉注释，以便在休眠时断开网络，唤醒时重新连接。</p>
<pre lang="bash">
### network
DownInterfaces eth0
UpInterfaces auto
</pre>
<p>我用的是Nvidia的GeForce 2的卡，还需要在<code>/etc/X11/xorg.conf</code>里的Device Section里添加一句<code>Option "NvAGP" "1"</code>，如下:</p>
<pre lang="bash">
Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "NV11 [GeForce2 MX/MX 400]"
        BusID       "PCI:1:0:0"
        Option      "NvAGP" "1"
        ...
EndSection
</pre>
<p>最后在<code>/etc/rc.conf</code>里检查下<code>MODULES</code>这行，把不需要的模块都清除掉，因为我是全部编进了kernel，直接将此行留空。</p>
<p>全部搞定后重启进入新的TuxOnIce内核吧，<del datetime="2008-08-15T15:23:54+00:00">我的Loading Udev Events时间由20秒缩短为7秒了(还是很不爽啊! Gentoo多快啊!)</del>再次重编，Udev Events Loading缩短为4秒了，总算比较可以忍受了，运行<code>$ sudo hibernate -n</code>进行休眠测试，没问题的话以后就<code>$ sudo hibernate</code>进行休眠吧。唤醒的话正常开机由grub引导进入就行了。</p>
<h3>参考</h3>
<ul>
<li><a href="http://gentoo-wiki.com/TuxOnIce" title="TuxOnIce -  Gentoo Linux Wiki">TuxOnIce &#8211;  Gentoo Linux Wiki</a></li>
<li><a href="http://wiki.archlinux.org/index.php/Suspend_to_Disk#Tuxonice_method" title="Suspend to Disk">Suspend to Disk : Tuxonice method &#8211; Arch Wiki</a></li>
</ul>
<p>最后抱怨几句:</p>
<p>为什么Archlinux要把kde3赶出repo，kde4还不足够稳定到给广大用户使用吧。像Gentoo那样用不同的slot机制来并存kde3和kde4多好。</p>
<p>Archlinux的源很痛苦，ABS的rsync服务器更是痛苦&#8230;</p>
<p>尽管有官方预编译包，我还是需要自己去手动编译那些软件，scim就是其一。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.punkid.org/2008/08/14/compile-tuxonice-kernel-in-archlinux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why I &lt;3 Gentoo and Its Community So Much</title>
		<link>http://blog.punkid.org/2007/11/10/why-i-love-gentoo-and-its-community-so-much/</link>
		<comments>http://blog.punkid.org/2007/11/10/why-i-love-gentoo-and-its-community-so-much/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 07:21:23 +0000</pubDate>
		<dc:creator>iPUNKID</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ASUS K8N4-E]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[nForce]]></category>
		<category><![CDATA[sata]]></category>
		<category><![CDATA[内核无法识别SATA设备]]></category>

		<guid isPermaLink="false">http://blog.punkid.org/2007/11/10/why-i-love-gentoo-and-its-community-so-much/</guid>
		<description><![CDATA[今天，总算是把Gentoo下困扰我N久的一个问题给解决了，把经历分享下，以便与我同命相连的人google到这篇日志。 主要症状是这样的: 使用华硕K8N4-E/Deluxe主板的，无论是使用Gentoo LiveCD 06/07版还是自编译内核(>2.6.13)启动，都无法识别到SATA硬盘设备，必须采用降级内核的方式或者使用Gentoo LiveCD 2005才能正常识别，而在Ubuntu/Fedora Core (2.6.2系列kernel)下却没有这个问题。只要是大于2.6.13的内核无论是gentoo-sources, genkernel, vanilla-sources, mm-sources, sabayon-sources甚至Ubuntu和Fedora的kernel都没用。我曾经在论坛里发过帖子询问，当时没太在意，以为降级内核到2.6.13就算解决了，但是随便kernel的不断更新，问题越来越多了，udev不能用最新的，与之而来的就是hal不能自动挂载移动储存设备，nvidia驱动不能用100系列版本，否则退出X会花屏，xorg-x11不能用7.3，因为没有100系列的nvidia驱动配合，这么多问题差点让我被迫转投ubuntu了，还好最终还是选择向Gentoo Community寻求帮助。 我在open a new thread之前就发现论坛里用同样一块主板的朋友都遇到了这个问题: SATA drives not recognized on kernel &#62; 2.6.11 Problem finding my SATA-drives kernel panic (solved) What does &#8220;VFS: Cannot open root device&#8230;&#8221; mean, exactly? 加上后面两个我之前发布的贴子/回复，搜集好所有信息后，我发了个新的帖子: Kernels(&#62;2.6.13) dont recognize sata disk on K8N4-E [solved] 并给当时发表/回复那些帖子的人发了封private message，也得到了这些人的热心帮助，但是始终没能解决问题。于是我去Gentoo Mailing List上发邮件，也没能得到解决的办法，最终选择了向Gentoo的Bugzilla提交bug，直接询问Gentoo [...]]]></description>
			<content:encoded><![CDATA[<p>今天，总算是把Gentoo下困扰我N久的一个问题给解决了，把经历分享下，以便与我同命相连的人google到这篇日志。</p>
<p>主要症状是这样的: 使用华硕K8N4-E/Deluxe主板的，无论是使用Gentoo LiveCD 06/07版还是自编译内核(>2.6.13)启动，都无法识别到SATA硬盘设备，必须采用降级内核的方式或者使用Gentoo LiveCD 2005才能正常识别，而在Ubuntu/Fedora Core (2.6.2系列kernel)下却没有这个问题。只要是大于2.6.13的内核无论是gentoo-sources, genkernel, vanilla-sources, mm-sources, sabayon-sources甚至Ubuntu和Fedora的kernel都没用。我曾经在论坛里<a href="http://forums.gentoo.org/viewtopic-t-442276.html" title="kernel panic (solved)">发过帖子</a>询问，当时没太在意，以为降级内核到2.6.13就算解决了，但是随便kernel的不断更新，问题越来越多了，udev不能用最新的，与之而来的就是hal不能自动挂载移动储存设备，nvidia驱动不能用100系列版本，否则退出X会花屏，xorg-x11不能用7.3，因为没有100系列的nvidia驱动配合，这么多问题差点让我被迫转投ubuntu了，还好最终还是选择向Gentoo Community寻求帮助。<br />
<span id="more-169"></span><br />
我在open a new thread之前就发现论坛里用同样一块主板的朋友都遇到了这个问题:</p>
<ol>
<li><a href="http://forums.gentoo.org/viewtopic-t-522268.html" title="ATA drives not recognized on kernel &gt; 2.6.11">SATA drives not recognized on kernel &gt; 2.6.11</a></li>
<li><a href="http://forums.gentoo.org/viewtopic-t-525163.html" title="Problem finding my SATA-drives">Problem finding my SATA-drives</a></li>
<li><a href="http://forums.gentoo.org/viewtopic-t-442276.html" title="kernel panic (solved)">kernel panic (solved)</a></li>
<li><a href="http://forums.gentoo.org/viewtopic-t-510265.html" title="What does "VFS: Cannot open root device..." mean, exactly?">What does &#8220;VFS: Cannot open root device&#8230;&#8221; mean, exactly?</a></li>
</ol>
<p>加上后面两个我之前发布的贴子/回复，搜集好所有信息后，我发了个新的帖子:</p>
<p><a href="http://forums.gentoo.org/viewtopic-t-581033.html" title="Kernels(&gt;2.6.13) dont recognize sata disk on K8N4-E [solved]">Kernels(&gt;2.6.13) dont recognize sata disk on K8N4-E [solved]</a></p>
<p>并给当时发表/回复那些帖子的人发了封private message，也得到了这些人的热心帮助，但是始终没能解决问题。于是我去Gentoo Mailing List上发邮件，也没能得到解决的办法，最终选择了向Gentoo的Bugzilla提交bug，直接询问Gentoo Developers。</p>
<p>Bugzilla Bug 194531 : <a href="http://bugs.gentoo.org/show_bug.cgi?id=194531" title="Kernels (&gt;2.6.13) dont recognize the sata harddisk on ASUS K8N4-E motherboard">Kernels (&gt;2.6.13) dont recognize the sata harddisk on ASUS K8N4-E motherboard</a></p>
<p>在这里得到了解决方案，关闭MMCONFIG PCI Access Mode可以成功识别到SATA设备，正如其中一个developer说的: <em>Nforce motherboards don&#8217;t have the best history with the linux kernel</em>。关闭MMCONFIG有两种方式，一是设置内核:</p>
<p>取消自动选择模式和MMCONFIG模式，选择BIOS或者DIRECT方式</p>
<pre>
CONFIG_PCI=y
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GOMMCONFIG is not set
CONFIG_PCI_GODIRECT=y
# CONFIG_PCI_GOANY is not set
</pre>
<p>二是在grub.conf的kernel行末尾添加<code>pci=nommconf</code>参数来关闭它。</p>
<p>同样，使用Gentoo LiveCD的话，可以在启动时加入启动参数<em>nommconf</em>来顺利引导LiveCD读取SATA硬盘。问题是解决了，不过查看下ubuntu和fedora的kernel config文件，并没有关闭MMCONFIG模式，难道还是Gentoo的问题?</p>
<p>在Developers的帮助下，进入Kubuntu/Fedora LiveCD，<code>cat /proc/iomem</code>发现其中没有那句<code>f0000000-f3ffffff : PCI MMCONFIG 0</code>，意味着Ubuntu和Fedora把MMCONFIG给blacklist了。<strong>哪位使用Ubuntu或者Fedora的朋友麻烦把<code>cat /proc/iomem</code>的结果贴出来给我看下</strong>，我想知道是Ubuntu/Fedora直接blacklist了MMCONFIG还是在硬件检测时根据我的硬件关闭了MMCONFIG。</p>
<p>这样，整个症结就落在了MMCONFIG上，排除了Gentoo本身的因素。</p>
<p>Gentoo之所以受青睐的原因不仅是它的高度可定制性和portage的包管理方式，还有它背后强大的社区支持。<a href="http://forums.gentoo.org/" title="Gentoo Forums">Gentoo的官方论坛</a> 是目前最活跃的linux论坛之一了，里面集结了来自全世界各地的顶尖linux高手和geek，无论是帖子还是回复都是高质量的，即便是不用Gentoo Linux的朋友在里面都能找到很多有价值的东西。而Bugzilla作为forum的补充，提供了与开发人员直接的交流平台，你可以得到最专业的帮助。</p>
<p>I &lt;3 Gentoo and its Community !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.punkid.org/2007/11/10/why-i-love-gentoo-and-its-community-so-much/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

