restool: sort source files for reproducible builds

Right now the list is generated by find, which order depends of the underlying
filesystem. This causes reproducibility issues within the OpenWrt build system.

Fix it by adding a deterministic sort.

Sent to upstream via https://github.com/nxp-qoriq/restool/pull/3

Link: https://github.com/openwrt/openwrt/pull/25531
Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren committed 2026-10-03 20:22:20 +02:00
1 parent a20047f6ee
commit ab8d38d99b
2 files changed
+29 -1

No files matched your search

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=restool
PKG_VERSION:=6.18.2.1.0.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/restool
@@ -0,0 +1,28 @@
From 7eaf41b04bd2a2b8775c1feb91a631236182bf86 Mon Sep 17 00:00:00 2001
From: Paul Spooren <mail@aparcar.org>
Date: Fri, 2 Oct 2026 12:33:51 +0200
Subject: [PATCH] Makefile: sort source files for reproducible builds
Right now the list is generated by find, which order depends of the underlying
filesystem. This causes reproducibility issues within the OpenWrt build system.
Fix it by adding a deterministic sort.
Signed-off-by: Paul Spooren <mail@aparcar.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index a3d1599..461100d 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ ifeq ($(origin CC),default)
CC := $(CROSS_COMPILE)gcc
endif
-SRC = $(shell find . -name "*.c")
+SRC = $(sort $(shell find . -name "*.c"))
OBJ = $(patsubst %.c, %.o, $(SRC))
MANPAGE ?= restool.1
RESTOOL_SCRIPT_SYMLINKS = ls-addmux ls-addsw ls-addni ls-listni ls-listmac ls-delete