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