This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: bitbake change hostname

Part Number: AM5728


Hi, I would like the hostname to use the name of my board, rather than the generic "am57xx-evm".

I think this is done by changing the contents of /etc/hostname.

I am building the rootfs using bitbake, so my question is, what do I need to do in bitbake to change the contents of /etc/hostname?

  • Hi Bob,

    The /etc/hostname is configured by the base-files recipe  that is present under ./oe-core/meta/recipes-core/base-files/

    You will have to change the hostname in here or you can override it in the bbappend in a higher layer.

    Regards

    Karthik

  • Hi Karthik,

    You are exactly right about the hostname coming from a recipe in oe-core/meta/recipes-core/base-files.  In the recipe, it looks like by default the hostname is taken from the machine name:

    hostname = "${MACHINE}"

    I do not wish to change the hostname in the actual recipe (base-files_3.0.14.bb in this case), but would rather do it in a bbappend file.  Problem is, I can't work out how make that work.

    Best regards,

    Bob.

  • Just in case anyone else has this issue, the answer that work for me was to create a bbappend file in my custom layer, along these lines:

    file: base-files_%.bbappend

    # look for files in this layer first
    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

    hostname = "custom-hostname"