chiark / gitweb /
kernel-install: don't make unused parameter mandatory
[elogind.git] / src / kernel-install / kernel-install
index 6378d8c315bde5149ffe0b23b5195baf0079c649..9f3a5232181de5ef1dd0fc737d5513e3c6b313c5 100644 (file)
@@ -62,14 +62,14 @@ usage()
     } >&2
 }
 
-if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] && [[ $KERNEL_IMAGE ]] ); then
+if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] ); then
     usage
     exit 1
 fi
 
 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"
 ret=0
 
 dropindirs_sort()
@@ -101,6 +101,10 @@ readarray -t PLUGINS < <(
 
 case "$COMMAND" in
     add)
+        if [[ -z $KERNEL_IMAGE ]]; then
+            usage
+            exit 1
+        fi
         mkdir -p "$BOOT_DIR_ABS" || exit 1
 
         for f in "${PLUGINS[@]}"; do