summaryrefslogtreecommitdiff
path: root/scripts/install.sh
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2022-10-21 16:00:35 -0700
committerNick Terrell <terrelln@fb.com>2022-10-21 16:00:35 -0700
commit14e77332e74603efab8347c89d3cda447c3b97c9 (patch)
treeb7b8a48f4f75590266a763c52e072dda32b228ae /scripts/install.sh
parent88a309465b3f05a100c3b81966982c0f9f5d23a6 (diff)
parent1d61754caa8c69f566504e63c8b3f3a2df0954c8 (diff)
Merge branch 'main' into zstd-next
Diffstat (limited to 'scripts/install.sh')
-rwxr-xr-xscripts/install.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000000000..9bb0fb44f04a7
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 1995 by Linus Torvalds
+#
+# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
+# Common code factored out by Masahiro Yamada
+
+set -e
+
+# Make sure the files actually exist
+for file in "${KBUILD_IMAGE}" System.map
+do
+ if [ ! -f "${file}" ]; then
+ echo >&2
+ echo >&2 " *** Missing file: ${file}"
+ echo >&2 ' *** You need to run "make" before "make install".'
+ echo >&2
+ exit 1
+ fi
+done
+
+# User/arch may have a custom install script
+for file in "${HOME}/bin/${INSTALLKERNEL}" \
+ "/sbin/${INSTALLKERNEL}" \
+ "${srctree}/arch/${SRCARCH}/install.sh" \
+ "${srctree}/arch/${SRCARCH}/boot/install.sh"
+do
+ if [ ! -x "${file}" ]; then
+ continue
+ fi
+
+ # installkernel(8) says the parameters are like follows:
+ #
+ # installkernel version zImage System.map [directory]
+ exec "${file}" "${KERNELRELEASE}" "${KBUILD_IMAGE}" System.map "${INSTALL_PATH}"
+done
+
+echo "No install script found" >&2
+exit 1