phase1: remove kmods in target packages if archive is enabled
authorDaniel Golle <daniel@makrotopia.org>
Fri, 15 Nov 2024 14:27:55 +0000 (15:27 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 18 Nov 2024 08:08:54 +0000 (08:08 +0000)
OPKG gets confused if kmod packages are present in both, target packages
as well as kernel version specific folder.
Remove them from target packages to make opkg pick the kmods from kmod
archive folder only.

This also affects APK that picks packages from the first entry in the
repository file and doesn't support checking the same package from
multiple entry.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[ add --remove-source-files and improve implementation ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
phase1/master.cfg

index 82ebc90626b983a59920c538d773113e44dd2dc5..380338b1a01689a12b7e68b708176ef9355c11a3 100644 (file)
@@ -1250,23 +1250,6 @@ def prepareFactory(target):
         )
     )
 
-    factory.addStep(
-        ShellCommand(
-            name="pkgindex",
-            description="Indexing packages",
-            descriptionDone="Packages indexed",
-            command=[
-                "make",
-                Interpolate("-j%(prop:nproc:-1)s"),
-                "package/index",
-                "V=s",
-                "CONFIG_SIGNED_PACKAGES=",
-            ],
-            env=MakeEnv(),
-            haltOnFailure=True,
-        )
-    )
-
     factory.addStep(
         ShellCommand(
             name="images",
@@ -1303,17 +1286,6 @@ def prepareFactory(target):
         )
     )
 
-    factory.addStep(
-        ShellCommand(
-            name="checksums",
-            description="Calculating checksums",
-            descriptionDone="Checksums calculated",
-            command=["make", "-j1", "checksum", "V=s"],
-            env=MakeEnv(),
-            haltOnFailure=True,
-        )
-    )
-
     factory.addStep(
         ShellCommand(
             name="kmoddir",
@@ -1339,6 +1311,7 @@ def prepareFactory(target):
             descriptionDone="Kmod archive prepared",
             command=[
                 "rsync",
+                "--remove-source-files",
                 "--include=/kmod-*.ipk",
                 "--include=/kmod-*.apk",
                 "--exclude=*",
@@ -1359,6 +1332,23 @@ def prepareFactory(target):
         )
     )
 
+    factory.addStep(
+        ShellCommand(
+            name="pkgindex",
+            description="Indexing packages",
+            descriptionDone="Packages indexed",
+            command=[
+                "make",
+                Interpolate("-j%(prop:nproc:-1)s"),
+                "package/index",
+                "V=s",
+                "CONFIG_SIGNED_PACKAGES=",
+            ],
+            env=MakeEnv(),
+            haltOnFailure=True,
+        )
+    )
+
     factory.addStep(
         ShellCommand(
             name="kmodindex",
@@ -1382,6 +1372,17 @@ def prepareFactory(target):
         )
     )
 
+    factory.addStep(
+        ShellCommand(
+            name="checksums",
+            description="Calculating checksums",
+            descriptionDone="Checksums calculated",
+            command=["make", "-j1", "checksum", "V=s"],
+            env=MakeEnv(),
+            haltOnFailure=True,
+        )
+    )
+
     # sign
     factory.addStep(
         MasterShellCommand(