target/linux: replace egrep with grep -E
egrep is deprecated and replaced by grep -E. The latter is used throughout the tree. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
7994461a5a
commit
8cfce165a7
@ -1,6 +1,6 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
|
||||||
|
|
||||||
RAMFS_COPY_BIN="bcm4908img expr egrep fdtget fw_printenv fw_setenv tr"
|
RAMFS_COPY_BIN="bcm4908img expr grep fdtget fw_printenv fw_setenv tr"
|
||||||
|
|
||||||
PART_NAME=firmware
|
PART_NAME=firmware
|
||||||
|
|
||||||
@ -112,19 +112,19 @@ platform_pkgtb_get_image() {
|
|||||||
|
|
||||||
local image_name=$(platform_pkgtb_get_image_name "$1" "$cmd" "$3")
|
local image_name=$(platform_pkgtb_get_image_name "$1" "$cmd" "$3")
|
||||||
|
|
||||||
$cmd < $1 | fdtget -p - /images/$image_name | egrep -q "^data$" && {
|
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data$" && {
|
||||||
$cmd < $1 | fdtget -t r - /images/$image_name data
|
$cmd < $1 | fdtget -t r - /images/$image_name data
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd < $1 | fdtget -p - /images/$image_name | egrep -q "^data-position$" && {
|
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data-position$" && {
|
||||||
local data_position=$($cmd < $1 | fdtget - /images/$image_name data-position)
|
local data_position=$($cmd < $1 | fdtget - /images/$image_name data-position)
|
||||||
local data_size=$($cmd < $1 | fdtget - /images/$image_name data-size)
|
local data_size=$($cmd < $1 | fdtget - /images/$image_name data-size)
|
||||||
$cmd < $1 2>/dev/null | dd skip=$data_position count=$data_size iflag=skip_bytes,count_bytes
|
$cmd < $1 2>/dev/null | dd skip=$data_position count=$data_size iflag=skip_bytes,count_bytes
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd < $1 | fdtget -p - /images/$image_name | egrep -q "^data-offset" && {
|
$cmd < $1 | fdtget -p - /images/$image_name | grep -Eq "^data-offset" && {
|
||||||
local data_offset=$($cmd < $1 | fdtget - /images/$image_name data-offset)
|
local data_offset=$($cmd < $1 | fdtget - /images/$image_name data-offset)
|
||||||
local totalsize=$(get_hex_u32_be "$1" 4)
|
local totalsize=$(get_hex_u32_be "$1" 4)
|
||||||
local data_position=$(((0x$totalsize + data_offset + 3) & ~3))
|
local data_position=$(((0x$totalsize + data_offset + 3) & ~3))
|
||||||
|
@ -9,7 +9,7 @@ linksys_get_target_firmware() {
|
|||||||
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
||||||
if [ -z "${cur_boot_part}" ] ; then
|
if [ -z "${cur_boot_part}" ] ; then
|
||||||
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
||||||
case $(egrep ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
||||||
kernel1|rootfs1)
|
kernel1|rootfs1)
|
||||||
cur_boot_part=1
|
cur_boot_part=1
|
||||||
;;
|
;;
|
||||||
|
@ -9,7 +9,7 @@ linksys_get_target_firmware() {
|
|||||||
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
||||||
if [ -z "${cur_boot_part}" ] ; then
|
if [ -z "${cur_boot_part}" ] ; then
|
||||||
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
||||||
case $(egrep ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
||||||
kernel|rootfs)
|
kernel|rootfs)
|
||||||
cur_boot_part=1
|
cur_boot_part=1
|
||||||
;;
|
;;
|
||||||
|
@ -9,7 +9,7 @@ linksys_get_target_firmware() {
|
|||||||
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
|
||||||
if [ -z "${cur_boot_part}" ] ; then
|
if [ -z "${cur_boot_part}" ] ; then
|
||||||
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
|
||||||
case $(egrep ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
|
||||||
kernel1|rootfs1)
|
kernel1|rootfs1)
|
||||||
cur_boot_part=1
|
cur_boot_part=1
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user