#!/bin/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 # # Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen # # "make install" script for ppc64 architecture # # Arguments: # $1 - kernel version # $2 - kernel image file # $3 - kernel map file # $4 - default install path (blank if root directory) # $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. # # Bail with error code if anything goes wrong set -e # 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; } # Default install # this should work for both the pSeries zImage and the iSeries vmlinux.sm global image_name := $[basename $2] if test -f $4/$image_name { mv $4/$image_name $4/$image_name.old } if test -f $4/System.map { mv $4/System.map $4/System.old } cat $2 > $4/$image_name cp $3 $4/System.map # Copy all the bootable image files global path := $4 shift 4 while [ $# -ne 0 ] { global image_name := $[basename $1] if test -f $path/$image_name { mv $path/$image_name $path/$image_name.old } cat $1 > $path/$image_name shift }; (CommandList children: [ (C {(set)} {(-e)}) (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 85] ) ] spids: [-1 100] ) (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 116] ) ] spids: [-1 130] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:image_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number "$2")})]) left_token: spids: [141 145] ) } spids: [140] ) ] spids: [140] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {($ VSub_Number "$4") (/) ($ VSub_Name "$image_name")} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {($ VSub_Number "$4") (/) ($ VSub_Name "$image_name")} {($ VSub_Number "$4") (/) ($ VSub_Name "$image_name") (.old)} ) ] spids: [-1 161] ) ] spids: [-1 175] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {($ VSub_Number "$4") (/System.map)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(mv)} {($ VSub_Number "$4") (/System.map)} {($ VSub_Number "$4") (/System.old)})] spids: [-1 190] ) ] spids: [-1 201] ) (SimpleCommand words: [{(cat)} {($ VSub_Number "$2")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Number "$4") (/) ($ VSub_Name "$image_name")} spids: [208] ) ] ) (C {(cp)} {($ VSub_Number "$3")} {($ VSub_Number "$4") (/System.map)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:path) op:Equal rhs:{($ VSub_Number "$4")} spids:[225])] spids: [225] ) (C {(shift)} {(4)}) (Sentence child: (While cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-ne)} {(0)} {(Lit_Other "]")}) terminator: ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:image_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number "$1")})] ) left_token: spids: [249 253] ) } spids: [248] ) ] spids: [248] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {($ VSub_Name "$path") (/) ($ VSub_Name "$image_name")} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {($ VSub_Name "$path") (/) ($ VSub_Name "$image_name")} {($ VSub_Name "$path") (/) ($ VSub_Name "$image_name") (.old)} ) ] spids: [-1 269] ) ] spids: [-1 284] ) (SimpleCommand words: [{(cat)} {($ VSub_Number "$1")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$path") (/) ($ VSub_Name "$image_name")} spids: [291] ) ] ) (C {(shift)}) ] spids: [245 300] ) ) terminator: ) ] )