2021-08-20 06:09 AM
I have set :
hostname_pn-base-files = "new_host_name"
in my conf file.
This seems changing /etc/hostname in base-files image. However, there is log message telling:
"[ 7.249795] systemd[1]: Set hostname to <stm32mp1-disco>."
Also, /etc/hosname contents is "stm32mp1-disco".
I can't find what other recipe/module is dealing with hostname settings.
Solved! Go to Solution.
2021-08-31 05:31 AM
Hello @MKaas.1
I agree with your modification related to hostname_pn-base-files = "new_host_name" in the conf file.
I guess there are some troubles with the dhcp service but I am not an expert on this topic so my piece of advice may be really poor.
We can see this line in the file /etc/dhcp/dhcp.client
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
From my understanding, the term «host-name» implies to update the board hostname from the DHCP server. If the DHCP leasing is still active from a previous connection, it may explain the change of your hostname through the DCHP service.
To check this hypothesis, perhaps you could boot your board without any ethernet or wifi connections:
Best regards,
--JM
2021-08-31 12:45 AM
Hi @MKaas.1 ,
Sorry for late reply.
I found my side : meta-st/meta-st-stm32mp/conf/machine/stm32mp1-disco.conf:#@NAME: stm32mp1-disco
Hope it help
Olivier
2021-08-31 01:14 AM
That seems a comment to me. The file I mentioned: "/etc/hostname" carries the original hostname. That should be kept unchanged until boot. In common, recipes are not allowed touching files other recipes are producing, i.e. several recipes should not produce the same file. You can possibly cope that with PREFERRED_PROVIDER - just to select packets, but not files. Also, you could write a BBAPPEND recipe to replace the original file. So, I suppose that /etc/hostname is changed by some post-install script or BBAPPEND recipe that I can't find out.
2021-08-31 05:31 AM
Hello @MKaas.1
I agree with your modification related to hostname_pn-base-files = "new_host_name" in the conf file.
I guess there are some troubles with the dhcp service but I am not an expert on this topic so my piece of advice may be really poor.
We can see this line in the file /etc/dhcp/dhcp.client
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
From my understanding, the term «host-name» implies to update the board hostname from the DHCP server. If the DHCP leasing is still active from a previous connection, it may explain the change of your hostname through the DCHP service.
To check this hypothesis, perhaps you could boot your board without any ethernet or wifi connections:
Best regards,
--JM
2021-08-31 05:50 AM
Hi @Jean-Marc B
This can be true. I checked from st-image-core....tar.gz and there /etc/hostname was that, what I had defined. So, at least build time post installation scripts had not changed it. I'll write the image to SD card and try it out without Ethernet.
2021-08-31 06:08 AM
Yes, I can verify, that /etc/hostname did not change at boot when I booted first time Ethernet disconnected.
Thank you for your help