Commit 6eba4cbf authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: add default hostname when CONFIG_HOSTNAME_STRING is not defined

Use default hostname "wrs" when CONFIG_HOSTNAME_STATIC = y, but
CONFIG_HOSTNAME_STRING is not defined.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 1ead2f04
...@@ -59,6 +59,10 @@ if [ "$CONFIG_ETH0_STATIC" = "y" ] || [ "$CONFIG_ETH0_DHCP_ONCE" = "y" ]; then ...@@ -59,6 +59,10 @@ if [ "$CONFIG_ETH0_STATIC" = "y" ] || [ "$CONFIG_ETH0_DHCP_ONCE" = "y" ]; then
fi fi
if [ "$CONFIG_HOSTNAME_STATIC" = "y" ]; then if [ "$CONFIG_HOSTNAME_STATIC" = "y" ]; then
if [ -z "$CONFIG_HOSTNAME_STRING" ]; then
echo "empty CONFIG_HOSTNAME_STRING! use wrs"
CONFIG_HOSTNAME_STRING="wrs"
fi
/bin/hostname "$CONFIG_HOSTNAME_STRING" /bin/hostname "$CONFIG_HOSTNAME_STRING"
echo "$CONFIG_HOSTNAME_STRING" > /etc/hostname echo "$CONFIG_HOSTNAME_STRING" > /etc/hostname
elif [ "$CONFIG_HOSTNAME_DHCP" = "y" ]; then elif [ "$CONFIG_HOSTNAME_DHCP" = "y" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment