<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: kernel config based on lsmod output</title>
	<atom:link href="http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/feed" rel="self" type="application/rss+xml" />
	<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output</link>
	<description>Electronics and small programs and other stuff</description>
	<lastBuildDate>Fri, 06 Jan 2012 17:37:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Andreas Goelzer</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-2115</link>
		<dc:creator>Andreas Goelzer</dc:creator>
		<pubDate>Fri, 07 Oct 2011 12:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-2115</guid>
		<description>Thanks sherif, I updated the post.</description>
		<content:encoded><![CDATA[<p>Thanks sherif, I updated the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sherif</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-2114</link>
		<dc:creator>sherif</dc:creator>
		<pubDate>Fri, 07 Oct 2011 08:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-2114</guid>
		<description>Hi  thanks for this one  ( I also   read about the 5 second boot and wanted to optimize my system :D )
There is a make localmodconfig option in the  current kernel  
may be you can update your post 

Best regards sherif.</description>
		<content:encoded><![CDATA[<p>Hi  thanks for this one  ( I also   read about the 5 second boot and wanted to optimize my system <img src='http://andreas.goelzer.de/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )<br />
There is a make localmodconfig option in the  current kernel<br />
may be you can update your post </p>
<p>Best regards sherif.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lorenzo Dephillips</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-1396</link>
		<dc:creator>Lorenzo Dephillips</dc:creator>
		<pubDate>Sat, 29 Jan 2011 19:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-1396</guid>
		<description>Greetings! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!</description>
		<content:encoded><![CDATA[<p>Greetings! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Katrina Woloszczak</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-845</link>
		<dc:creator>Katrina Woloszczak</dc:creator>
		<pubDate>Fri, 14 May 2010 19:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-845</guid>
		<description>Just wanted to say I loved the information you had here will absolutely help me out. Thanks</description>
		<content:encoded><![CDATA[<p>Just wanted to say I loved the information you had here will absolutely help me out. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-360</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Mon, 15 Jun 2009 08:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-360</guid>
		<description>Hi again, quick heads up.  There is a bug in the pattern match which may miss some config options.  I noticed this while writing my own perl version of your program.  Look at:

kernel, drivers/video/console, bitblit
./linux-2.6.24/drivers/video/console/Makefile

You&#039;ll see that sometimes there is more than one object on the line:

obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o font.o softcursor.o

To account for this you need to re-write your match pattern to allow anything between the += and the object file name:

m=re.search(r&quot;obj-\$\((?P[A-Z0-9_]*)\)\W*\+=.*&quot;+moduleprops.group(&#039;file&#039;)+r&quot;\.o&quot;,cont);

At least that&#039;s what I did in Perl and I assume it should work in python too.

Another interesting thing I noticed is that there can be either a many to one or one to many relationship between modules and config options.  For instance CONFIG_FRAMEBUFFER_CONSOLE causes four different modules to be built whereas the drivers/cdrom/cdrom.o object has 5 different config option which all turn it on.

I&#039;m trying to see now if there is a way to automate lum configuration, although I have the feeling that one may have to be done by hand.</description>
		<content:encoded><![CDATA[<p>Hi again, quick heads up.  There is a bug in the pattern match which may miss some config options.  I noticed this while writing my own perl version of your program.  Look at:</p>
<p>kernel, drivers/video/console, bitblit<br />
./linux-2.6.24/drivers/video/console/Makefile</p>
<p>You&#8217;ll see that sometimes there is more than one object on the line:</p>
<p>obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o font.o softcursor.o</p>
<p>To account for this you need to re-write your match pattern to allow anything between the += and the object file name:</p>
<p>m=re.search(r&#8221;obj-\$\((?P[A-Z0-9_]*)\)\W*\+=.*&#8221;+moduleprops.group(&#8216;file&#8217;)+r&#8221;\.o&#8221;,cont);</p>
<p>At least that&#8217;s what I did in Perl and I assume it should work in python too.</p>
<p>Another interesting thing I noticed is that there can be either a many to one or one to many relationship between modules and config options.  For instance CONFIG_FRAMEBUFFER_CONSOLE causes four different modules to be built whereas the drivers/cdrom/cdrom.o object has 5 different config option which all turn it on.</p>
<p>I&#8217;m trying to see now if there is a way to automate lum configuration, although I have the feeling that one may have to be done by hand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Goelzer</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-359</link>
		<dc:creator>Andreas Goelzer</dc:creator>
		<pubDate>Sun, 14 Jun 2009 11:30:53 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-359</guid>
		<description>lsmod only lists the modules that were dynamically loaded, not the things you compiled in. so by compiling the kernel yourself, you can really clean up things.

if you&#039;d want to have more than one kernel source dir, you could try nesting try...except (i think that is not the right way to do it, but i&#039;m not that familiar with python myself), ie. something like:

sourcedir2=...
try:
   f=open(options.sourcedir + moduleprops.group(&#039;path&#039;) + &#039;Makefile&#039; , &#039;r&#039;);
except IOError:
   try:
      f=open(sourcedir2 + moduleprops.group(&#039;path&#039;) + &#039;Makefile&#039; , 
   except IOError:
      stderr.write(&#039;Could not find Makefile for &#039; + modname + &#039;\n&#039;);
      continue

take care of proper whitespacing :)

As to the format of the two config files, i have no idea, maybe you can just cat them together or so for an input file, and then use the resulting file for both. or use /boot/config-2.6.XX-YY-generic as an input config.

note that you can also compile vanilla kernels the usual way in ubuntu, works fine (no support though, but afaik also not with self-compiled ubuntu kernels)</description>
		<content:encoded><![CDATA[<p>lsmod only lists the modules that were dynamically loaded, not the things you compiled in. so by compiling the kernel yourself, you can really clean up things.</p>
<p>if you&#8217;d want to have more than one kernel source dir, you could try nesting try&#8230;except (i think that is not the right way to do it, but i&#8217;m not that familiar with python myself), ie. something like:</p>
<p>sourcedir2=&#8230;<br />
try:<br />
   f=open(options.sourcedir + moduleprops.group(&#8216;path&#8217;) + &#8216;Makefile&#8217; , &#8216;r&#8217;);<br />
except IOError:<br />
   try:<br />
      f=open(sourcedir2 + moduleprops.group(&#8216;path&#8217;) + &#8216;Makefile&#8217; ,<br />
   except IOError:<br />
      stderr.write(&#8216;Could not find Makefile for &#8216; + modname + &#8216;\n&#8217;);<br />
      continue</p>
<p>take care of proper whitespacing <img src='http://andreas.goelzer.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As to the format of the two config files, i have no idea, maybe you can just cat them together or so for an input file, and then use the resulting file for both. or use /boot/config-2.6.XX-YY-generic as an input config.</p>
<p>note that you can also compile vanilla kernels the usual way in ubuntu, works fine (no support though, but afaik also not with self-compiled ubuntu kernels)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-358</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sun, 14 Jun 2009 10:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-358</guid>
		<description>Great script!  I&#039;m trying to understand the config process and wondered if you could answer some questions.  I&#039;m trying to debloat my kernel compiles on Ubuntu 8.04 Hardy and am still fairly new at this.

Something that hasn&#039;t been clear to me is if lsmod lists all modules regardless of whether they&#039;re compiled into the kernel or compiled as loadable modules or just lists loadable modules.

Second question: Ubuntu splits it modules ( I don&#039;t know why ) between the kernel and the lum ( linux-ubuntu-modules ) package such that most of my modules as reported by modinfo are in:

/lib/modules/$(uname -r)/kernel/

but some such as the ALSA sound subsystem are in:

/lib/modules/$(uname -r)/ubuntu/

which each correspond to the kernel and lum packages respectively.

I store my source and configs for these two packages in 

~/kernel-source/linux-2.6.24/.config
~/kernel-source/linux-ubuntu-modules-2.6.24-2.6.24/.config

If I wanted to modify your script to work with this setup what would I need to do?  I&#039;m used to perl and don&#039;t know the first thing about python.</description>
		<content:encoded><![CDATA[<p>Great script!  I&#8217;m trying to understand the config process and wondered if you could answer some questions.  I&#8217;m trying to debloat my kernel compiles on Ubuntu 8.04 Hardy and am still fairly new at this.</p>
<p>Something that hasn&#8217;t been clear to me is if lsmod lists all modules regardless of whether they&#8217;re compiled into the kernel or compiled as loadable modules or just lists loadable modules.</p>
<p>Second question: Ubuntu splits it modules ( I don&#8217;t know why ) between the kernel and the lum ( linux-ubuntu-modules ) package such that most of my modules as reported by modinfo are in:</p>
<p>/lib/modules/$(uname -r)/kernel/</p>
<p>but some such as the ALSA sound subsystem are in:</p>
<p>/lib/modules/$(uname -r)/ubuntu/</p>
<p>which each correspond to the kernel and lum packages respectively.</p>
<p>I store my source and configs for these two packages in </p>
<p>~/kernel-source/linux-2.6.24/.config<br />
~/kernel-source/linux-ubuntu-modules-2.6.24-2.6.24/.config</p>
<p>If I wanted to modify your script to work with this setup what would I need to do?  I&#8217;m used to perl and don&#8217;t know the first thing about python.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Goelzer</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-339</link>
		<dc:creator>Andreas Goelzer</dc:creator>
		<pubDate>Tue, 19 May 2009 23:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-339</guid>
		<description>I replaced the script with an updated version. Now that missing Makefile error should not prevent the script from finishing, modules it cannot find won&#039;t get compiled in - that means, if that isofs module is crucial for your setup, make sure to select it manually.

I&#039;m sorry, noticed that bug a while ago, but somehow forgot to update the script here :/</description>
		<content:encoded><![CDATA[<p>I replaced the script with an updated version. Now that missing Makefile error should not prevent the script from finishing, modules it cannot find won&#8217;t get compiled in &#8211; that means, if that isofs module is crucial for your setup, make sure to select it manually.</p>
<p>I&#8217;m sorry, noticed that bug a while ago, but somehow forgot to update the script here :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KaZe</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-338</link>
		<dc:creator>KaZe</dc:creator>
		<pubDate>Tue, 19 May 2009 22:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-338</guid>
		<description>Hi, i&#039;d like to configure my own kernel, but when i tried to run this script i get the follow error:

facu@facu-ubunchu:~/Escritorio$ ./customconfig.py -i /boot/config-2.6.28-11-generic -o .config
Traceback (most recent call last):
  File &quot;./customconfig.py&quot;, line 61, in 
    f=open(options.sourcedir + moduleprops.group(&#039;path&#039;) + &#039;Makefile&#039; , &#039;r&#039;);
IOError: [Errno 2] No such file or directory: &#039;./fs/isofs/Makefile&#039;</description>
		<content:encoded><![CDATA[<p>Hi, i&#8217;d like to configure my own kernel, but when i tried to run this script i get the follow error:</p>
<p>facu@facu-ubunchu:~/Escritorio$ ./customconfig.py -i /boot/config-2.6.28-11-generic -o .config<br />
Traceback (most recent call last):<br />
  File &#8220;./customconfig.py&#8221;, line 61, in<br />
    f=open(options.sourcedir + moduleprops.group(&#8216;path&#8217;) + &#8216;Makefile&#8217; , &#8216;r&#8217;);<br />
IOError: [Errno 2] No such file or directory: &#8216;./fs/isofs/Makefile&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giacomo</title>
		<link>http://andreas.goelzer.de/kernel-config-based-on-lsmod-output/comment-page-1#comment-34</link>
		<dc:creator>Giacomo</dc:creator>
		<pubDate>Fri, 19 Dec 2008 02:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://andreas.goelzer.de/?p=23#comment-34</guid>
		<description>Thank you, very very much
I was going to write down a similar script, than I&#039;ve found this</description>
		<content:encoded><![CDATA[<p>Thank you, very very much<br />
I was going to write down a similar script, than I&#8217;ve found this</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/15 queries in 0.020 seconds using disk: basic
Object Caching 330/330 objects using disk: basic

Served from: andreas.goelzer.de @ 2012-02-05 06:08:58 -->
