The wildcard matching the default loader entry should always be able to point to
the same machine.
So instead of sorting by <distribution>-<kernel-version>-<machine-id>
we better sort by <machine-id>-<kernel-version>.
BOOT_DIR="/${MACHINE_ID}/${KERNEL_VERSION}"
BOOT_DIR_ABS="/boot${BOOT_DIR}"
BOOT_DIR="/${MACHINE_ID}/${KERNEL_VERSION}"
BOOT_DIR_ABS="/boot${BOOT_DIR}"
-LOADER_ENTRY="/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
+LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-${KERNEL_VERSION}.conf"