boot-qemu: Use hostname -I to obtian container IP

The code was using `awk 'END{print $1}' /etc/hosts` to obtain the
container IP, it works OK for containers with IPv4-only address, but
does not work for containers with IPv6 address, because the last line of
`/etc/hosts` is IPv6 address in such containers. Then the script will
use `127.0.0.1` as the IP address to start the QEMU, which will not work
for QEMU CI because the host can not access the QEMU's ports.

Fix this by using `hostname -I` to obtain the IPv4 address.

Tested: Verify QEMU CI passes in containers with IPv6 address.

Change-Id: I3ce39b5633a913c303ccc8297cdf39a87f5be99a
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
1 file changed
tree: 18c76810e5c66e5c5ec46c1f7a90df6b449a734a
  1. config/
  2. jenkins/
  3. scripts/
  4. tools/
  5. .gitignore
  6. .shellcheck
  7. build-rootfs-size-docker.sh
  8. build-setup.sh
  9. LICENSE
  10. OWNERS
  11. qemu-build.sh
  12. README.md
  13. run-qemu-robot-test.sh
  14. run-rootfs-size-docker.sh
  15. run-unit-test-docker.sh
README.md

openbmc-build-scripts

Build script for CI jobs in Jenkins.

Linter policy and related build failures

Formatting linters sometimes change stylistic output across releases. Separately, some linters are not version-pinned in the CI container, as pinning would drive either frequent maintenance with upgrades or stagnation of the code-base against older versions.

The combination may result in inconsistent formatting opinions across CI worker nodes[^1].

If you see such behaviour consider changing the thing to force a container refresh.

[^1]: The collection of container builds across all worker nodes may not hold a consistent set of tool versions despite being built from the same specification: The inconsistencies emerge from the cadence of upstream tool package updates beating against the cadence of container rebuilds on the worker nodes.