diff options
Diffstat (limited to 'main/installkernel')
-rw-r--r-- | main/installkernel/installkernel | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/main/installkernel/installkernel b/main/installkernel/installkernel new file mode 100644 index 0000000000..2c9fc416a9 --- /dev/null +++ b/main/installkernel/installkernel @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e + +if [ $# -eq 3 ] || [ $# -eq 4 ]; then + kernelversion="$1" + bootimage="$2" + mapfile="$3" + destdir="${4:-/boot}" +else + echo "Usage: installkernel <version> <image> <System.map> <directory>" + exit 1 +fi + + +mapdir=$(dirname "$mapfile") +config="$mapdir"/.config + + +suffix= +flavor=${kernelversion##*[0-9]-} +if [ "$flavor" != "$kernelversion" ]; then + suffix=-$flavor +fi + +for i in vmlinuz${suffix} System.map${suffix} config${suffix}; do + if [ -e "$destdir"/$i ]; then + cp "$destdir"/$i "$destdir"/$i.old + fi +done + +cp "$bootimage" "$destdir"/vmlinuz${suffix} +cp "$mapfile" "$destdir"/System.map${suffix} +cp "$config" "$destdir"/config${suffix} + +exit 0 |