summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2023-06-08 17:59:35 +0800
committerArmin Kuster <akuster808@gmail.com>2023-06-11 10:40:33 -0400
commitc50757b2f17abb5e26d069b280933451f6190829 (patch)
treeb134e82c8ce61bed754673cba879bbdc1d88ba6a
parent440e1578198f2dceff2346d4503d58da5f1c892c (diff)
downloadmeta-security-c50757b2f17abb5e26d069b280933451f6190829.tar.gz
dmverity: Suppress the realpath errors
If we use a non PARTUUID root parameter, we would always get a error like below: realpath: /dev/disk/by-partuuid//dev/mmcblk0p2: No such file or directory This seems pretty confusion and it also seems no need to emit this kind of error when we are waiting for the root device. So suppress all the realpath errors. Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-core/initrdscripts/initramfs-framework-dm/dmverity14
1 files changed, 7 insertions, 7 deletions
diff --git a/recipes-core/initrdscripts/initramfs-framework-dm/dmverity b/recipes-core/initrdscripts/initramfs-framework-dm/dmverity
index c815940..71afc91 100644
--- a/recipes-core/initrdscripts/initramfs-framework-dm/dmverity
+++ b/recipes-core/initrdscripts/initramfs-framework-dm/dmverity
@@ -14,7 +14,7 @@ dmverity_run() {
14 C=0 14 C=0
15 delay=${bootparam_rootdelay:-1} 15 delay=${bootparam_rootdelay:-1}
16 timeout=${bootparam_roottimeout:-5} 16 timeout=${bootparam_roottimeout:-5}
17 RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=})" 17 RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=} 2>/dev/null)"
18 while [ ! -b "${RDEV}" ]; do 18 while [ ! -b "${RDEV}" ]; do
19 if [ $(( $C * $delay )) -gt $timeout ]; then 19 if [ $(( $C * $delay )) -gt $timeout ]; then
20 fatal "Root device resolution failed" 20 fatal "Root device resolution failed"
@@ -23,22 +23,22 @@ dmverity_run() {
23 23
24 case "${bootparam_root}" in 24 case "${bootparam_root}" in
25 ID=*) 25 ID=*)
26 RDEV="$(realpath /dev/disk/by-id/${bootparam_root#ID=})" 26 RDEV="$(realpath /dev/disk/by-id/${bootparam_root#ID=} 2>/dev/null)"
27 ;; 27 ;;
28 LABEL=*) 28 LABEL=*)
29 RDEV="$(realpath /dev/disk/by-label/${bootparam_root#LABEL=})" 29 RDEV="$(realpath /dev/disk/by-label/${bootparam_root#LABEL=} 2>/dev/null)"
30 ;; 30 ;;
31 PARTLABEL=*) 31 PARTLABEL=*)
32 RDEV="$(realpath /dev/disk/by-partlabel/${bootparam_root#PARTLABEL=})" 32 RDEV="$(realpath /dev/disk/by-partlabel/${bootparam_root#PARTLABEL=} 2>/dev/null)"
33 ;; 33 ;;
34 PARTUUID=*) 34 PARTUUID=*)
35 RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=})" 35 RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=} 2>/dev/null)"
36 ;; 36 ;;
37 PATH=*) 37 PATH=*)
38 RDEV="$(realpath /dev/disk/by-path/${bootparam_root#PATH=})" 38 RDEV="$(realpath /dev/disk/by-path/${bootparam_root#PATH=} 2>/dev/null)"
39 ;; 39 ;;
40 UUID=*) 40 UUID=*)
41 RDEV="$(realpath /dev/disk/by-uuid/${bootparam_root#UUID=})" 41 RDEV="$(realpath /dev/disk/by-uuid/${bootparam_root#UUID=} 2>/dev/null)"
42 ;; 42 ;;
43 *) 43 *)
44 RDEV="${bootparam_root}" 44 RDEV="${bootparam_root}"