| Summary: | yocto-autobuilder-setup fails on openSUSE clean install | ||
|---|---|---|---|
| Product: | [Infrastructure] AutoBuilder | Reporter: | Olev Kartau <olev.kartau> |
| Component: | autobuilder | Assignee: | Joshua Lock <joshuagloe> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | infras.ab.watcher, Infras.watcher, pidge |
| Version: | unspecified | ||
| Target Milestone: | 2.3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
Olev Kartau
2017-02-15 09:34:33 UTC
Should be trivial to detect whether the call to `hostname -I` fails and try `hostname -i` Something like:
if ! HOST_ADDR=$(hostname -I); then
HOST_ADDR=$(hostname -i)
fi
tried this piece, it gets correct value to HOST_ADDR.
Cosmetic issue still remains: invalid option error,
followed by full usage help,
gets printed out on console in the middle of progress trace.
hostname: invalid option -- 'I'
Usage: hostname [-v] {hostname|-F file} set hostname (from file)
domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
hostname [-v] display hostname
hostname -V|--version|-h|--help print info and exit
dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y
-s, --short short host name
-a, --alias alias names
-i, --ip-address addresses for the hostname
-f, --fqdn, --long long host name (FQDN)
-d, --domain DNS domain name
-y, --yp, --nis NIS/YP domainname
-F, --file read hostname or NIS domainname from given file
This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
Of course. I think we're safe if we redirect stderr to /dev/null, i.e.
if ! HOST_ADDR=$(hostname -I 2> /dev/null); then
HOST_ADDR=$(hostname -i)
fi
Landed the proposed change: http://git.yoctoproject.org/clean/cgit.cgi/yocto-autobuilder/commit/?id=6c2dc31749d9dfea660618ef07b1fa06f1a3f7ec |