Skip to content

Commit

Permalink
Use pigz for backup
Browse files Browse the repository at this point in the history
  • Loading branch information
procount committed Mar 15, 2019
1 parent 14c23ef commit 18319ab
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildroot/.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.02-git-00002-g45ffeca-dirty Configuration
# Buildroot 2015.02-git-00003-gc5dd575-dirty Configuration
#
BR2_HAVE_DOT_CONFIG=y

Expand Down Expand Up @@ -344,6 +344,7 @@ BR2_PACKAGE_PARTCLONE=y
BR2_PACKAGE_RECOVERY=y
BR2_PACKAGE_REBOOTP=y
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
BR2_PACKAGE_PIGZ=y

#
# Audio and video applications
Expand Down
1 change: 1 addition & 0 deletions buildroot/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ menu "Target packages"
source "package/recovery/Config.in"
source "package/rebootp/Config.in"
source "package/rpi-wifi-firmware/Config.in"
source "package/pigz/Config.in"

menu "Audio and video applications"
source "package/alsa-utils/Config.in"
Expand Down
14 changes: 14 additions & 0 deletions buildroot/package/pigz/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config BR2_PACKAGE_PIGZ
bool "pigz"
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_ZLIB
help
pigz, which stands for parallel implementation of gzip, is a
fully functional replacement for gzip that exploits multiple
processors and multiple cores to the hilt when compressing
data.

http://www.zlib.net/pigz/

comment "pigz needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
30 changes: 30 additions & 0 deletions buildroot/package/pigz/pigz.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#############################################################
#
# pigz
#
#############################################################
PIGZ_VERSION = 2.4
PIGZ_SOURCE = pigz-$(PIGZ_VERSION).tar.gz
PIGZ_SITE = zlib.net/pigz
#download.freenas.org/distfiles
PIGZ_CAT = $(ZCAT)
PIGZ_DIR = $(BUILD_DIR)/pigz-$(PIGZ_VERSION)
PIGZ_BINARY = pigz
PIGZ_DEPENDENCIES = zlib

define PIGZ_EXTRACT_CMDS
$(ZCAT) $(DL_DIR)/$(PIGZ_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
endef

define PIGZ_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
endef

define PIGZ_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/pigz $(TARGET_DIR)/usr/bin/pigz
$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/pigz
endef

$(eval $(generic-package))
2 changes: 1 addition & 1 deletion recovery/backupthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ bool BackupThread::processImage(const QVariantMap & entry)
{
// tar gzip
emit statusUpdate(tr("%1: Archiving (%2)").arg(os_name, QString(label)));
cmd = "sh -c \"cd /tmp/src; tar -c . | gzip > "+ backupFolder+"/"+label+".tar.gz\"";
cmd = "sh -c \"cd /tmp/src; tar -c . | pigz > "+ backupFolder+"/"+label+".tar.gz\"";
}

qDebug()<<cmd;
Expand Down

0 comments on commit 18319ab

Please sign in to comment.