chiark / gitweb /
kernel-install: add compat with 'installkernel'
authorTom Gundersen <teg@jklm.no>
Wed, 25 Sep 2013 22:38:34 +0000 (00:38 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 1 Oct 2013 15:40:30 +0000 (17:40 +0200)
If 'kernel-install' is called as 'installkernel' it will be compatible with the
syntax used by the kernel's build system.

This means it can be called by doing 'make install' in a kernel build
directory, if the correct symlink has been installed (which we don't do by
default yet).

[Edit harald@redhat.com: removed basename and use shift]

src/kernel-install/kernel-install

index fb2ee57..9d3e75d 100644 (file)
@@ -54,9 +54,15 @@ dropindirs_sort()
 
 export LC_COLLATE=C
 
 
 export LC_COLLATE=C
 
-COMMAND="$1"
-KERNEL_VERSION="$2"
-KERNEL_IMAGE="$3"
+if [[ "${0##*/}" == 'installkernel' ]]; then
+    COMMAND='add'
+else
+    COMMAND="$1"
+    shift
+fi
+
+KERNEL_VERSION="$1"
+KERNEL_IMAGE="$2"
 
 if [[ -f /etc/machine-id ]]; then
     read MACHINE_ID < /etc/machine-id
 
 if [[ -f /etc/machine-id ]]; then
     read MACHINE_ID < /etc/machine-id