#!/bin/sh # # arch/blackfin/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 Mike Frysinger # # "make install" script for Blackfin 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 which $(INSTALLKERNEL) >/dev/null !2 > !1 { exec $(INSTALLKERNEL) @Argv } # Default install - same as make zlilo proc back_it_up { var file = $1 test -f $(file) || return 0 var stamp = $[stat -c %Y $(file) !2 >/dev/null] mv $(file) $(file).$(stamp:-old) } back_it_up $4/uImage back_it_up $4/System.map cat $2 > $4/uImage cp $3 $4/System.map (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 174] ) ] spids: [-1 189] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(which)} {(${ VSub_Name INSTALLKERNEL)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [199] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[202]) ] ) terminator: ) ] action: [(C {(exec)} {(${ VSub_Name INSTALLKERNEL)} {(DQ ($ VSub_At "$@"))})] spids: [-1 206] ) ] spids: [-1 219] ) (FuncDef name: back_it_up body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Number "$1")} spids: [235] ) ] spids: [233] ) (AndOr children: [ (C {(Lit_Other "[")} {(-f)} {(${ VSub_Name file)} {(Lit_Other "]")}) (ControlFlow token: arg_word:{(0)}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:stamp) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(stat)} {(-c)} {(Lit_Other "%") (Y)} {(${ VSub_Name file)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [271] ) ] ) ] ) left_token: spids: [259 273] ) } spids: [258] ) ] spids: [256] ) (C {(mv)} {(${ VSub_Name file)} {(${ VSub_Name file) (.) (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(old)}) spids: [286 290] ) } ) ] spids: [230] ) spids: [226 229] ) (C {(back_it_up)} {($ VSub_Number "$4") (/uImage)}) (C {(back_it_up)} {($ VSub_Number "$4") (/System.map)}) (SimpleCommand words: [{(cat)} {($ VSub_Number "$2")}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Number "$4") (/uImage)} spids:[310]) ] ) (C {(cp)} {($ VSub_Number "$3")} {($ VSub_Number "$4") (/System.map)}) ] )