Skip to contentSkip to conversation

setup-uboot-env-*: replace ifconfig with ip addr show

PATCH Applied Denys Dmytriyenko 2 participants 2 messages Dec 10, 2019 – Dec 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 setup-uboot-env-*: replace ifconfig with ip addr show

Simple ifconfig has been deprecated for quite some time in favor of ip tools. New distros no longer package ifconfig, so use ip addr show command instead.

Cc Andreas Dannenberg <[email protected]>
---
 setup-uboot-env-am18x.sh       | 2 +-
 setup-uboot-env-am335x.sh      | 2 +-
 setup-uboot-env-am3517.sh      | 2 +-
 setup-uboot-env-am37x.sh       | 2 +-
 setup-uboot-env-am43x.sh       | 2 +-
 setup-uboot-env-am57xx-evm.sh  | 2 +-
 setup-uboot-env-am65x.sh       | 2 +-
 setup-uboot-env-beagleboard.sh | 2 +-
 setup-uboot-env-k2g-evm.sh     | 2 +-
 setup-uboot-env-keystone.sh    | 2 +-
 setup-uboot-env-omap5.sh       | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)
setup-uboot-env-am18x.sh +1 -1
index 8c296e5..3733281 100644
@@ -42,7 +42,7 @@ SDKinstall=`grep TI_SDK_PATH= $cwd/../Rules.make | cut -d= -f2`
 dstdefault=$SDKinstall/targetNFS
 
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 prompt=" >"
 
setup-uboot-env-am335x.sh +1 -1
index 80b0a52..f129875 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the U-Boot variables for booting the EVM."
 echo
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-am3517.sh +1 -1
index 73e9971..49dda0a 100644
@@ -37,7 +37,7 @@ echo
 echo "--------------------------------------------------------------------------------"
 echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 prompt="EVM #"
 
setup-uboot-env-am37x.sh +1 -1
index e9970d6..eab332b 100644
@@ -37,7 +37,7 @@ echo
 echo "--------------------------------------------------------------------------------"
 echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 prompt="EVM #"
 
setup-uboot-env-am43x.sh +1 -1
index f7f2d95..24bc58a 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the u-boot variables for booting the EVM."
 echo
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-am57xx-evm.sh +1 -1
index 574c111..323c134 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the u-boot variables for booting the EVM."
 echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-am65x.sh +1 -1
index 6335ce4..e17f700 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the u-boot variables for booting the EVM."
 echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-beagleboard.sh +1 -1
index bc237ae..60ca7d6 100644
@@ -37,7 +37,7 @@ echo
 echo "--------------------------------------------------------------------------------"
 echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 prompt="OMAP3 beagleboard.org #"
 
setup-uboot-env-k2g-evm.sh +1 -1
index 4944f99..5845f2d 100755
@@ -78,7 +78,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the u-boot variables for booting the EVM."
 echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-keystone.sh +1 -1
index 37fb2c1..3a443dd 100755
@@ -154,7 +154,7 @@ echo "--------------------------------------------------------------------------
 echo "This step will set up the u-boot variables for booting the EVM."
 echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
 # Configure prompt for U-Boot 2016.05
setup-uboot-env-omap5.sh +1 -1
index 7b6f084..7fba3ef 100644
@@ -37,7 +37,7 @@ echo
 echo "--------------------------------------------------------------------------------"
 echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
 platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 prompt="$prompt"
 
Signature · 1 line
2.7.4
#1 lore raw

Pushed to master.

Thank you,

Jake

Quoted 162 lines · Denys Dmytriyenko

Simple ifconfig has been deprecated for quite some time in favor of ip tools. New distros no longer package ifconfig, so use ip addr show command instead.

Cc Andreas Dannenberg <[email protected]>
---
  setup-uboot-env-am18x.sh       | 2 +-
  setup-uboot-env-am335x.sh      | 2 +-
  setup-uboot-env-am3517.sh      | 2 +-
  setup-uboot-env-am37x.sh       | 2 +-
  setup-uboot-env-am43x.sh       | 2 +-
  setup-uboot-env-am57xx-evm.sh  | 2 +-
  setup-uboot-env-am65x.sh       | 2 +-
  setup-uboot-env-beagleboard.sh | 2 +-
  setup-uboot-env-k2g-evm.sh     | 2 +-
  setup-uboot-env-keystone.sh    | 2 +-
  setup-uboot-env-omap5.sh       | 2 +-
  11 files changed, 11 insertions(+), 11 deletions(-)
setup-uboot-env-am18x.sh +1 -1
index 8c296e5..3733281 100644
@@ -42,7 +42,7 @@ SDKinstall=`grep TI_SDK_PATH= $cwd/../Rules.make | cut -d= -f2`
  dstdefault=$SDKinstall/targetNFS
 
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
  prompt=" >"
 
setup-uboot-env-am335x.sh +1 -1
index 80b0a52..f129875 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the U-Boot variables for booting the EVM."
  echo
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-am3517.sh +1 -1
index 73e9971..49dda0a 100644
@@ -37,7 +37,7 @@ echo
  echo "--------------------------------------------------------------------------------"
  echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
  prompt="EVM #"
 
setup-uboot-env-am37x.sh +1 -1
index e9970d6..eab332b 100644
@@ -37,7 +37,7 @@ echo
  echo "--------------------------------------------------------------------------------"
  echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
  prompt="EVM #"
 
setup-uboot-env-am43x.sh +1 -1
index f7f2d95..24bc58a 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the u-boot variables for booting the EVM."
  echo
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-am57xx-evm.sh +1 -1
index 574c111..323c134 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the u-boot variables for booting the EVM."
  echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-am65x.sh +1 -1
index 6335ce4..e17f700 100644
@@ -51,7 +51,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the u-boot variables for booting the EVM."
  echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-beagleboard.sh +1 -1
index bc237ae..60ca7d6 100644
@@ -37,7 +37,7 @@ echo
  echo "--------------------------------------------------------------------------------"
  echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
  prompt="OMAP3 beagleboard.org #"
 
setup-uboot-env-k2g-evm.sh +1 -1
index 4944f99..5845f2d 100755
@@ -78,7 +78,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the u-boot variables for booting the EVM."
  echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-keystone.sh +1 -1
index 37fb2c1..3a443dd 100755
@@ -154,7 +154,7 @@ echo "--------------------------------------------------------------------------
  echo "This step will set up the u-boot variables for booting the EVM."
  echo "--------------------------------------------------------------------------------"
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
 
  # Configure prompt for U-Boot 2016.05
setup-uboot-env-omap5.sh +1 -1
index 7b6f084..7fba3ef 100644
@@ -37,7 +37,7 @@ echo
  echo "--------------------------------------------------------------------------------"
  echo "This step will set up the u-boot variables for booting the EVM."
 
-ipdefault=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'`
+ipdefault=`ip addr show | grep 'inet ' | grep -v '127.0.0.1' | cut -d/ -f1 | awk '{ print $2 }'`
  platform=`grep PLATFORM= $cwd/../Rules.make | cut -d= -f2`
  prompt="$prompt"