PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/m32r/boot/compressed/install.sh

https://bitbucket.org/evzijst/gittest
Shell | 57 lines | 24 code | 7 blank | 26 comment | 6 complexity | 2ac891cdfab0f12fd0078c917985a4d6 MD5 | raw file
 1#!/bin/sh
 2#
 3# arch/sh/boot/install.sh
 4#
 5# This file is subject to the terms and conditions of the GNU General Public
 6# License.  See the file "COPYING" in the main directory of this archive
 7# for more details.
 8#
 9# Copyright (C) 1995 by Linus Torvalds
10#
11# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
12# Adapted from code in arch/i386/boot/install.sh by Russell King
13# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
14# Adapted from code in arch/sh/boot/install.sh by Takeo Takahashi
15#
16# "make install" script for sh architecture
17#
18# Arguments:
19#   $1 - kernel version
20#   $2 - kernel image file
21#   $3 - kernel map file
22#   $4 - default install path (blank if root directory)
23#
24
25# User may have a custom install script
26
27if [ -x /sbin/installkernel ]; then
28  exec /sbin/installkernel "$@"
29fi
30
31if [ "$2" = "zImage" ]; then
32# Compressed install
33  echo "Installing compressed kernel"
34  if [ -f $4/vmlinuz-$1 ]; then
35    mv $4/vmlinuz-$1 $4/vmlinuz.old
36  fi
37
38  if [ -f $4/System.map-$1 ]; then
39    mv $4/System.map-$1 $4/System.old
40  fi
41
42  cat $2 > $4/vmlinuz-$1
43  cp $3 $4/System.map-$1
44else
45# Normal install
46  echo "Installing normal kernel"
47  if [ -f $4/vmlinux-$1 ]; then
48    mv $4/vmlinux-$1 $4/vmlinux.old
49  fi
50
51  if [ -f $4/System.map ]; then
52    mv $4/System.map $4/System.old
53  fi
54
55  cat $2 > $4/vmlinux-$1
56  cp $3 $4/System.map
57fi