#!/bin/sh # # arch/arm/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. # # Copyright (C) 1995 by Linus Torvalds # # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin # Adapted from code in arch/i386/boot/install.sh by Russell King # # "make install" script for arm architecture # # Arguments: # $1 - kernel version # $2 - kernel image file # $3 - kernel map file # $4 - default install path (blank if root directory) # proc verify { if test ! -f $1 { echo "" !1 > !2 echo " *** Missing file: $1" !1 > !2 echo ' *** You need to run "make" before "make install".' !1 > !2 echo "" !1 > !2 exit 1 } } # Make sure the files actually exist verify $2 verify $3 # User may have a custom install script if test -x ~/bin/$(INSTALLKERNEL) { exec ~/bin/$(INSTALLKERNEL) @Argv; } if test -x /sbin/$(INSTALLKERNEL) { exec /sbin/$(INSTALLKERNEL) @Argv; } if test $[basename $2] = "zImage" { # Compressed install echo "Installing compressed kernel" global base := 'vmlinuz' } else { # Normal install echo "Installing normal kernel" global base := 'vmlinux' } if test -f $4/$base-$1 { mv $4/$base-$1 $4/$base-$1.old } cat $2 > $4/$base-$1 # Install system map file if test -f $4/System.map-$1 { mv $4/System.map-$1 $4/System.map-$1.old } cp $3 $4/System.map-$1 if test -x /sbin/loadmap { /sbin/loadmap } else { echo "You have to install it yourself" } (CommandList children: [ (FuncDef name: verify body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ )}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[95])] ) (SimpleCommand words: [{(echo)} {(DQ (" *** Missing file: ") ($ VSub_Number "$1"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[106])] ) (SimpleCommand words: [{(echo)} {(SQ <" *** You need to run \"make\" before \"make install\".">)}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[116])] ) (SimpleCommand words: [{(echo)} {(DQ )}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[125])] ) (C {(exit)} {(1)}) ] spids: [-1 87] ) ] spids: [-1 134] ) ] spids: [69] ) spids: [64 68] ) (C {(verify)} {(DQ ($ VSub_Number "$2"))}) (C {(verify)} {(DQ ($ VSub_Number "$3"))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-x)} {(TildeSubPart prefix:"") (/bin/) (${ VSub_Name INSTALLKERNEL)} {(Lit_Other "]")} ) terminator: ) ] action: [ (Sentence child: (C {(exec)} {(TildeSubPart prefix:"") (/bin/) (${ VSub_Name INSTALLKERNEL)} {(DQ ($ VSub_At "$@"))} ) terminator: ) ] spids: [-1 173] ) ] spids: [-1 188] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-x)} {(/sbin/) (${ VSub_Name INSTALLKERNEL)} {(Lit_Other "]")}) terminator: ) ] action: [ (Sentence child: (C {(exec)} {(/sbin/) (${ VSub_Name INSTALLKERNEL)} {(DQ ($ VSub_At "$@"))}) terminator: ) ] spids: [-1 204] ) ] spids: [-1 218] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number "$2")})] ) left_token: spids: [226 230] ) ) } {(Lit_Other "=")} {(DQ (zImage))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("Installing compressed kernel"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:base) op:Equal rhs:{(vmlinuz)} spids:[255])] spids: [255] ) ] spids: [-1 242] ) ] else_action: [ (C {(echo)} {(DQ ("Installing normal kernel"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:base) op:Equal rhs:{(vmlinux)} spids:[271])] spids: [271] ) ] spids: [258 274] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {($ VSub_Number "$4") (/) ($ VSub_Name "$base") (-) ($ VSub_Number "$1")} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {($ VSub_Number "$4") (/) ($ VSub_Name "$base") (-) ($ VSub_Number "$1")} {($ VSub_Number "$4") (/) ($ VSub_Name "$base") (-) ($ VSub_Number "$1") (.old)} ) ] spids: [-1 292] ) ] spids: [-1 310] ) (SimpleCommand words: [{(cat)} {($ VSub_Number "$2")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Number "$4") (/) ($ VSub_Name "$base") (-) ($ VSub_Number "$1")} spids: [316] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {($ VSub_Number "$4") (/System.map-) ($ VSub_Number "$1")} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {($ VSub_Number "$4") (/System.map-) ($ VSub_Number "$1")} {($ VSub_Number "$4") (/System.map-) ($ VSub_Number "$1") (.old)} ) ] spids: [-1 341] ) ] spids: [-1 355] ) (C {(cp)} {($ VSub_Number "$3")} {($ VSub_Number "$4") (/System.map-) ($ VSub_Number "$1")}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-x)} {(/sbin/loadmap)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(/sbin/loadmap)})] spids: [-1 377] ) ] else_action: [(C {(echo)} {(DQ ("You have to install it yourself"))})] spids: [382 391] ) ] )