Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S269572AbUINRCt (ORCPT ); Tue, 14 Sep 2004 13:02:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S269567AbUINQ4i (ORCPT ); Tue, 14 Sep 2004 12:56:38 -0400 Received: from host-81-191-110-70.bluecom.no ([81.191.110.70]:30092 "EHLO mail.blenning.no") by vger.kernel.org with ESMTP id S269606AbUINQeq (ORCPT ); Tue, 14 Sep 2004 12:34:46 -0400 Subject: /proc/config reducing kernel image size From: Tom Fredrik Blenning Klaussen To: linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="=-ReC/VeQMtSHK8r7oM38J" Message-Id: <1095179606.11939.22.camel@host-81-191-110-70.bluecom.no> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 14 Sep 2004 18:33:26 +0200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10407 Lines: 156 --=-ReC/VeQMtSHK8r7oM38J Content-Type: text/plain Content-Transfer-Encoding: 7bit I've written a small patch that reduces the size of /proc/config. There is no point in storing all the comments and unused options in the kernel image. This typically reduces the config size to about 1/5th before compressing, and to about 1/4th after compressing. I've also added the configuration option of how you want to compress it. In order to do the comment stripping I was forced to add a small script to the scripts, section, this has to be made executable. However if it is possible, the script should be skipped altogether, but I can't figure out how to do the proper escaping of the special characters in the kernel/Makefile. So if anyone could help me with that, I would be grateful. I'm interessted in comments on the concept. Sincerely -- BFG --=-ReC/VeQMtSHK8r7oM38J Content-Disposition: attachment; filename=linux-2.6.8.1-config-compress-patch.diff Content-Type: text/x-patch; name=linux-2.6.8.1-config-compress-patch.diff; charset=ISO-8859-1 Content-Transfer-Encoding: base64 ZGlmZiAtcnVOIC91c3Ivc3JjL2xpbnV4LTIuNi44LjEvaW5pdC9LY29uZmlnIC4vaW5pdC9LY29u ZmlnDQotLS0gL3Vzci9zcmMvbGludXgtMi42LjguMS9pbml0L0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A0KQEAgLTAsMCArMSwyIEBADQorIyEvYmluL3NoDQor ZWdyZXAgLXYgJ14jfF5bOnNwYWNlOl0qJCcNCg== --=-ReC/VeQMtSHK8r7oM38J-- - 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/