summaryrefslogtreecommitdiffstats
path: root/main/installkernel
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-15 09:59:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-15 09:59:24 +0000
commitb468fc55e6289073b234fd1f7fa9a4707e7b7331 (patch)
tree2ddb79ae744d989980386abd8dbba6c30c13d428 /main/installkernel
parent6acfd118406df70bf53b6edffed51bcba49ca93e (diff)
downloadaports-b468fc55e6289073b234fd1f7fa9a4707e7b7331.tar.bz2
aports-b468fc55e6289073b234fd1f7fa9a4707e7b7331.tar.xz
main/installkernel: implement our own version
- Remove the version number. We don't support installing multiple versions of same pkgname anyways. - Remove and symlinks. So /boot can be on fat. Will allow us make boot usb layout of /boot more consistent with disk installs. Will make UEFI boot easier.
Diffstat (limited to 'main/installkernel')
-rw-r--r--main/installkernel/installkernel36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/installkernel/installkernel b/main/installkernel/installkernel
new file mode 100644
index 000000000..2c9fc416a
--- /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