Trying to set up autobuilder on a clean install of openSUSE 42.2 server profile fails: $ source yocto-autobuilder-setup hostname: invalid option -- 'I' That's because on openSUSE, hostname command is provided by 'net-tools' package (version 1.60 in current case) and supports -i option to read IP addresses of host. There is hostname package 3.16 available for openSUSE 42.2 but in base server profile install it is not installed. On Fedora-25 (and probably many others), hostname cmd is installed from 'hostname' package and supports option -I to get IP address.
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