mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-11 00:31:39 +00:00
h3consumption: fix for disabling and re-enabling Ethernet on Fast Ethernet boards
This commit is contained in:
parent
b5ef414332
commit
0bc9faecac
1 changed files with 9 additions and 2 deletions
|
@ -213,10 +213,17 @@ ChangeSettings() {
|
|||
echo 'ethtool -s eth0 speed 100 duplex full' >>"${RCLocalContents}"
|
||||
;;
|
||||
on)
|
||||
sed -i -e 's/^gmac_used\ =\ 0/gmac_used = 1/g' "${FexSettings}"
|
||||
BOARD=$(awk -F"=" '/^BOARD=/ {print $2}' </etc/armbian-release)
|
||||
if [ "X${BOARD}" = "X" ]; then
|
||||
echo "Armbian installation too old, please apt-get upgrade before. Exiting." >&2
|
||||
exit 1
|
||||
else
|
||||
OrigSettings=$(bin2fex /boot/bin/${BOARD}.bin 2>/dev/null | awk -F" " '/^gmac_used/ {print $3}')
|
||||
sed -i -e "s/^gmac_used\ =\ 0/gmac_used = ${OrigSettings}/g" "${FexSettings}"
|
||||
fi
|
||||
;;
|
||||
off)
|
||||
sed -i -e 's/^gmac_used\ =\ 1/gmac_used = 0/g' "${FexSettings}"
|
||||
sed -i -e 's/^gmac_used\ =\ \(.*\)/gmac_used = 0/g' "${FexSettings}"
|
||||
;;
|
||||
*)
|
||||
echo "Parameter error: -e requires either on, fast or off. Exiting" >&2
|
||||
|
|
Loading…
Add table
Reference in a new issue