add a template script to start with - template_new_releng

This commit is contained in:
George Danchev 2011-06-26 23:44:51 +00:00
parent 8f4c0e82ef
commit 54e65fa11e
3 changed files with 44 additions and 15 deletions

View File

@ -12,6 +12,7 @@ Release Engineering Che[at|ck] List
+ Read the configuration files and set up accordingly + Read the configuration files and set up accordingly
* DELIVERING A NEW TEST SCRIPT * DELIVERING A NEW TEST SCRIPT
+ start a new test over the top of template_new_releng
+ file name starts with releng_ + file name starts with releng_
+ mandatory options -rc [-clean] + mandatory options -rc [-clean]
+ well documented configuration file test.conf{.template} + well documented configuration file test.conf{.template}

View File

@ -14,25 +14,22 @@ BOOT_CAT=""
CONFFILE=$HOME/releng_build_isojigdo.conf CONFFILE=$HOME/releng_build_isojigdo.conf
CLEAN=0 CLEAN=0
RES=""
print_help() { print_help() {
cat << HLP cat << HLP
Usage: Usage:
$0 -help $0 -help
# using a config file ${CONFFILE} # using a config file ${CONFFILE}
$0 -rc [-clean] $0 -rc [-clean]
config file content:
XOR=/path/to/xorriso
DIR=/path/to/input_dir
IMG=/path/to/out_image
ISOLINUX_BIN=/path/to/isolinux.bin
BOOT_CAT=/path/to/boot.cat
# without using a config file # without using a config file
$0 xorriso_cmd IN_dir OUT_image [IN_isolinux] [OUT_bootcat] [-clean] $0 xorriso_cmd IN_dir OUT_image [IN_isolinux] [OUT_bootcat] [-clean]
HLP HLP
} }
#####################################################################
# help # help
if [ ! "${1}" -o "${1}" == "-help" ]; then print_help && exit 10; fi if [ ! "${1}" ]; then print_help && exit 10; fi
# config file # config file
if [ "${1}" == "-rc" ]; then if [ "${1}" == "-rc" ]; then
if [ -e ${CONFFILE} ]; then if [ -e ${CONFFILE} ]; then
@ -72,9 +69,8 @@ printf "$0: Config items:"
printf "\n\txorriso_cmd=${XOR}\n\tIN_dir=${DIR}\n\tOUT_image=${IMG}.iso" printf "\n\txorriso_cmd=${XOR}\n\tIN_dir=${DIR}\n\tOUT_image=${IMG}.iso"
printf "\n\tIN_isolinux=${ISOLINUX_BIN}\n\tOUT_bootcat=${BOOT_CAT}\n" printf "\n\tIN_isolinux=${ISOLINUX_BIN}\n\tOUT_bootcat=${BOOT_CAT}\n"
RES="${IMG}.iso ${IMG}.new ${IMG}.md5 ${IMG}.jigdo ${IMG}.template" RES="${IMG}.iso ${IMG}.new ${IMG}.md5 ${IMG}.jigdo ${IMG}.template"
############################################################
main() { # xorriso version details, incl. underlying libraries
# version details, incl. underlying libraries
"${XOR}" -version "${XOR}" -version
if ! "${XOR}" -version | grep libjte >/dev/null 2>&1; then if ! "${XOR}" -version | grep libjte >/dev/null 2>&1; then
printf "\n$0: JTE not supported with this xorriso build. Install jigit and rebuild." printf "\n$0: JTE not supported with this xorriso build. Install jigit and rebuild."
@ -188,8 +184,3 @@ printf " * xorriso -indev ${IMG}.iso -pvd_info\n"
printf " * fdisk -lu ${IMG}.iso\n" printf " * fdisk -lu ${IMG}.iso\n"
exit 0 exit 0
}
#
main

37
releng/template_new_releng Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
set -e
START_DIR_DONT_CHANGE=`pwd`
# required config items
# XOR=""
# optional config items
# config file
CONFFILE=$HOME/TODO.conf
CLEAN=0
#####################################################################
print_help() {
cat << HLP
Usage:
$0 -help
# using a config file ${CONFFILE}
$0 -rc [-clean]
# without using a config file
$0
HLP
}
#####################################################################
#if [ ! -x "${XOR}" ]; then
# printf "$0: Not found or not an executable: $XOR\n"
# exit 50
#fi
# xorriso version details, incl. underlying libraries
# "${XOR}" -version
exit 0