Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 13 Feb 2002 13:14:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 13 Feb 2002 13:14:45 -0500 Received: from air-2.osdl.org ([65.201.151.6]:24336 "EHLO osdlab.pdx.osdl.net") by vger.kernel.org with ESMTP id ; Wed, 13 Feb 2002 13:14:28 -0500 Date: Wed, 13 Feb 2002 10:09:43 -0800 (PST) From: "Randy.Dunlap" X-X-Sender: To: "Richard B. Johnson" cc: Horst von Brand , Daniel Phillips , Bill Davidsen , Subject: Re: How to check the kernel compile options ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="346823425-27554337-1013623783=:1530" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --346823425-27554337-1013623783=:1530 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 13 Feb 2002, Richard B. Johnson wrote: | On Wed, 13 Feb 2002, Horst von Brand wrote: | | > Daniel Phillips said: | > > On February 12, 2002 05:38 pm, Bill Davidsen wrote: | > | > [...] | [SNIPPED...] | | My idea is to take the .config file and remove most of its | redundancy and unnecessary verbage. Then, the result is | compressed and written to a constant global array, linked | into the kernel. Both the array and the array length will then | be available from /proc/kcore for user-mode tools to recreate the | .config file. This is a bit similar to what I did last weekend (and attach here). Mine goes into the kernel boot file, however, so that it can be read even when the kernel isn't running. I'll experiment with ideas from Andreas (thanks) or Ian Soboroff to create a userspace get-config tool. One small nit: you say "user-mode tools", but /proc/kcore is read-only for root only -- right? That's not desirable or required IMO. | Here are tools and a test/documentation script that shows it | will work. The .config on my machine generates a 1730 byte | array. This is certainly small enough to not be considered | bloat. Not a problem to me, although most people seem to want to see it as a config option. I plan to add that to what I've done... and probably strip the leading "CONFIG_" strings. | The advantage, of course is that if you are executing the kernel, | it can give you all the information necessary to recreate a | new one from the sources because its .config is embeded into | itself. Once you have the ".config" file, you just do `make oldconfig` | and you are home free. -- ~Randy --346823425-27554337-1013623783=:1530 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="config-info.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="config-info.patch" LS0tIGxpbnV4LTI0MTYvTWFrZWZpbGUub3JnCU1vbiBOb3YgMjYgMDU6Mjk6 MTcgMjAwMQ0KKysrIGxpbnV4LTI0MTYvTWFrZWZpbGUJV2VkIEZlYiAxMyAw OToxNjozOSAyMDAyDQpAQCAtMjU3LDggKzI1Nyw4IEBADQogYm9vdDogdm1s aW51eA0KIAlAJChNQUtFKSBDRkxBR1M9IiQoQ0ZMQUdTKSAkKENGTEFHU19L RVJORUwpIiAtQyBhcmNoLyQoQVJDSCkvYm9vdA0KIA0KLXZtbGludXg6IGlu Y2x1ZGUvbGludXgvdmVyc2lvbi5oICQoQ09ORklHVVJBVElPTikgaW5pdC9t YWluLm8gaW5pdC92ZXJzaW9uLm8gbGludXhzdWJkaXJzDQotCSQoTEQpICQo TElOS0ZMQUdTKSAkKEhFQUQpIGluaXQvbWFpbi5vIGluaXQvdmVyc2lvbi5v IFwNCit2bWxpbnV4OiBpbmNsdWRlL2xpbnV4L3ZlcnNpb24uaCAkKENPTkZJ R1VSQVRJT04pIGluaXQvbWFpbi5vIGluaXQvdmVyc2lvbi5vIGluaXQvY29u Zmlncy5vIGxpbnV4c3ViZGlycw0KKwkkKExEKSAkKExJTktGTEFHUykgJChI RUFEKSBpbml0L21haW4ubyBpbml0L3ZlcnNpb24ubyBpbml0L2NvbmZpZ3Mu byBcDQogCQktLXN0YXJ0LWdyb3VwIFwNCiAJCSQoQ09SRV9GSUxFUykgXA0K IAkJJChEUklWRVJTKSBcDQpAQCAtMzM0LDYgKzMzNCwxMyBAQA0KIA0KIGlu aXQvbWFpbi5vOiBpbml0L21haW4uYyBpbmNsdWRlL2NvbmZpZy9NQVJLRVIN CiAJJChDQykgJChDRkxBR1MpICQoQ0ZMQUdTX0tFUk5FTCkgJChQUk9GSUxJ TkcpIC1jIC1vICQqLm8gJDwNCisNCitzY3JpcHRzL21rY29uZmlnczogc2Ny aXB0cy9ta2NvbmZpZ3MuYw0KKwkkKEhPU1RDQykgJChIT1NUQ0ZMQUdTKSAt byBzY3JpcHRzL21rY29uZmlncyBzY3JpcHRzL21rY29uZmlncy5jDQorDQor aW5pdC9jb25maWdzLm86IHNjcmlwdHMvbWtjb25maWdzICQoVE9QRElSKS8u Y29uZmlnIGluY2x1ZGUvY29uZmlnL01BUktFUg0KKwlzY3JpcHRzL21rY29u ZmlncyAkKFRPUERJUikvLmNvbmZpZyBpbml0L2NvbmZpZ3MuYw0KKwkkKEND KSAkKENGTEFHUykgJChDRkxBR1NfS0VSTkVMKSAtREVYUE9SVF9TWU1UQUIg LWMgLW8gaW5pdC9jb25maWdzLm8gaW5pdC9jb25maWdzLmMNCiANCiBmcyBs aWIgbW0gaXBjIGtlcm5lbCBkcml2ZXJzIG5ldDogZHVtbXkNCiAJJChNQUtF KSBDRkxBR1M9IiQoQ0ZMQUdTKSAkKENGTEFHU19LRVJORUwpIiAkKHN1YnN0 ICRALCBfZGlyXyRALCAkQCkNCi0tLSAvaG9tZS9yZGR1bmxhcC9kb2MvZXBv Y2gJV2VkIE1heSAyNCAwOTo1MTowMCAyMDAwDQorKysgbGludXgtMjQxNi9z Y3JpcHRzL21rY29uZmlncy5jCVdlZCBGZWIgMTMgMDk6MDc6MjAgMjAwMg0K QEAgLTAsMCArMSwxNTUgQEANCisvKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqDQorICogbWtjb25maWdzLmMNCisgKiAoQykgMjAwMiBSYW5keSBE dW5sYXAgPHJkZHVubGFwQG9zZGwub3JnPg0KKw0KKyMgICBUaGlzIHByb2dy YW0gaXMgZnJlZ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oMyk7DQorCX0NCisJaWYgKGZjbG9zZSAoY29uZmlnZmls ZSkpIHsNCisJCWZwcmludGYgKHN0ZGVyciwgIiVzOiBlcnJvciAlZCBjbG9z aW5nICclcydcbiIsDQorCQkJCXByb2duYW1lLCBlcnJubywgY29uZmlnbmFt ZSk7DQorCQlleGl0ICgzKTsNCisJfQ0KKw0KKwlleGl0ICgwKTsNCit9DQor DQorLyogZW5kIG1rY29uZmlncy5jICovDQo= --346823425-27554337-1013623783=:1530-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/