From patchwork Tue Oct 9 23:34:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentine Barshak X-Patchwork-Id: 190512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 7EC692C00A8 for ; Wed, 10 Oct 2012 10:34:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 287FBA065B; Tue, 9 Oct 2012 23:34:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XkB2PL0qXMhw; Tue, 9 Oct 2012 23:34:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7D1B5A064D; Tue, 9 Oct 2012 23:34:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 43B9C8F74A for ; Tue, 9 Oct 2012 23:34:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A04A180BFF for ; Tue, 9 Oct 2012 23:34:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JR+X2545B4h5 for ; Tue, 9 Oct 2012 23:34:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 304748F548 for ; Tue, 9 Oct 2012 23:34:00 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id m4so6103lbo.16 for ; Tue, 09 Oct 2012 16:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=QSEpHwFdY8/8PaEgFQvXv7MGenwb/INYDEZ2ndhfhrM=; b=z1uZ6Dcw5GVAufXDlRU7iv5nVrUBh2XA3OPF7jF8LQILhylP9pEv9n1QZLFKyndg9l yiZVayx9tkiAEODDmKnX+soPpWP+8nSVFAYpKwa3eE1DCaphIotkCJZwd5BxzjEyUoVK XG+S7XBKpOeRShd/l6mac75jj53v+JRuf0b7URPyrtlhnFF8Kv7JWuEfDpFO1Qk4VSbo QNOrMX1V/XMN9afMPcYC8Fc87m0n7a3ASyflkm7rWxKshlG5JngS7/NsiIAFBh4jVZg8 jXlHm22I3HbHvZ8QTto9bbkSgghxTQlFQyxXdlRdlJuK8DJdtmK5iQhkTWPr7VnoyCVT 5aSA== Received: by 10.152.105.103 with SMTP id gl7mr1495892lab.10.1349825638996; Tue, 09 Oct 2012 16:33:58 -0700 (PDT) Received: from black.localnet ([93.100.122.208]) by mx.google.com with ESMTPS id d1sm4092lbh.7.2012.10.09.16.33.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 16:33:58 -0700 (PDT) From: Valentine Barshak To: buildroot@busybox.net Date: Wed, 10 Oct 2012 03:34:56 +0400 Message-Id: <1349825696-28535-1-git-send-email-gvaxon@gmail.com> X-Mailer: git-send-email 1.7.11.4 Subject: [Buildroot] [PATCH] linux: Do not force GZIP initramfs compression X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Initramfs compression does not make much sense for the architectures that support compressed kernel images because in this case the data would be compressed twice. This will eventually result in a bigger kernel image and time overhead when uncompressing it. The only reason to use compressed initramfs is to reduce memory usage when the kernel prepares rootfs, and both the unpacked filesystem and initramfs.cpio are present in the memory. Buildroot attempts to force GZIP compression for initramfs, however it doesn't always work because initramfs compression mode depends on RAM disk compression supported by the kernel. Thus, CONFIG_INITRAMFS_COMPRESSION_GZIP depends on CONFIG_RD_GZIP. If CONFIG_RD_GZIP is not set, setting GZIP initramfs compression will have no effect. Besides, the kernel also supports other compression methods, like BZIP2, LZMA, XZ and LZO. Forcing the good old GZIP does not really make much sense any more. This removes initramfs compression settings from Buildroot, so that the default value preset in the kernel config is used, which is CONFIG_INITRAMFS_COMPRESSION_NONE. If initramfs compression is still needed, it can be set in the kernel config (using make linux-menuconfig) Signed-off-by: Valentine Barshak Acked-by: Arnout Vandecappelle (Essensium/Mind) --- fs/initramfs/Config.in | 4 ++-- linux/linux.mk | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/initramfs/Config.in b/fs/initramfs/Config.in index bbc2ab0..b71018e 100644 --- a/fs/initramfs/Config.in +++ b/fs/initramfs/Config.in @@ -9,8 +9,8 @@ config BR2_TARGET_ROOTFS_INITRAMFS A rootfs.cpio file will be generated in the images/ directory. This is the archive that will be included in the kernel image. - The rootfs in the kernel will always be gzip'ed, regardless - of how buildroot's cpio archive is configured. + The default rootfs compression set in the kernel configuration + is used, regardless of how buildroot's cpio archive is configured. Note that enabling initramfs together with another filesystem formats doesn't make sense: you would end up having two diff --git a/linux/linux.mk b/linux/linux.mk index c4bdf90..914c09a 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -169,9 +169,7 @@ define LINUX_CONFIGURE_CMDS $(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config) $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config) $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config) - $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config) - $(call KCONFIG_DISABLE_OPT,CONFIG_INITRAMFS_COMPRESSION_NONE,$(@D)/.config) - $(call KCONFIG_ENABLE_OPT,CONFIG_INITRAMFS_COMPRESSION_GZIP,$(@D)/.config)) + $(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config)) $(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),, $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS,$(@D)/.config) $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS_MOUNT,$(@D)/.config))