mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-28 04:42:14 +01:00
- 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.
37 lines
662 B
Bash
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
|