summaryrefslogtreecommitdiff
path: root/recipes-core/set-hostname
AgeCommit message (Collapse)Author
2024-04-24set-hostname: update sethostname script to handle read-only root filesystemHiago De Franco
The sethostname script has issues when the root filesystem is mounted as read-only, making not possible to create or modify the /etc/hostname file. Therefore, this change updates the sethostname script and adds the @@HOSTNAMECTL_OPT@@ that can further be replaced with the "--transient" flag for hostnamectl if the system uses a read-only root FS. This flag will change the hostname without creating the /etc/hostname file. With this change, update recipe version from 1.0 to 1.1. Related-to: ELB-5713 Signed-off-by: Hiago De Franco <hiago.franco@toradex.com> (cherry picked from commit 9d2e8422f17a52e4dd7d2170c685cad2acba5550)
2022-02-21set-hostname: work around race conditionMax Krummenacher
This service sets the hostname on boot to the machine name amended by the serial number unless /etc/hostname already exists. systemd does also set a hostname, if none is available it uses 'localhost' and creates an empty /etc/hostname. This two mechanism have a race condition so that systemd might run before set-hostname was able to create /etc/hostname. Likely only seens a recent systemd update. Fix that by changing the conditions for executing set-hostname to run when there is no or an empty /etc/hostname file. Related-to: ELB-4277 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 2f6a4e41f66496b6719e9b493207b99b9446c837)
2021-08-14layer: convert to new override syntaxMax Krummenacher
This is the result of automated script (0.9.3) conversion: +# meta-toradex-distro +vars = vars + ["preempt-rt","tdx","upstream"] +# meta-toradex-* machines +vars = vars + ["apalis-","colibri-","verdin-","tegra124"] +# meta-freescale +vars = vars + ["imx","mx6","mx7","mx8","use-mainline-bsp","use-nxp-bsp"] ../openembedded-core/scripts/contrib/convert-overrides.py . converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-03-19hostname: generate a uniqe hostname on bootLuka Pivk
This will generate a hostname based on machine name and serial number. (E.g. colibri-imx7-031111777) If serial number is not found it will say "no-serial-number" in host name. If machine is not supported hostname will include "unsupported-device" string. If /dev/device-tree does not exist it will say "recovery-mode" as it assumes its in recovery mode of Toradex Easy Installer To prevent openembedded from creating /etc/hostname file add hostname_pn-base-files = "" to configration Related-to: TEI-100, ELB-1322 Signed-off-by: Luka Pivk <luka.pivk@toradex.com>