18c2ecf20Sopenharmony_ci#!/bin/sh
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public
48c2ecf20Sopenharmony_ci# License.  See the file "COPYING" in the main directory of this archive
58c2ecf20Sopenharmony_ci# for more details.
68c2ecf20Sopenharmony_ci#
78c2ecf20Sopenharmony_ci# Copyright (C) 1995 by Linus Torvalds
88c2ecf20Sopenharmony_ci#
98c2ecf20Sopenharmony_ci# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
108c2ecf20Sopenharmony_ci#
118c2ecf20Sopenharmony_ci# "make install" script for SPARC architecture
128c2ecf20Sopenharmony_ci#
138c2ecf20Sopenharmony_ci# Arguments:
148c2ecf20Sopenharmony_ci#   $1 - kernel version
158c2ecf20Sopenharmony_ci#   $2 - kernel image file
168c2ecf20Sopenharmony_ci#   $3 - kernel map file
178c2ecf20Sopenharmony_ci#   $4 - default install path (blank if root directory)
188c2ecf20Sopenharmony_ci#
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_civerify () {
218c2ecf20Sopenharmony_ci	if [ ! -f "$1" ]; then
228c2ecf20Sopenharmony_ci		echo ""                                                   1>&2
238c2ecf20Sopenharmony_ci		echo " *** Missing file: $1"                              1>&2
248c2ecf20Sopenharmony_ci		echo ' *** You need to run "make" before "make install".' 1>&2
258c2ecf20Sopenharmony_ci		echo ""                                                   1>&2
268c2ecf20Sopenharmony_ci		exit 1
278c2ecf20Sopenharmony_ci	fi
288c2ecf20Sopenharmony_ci}
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci# Make sure the files actually exist
318c2ecf20Sopenharmony_civerify "$2"
328c2ecf20Sopenharmony_civerify "$3"
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci# User may have a custom install script
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciif [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
378c2ecf20Sopenharmony_ciif [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci# Default install - same as make zlilo
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ciif [ -f $4/vmlinuz ]; then
428c2ecf20Sopenharmony_ci	mv $4/vmlinuz $4/vmlinuz.old
438c2ecf20Sopenharmony_cifi
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciif [ -f $4/System.map ]; then
468c2ecf20Sopenharmony_ci	mv $4/System.map $4/System.old
478c2ecf20Sopenharmony_cifi
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_cicat $2 > $4/vmlinuz
508c2ecf20Sopenharmony_cicp $3 $4/System.map
51