Auto Hostname

This section shows how to enable lmp-auto-hostname. This utility customizes a device’s hostname at runtime, by appending it with either the serial number from the device tree, or the mac address.

The recipe for lmp-auto-hostname is provided by meta-lmp and can be added by customizing meta-subscriber-overrides.git.

Adding the Recipe

Clone your meta-subscriber-overrides.git repo and enter its directory:

git clone<factory>/meta-subscriber-overrides.git
cd meta-subscriber-overrides

Edit recipes-samples/images/, adding the recipe to the CORE_IMAGE_BASE_INSTALL list:

diff --git a/recipes-samples/images/ b/recipes-samples/images/
--- a/recipes-samples/images/
+++ b/recipes-samples/images/
@@ -30,6 +30,7 @@ CORE_IMAGE_BASE_INSTALL += " \
     networkmanager-nmcli \
     git \
     vim \
+    lmp-auto-hostname \
     packagegroup-core-full-cmdline-extended \
     ${@bb.utils.contains('LMP_DISABLE_GPLV3', '1', '', '${CORE_IMAGE_BASE_INSTALL_GPLV3}', d)} \

LmP Auto Hostname Variables

The lmp-auto-hostname recipe can be configured through variables.

Default: serial

Appends the serial number of the device:



Appends the MAC address of a chosen network interface.


Default: eth0

If using mac mode, provide the device network interface to retrieve a MAC address from:

eth0 or wlan0

Configuring the LmP Auto Hostname

Select the Serial or MAC tab below, according to your needs.

Serial is configured by default in the lmp-auto-hostname recipe, no need for extra changes. Add the recipes-samples/images/ file, commit, and push:

git commit -m "lmp-auto-hostname: Adding recipe" recipes-samples/images/
git push

The latest Target named platform-devel should be the CI job you just created.

If your device is already registered, when all jobs finish, wait until the Over-the-Air update completes. Otherwise download and flash the image.

Testing Auto Hostname

Log in to the device via SSH and check the new hostname (right after fio@). You can also check /etc/hostname to confirm the new hostname.

cat /etc/hostname