mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-08-07 15:26:26 +00:00
c25cfec84c
* Add python pip to buildroot * Use DHCP for agent * Use systemd for naming network interfaces * Removed eth0 dhcp setting * Add ETH_IFACE variable * Added explanation for ETH_IFACE name * Further explain ETH_IFACE value
23 lines
873 B
Bash
23 lines
873 B
Bash
#!/bin/sh
|
|
|
|
# The variable ETH_IFACE contains the name the systemd gave to the network interface.
|
|
# The systemd configures the name based on the QEMU parameters.
|
|
# The parts of the name enp0s2 mean:
|
|
# et - ethernet card. It means this is the ethernet interface.
|
|
# p - means that the interface is connected to a PCI bus.
|
|
# 0 - the interface is connected to bus 0.
|
|
# s2 -the interface is connected to slot 2.
|
|
|
|
# The variable ETH_IFACE value must match the name configured through QEMU parameters for the network device.
|
|
# The bus number and slot number are configured through QEMU device parameters, parameters
|
|
# addr (for slot number), and bus (for bus number).
|
|
ETH_IFACE=enp0s2
|
|
|
|
ip link set dev $ETH_IFACE up
|
|
dhclient $ETH_IFACE
|
|
AGENT_GRPC_HOST=$(ip -4 addr show $ETH_IFACE | grep inet | awk '{print $2}' | cut -d/ -f1)
|
|
|
|
export AGENT_GRPC_HOST
|
|
|
|
exec /bin/cocos-agent
|