[OE-core] [PATCH 1/1] netbase: add entry to /etc/hosts according to /etc/hostname

Burton, Ross ross.burton at intel.com
Fri Dec 14 21:45:09 UTC 2018


On Fri, 30 Nov 2018 at 02:18, Chen Qi <Qi.Chen at windriver.com> wrote:
> We default hostname to ${MACHINE}, but it's not in /etc/hosts,
> resulting in commands like `hostname -f' failing due to lack
> of entry.
>
> So add entry to /etc/hosts according to /etc/hostname. We do
> this via pkg_postinst because hostname is set in base-files
> recipe.

RP and myself are still arguing over this so I thought I'd make my
argument on the list for debate.

Updating /etc/hosts is being done with a postinst in netbase simply
because /etc/hostname is contained in the base-files recipe. I
advocate just moving the creation of /etc/hosts to base-files along
with /etc/hostname, then base-files can write both files at the same
time.  There's already a dependency on base-files from netbase so
there will be no change in the rootfs, a file will just move between
packages.

Ross


More information about the Openembedded-core mailing list