From ed1b492d086356c4705b60c68a4da9d63ff0bb89 Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Fri, 16 Oct 2015 23:34:15 +0200
Subject: [PATCH] Makefile: Correct calculation of filesystem.size

This should fix that the progress bar shows 100% for most of the installation
process.

Reference: https://help.ubuntu.com/community/LiveCDCustomizationFromScratch
---
 Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index f99c16f..6ed3648 100644
--- a/Makefile
+++ b/Makefile
@@ -308,9 +308,8 @@ $(call gentargets,$(CHECKSUMS)) : $(call archdir,%)$(STATE_DIR)/rootfs_remastere
 
 rootfs_fssize: $(ARCH_DIR)/filesystem.size
 $(call gentargets,/filesystem.size) : $(call archdir,%)$(STATE_DIR)/rootfs_remastered
-	IN_BYTES=$$(du -s "$(call archdir,$*)$(ROOTFS)"|cut -f1) && \
-	IN_SECTORS=$$(($$IN_BYTES * 512)) && \
-	echo $$IN_SECTORS > $(call archdir,$*)/filesystem.size
+	IN_BYTES=$$(du -sx --block-size=1 "$(call archdir,$*)$(ROOTFS)"|cut -f1) && \
+	echo $$IN_BYTES > $(call archdir,$*)/filesystem.size
 
 rootfs_deduplicate $(COMMON_DIR)$(STATE_DIR)/rootfs_deduplicated: $(PRIMARY_ARCH_DIR)$(CHECKSUMS) $(SECONDARY_ARCH_DIR)$(CHECKSUMS)
 	mkdir -p "$(COMMON_DIR)$(STATE_DIR)"
-- 
GitLab