diff --git a/man/kernel-install.xml b/man/kernel-install.xml index 273270f550..3de95f7088 100644 --- a/man/kernel-install.xml +++ b/man/kernel-install.xml @@ -211,7 +211,9 @@ /etc/machine-id - The content of the file specifies the machine identification MACHINE-ID. + The content of this file specifies the machine identification + MACHINE-ID. If it cannot read /etc/machine-id, + kernel-install will use "Linux" as the machine ID instead. diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install index e2590c434c..ca21be7e61 100755 --- a/src/kernel-install/kernel-install +++ b/src/kernel-install/kernel-install @@ -87,6 +87,8 @@ KERNEL_IMAGE="$2" if [[ -f /etc/machine-id ]]; then read MACHINE_ID < /etc/machine-id +else + MACHINE_ID="Linux" fi if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then @@ -94,10 +96,7 @@ if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then exit 1 fi -if ! [[ $MACHINE_ID ]]; then - ENTRY_DIR_ABS=$(mktemp -d /tmp/kernel-install.XXXXX) || exit 1 - trap "rm -rf '$ENTRY_DIR_ABS'" EXIT INT QUIT PIPE -elif [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then +if [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then ENTRY_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION" elif [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then ENTRY_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION" @@ -146,14 +145,6 @@ case $COMMAND in ((ret+=$x)) fi done - - if ! [[ $MACHINE_ID ]] && ! rmdir "$ENTRY_DIR_ABS"; then - echo "Warning: In kernel-install plugins, requiring ENTRY_DIR_ABS to be preset is deprecated." >&2 - echo " All plugins should not put anything in ENTRY_DIR_ABS if the environment" >&2 - echo " variable KERNEL_INSTALL_MACHINE_ID is empty." >&2 - rm -rf "$ENTRY_DIR_ABS" - ((ret+=$?)) - fi ;; remove)