In order to remove any duplicate files in the tarball, we
have to unpack it again. The whole filesystem is written
to disk twice which is unnecessary.
This patch removes that temporary step and reduces IO
during the build.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
THISAPP = cdrom
TARGET = $(DIR_INFO)/$(THISAPP)
THISAPP = cdrom
TARGET = $(DIR_INFO)/$(THISAPP)
+# Fail when there is an error in the tar pipe
+SHELL=/bin/bash -o pipefail
+
ifeq "$(BUILD_PLATFORM)" "arm"
TAR_OPTIONS =
else
ifeq "$(BUILD_PLATFORM)" "arm"
TAR_OPTIONS =
else
# since stage2 has been executed..
echo "$(SYSTEM_RELEASE)" > /etc/system-release
# since stage2 has been executed..
echo "$(SYSTEM_RELEASE)" > /etc/system-release
- rm -rf /install/cdrom /tmp/*
mkdir -p /install/cdrom/doc
# Clear mtab (prevents .journal problems)
mkdir -p /install/cdrom/doc
# Clear mtab (prevents .journal problems)
BUILDTARGET="$(BUILDTARGET)" BUILD_ARCH="$(BUILD_ARCH)" KVER="$(KVER)" \
$(DIR_SRC)/src/scripts/archive.files \
$(DIR_SRC)/config/rootfiles/common \
BUILDTARGET="$(BUILDTARGET)" BUILD_ARCH="$(BUILD_ARCH)" KVER="$(KVER)" \
$(DIR_SRC)/src/scripts/archive.files \
$(DIR_SRC)/config/rootfiles/common \
# Compress root filesystem
# Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
# Compress root filesystem
# Reason for this tar+untar+tar is removing of entries listed two or more in src/ROOTFILES
- tar -c --exclude='#*' --exclude='proc/*' --exclude='dev/pts/*' \
- --exclude='__pycache__' --exclude='tmp/ROOTFILES' \
- -C / --files-from=/tmp/ROOTFILES -f /$(SNAME).tar
- rm -f /tmp/ROOTFILES
- tar -x -C /tmp -f /$(SNAME).tar
- rm -f /$(SNAME).tar
- @mkdir /tmp/sys
- cd /tmp && tar cf - * | xz $(XZ_OPT) > /install/cdrom/distro.img && rm -rf *
+ rm -rf $(DIR_TMP)/root && mkdir -p $(DIR_TMP)/root
+ tar -c --exclude='#*' --exclude='proc/*' --exclude='dev/pts/*' --exclude='tmp/*' \
+ --exclude='__pycache__' \
+ -C / --files-from=$(DIR_TMP)/ROOTFILES | tar -x -C $(DIR_TMP)/root
+ rm -f $(DIR_TMP)/ROOTFILES
+ mkdir $(DIR_TMP)/root/sys
+ cd $(DIR_TMP)/root && tar cf - * | xz $(XZ_OPT) > /install/cdrom/distro.img
+ rm -rf $(DIR_TMP)/root
# Other files
touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media
# Other files
touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media