google-misc: srcrev bump 177e7270dc..1e76060a37

Yuxiao Zhang (1):
      meta-google: dhcp-done: Adding status report

Do the srcbump and add other status report changes (otherwise the build will be broken).

Tested: try bmc upgrade with old/new bmc versions, all passed and status
is correctly reported.

Change-Id: Iafdb611ef80f1e4790f1512a7b8b48b8b9baa535
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
diff --git a/meta-google/recipes-google/google-misc/google-misc.inc b/meta-google/recipes-google/google-misc/google-misc.inc
index a630a60..3b09e2e 100644
--- a/meta-google/recipes-google/google-misc/google-misc.inc
+++ b/meta-google/recipes-google/google-misc/google-misc.inc
@@ -6,7 +6,7 @@
 LIC_FILES_CHKSUM = "file://../../LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
 
 SRC_URI += "git://github.com/openbmc/google-misc;branch=master;protocol=https"
-SRCREV = "177e7270dc45490ed9410c6f66363e4163278495"
+SRCREV = "1e76060a37b960851faa2ea469ce2472f9741bfe"
 
 S = "${WORKDIR}/git/subprojects/${GOOGLE_MISC_PROJ}"
 inherit meson pkgconfig
diff --git a/meta-google/recipes-google/networking/dhcp-done_git.bb b/meta-google/recipes-google/networking/dhcp-done_git.bb
index 12e3903..2cc9b95 100644
--- a/meta-google/recipes-google/networking/dhcp-done_git.bb
+++ b/meta-google/recipes-google/networking/dhcp-done_git.bb
@@ -4,9 +4,12 @@
 
 require ../google-misc/google-misc.inc
 
+EXTRA_OEMESON = " \
+        -Dtests=disabled \
+        "
 inherit systemd
 
-SYSTEMD_SERVICE:${PN} += "dhcp-done@.service"
+SYSTEMD_SERVICE:${PN} += "dhcp-done.service"
 
 DEPENDS += " \
   sdeventplus \
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh
index c0974a0..ace4ac5 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh
@@ -25,7 +25,7 @@
   fi
 
   echo "Powercycling" >&2
-  systemctl start gbmc-psu-hardreset.target || return
+  update-dhcp-status 'POWERCYCLE' "netboot powercycle"
 
   # Ensure that we don't continue the DHCP process while waiting for the
   # powercycle.
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.service b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.service
index 60ea0fb..c361181 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.service
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.service
@@ -1,13 +1,14 @@
 [Unit]
 Description=gBMC DHCP Client
-After=network.target
+After=network.target dhcp-done.service
+Wants=dhcp-done.service
 StartLimitIntervalSec=10
 StartLimitBurst=3
 
 [Service]
 Restart=on-failure
 RestartSec=5
-ExecCondition=/bin/bash -c "! /bin/systemctl is-active -q dhcp-done@*"
+ExecStartPre=/usr/bin/update-dhcp-status 'ONGOING' 'Starting dhcp process'
 ExecStart=/usr/bin/udhcpc6 -f -q -O fqdn -O bootfile_url -O bootfile_param -i gbmcbr -s /usr/libexec/gbmc-br-dhcp.sh
 
 [Install]
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
index 4360e11..c31090b 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
@@ -42,21 +42,26 @@
   # shellcheck disable=SC2154
   echo "DHCPv6(gbmcbr): $ipv6/128" >&2
 
+  update-dhcp-status 'ONGOING' "Received dhcp response ${ipv6}"
   pfx_bytes=()
   ip_to_bytes pfx_bytes "$ipv6"
   # Ensure we are a BMC and have a suffix nibble, the 0th index is reserved
   if (( pfx_bytes[8] != 0xfd || (pfx_bytes[9] & 0xf) == 0 )); then
-    echo "Invalid address" >&2
+    echo "Invalid address prefix ${ipv6}" >&2
+    update-dhcp-status 'ONGOING' "Invalid address prefix ${ipv6}"
     exit 1
   fi
   # Ensure we don't have more than a /80 address
   for (( i = 10; i < 16; ++i )); do
     if (( pfx_bytes[i] != 0 )); then
-      echo "Invalid address" >&2
+      echo "Invalid address ${ipv6}" >&2
+      update-dhcp-status 'ONGOING' "Invalid address ${ipv6}"
       exit 1
     fi
   done
 
+  update-dhcp-status 'ONGOING' "Setting hostname ${fqdn} and ip ${ipv6}"
+
   pfx="$(ip_bytes_to_str pfx_bytes)"
   gbmc_br_set_ip "$pfx" || exit
 
@@ -70,11 +75,13 @@
   # If any of our hooks had expectations we should fail here
   if [ "${#GBMC_BR_DHCP_OUTSTANDING[@]}" -gt 0 ]; then
     echo "Not done with DHCP process: ${!GBMC_BR_DHCP_OUTSTANDING[*]}" >&2
+    update-dhcp-status 'ONGOING' "Outstanding DHCP hooks ${!GBMC_BR_DHCP_OUTSTANDING[*]}"
     exit 1
   fi
 
   # Ensure that the installer knows we have completed processing DHCP by
   # running a service that reports completion
-  echo 'Start DHCP Done' >&2
-  systemctl start dhcp-done@DONE --no-block
+  echo 'Signaling dhcp done' >&2
+  update-dhcp-status 'DONE' "Netboot finished"
+
 fi
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-start-dhcp.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-start-dhcp.sh
index c6fddbb..b968573 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-start-dhcp.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-start-dhcp.sh
@@ -15,10 +15,6 @@
 
 systemctl stop gbmc-br-dhcp
 
-# in some cases dhcp-done might be run already, in this case we want
-# a powercycle for a clean install
-systemctl is-active -q dhcp-done@* && exit 1
-
 # stop dhcp term service to prevent race condition
 systemctl is-active --quiet gbmc-br-dhcp-term && systemctl stop gbmc-br-dhcp-term
 
diff --git a/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh b/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
index d671e81..a379eff 100644
--- a/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
+++ b/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
@@ -55,6 +55,7 @@
   stime=5
   while true; do
     local st=()
+    update-dhcp-status 'ONGOING' "downloading and unpacking from ${bootfile_url}, remaining time $(( timeout - SECONDS ))"
     curl -LSsk --max-time $((timeout - SECONDS)) "$bootfile_url" |
       tar "${tflags[@]}" --wildcards --warning=none -xC "$tmpdir" "${GBMC_UPGRADE_UNPACK_FILES[@]}" 2>"$tmpdir"/tarerr \
       && st=("${PIPESTATUS[@]}") || st=("${PIPESTATUS[@]}")