From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] xz: Performance and compression tuning (V2) - fine tuning Date: Mon, 21 May 2018 16:19:48 +0200 Message-ID: <20180521141948.10024-1-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9184383426574831373==" List-Id: --===============9184383426574831373== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Changes since V1: - Tuned some more 'tar'-command lines - Included 'lfs/core-updates' - Some fine-tuning Hi, Current results with V2 (clean builds): 'next': 'packages' =3D> 255 MB 'ipfire-2.19.2gb-ext4.i586-full-core121.img.gz =3D> 319 MB 'ipfire-2.19.i586-full-core121.iso' =3D> 218 MB Total =3D> 792 MB 'xz-tuning': 'packages' =3D> 228 MB 'ipfire-2.19.2gb-ext4.i586-full-core121.img.gz' =3D> 318 MB 'ipfire-2.19.i586-full-core121.iso' =3D> 207 MB Total =3D> 753 MB (-39 MB) It would be nice if someone could review and test these. ;-) If necessary, I can upload a complete patch. Best, Matthias Signed-off-by: Matthias Fischer --- lfs/Config | 6 ++++-- lfs/cdrom | 4 ++-- lfs/core-updates | 9 +++++---- make.sh | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lfs/Config b/lfs/Config index c667a3cc7..a726f171d 100644 --- a/lfs/Config +++ b/lfs/Config @@ -47,6 +47,8 @@ else PREFIX =3D /usr endif =20 +TAR_OPTIONS =3D --xz + # URLs that are common sources of downloads. If you're having trouble with # a site you should change its URL to that of a suitable mirror site. # @@ -209,11 +211,11 @@ define PAK tar xf /install/packages/package/files.tmp -C /install/packages/package/tmp= / \ -p --numeric-owner rm -f /install/packages/package/files.tmp - cd /install/packages/package/tmp/ && XZ_OPT=3D"$(XZ_OPT)" tar -c -p --numer= ic-owner -J -f /install/packages/package/files.tar.xz * + cd /install/packages/package/tmp/ && XZ_OPT=3D"$(XZ_OPT)" tar -c -p --numer= ic-owner -J -f /install/packages/package/files.tar.xz $(TAR_OPTIONS) * rm -r /install/packages/package/tmp -cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/= package/ROOTFILES.tmp mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFI= LES - cd /install/packages/package && tar cf ../$(PROG)-$(VER)-$(PAK_VER).ipfire = --files-from=3D/usr/src/src/paks/files + cd /install/packages/package && XZ_OPT=3D"$(XZ_OPT)" tar cf ../$(PROG)-$(VE= R)-$(PAK_VER).ipfire $(TAR_OPTIONS) --files-from=3D/usr/src/src/paks/files rm -rf /install/packages/package sed -e s/NAME/$(PROG)/g \ -e s/VER/$(VER)/g \ diff --git a/lfs/cdrom b/lfs/cdrom index 820c55b87..cdb7b07da 100644 --- a/lfs/cdrom +++ b/lfs/cdrom @@ -71,14 +71,14 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) =20 # Compress root filesystem # Reason for this tar+untar+tar is removing of entries listed two or more i= n src/ROOTFILES - XZ_OPT=3D"$(XZ_OPT)" tar -c -C / --files-from=3D/tmp/ROOTFILES \ + tar -c -C / --files-from=3D/tmp/ROOTFILES \ -f /$(SNAME).tar --exclude=3D'#*' --exclude=3D'dev/pts/*' \ --exclude=3D'proc/*' --exclude=3D'tmp/ROOTFILES' rm -f /tmp/ROOTFILES tar -x -C /tmp -f /$(SNAME).tar rm -f /$(SNAME).tar @mkdir /tmp/sys - cd /tmp && tar cf /install/cdrom/distro.img $(TAR_OPTIONS) * && rm -rf * + cd /tmp && XZ_OPT=3D"$(XZ_OPT)" tar cf /install/cdrom/distro.img $(TAR_OPTI= ONS) * && rm -rf * =20 # Other files touch /install/cdrom/$(SNAME)-$(VERSION)-core$(CORE).media diff --git a/lfs/core-updates b/lfs/core-updates index 3c847daf2..d34926967 100644 --- a/lfs/core-updates +++ b/lfs/core-updates @@ -26,8 +26,9 @@ include Config =20 VER =3D ipfire =20 -THISAPP =3D core-updates -TARGET =3D $(DIR_INFO)/$(THISAPP) +THISAPP =3D core-updates +TARGET =3D $(DIR_INFO)/$(THISAPP) +TAR_OPTIONS =3D --xz =20 ############################################################################= ### # Top-level Rules @@ -78,7 +79,7 @@ core/%: mv -f /tmp/ROOTFILES /install/packages/package/ROOTFILES tar -p --numeric-owner -x -C /tmp -f /$(SNAME).tar rm -f /$(SNAME).tar - cd /tmp && tar cJf /install/packages/package/files.tar.xz * && rm -rf * + cd /tmp && XZ_OPT=3D"$(XZ_OPT)" tar cJf /install/packages/package/files.tar= .xz $(TAR_OPTIONS) * && rm -rf * cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/p= ackage/ROOTFILES.tmp rm /install/packages/package/ROOTFILES mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFI= LES @@ -89,7 +90,7 @@ core/%: #Change xxxKVERxxx to Kernelversion sed -e "s/xxxKVERxxx/$(KVER)/g" -i /install/packages/package/update.sh =20 - cd /install/packages/package && tar cf ../core-upgrade-$(VERSION)-$$(basena= me $@).ipfire \ + cd /install/packages/package && XZ_OPT=3D"$(XZ_OPT)" tar cf ../core-upgrade= -$(VERSION)-$$(basename $@).ipfire $(TAR_OPTIONS) \ update.sh files.tar.xz ROOTFILES rm -rf /install/packages/package sed -e "s/NAME/core-upgrade/g" \ diff --git a/make.sh b/make.sh index 33ebc16bb..9893fbb20 100755 --- a/make.sh +++ b/make.sh @@ -1776,7 +1776,7 @@ toolchain) buildtoolchain echo "`date -u '+%b %e %T'`: Create toolchain image for ${BUILD_ARCH}" | te= e -a $LOGFILE test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains - cd $BASEDIR && XZ_OPT=3D"$(XZ_OPT)" tar -Jc --exclude=3D'log/_build.*.log' = -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar= .xz \ + cd $BASEDIR && XZ_OPT=3D"$(XZ_OPT)" tar -Jc --exclude=3D'log/_build.*.log' = -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar= .xz --xz \ build/${TOOLS_DIR} build/bin/sh log >> $LOGFILE md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARC= H}.tar.xz \ > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.m= d5 --=20 2.17.0 --===============9184383426574831373==--