Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 14 Feb 2002 11:54:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 14 Feb 2002 11:54:10 -0500 Received: from air-2.osdl.org ([65.201.151.6]:16395 "EHLO osdlab.pdx.osdl.net") by vger.kernel.org with ESMTP id ; Thu, 14 Feb 2002 11:53:54 -0500 Date: Thu, 14 Feb 2002 08:48:55 -0800 (PST) From: "Randy.Dunlap" X-X-Sender: To: Bill Davidsen cc: Ben Greear , Linux Kernel Mailing List Subject: Re: How to check the kernel compile options ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="346823425-836931094-1013705335=: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-836931094-1013705335=:1530 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 13 Feb 2002, Bill Davidsen wrote: | On Wed, 13 Feb 2002, Ben Greear wrote: | [snippage] | | No, but there's no reason to have it part of the kernel image as the only | solution. It works as a module, it works as a flat text data file in the | modules directory (except for those who can't match kernel to modules), | and ther's no reason why this can't exist somewhere which has no impact on | the size of the kernel image. I agree, if I understand you correctly. I don't see a need for a CONFIG_SAVE_CONFIG option with value 'm'. kbuild in 2.5 (or any script like 'installkernel') can do that by copying the current .config file to the modules install directory or the /boot directory. I was hoping that (e)grep could search a (b)zImage file for a binary pattern like the gzip header, but I couldn't make it work. I ended up writing a binary pattern search tool that returns the offset of the located pattern, and then I feed that value to tail | gunzip > strings | grep to get the CONFIG text that was saved by the code that I posted yesterday. I still plan to make this a config/build option (y/n) and remove the leading "CONFIG_" parts of the strings. binoffset.c and extract-config (script) attached. -- ~Randy --346823425-836931094-1013705335=:1530 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=extract-config Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=extract-config IyEgL2Jpbi9iYXNoDQojIGV4dHJhY3RzIC5jb25maWcgaW5mbyBmcm9tIGEg W2JdekltYWdlIGZpbGUNCiMgdXNlcyBiaW5vZmZzZXQgKG5ldyksIHRhaWws IGd1bnppcCwgc3RyaW5ncywgYW5kIGdyZXANCiMgJGFyZzEgaXMgW2Jdeklt YWdlIGZpbGVuYW1lDQoNCmd6aXBoZHI9YGJpbm9mZnNldCAkMSAweDFmIDB4 OGIgMHgwOCAweDBgDQojIGluY3JlbWVudCBieSAxIHNpbmNlIHRhaWwgb2Zm c2V0cyBhcmUgMS1iYXNlZCwgbm90IDAtYmFzZWQNCmd6aXBoZHI9JCgoZ3pp cGhkciArIDEpKQ0KDQp0YWlsIC1jICskZ3ppcGhkciAkMSB8IGd1bnppcCA+ ICQxLnRtcA0Kc3RyaW5ncyAkMS50bXAgfCBncmVwIENPTkZJR18gPiAkMS5v bGQuY29uZmlnDQpybSAkMS50bXANCg== --346823425-836931094-1013705335=:1530 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="binoffset.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="binoffset.c" LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICogYmlub2Zmc2V0 LmMNCiAqIChDKSAyMDAyIFJhbmR5IER1bmxhcCA8cmRkdW5sYXBAb3NkbC5v cmc+DQoNCiMgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91 IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQ0KIyAgIGl0IHVu ZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vu c2UgYXMgcHVibGlzaGVkIGJ5DQojICAgdGhlIEZyZWUgU29mdHdhcmUgRm91 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lleGl0ICgzKTsNCgl9DQoNCglmaWxl c2l6ZSA9IGdldF9maWxlc2l6ZSAoaW5wdXRmZCk7DQoNCgltYWRyID0gbW1h cCAoMCwgZmlsZXNpemUsIFBST1RfUkVBRCwgTUFQX1BSSVZBVEUsIGlucHV0 ZmQsIDApOw0KCWlmIChtYWRyID09IE1BUF9GQUlMRUQpIHsNCgkJZnByaW50 ZiAoc3RkZXJyLCAibW1hcCBlcnJvciA9ICVkXG4iLCBlcnJubyk7DQoJCWNs b3NlIChpbnB1dGZkKTsNCgkJZXhpdCAoNCk7DQoJfQ0KDQoJc2VhcmNoX3Bh dHRlcm4gKCk7DQoNCglpZiAobXVubWFwIChtYWRyLCBmaWxlc2l6ZSkpDQoJ CWZwcmludGYgKHN0ZGVyciwgIm11bm1hcCBlcnJvciA9ICVkXG4iLCBlcnJu byk7DQoNCglpZiAoY2xvc2UgKGlucHV0ZmQpKQ0KCQlmcHJpbnRmIChzdGRl cnIsICIlczogZXJyb3IgJWQgY2xvc2luZyAnJXMnXG4iLA0KCQkJCXByb2du YW1lLCBlcnJubywgaW5wdXRuYW1lKTsNCg0KCWZwcmludGYgKHN0ZGVyciwg Im51bWJlciBvZiBwYXR0ZXJuIG1hdGNoZXMgPSAlZFxuIiwgbnVtX21hdGNo ZXMpOw0KCWlmIChudW1fbWF0Y2hlcyA9PSAwKQ0KCQlmaXJzdGxvYyA9IH4w Ow0KCXByaW50ZiAoIiVkXG4iLCBmaXJzdGxvYyk7DQoJZnByaW50ZiAoc3Rk ZXJyLCAiJWRcbiIsIGZpcnN0bG9jKTsNCg0KCWV4aXQgKG51bV9tYXRjaGVz ID8gMCA6IDIpOw0KfQ0KDQovKiBlbmQgYmlub2Zmc2V0LmMgKi8NCg== --346823425-836931094-1013705335=: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/