mirror of
https://git.yoctoproject.org/meta-security
synced 2026-01-11 15:00:34 +00:00
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>
This commit is contained in:
@@ -14,7 +14,7 @@ dmverity_run() {
|
||||
C=0
|
||||
delay=${bootparam_rootdelay:-1}
|
||||
timeout=${bootparam_roottimeout:-5}
|
||||
RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=})"
|
||||
RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=} 2>/dev/null)"
|
||||
while [ ! -b "${RDEV}" ]; do
|
||||
if [ $(( $C * $delay )) -gt $timeout ]; then
|
||||
fatal "Root device resolution failed"
|
||||
@@ -23,22 +23,22 @@ dmverity_run() {
|
||||
|
||||
case "${bootparam_root}" in
|
||||
ID=*)
|
||||
RDEV="$(realpath /dev/disk/by-id/${bootparam_root#ID=})"
|
||||
RDEV="$(realpath /dev/disk/by-id/${bootparam_root#ID=} 2>/dev/null)"
|
||||
;;
|
||||
LABEL=*)
|
||||
RDEV="$(realpath /dev/disk/by-label/${bootparam_root#LABEL=})"
|
||||
RDEV="$(realpath /dev/disk/by-label/${bootparam_root#LABEL=} 2>/dev/null)"
|
||||
;;
|
||||
PARTLABEL=*)
|
||||
RDEV="$(realpath /dev/disk/by-partlabel/${bootparam_root#PARTLABEL=})"
|
||||
RDEV="$(realpath /dev/disk/by-partlabel/${bootparam_root#PARTLABEL=} 2>/dev/null)"
|
||||
;;
|
||||
PARTUUID=*)
|
||||
RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=})"
|
||||
RDEV="$(realpath /dev/disk/by-partuuid/${bootparam_root#PARTUUID=} 2>/dev/null)"
|
||||
;;
|
||||
PATH=*)
|
||||
RDEV="$(realpath /dev/disk/by-path/${bootparam_root#PATH=})"
|
||||
RDEV="$(realpath /dev/disk/by-path/${bootparam_root#PATH=} 2>/dev/null)"
|
||||
;;
|
||||
UUID=*)
|
||||
RDEV="$(realpath /dev/disk/by-uuid/${bootparam_root#UUID=})"
|
||||
RDEV="$(realpath /dev/disk/by-uuid/${bootparam_root#UUID=} 2>/dev/null)"
|
||||
;;
|
||||
*)
|
||||
RDEV="${bootparam_root}"
|
||||
|
||||
Reference in New Issue
Block a user