Skip to contentSkip to conversation

fs/iso9660: add transparent compression

PATCH New Yann E. MORIN 2 participants 6 messages Dec 20, 2017 – Jan 1, 2018

lore
Share & tools
lore
#0 lore raw

cover fs/iso9660: add transparent compression

Hello All!

This two-patch series introduces support for generating iso9660 images with compressed files in them, using transparent (de)compression.

Regards,
Yann E. MORIN.

The following changes since commit 5b85c6a038cc210355d8d5715cdf6fa73d18e8ac

pulseaudio: fix libsamplerate dependency (2017-12-20 21:37:18 +0100)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to d9148095910e211f1b38a85f93a10ab88fa1af04

core/tests: add test for compressed iso9660 (2017-12-20 22:12:23 +0100)

----------------------------------------------------------------
Yann E. MORIN (2):
fs/iso9660: add option for transparent (de)compression core/tests: add test for compressed iso9660

 .gitlab-ci.yml                           |  2 ++
 fs/iso9660/Config.in                     |  9 +++++++
 fs/iso9660/iso9660.mk                    | 12 ++++++++++
 support/testing/tests/fs/test_iso9660.py | 41 ++++++++++++++++++++++++++++++++
 4 files changed, 64 insertions(+)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 fs/iso9660: add option for transparent (de)compression

---
 fs/iso9660/Config.in  |  9 +++++++++
 fs/iso9660/iso9660.mk | 12 ++++++++++++
 2 files changed, 21 insertions(+)
fs/iso9660/Config.in +9 -0
index 842c987f21..1457c80569 100644
@@ -63,6 +63,15 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
 	  contain a kernel image, an initrd image (unless an initramfs
 	  linked into the kernel is used) and the bootloader.
 
+config BR2_TARGET_ROOTFS_ISO9660_TRANSP_COMPRESS
+	bool "transparent compression"
+	depends on !BR2_TARGET_ROOTFS_ISO9660_INITRD
+	depends on !BR2_TARGET_ROOTFS_INITRAMFS
+	help
+	  Say 'y' to enable use of transparent (de)compression. Files
+	  are stored compressed and will be decompressed on-the-fly
+	  upon access at runtime.
+
 config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 	bool "Build hybrid image"
 	depends on BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
fs/iso9660/iso9660.mk +12 -0
index c2de27101a..771ad4eceb 100644
@@ -41,6 +41,17 @@ define ROOTFS_ISO9660_CREATE_TEMPDIR
 	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_CREATE_TEMPDIR
+else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_TRANSP_COMPRESS),y)
+ROOTFS_ISO9660_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp
+# This must be early, before we copy the bootloader files
+define ROOTFS_ISO9660_MKZFTREE
+	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
+	mkzftree -X -z 9 -p $(PARALLEL_JOBS) \
+		$(TARGET_DIR) \
+		$(ROOTFS_ISO9660_TARGET_DIR)
+endef
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_MKZFTREE
+ROOTFS_ISO9660_GENISOIMAGE_OPTS += -z
 else
 ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
 endif
@@ -117,6 +128,7 @@ endif # ROOTFS_ISO9660_USE_INITRD
 define ROOTFS_ISO9660_CMD
 	$(HOST_DIR)/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
+		$(ROOTFS_ISO9660_GENISOIMAGE_OPTS) \
 		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/2 fs/iso9660: add option for transparent (de)compression

Hello,

Quoted 1 line · Yann E. MORIN

+config BR2_TARGET_ROOTFS_ISO9660_TRANSP_COMPRESS

I found the abbreviation to TRANSP_COMPRESS a little bit useless, so I've changed the name of the option to _TRANSPARENT_COMPRESSION instead. Applied with this change. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 core/tests: add test for compressed iso9660

In reply to Yann E. MORIN
---
 .gitlab-ci.yml                           |  2 ++
 support/testing/tests/fs/test_iso9660.py | 41 ++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
.gitlab-ci.yml +2 -0
index c81697920b..8b35e18003 100644
@@ -256,8 +256,10 @@ tests.fs.test_ext.TestExt2r1: *runtime_test
 tests.fs.test_ext.TestExt3: *runtime_test
 tests.fs.test_ext.TestExt4: *runtime_test
 tests.fs.test_iso9660.TestIso9660Grub2External: *runtime_test
+tests.fs.test_iso9660.TestIso9660Grub2ExternalCompress: *runtime_test
 tests.fs.test_iso9660.TestIso9660Grub2Internal: *runtime_test
 tests.fs.test_iso9660.TestIso9660SyslinuxExternal: *runtime_test
+tests.fs.test_iso9660.TestIso9660SyslinuxExternalCompress: *runtime_test
 tests.fs.test_iso9660.TestIso9660SyslinuxInternal: *runtime_test
 tests.fs.test_jffs2.TestJffs2: *runtime_test
 tests.fs.test_squashfs.TestSquashfs: *runtime_test
support/testing/tests/fs/test_iso9660.py +41 -0

53 lines not on this page · raw message

Signature · 1 line
2.11.0
#4 lore raw

PATCH 2/2 core/tests: add test for compressed iso9660

Hello,

support/testing/tests/fs/test_iso9660.py class TestIso9660Grub2External(infra.basetest.BRTest): · line 75

Quoted 6 lines · Yann E. MORIN
support/testing/tests/fs/test_iso9660.py +6 -0
+class TestIso9660Grub2ExternalCompress(infra.basetest.BRTest):
+    config = BASIC_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_ISO9660=y
+        # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set
+        BR2_TARGET_ROOTFS_ISO9660_TRANSP_COMPRESS

Not sure you really tested with transparent compression enabled, since =y was missing. So I've fixed that, taken into account the option rename, and applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#5 lore raw

PATCH 2/2 core/tests: add test for compressed iso9660

Thomas, All,

On 2017-12-31 18:23 +0100, Thomas Petazzoni spake thusly:

Quoted 10 lines · Yann E. MORIN

support/testing/tests/fs/test_iso9660.py class TestIso9660Grub2External(infra.basetest.BRTest): · line 75

Quoted 6 lines
support/testing/tests/fs/test_iso9660.py +6 -0
+class TestIso9660Grub2ExternalCompress(infra.basetest.BRTest):
+    config = BASIC_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_ISO9660=y
+        # BR2_TARGET_ROOTFS_ISO9660_INITRD is not set
+        BR2_TARGET_ROOTFS_ISO9660_TRANSP_COMPRESS

Not sure you really tested with transparent compression enabled, since =y was missing. So I've fixed that, taken into account the option rename, and applied. Thanks!

I'm pretty sure that got tested:

    https://gitlab.com/ymorin/buildroot-ci/pipelines/15356311

But it proabably got ignored, so the filesystem was not compression enabled.

Thanks for the fix.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'