[PATCH] treewide: switch head to SUSv3-style arguments
Rui Salvaterra
rsalvaterra at gmail.com
Thu Jul 9 04:04:56 EDT 2020
Before disabling support for SUSv2 by default on BusyBox, care must be taken to
ensure the arguments are SUSv3-compliant. Make it so.
Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
package/base-files/files/lib/preinit/02_sysinfo | 2 +-
package/base-files/files/lib/preinit/99_10_failsafe_login | 2 +-
package/utils/busybox/config/init/Config.in | 2 +-
target/linux/ar71xx/image/lzma-loader/src/Makefile | 2 +-
target/linux/ath79/image/lzma-loader/src/Makefile | 2 +-
target/linux/bcm63xx/image/lzma-loader/src/Makefile | 2 +-
...-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch | 4 ++--
target/linux/generic/image/lzma-loader/src/Makefile | 2 +-
target/linux/generic/image/relocate/Makefile | 2 +-
target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh | 2 +-
target/linux/ramips/image/lzma-loader/src/Makefile | 2 +-
11 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/package/base-files/files/lib/preinit/02_sysinfo b/package/base-files/files/lib/preinit/02_sysinfo
index 65b50968e2..45eba73eca 100644
--- a/package/base-files/files/lib/preinit/02_sysinfo
+++ b/package/base-files/files/lib/preinit/02_sysinfo
@@ -2,7 +2,7 @@ do_sysinfo_generic() {
[ -d /proc/device-tree ] || return
mkdir -p /tmp/sysinfo
[ -e /tmp/sysinfo/board_name ] || \
- echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
+ echo "$(strings /proc/device-tree/compatible | head -n 1)" > /tmp/sysinfo/board_name
[ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
}
diff --git a/package/base-files/files/lib/preinit/99_10_failsafe_login b/package/base-files/files/lib/preinit/99_10_failsafe_login
index 16ad84f4ba..f1faeac8c9 100644
--- a/package/base-files/files/lib/preinit/99_10_failsafe_login
+++ b/package/base-files/files/lib/preinit/99_10_failsafe_login
@@ -3,7 +3,7 @@
# Copyright (C) 2010 Vertical Communications
failsafe_shell() {
- local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')"
+ local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -n 1 | sed -e 's/^console=//' -e 's/,.*//')"
[ -n "$console" ] || console=console
[ -c "/dev/$console" ] || return 0
while true; do
diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in
index fc6c916a68..8d5f8694c3 100644
--- a/package/utils/busybox/config/init/Config.in
+++ b/package/utils/busybox/config/init/Config.in
@@ -31,7 +31,7 @@ config BUSYBOX_CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER
title = Boot chart for `hostname` (`date`)
system.uname = `uname -srvm`
system.release = `cat /etc/DISTRO-release`
- system.cpu = `grep '^model name' /proc/cpuinfo | head -1` ($cpucount)
+ system.cpu = `grep '^model name' /proc/cpuinfo | head -n 1` ($cpucount)
system.kernel.options = `cat /proc/cmdline`
This data is not mandatory for bootchart graph generation,
and is considered bloat. Nevertheless, this option
diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile
index 7773f027a2..a5aaccdf69 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile
@@ -45,7 +45,7 @@ LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
LDFLAGS += -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START)
LDFLAGS += -flto -fwhole-program
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
OBJECTS := head.o loader.o cache.o board.o printf.o LzmaDecode.o
diff --git a/target/linux/ath79/image/lzma-loader/src/Makefile b/target/linux/ath79/image/lzma-loader/src/Makefile
index 7773f027a2..a5aaccdf69 100644
--- a/target/linux/ath79/image/lzma-loader/src/Makefile
+++ b/target/linux/ath79/image/lzma-loader/src/Makefile
@@ -45,7 +45,7 @@ LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
LDFLAGS += -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START)
LDFLAGS += -flto -fwhole-program
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
OBJECTS := head.o loader.o cache.o board.o printf.o LzmaDecode.o
diff --git a/target/linux/bcm63xx/image/lzma-loader/src/Makefile b/target/linux/bcm63xx/image/lzma-loader/src/Makefile
index 0310051a93..2fc5e4a5b0 100644
--- a/target/linux/bcm63xx/image/lzma-loader/src/Makefile
+++ b/target/linux/bcm63xx/image/lzma-loader/src/Makefile
@@ -44,7 +44,7 @@ ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
LDFLAGS = -static --gc-sections -no-warn-mismatch
LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START)
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
OBJECTS := head.o loader.o cache.o board.o printf.o LzmaDecode.o
diff --git a/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch b/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch
index 638a2b4529..d7e02a3fc1 100644
--- a/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch
+++ b/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch
@@ -27,14 +27,14 @@ multiple filters don't scale particularly well as each filter must be
traversed whether it matches or not. e.g. a simple example to map 3
firewall marks to tins:
-MAJOR=$( tc qdisc show dev $DEV | head -1 | awk '{print $3}' )
+MAJOR=$( tc qdisc show dev $DEV | head -n 1 | awk '{print $3}' )
tc filter add dev $DEV parent $MAJOR protocol all handle 0x01 fw action skbedit priority ${MAJOR}1
tc filter add dev $DEV parent $MAJOR protocol all handle 0x02 fw action skbedit priority ${MAJOR}2
tc filter add dev $DEV parent $MAJOR protocol all handle 0x03 fw action skbedit priority ${MAJOR}3
Another option is to use eBPF cls_act with tc filters e.g.
-MAJOR=$( tc qdisc show dev $DEV | head -1 | awk '{print $3}' )
+MAJOR=$( tc qdisc show dev $DEV | head -n 1 | awk '{print $3}' )
tc filter add dev $DEV parent $MAJOR bpf da obj my-bpf-fwmark-to-class.o
This has the disadvantages of a) needing someone to write & maintain
diff --git a/target/linux/generic/image/lzma-loader/src/Makefile b/target/linux/generic/image/lzma-loader/src/Makefile
index 910172c4f8..239ef308c1 100644
--- a/target/linux/generic/image/lzma-loader/src/Makefile
+++ b/target/linux/generic/image/lzma-loader/src/Makefile
@@ -29,7 +29,7 @@ CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJDUMP = $(CROSS_COMPILE)objdump
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
# Drop some uninteresting sections in the kernel.
# This is only relevant for ELF kernels but doesn't hurt a.out
diff --git a/target/linux/generic/image/relocate/Makefile b/target/linux/generic/image/relocate/Makefile
index 62e3b32ee2..206710f51d 100644
--- a/target/linux/generic/image/relocate/Makefile
+++ b/target/linux/generic/image/relocate/Makefile
@@ -46,7 +46,7 @@ ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
LDFLAGS = -static --gc-sections -no-warn-mismatch
LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START)
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
OBJECTS := head.o
diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
index 0bb1dd12cc..417c628300 100644
--- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
+++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
@@ -19,7 +19,7 @@ udpu_check_emmc() {
udpu_part_prep() {
if [ "$(grep $1 /proc/mounts)" ]; then
- mounted_part="$(grep $1 /proc/mounts | awk '{print $2}' | head -1)"
+ mounted_part="$(grep $1 /proc/mounts | awk '{print $2}' | head -n 1)"
umount $mounted_part
[ "$(grep -wo $mounted_part /proc/mounts)" ] && umount -l $mounted_part
fi
diff --git a/target/linux/ramips/image/lzma-loader/src/Makefile b/target/linux/ramips/image/lzma-loader/src/Makefile
index d20cd77346..f1125b236b 100644
--- a/target/linux/ramips/image/lzma-loader/src/Makefile
+++ b/target/linux/ramips/image/lzma-loader/src/Makefile
@@ -51,7 +51,7 @@ LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
LDFLAGS += -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START)
LDFLAGS += -flto -fwhole-program -Wl,-z,max-page-size=4096
-O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32)
+O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
OBJECTS := head.o loader.o cache.o board-$(PLATFORM).o printf.o LzmaDecode.o
--
2.27.0
More information about the openwrt-devel
mailing list