fs/iso9660: fix transparent (de)compression

It needs mkzftree from zisofs-tools, so we add a dependency to it, and
we call that one explicitly (to avoid using the one from the host in
PATH).

It also needs the the uncompressed kernel image, but because it is
already in target/ so it gets compressed by mkzftree. We have two
options:
  - compress everything but the kernel image,
  - compress everything, kernel included, and recopy it later.

We choose the latter, because it is the simplest solution. So, we always
define the kernel-copy hook, but only register it when needed.

Finally, it needs a kernel with support for transparent
(de)compression, so we update the existing test config.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2018.02.x
Yann E. MORIN 2018-01-02 21:04:12 +01:00 committed by Thomas Petazzoni
parent fa4ee4dc0a
commit 158e832aac
2 changed files with 9 additions and 4 deletions

View File

@ -42,11 +42,12 @@ define ROOTFS_ISO9660_CREATE_TEMPDIR
endef
ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_CREATE_TEMPDIR
else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION),y)
ROOTFS_ISO9660_DEPENDENCIES += host-zisofs-tools
ROOTFS_ISO9660_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp
# This must be early, before we copy the bootloader files
# 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) \
$(HOST_DIR)/bin/mkzftree -X -z 9 -p $(PARALLEL_JOBS) \
$(TARGET_DIR) \
$(ROOTFS_ISO9660_TARGET_DIR)
endef
@ -92,14 +93,13 @@ define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
$(SED) '/__INITRD_PATH__/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
endef
ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
# Copy the kernel to temporary filesystem
define ROOTFS_ISO9660_COPY_KERNEL
$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
endef
ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
# If initramfs is used, disable loading the initrd as the rootfs is
@ -119,6 +119,10 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
endif
else # ROOTFS_ISO9660_USE_INITRD
ifeq ($(BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION),y)
# We must use the uncompressed kernel image
ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
endif
ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD

View File

@ -43,6 +43,7 @@ CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_EXT4_FS=y
CONFIG_ISO9660_FS=y
CONFIG_ZISOFS=y
CONFIG_JOLIET=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y