Skip to content

Commit 32b5681

Browse files
committed
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 <[email protected]>
1 parent 112eefd commit 32b5681

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

meta-google/recipes-google/google-misc/google-misc.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LICENSE = "Apache-2.0"
66
LIC_FILES_CHKSUM = "file://../../LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
77

88
SRC_URI += "git://github.com/openbmc/google-misc;branch=master;protocol=https"
9-
SRCREV = "177e7270dc45490ed9410c6f66363e4163278495"
9+
SRCREV = "1e76060a37b960851faa2ea469ce2472f9741bfe"
1010

1111
S = "${WORKDIR}/git/subprojects/${GOOGLE_MISC_PROJ}"
1212
inherit meson pkgconfig

meta-google/recipes-google/networking/dhcp-done_git.bb

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ GOOGLE_MISC_PROJ = "dhcp-done"
44

55
require ../google-misc/google-misc.inc
66

7+
EXTRA_OEMESON = " \
8+
-Dtests=disabled \
9+
"
710
inherit systemd
811

9-
SYSTEMD_SERVICE:${PN} += "dhcp-done@.service"
12+
SYSTEMD_SERVICE:${PN} += "dhcp-done.service"
1013

1114
DEPENDS += " \
1215
sdeventplus \

meta-google/recipes-google/networking/gbmc-bridge/50-gbmc-psu-hardreset.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gbmc_psu_hardreset_hook() {
2525
fi
2626

2727
echo "Powercycling" >&2
28-
systemctl start gbmc-psu-hardreset.target || return
28+
update-dhcp-status 'POWERCYCLE' "netboot powercycle"
2929

3030
# Ensure that we don't continue the DHCP process while waiting for the
3131
# powercycle.

meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.service

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[Unit]
22
Description=gBMC DHCP Client
3-
After=network.target
3+
After=network.target dhcp-done.service
4+
Wants=dhcp-done.service
45
StartLimitIntervalSec=10
56
StartLimitBurst=3
67

78
[Service]
89
Restart=on-failure
910
RestartSec=5
10-
ExecCondition=/bin/bash -c "! /bin/systemctl is-active -q dhcp-done@*"
11+
ExecStartPre=/usr/bin/update-dhcp-status 'ONGOING' 'Starting dhcp process'
1112
ExecStart=/usr/bin/udhcpc6 -f -q -O fqdn -O bootfile_url -O bootfile_param -i gbmcbr -s /usr/libexec/gbmc-br-dhcp.sh
1213

1314
[Install]

meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,26 @@ if [ "$1" = bound ]; then
4242
# shellcheck disable=SC2154
4343
echo "DHCPv6(gbmcbr): $ipv6/128" >&2
4444

45+
update-dhcp-status 'ONGOING' "Received dhcp response ${ipv6}"
4546
pfx_bytes=()
4647
ip_to_bytes pfx_bytes "$ipv6"
4748
# Ensure we are a BMC and have a suffix nibble, the 0th index is reserved
4849
if (( pfx_bytes[8] != 0xfd || (pfx_bytes[9] & 0xf) == 0 )); then
49-
echo "Invalid address" >&2
50+
echo "Invalid address prefix ${ipv6}" >&2
51+
update-dhcp-status 'ONGOING' "Invalid address prefix ${ipv6}"
5052
exit 1
5153
fi
5254
# Ensure we don't have more than a /80 address
5355
for (( i = 10; i < 16; ++i )); do
5456
if (( pfx_bytes[i] != 0 )); then
55-
echo "Invalid address" >&2
57+
echo "Invalid address ${ipv6}" >&2
58+
update-dhcp-status 'ONGOING' "Invalid address ${ipv6}"
5659
exit 1
5760
fi
5861
done
5962

63+
update-dhcp-status 'ONGOING' "Setting hostname ${fqdn} and ip ${ipv6}"
64+
6065
pfx="$(ip_bytes_to_str pfx_bytes)"
6166
gbmc_br_set_ip "$pfx" || exit
6267

@@ -70,11 +75,13 @@ if [ "$1" = bound ]; then
7075
# If any of our hooks had expectations we should fail here
7176
if [ "${#GBMC_BR_DHCP_OUTSTANDING[@]}" -gt 0 ]; then
7277
echo "Not done with DHCP process: ${!GBMC_BR_DHCP_OUTSTANDING[*]}" >&2
78+
update-dhcp-status 'ONGOING' "Outstanding DHCP hooks ${!GBMC_BR_DHCP_OUTSTANDING[*]}"
7379
exit 1
7480
fi
7581

7682
# Ensure that the installer knows we have completed processing DHCP by
7783
# running a service that reports completion
78-
echo 'Start DHCP Done' >&2
79-
systemctl start dhcp-done@DONE --no-block
84+
echo 'Signaling dhcp done' >&2
85+
update-dhcp-status 'DONE' "Netboot finished"
86+
8087
fi

meta-google/recipes-google/networking/gbmc-bridge/gbmc-start-dhcp.sh

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
systemctl stop gbmc-br-dhcp
1717

18-
# in some cases dhcp-done might be run already, in this case we want
19-
# a powercycle for a clean install
20-
systemctl is-active -q dhcp-done@* && exit 1
21-
2218
# stop dhcp term service to prevent race condition
2319
systemctl is-active --quiet gbmc-br-dhcp-term && systemctl stop gbmc-br-dhcp-term
2420

meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ gbmc_upgrade_dl_unpack() {
5555
stime=5
5656
while true; do
5757
local st=()
58+
update-dhcp-status 'ONGOING' "downloading and unpacking from ${bootfile_url}, remaining time $(( timeout - SECONDS ))"
5859
curl -LSsk --max-time $((timeout - SECONDS)) "$bootfile_url" |
5960
tar "${tflags[@]}" --wildcards --warning=none -xC "$tmpdir" "${GBMC_UPGRADE_UNPACK_FILES[@]}" 2>"$tmpdir"/tarerr \
6061
&& st=("${PIPESTATUS[@]}") || st=("${PIPESTATUS[@]}")

0 commit comments

Comments
 (0)