From b06f543c8122f9b5a9dffc8a43edf314b3025b21 Mon Sep 17 00:00:00 2001 From: Anton Gubarkov Date: Wed, 18 Aug 2021 12:56:12 +0300 Subject: [PATCH 1/3] fixed incorrect 0 retrn codes causing udev to interpret error messages instead of the device values --- cmd/vdev_id/vdev_id | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index d349ba43ca90..438656b3adab 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -140,7 +140,7 @@ Usage: vdev_id [-h] -p number of phy's per switch port [default=$PHYS_PER_PORT] -h show this summary EOF - exit 0 + exit 1 } map_slot() { @@ -728,7 +728,7 @@ done if [ ! -r "$CONFIG" ] ; then echo "Error: Config file \"$CONFIG\" not found" - exit 0 + exit 1 fi if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then From 6b6475c2664aac661755babf541bf9f3f40e8ad0 Mon Sep 17 00:00:00 2001 From: Anton Gubarkov Date: Fri, 20 Aug 2021 12:18:11 +0300 Subject: [PATCH 2/3] vdev_id: Return an error if config file is not found Signed-off-by: Anton Gubarkov --- cmd/vdev_id/vdev_id | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index 438656b3adab..cad59c93f078 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -141,6 +141,7 @@ Usage: vdev_id [-h] -h show this summary EOF exit 1 + # exit with error to avoid processing usage message by a udev rule } map_slot() { From 0e8cfee5a107a280cb7f4367c4c0df28d7cc0bbd Mon Sep 17 00:00:00 2001 From: Anton Gubarkov Date: Wed, 18 Aug 2021 12:56:12 +0300 Subject: [PATCH 3/3] vdev_id: Return an error if config file is not found Signed-off-by: Anton Gubarkov --- cmd/vdev_id/vdev_id | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index d349ba43ca90..cad59c93f078 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -140,7 +140,8 @@ Usage: vdev_id [-h] -p number of phy's per switch port [default=$PHYS_PER_PORT] -h show this summary EOF - exit 0 + exit 1 + # exit with error to avoid processing usage message by a udev rule } map_slot() { @@ -728,7 +729,7 @@ done if [ ! -r "$CONFIG" ] ; then echo "Error: Config file \"$CONFIG\" not found" - exit 0 + exit 1 fi if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then