]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes: Only allow network in existing network accessing code
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Dec 2021 17:38:58 +0000 (17:38 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 12 Jan 2022 21:10:15 +0000 (21:10 +0000)
Use the newly added network task flag against tasks where network
access is expected. This is do_fetch, do_checkuri, do_testimage, do_testsdk
and do_testsdkext.

We can't disable networking in sstate tasks due to sstate downloads and
also so we can report hash equivalence to the server so network access
is enabled in sstate tasks.

Access within build-appliance do_image is also allowed due to the use
of pip, this is a poor example made rather obvious now and needs to be reworked.

Network access anywhere else in any other task isn't allowed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass
meta/classes/sstate.bbclass
meta/classes/testimage.bbclass
meta/classes/testsdk.bbclass
meta/classes/utility-tasks.bbclass
meta/recipes-core/images/build-appliance-image_15.0.0.bb

index b709777f243b901e8882b9e9e4827ee15b74334f..5f4956a1d31b2f6ddf8a80f299d461ecce5c5e5f 100644 (file)
@@ -150,6 +150,7 @@ do_fetch[dirs] = "${DL_DIR}"
 do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
 do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"
 do_fetch[vardeps] += "SRCREV"
+do_fetch[network] = "1"
 python base_do_fetch() {
 
     src_uri = (d.getVar('SRC_URI') or "").split()
index 0326d27c743498983edc1b81f5beaa6ed89b9250..645377fdd8f49e025dec66de93aceff8c2d84c3c 100644 (file)
@@ -158,6 +158,8 @@ python () {
     for task in unique_tasks:
         d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
         d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
+        d.setVarFlag(task, 'network', '1')
+        d.setVarFlag(task + "_setscene", 'network', '1')
 }
 
 def sstate_init(task, d):
index 1c5fd4ee6a4a43fc763962686bc52733a815ee59..898248992c892724a8cdbc82d2e3506a27280b26 100644 (file)
@@ -139,6 +139,7 @@ python do_testimage() {
 
 addtask testimage
 do_testimage[nostamp] = "1"
+do_testimage[network] = "1"
 do_testimage[depends] += "${TESTIMAGEDEPENDS}"
 do_testimage[lockfiles] += "${TESTIMAGELOCK}"
 
index 758a23ac5532e8c60ae95fb290bc1f1c5f2ced2a..8b2e74f6069d3612a8d40e5c3049a45350f1a899 100644 (file)
@@ -36,12 +36,14 @@ python do_testsdk() {
 }
 addtask testsdk
 do_testsdk[nostamp] = "1"
+do_testsdk[network] = "1"
 
 python do_testsdkext() {
     import_and_run('TESTSDKEXT_CLASS_NAME', d)
 }
 addtask testsdkext
 do_testsdkext[nostamp] = "1"
+do_testsdkext[network] = "1"
 
 python () {
     if oe.types.boolean(d.getVar("TESTIMAGE_AUTO") or "False"):
index 34d6b8f4d52c04deba04c8e8c1a2c5acbd64587d..0466325c1313f9775c945258d7f5949c54254fcf 100644 (file)
@@ -38,6 +38,7 @@ python do_clean() {
 
 addtask checkuri
 do_checkuri[nostamp] = "1"
+do_checkuri[network] = "1"
 python do_checkuri() {
     src_uri = (d.getVar('SRC_URI') or "").split()
     if len(src_uri) == 0:
index ce72a944e74f31ec3f911144ff458efa27e16353..b774095b971cd93b48601032a490a700e64857b9 100644 (file)
@@ -109,6 +109,8 @@ fakeroot do_populate_poky_src () {
 }
 
 IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
+# For pip usage above
+do_image[network] = "1"
 
 addtask rootfs after do_unpack