Sfoglia il codice sorgente

improve linux-header to support driver modules (#746)

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update android.yml

* Update android.yml

* Update xmake.lua

* Update xmake.lua
ruki 3 anni fa
parent
commit
8d1a45b741
1 ha cambiato i file con 20 aggiunte e 3 eliminazioni
  1. 20 3
      packages/l/linux-headers/xmake.lua

+ 20 - 3
packages/l/linux-headers/xmake.lua

@@ -14,10 +14,27 @@ package("linux-headers")
     add_versions("5.9.16", "b0d7abae88e5f91893627c645e680a95c818defd1b4fcaf3e2afb4b2b6b4ab86")
     add_versions("5.10.46", "569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415")
 
-    add_deps("rsync")
+    add_configs("driver_modules", {description = "Enable driver modules files.", default = false, type = "boolean"})
 
-    on_install("@linux", function (package)
-        os.vrunv("make", {"headers_install", "INSTALL_HDR_PATH=" .. package:installdir()})
+    on_load(function (package)
+        if package:config("driver_modules") then
+            package:add("deps", "flex", "bison", "bc", "pkg-config")
+            package:add("deps", "openssl", "elfutils", {host = true})
+        else
+            package:add("deps", "rsync")
+        end
+    end)
+
+    on_install("linux", function (package)
+        import("package.tools.make")
+        if package:config("driver_modules") then
+            os.cp("*", package:installdir())
+            make.make(package, {"allyesconfig"}, {curdir = package:installdir()})
+            make.make(package, {"modules_prepare"}, {curdir = package:installdir()})
+            os.rm(path.join(package:installdir(), "source"))
+        else
+            os.vrunv("make", {"headers_install", "INSTALL_HDR_PATH=" .. package:installdir()})
+        end
     end)
 
     on_test(function (package)