ubox: Conditionally build getrandom
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 15 Jan 2017 04:08:56 +0000 (20:08 -0800)
committerFlorian Fainelli <f.fainelli@gmail.com>
Sun, 19 Mar 2017 04:42:46 +0000 (21:42 -0700)
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
package/system/ubox/Makefile
package/system/ubox/patches/001-no-getrandom.patch [new file with mode: 0644]

index 8ccd9dda84b28599fffdc334142a16bf7183f825..a11a4a17d11f2271a614997dc15c1c7f15394a96 100644 (file)
@@ -38,7 +38,7 @@ define Package/ubox/install
        $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin
 
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{kmodloader,validate_data} $(1)/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
+       -$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib
 
        $(LN) kmodloader $(1)/sbin/rmmod
diff --git a/package/system/ubox/patches/001-no-getrandom.patch b/package/system/ubox/patches/001-no-getrandom.patch
new file mode 100644 (file)
index 0000000..ee036cb
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 62de1d4b9648..3474af320ba3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,8 +24,6 @@ IF(getrandom)
+   INSTALL(TARGETS getrandom
+           RUNTIME DESTINATION bin
+   )
+-ELSE()
+-  message( FATAL_ERROR "Kernel too old, missing SYS_getrandom system call")
+ ENDIF()
+ ADD_EXECUTABLE(kmodloader kmodloader.c)