* [Buildroot] [PATCH] fs: allow to specify compression options
@ 2014-12-03 17:10 Vincent Stehlé
2014-12-09 23:16 ` Yann E. MORIN
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Stehlé @ 2014-12-03 17:10 UTC (permalink / raw)
To: buildroot
Add $BR2_TARGET_ROOTFS_xxx_OPTS options to allow changing the rootfs
compression options.
This allows to trade compression ratio versus compression speed for example.
We default to the previous settings.
Signed-off-by: Vincent Stehl? <vincent.stehle@freescale.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
Hi,
I would like to propose this patch, to allow specifying rootfs compression
options. I use it to reduce lzop compression level for faster rootfs
compression.
Best regards,
V.
fs/Config.in | 34 ++++++++++++++++++++++++++++++++++
fs/common.mk | 10 +++++-----
2 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/fs/Config.in b/fs/Config.in
index 5853113..9bd70e0 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -13,4 +13,38 @@ source "fs/tar/Config.in"
source "fs/ubifs/Config.in"
source "fs/yaffs2/Config.in"
+menu "Filesystem compression options"
+
+config BR2_TARGET_ROOTFS_GZIP_OPTS
+ string "Gzip options"
+ default "-9"
+ help
+ Options to use when compressing the root filesystem with gzip.
+
+config BR2_TARGET_ROOTFS_BZIP2_OPTS
+ string "Bzip2 options"
+ default "-9"
+ help
+ Options to use when compressing the root filesystem with bzip2.
+
+config BR2_TARGET_ROOTFS_LZMA_OPTS
+ string "Lzma options"
+ default "-9"
+ help
+ Options to use when compressing the root filesystem with lzma.
+
+config BR2_TARGET_ROOTFS_LZOP_OPTS
+ string "Lzop options"
+ default "-9"
+ help
+ Options to use when compressing the root filesystem with lzop.
+
+config BR2_TARGET_ROOTFS_XZ_OPTS
+ string "Xz options"
+ default "-9 -C crc32"
+ help
+ Options to use when compressing the root filesystem with xz.
+
+endmenu
+
endmenu
diff --git a/fs/common.mk b/fs/common.mk
index d40f5ae..c8a71d6 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -45,25 +45,25 @@ ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
ROOTFS_$(2)_COMPRESS_EXT = .gz
-ROOTFS_$(2)_COMPRESS_CMD = gzip -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = gzip $$(call qstrip,$$(BR2_TARGET_ROOTFS_GZIP_OPTS)) -c
endif
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
ROOTFS_$(2)_COMPRESS_EXT = .bz2
-ROOTFS_$(2)_COMPRESS_CMD = bzip2 -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = bzip2 $$(call qstrip,$$(BR2_TARGET_ROOTFS_BZIP2_OPTS)) -c
endif
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
ROOTFS_$(2)_DEPENDENCIES += host-lzma
ROOTFS_$(2)_COMPRESS_EXT = .lzma
-ROOTFS_$(2)_COMPRESS_CMD = $$(LZMA) -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = $$(LZMA) $$(call qstrip,$$(BR2_TARGET_ROOTFS_LZMA_OPTS)) -c
endif
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZO),y)
ROOTFS_$(2)_DEPENDENCIES += host-lzop
ROOTFS_$(2)_COMPRESS_EXT = .lzo
-ROOTFS_$(2)_COMPRESS_CMD = $$(LZOP) -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = $$(LZOP) $$(call qstrip,$$(BR2_TARGET_ROOTFS_LZOP_OPTS)) -c
endif
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_XZ),y)
ROOTFS_$(2)_COMPRESS_EXT = .xz
-ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c
+ROOTFS_$(2)_COMPRESS_CMD = xz $$(call qstrip,$$(BR2_TARGET_ROOTFS_XZ_OPTS)) -c
endif
$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)
--
2.1.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] fs: allow to specify compression options
2014-12-03 17:10 [Buildroot] [PATCH] fs: allow to specify compression options Vincent Stehlé
@ 2014-12-09 23:16 ` Yann E. MORIN
0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2014-12-09 23:16 UTC (permalink / raw)
To: buildroot
Vincent, All,
On 2014-12-03 18:10 +0100, Vincent Stehl? spake thusly:
> Add $BR2_TARGET_ROOTFS_xxx_OPTS options to allow changing the rootfs
> compression options.
>
> This allows to trade compression ratio versus compression speed for example.
Thank you for your contribution!
However, we would prefer that compression option be simply removed for
all filesystems, except for squashfs and jffs2 for which compression is
intrinsic to the filesystem.
Would you mind to work on this, please?
Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-09 23:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 17:10 [Buildroot] [PATCH] fs: allow to specify compression options Vincent Stehlé
2014-12-09 23:16 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox