diff --git a/Makefile b/Makefile index 7dfa5566..66e9ece7 100644 --- a/Makefile +++ b/Makefile @@ -473,6 +473,7 @@ bin_modules-$(CONFIG_UTIL_LINUX) += util-linux bin_modules-$(CONFIG_OPENSSL) += openssl bin_modules-$(CONFIG_TPM2_TOOLS) += tpm2-tools bin_modules-$(CONFIG_BASH) += bash +bin_modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils $(foreach m, $(bin_modules-y), \ $(call map,initrd_bin_add,$(call bins,$m)) \ diff --git a/modules/powerpc-utils b/modules/powerpc-utils new file mode 100644 index 00000000..dc19d13f --- /dev/null +++ b/modules/powerpc-utils @@ -0,0 +1,27 @@ +modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils + +powerpc-utils_version := 1.3.5 +powerpc-utils_dir := powerpc-utils-$(powerpc-utils_version) +powerpc-utils_tar := powerpc-utils-$(powerpc-utils_version).tar.gz +powerpc-utils_url := https://github.com/ibm-power-utilities/powerpc-utils/archive/v$(powerpc-utils_version)/$(powerpc-utils_tar) +powerpc-utils_hash := 77efe3978ac9c251c4728a35b9aebd6076583939a8e26cc7f07ffa86432a8bf0 + +powerpc-utils_configure := \ + ./autogen.sh && \ + $(CROSS_TOOLS) \ + CFLAGS="-Os" \ + ./configure \ + --host $(MUSL_ARCH)-elf-linux \ + --prefix "/" \ + --without-systemd \ + --without-librtas + +powerpc-utils_target := \ + $(MAKE_JOBS) \ + $(CROSS_TOOLS) \ + DESTDIR="$(INSTALL)" \ + install + +powerpc-utils_output := src/nvram + +powerpc-utils_depends := $(musl_dep) diff --git a/patches/powerpc-utils-1.3.5.patch b/patches/powerpc-utils-1.3.5.patch new file mode 100644 index 00000000..35b27cdb --- /dev/null +++ b/patches/powerpc-utils-1.3.5.patch @@ -0,0 +1,17 @@ +AC_FUNC_MALLOC somehow fails to find malloc(), so drop the check + +Weirdly, it doesn't fail configuration, but instead adds -Dmalloc=rpl_malloc +and fails linking. + +diff --git a/configure.ac.orig b/configure.ac +index a7be3ee95c..74aade323b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -33,7 +33,6 @@ AC_TYPE_UINT8_T + # Checks for library functions. + AC_FUNC_FORK + AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +-AC_FUNC_MALLOC + AC_FUNC_MKTIME + AC_CHECK_FUNCS([memset strchr strcspn strdup strerror strrchr strstr strtol strtoul strtoull gettimeofday]) +