Преглед изворни кода

isar-bootstrap: Clean up and fix rebuild

There is no reason for using a lock anymore. All bootstraps for the same
distro/arch are detected by bitbake as identical targets in multiconfig
scenarios and are not run multiple times. The assumed original reason
for the lock, the bogus sharing of isar-bootstrap-host between Debian
and Raspbian, is fixed now.

In addition, remove the equally bogus re-execution test in
do_apt_config_prepare. This also fixes rebuilds of the isar-bootstrap
target in case some parameter has changed.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Jan Kiszka пре 5 година
родитељ
комит
1cae951259

+ 14 - 16
meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb

@@ -8,7 +8,6 @@
 Description = "Minimal host Debian root file system"
 
 DEPLOY_ISAR_BOOTSTRAP = "${DEPLOY_DIR_BOOTSTRAP}/${HOST_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}"
-ISAR_BOOTSTRAP_LOCK = "${DEPLOY_DIR_BOOTSTRAP}/${HOST_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}.lock"
 
 require isar-bootstrap.inc
 
@@ -25,21 +24,20 @@ do_apt_config_prepare[vardeps] += "\
                                    DEPLOY_ISAR_BOOTSTRAP \
                                   "
 python do_apt_config_prepare() {
-    if not os.path.islink(d.getVar("DEPLOY_ISAR_BOOTSTRAP", True)):
-        apt_preferences_out = d.getVar("APTPREFS", True)
-        apt_preferences_list = (
-            d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or ""
-        ).split()
-        aggregate_files(d, apt_preferences_list, apt_preferences_out)
-
-        apt_sources_out = d.getVar("APTSRCS", True)
-        apt_sources_init_out = d.getVar("APTSRCS_INIT", True)
-        apt_sources_list = (
-            d.getVar("HOST_DISTRO_APT_SOURCES", True) or ""
-        ).split()
-
-        aggregate_files(d, apt_sources_list, apt_sources_init_out)
-        aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
+    apt_preferences_out = d.getVar("APTPREFS", True)
+    apt_preferences_list = (
+        d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or ""
+    ).split()
+    aggregate_files(d, apt_preferences_list, apt_preferences_out)
+
+    apt_sources_out = d.getVar("APTSRCS", True)
+    apt_sources_init_out = d.getVar("APTSRCS_INIT", True)
+    apt_sources_list = (
+        d.getVar("HOST_DISTRO_APT_SOURCES", True) or ""
+    ).split()
+
+    aggregate_files(d, apt_sources_list, apt_sources_init_out)
+    aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
 }
 addtask apt_config_prepare before do_bootstrap after do_unpack
 

+ 12 - 15
meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb

@@ -8,7 +8,6 @@
 Description = "Minimal target Debian root file system"
 
 DEPLOY_ISAR_BOOTSTRAP = "${DEPLOY_DIR_BOOTSTRAP}/${DISTRO}-${DISTRO_ARCH}"
-ISAR_BOOTSTRAP_LOCK = "${DEPLOY_DIR_BOOTSTRAP}/${DISTRO}-${DISTRO_ARCH}.lock"
 
 require isar-bootstrap.inc
 
@@ -22,19 +21,18 @@ do_apt_config_prepare[vardeps] += "\
                                    DEPLOY_ISAR_BOOTSTRAP \
                                   "
 python do_apt_config_prepare() {
-    if not os.path.islink(d.getVar("DEPLOY_ISAR_BOOTSTRAP", True)):
-        apt_preferences_out = d.getVar("APTPREFS", True)
-        apt_preferences_list = (
-            d.getVar("DISTRO_APT_PREFERENCES", True) or ""
-        ).split()
-        aggregate_files(d, apt_preferences_list, apt_preferences_out)
-
-        apt_sources_out = d.getVar("APTSRCS", True)
-        apt_sources_init_out = d.getVar("APTSRCS_INIT", True)
-        apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or "").split()
-
-        aggregate_files(d, apt_sources_list, apt_sources_init_out)
-        aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
+    apt_preferences_out = d.getVar("APTPREFS", True)
+    apt_preferences_list = (
+        d.getVar("DISTRO_APT_PREFERENCES", True) or ""
+    ).split()
+    aggregate_files(d, apt_preferences_list, apt_preferences_out)
+
+    apt_sources_out = d.getVar("APTSRCS", True)
+    apt_sources_init_out = d.getVar("APTSRCS_INIT", True)
+    apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or "").split()
+
+    aggregate_files(d, apt_sources_list, apt_sources_init_out)
+    aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
 }
 addtask apt_config_prepare before do_bootstrap after do_unpack
 
@@ -45,4 +43,3 @@ do_bootstrap() {
     isar_bootstrap
 }
 addtask bootstrap before do_build after do_generate_keyrings
-

+ 0 - 5
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc

@@ -211,14 +211,11 @@ do_generate_keyrings() {
 }
 addtask generate_keyrings before do_build after do_unpack
 
-
-
 def get_host_release():
     import platform
     rel = platform.release()
     return rel
 
-
 do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS"
 do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
 
@@ -245,7 +242,6 @@ isar_bootstrap() {
     E="${@bb.utils.export_proxies(d)}"
     export IS_HOST debootstrap_args E
     sudo -E -s <<'EOSUDO'
-        ( flock 9
         set -e
         if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
             rm -rf "${ROOTFSDIR}"
@@ -339,7 +335,6 @@ isar_bootstrap() {
             # Finalize debootstrap by setting the link in deploy
             ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
         fi
-        ) 9>'${ISAR_BOOTSTRAP_LOCK}'
 EOSUDO
 }