From ac3bae907fc2bc648b4b40b0df1f325b72ae24c3 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sat, 2 Mar 2019 14:46:57 +0100 Subject: [PATCH] tools/squashfskit: fix version detection on non-linux system gnu date is present in our staging_dir which means squashfskit will fail to build. Prevent also a race condition if coreutils is build after squashfskit. To prevent a race condition, depend on coreutils. Acked-by: Kevin Darbyshire-Bryant Signed-off-by: Felix Fietkau Signed-off-by: Alexander Couzens --- tools/Makefile | 2 +- .../patches/0001-fix-version.sh.patch | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tools/squashfskit4/patches/0001-fix-version.sh.patch diff --git a/tools/Makefile b/tools/Makefile index d9f92d5bd0..83ed56db97 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -44,7 +44,7 @@ $(curdir)/bison/compile := $(curdir)/flex/compile $(curdir)/flex/compile := $(curdir)/libtool/compile $(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile -$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile +$(curdir)/squashfskit4/compile := $(curdir)/coreutils/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile $(curdir)/autoconf/compile := $(curdir)/m4/compile $(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkg-config/compile $(curdir)/xz/compile diff --git a/tools/squashfskit4/patches/0001-fix-version.sh.patch b/tools/squashfskit4/patches/0001-fix-version.sh.patch new file mode 100644 index 0000000000..5f0894bc17 --- /dev/null +++ b/tools/squashfskit4/patches/0001-fix-version.sh.patch @@ -0,0 +1,21 @@ +--- a/squashfs-tools/version.sh ++++ b/squashfs-tools/version.sh +@@ -27,13 +27,11 @@ if [ -z "$OUTPUT" ] ; then + fi + + our_date() { +-case $(uname) in +-NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin) +- date -r "$1" "$2" +- ;; +-*) +- date -d "@$1" "$2" +-esac ++ if date --version 2>&1 | grep -q "GNU coreutils"; then ++ date -d "@$1" "$2" ++ else ++ date -r "$1" "$2" ++ fi + } + + try_version() {