#!/bin/ksh ############################################################################### # $Id: upload_iso_kernel_all,v 1.2 2005/10/11 12:37:48 petri Exp $ # Project: ESRF/Linux # Description: Update KickStart support ISO-CD kernel on all Rembo servers # using adequate version numbering. # # Author(s): Petri Makijarvi # European Synchrotron Radiation Facility, # Grenoble, France # # Original: August 2005 # # License: GNU General Public License, version 2 ############################################################################### # distbin='/dist/mydist/distbin' uploadscript="${distbin}/upload_on_all_remboservers" uploaddir='kickstart' # # This script can be executed only from its data directory # if [ $0 != "./upload_iso_kernel_all" ];then echo "You must start the script with command ./upload_iso_kernel_all" echo "- /dist/rX/vY/pZ/mydist/ksbin/ directory first" exit 1 fi # # The script should be executed in a directory path, such as # /dist/rX/vY/pZ/mydist/ksbin/ # 1 2 3 4 5 6 7 depth=`pwd | awk '/^\// { n = split ( $0, arr, "/"); print n; }'` if [ ${depth} -ne 7 ]; then echo "Sorry, you are executing this script from data directory" echo "- `pwd`" echo "Your data directory should in the directory where this script" echo "is located, something like" echo "- /dist/rX/vY/pZ/mydist/ksbin/" exit 1 fi # # The actual upload on all Rembo servers is done with a common script, # containing a list of servers. # if [ ! -e ${uploadscript} ];then echo "Sorry, cannot find script ${uploadscript}, or it is not executable." exit 1 fi # # We need to find the kernel file and its ramdisk images from relative paths. # The files are part of the RedHat distribution, and there is a run-time # kernel dependency. # kernel='../../rhel4ws/isolinux/vmlinuz' #kernel='/dist/rhe4-dist/isolinux/vmlinuz' if [ ! -r ${kernel} ];then echo "Sorry, cannot find ISO Linux kernel ${kernel}." exit 1 fi initrd='../../rhel4ws/isolinux/initrd.img' #initrd='/dist/rhe4-dist/isolinux/initrd.img' if [ ! -r ${initrd} ];then echo "Sorry, cannot find ISO Linux kernel's initial ramdisk ${initrd}." exit 1 fi # # Find out the revision, version and patch level string from the path # revision=`pwd | awk '/^\// { n = split ( $0, arr, "/"); print arr[3]; }'` version=`pwd | awk '/^\// { n = split ( $0, arr, "/"); print arr[4]; }'` patch=`pwd | awk '/^\// { n = split ( $0, arr, "/"); print arr[5]; }'` # # Build the destination kernel and initrd image names # destkernel="kslinuz_${revision}${version}${patch}" destinitrd="ksinitrd_${revision}${version}${patch}" # # Upload # echo "Uploading ${destkernel}" ${uploadscript} ${kernel} ${uploaddir} ${destkernel} echo "Uploading ${destinitrd}" ${uploadscript} ${initrd} ${uploaddir} ${destinitrd} echo "done." # end of upload_iso_kernel_all