aports/main/installkernel/installkernel
Natanael Copa b468fc55e6 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.
2014-01-15 09:59:24 +00:00

37 lines
662 B
Bash

#!/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