mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-26 07:55:28 +03:00
fix(lsinitrd.sh): handle /etc/machine-id empty or uninitialized
Handle the case where the user tries to query the initrd content after explicitly resetting the /etc/machine-id file.
This commit is contained in:
parent
97fe09769d
commit
971b302d70
@ -111,8 +111,9 @@ if [[ $1 ]]; then
|
||||
else
|
||||
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
|
||||
MACHINE_ID="Default"
|
||||
elif [[ -f /etc/machine-id ]]; then
|
||||
elif [[ -s /etc/machine-id ]]; then
|
||||
read -r MACHINE_ID < /etc/machine-id
|
||||
[[ $MACHINE_ID == "uninitialized" ]] && MACHINE_ID="Default"
|
||||
else
|
||||
MACHINE_ID="Default"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user