Skip to content

Commit 3e2f685

Browse files
committed
fix(dracut-init.sh): correct check in is_qemu_virtualized function
Do not redirect `systemd-detect-virt` to /dev/null, otherwise, the `vm` variable is always empty. This function was working only thanks to the following /sys check. Reported-by: Raymund Will <[email protected]>
1 parent 7ed765d commit 3e2f685

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dracut-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ is_qemu_virtualized() {
11901190
# 1 if a virt environment could not be detected
11911191
# 255 if any error was encountered
11921192
if type -P systemd-detect-virt > /dev/null 2>&1; then
1193-
if ! vm=$(systemd-detect-virt --vm > /dev/null 2>&1); then
1193+
if ! vm=$(systemd-detect-virt --vm 2> /dev/null); then
11941194
return 255
11951195
fi
11961196
[[ $vm == "qemu" ]] && return 0

0 commit comments

Comments
 (0)