Skip to content

Commit

Permalink
add auto hostname renaming on first start
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyken793 committed Feb 14, 2015
1 parent 4665d0c commit ebe2880
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boot/am335x_evm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ fi
mac_address="/proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address"
if [ -f ${mac_address} ] ; then
cpsw_0_mac=$(hexdump -v -e '1/1 "%02X" ":"' ${mac_address} | sed 's/.$//')
if [ `cat /etc/hostname` = arm ] ; then
hostname=ky-controller-$(hexdump -v -e '1/1 "%02X" ' /proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address)
echo $hostname > /etc/hostname
hostname $hostname
echo -e "127.0.0.1\t$hostname" |sudo tee -a /etc/hosts
fi
fi

mac_address="/proc/device-tree/ocp/ethernet@4a100000/slave@4a100300/mac-address"
Expand Down

0 comments on commit ebe2880

Please sign in to comment.