2018-05-31 11:01:20 +00:00
|
|
|
RED='\033[0;31m'
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
ORGANGE='\033[0;33m'
|
|
|
|
BLUE='\033[0;34m'
|
|
|
|
LGRAY='\033[0;37m'
|
|
|
|
|
|
|
|
NC='\033[0m'
|
|
|
|
|
2018-11-13 09:47:50 +00:00
|
|
|
[ -z "$ARCHISO_SERVER" ] && ARCHISO_SERVER=${PXE_SERVER}
|
|
|
|
[ -z "$ARCHISO_HTTP_BASE" ] && ARCHISO_HTTP_BASE=${PXE_HTTP_BASE}
|
|
|
|
|
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
requiredir() {
|
2019-01-12 12:32:19 +00:00
|
|
|
[ -n "$1" ] || return 1
|
2018-05-21 12:41:52 +00:00
|
|
|
[ -e $1 ] || mkdir $1
|
|
|
|
}
|
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
eexit() {
|
|
|
|
eerr "$1"
|
2018-05-21 12:41:52 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
checkstage() {
|
2018-05-21 12:41:52 +00:00
|
|
|
[ -e ${WORKDIR}/stage/_$1 ] || return 1
|
|
|
|
[ "$(cat $WORKDIR/stage/_$1)" != "done" ] && return 2
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
startstage() {
|
2018-11-06 22:29:48 +00:00
|
|
|
requiredir ${WORKDIR}/stage
|
2018-05-21 12:41:52 +00:00
|
|
|
echo -n "started" > ${WORKDIR}/stage/_$1
|
|
|
|
}
|
2018-11-06 22:29:48 +00:00
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
endstage() {
|
2018-05-21 12:41:52 +00:00
|
|
|
echo -n "done" > ${WORKDIR}/stage/_$1
|
|
|
|
}
|
2018-05-31 11:01:20 +00:00
|
|
|
|
2018-11-13 09:47:50 +00:00
|
|
|
edebug() {
|
|
|
|
[ "$MKLIVE_DEBUG" == "true" ] && echo "[dd] $1" 1>&2
|
|
|
|
}
|
|
|
|
|
2018-05-31 11:01:20 +00:00
|
|
|
eok() {
|
2018-11-13 09:47:50 +00:00
|
|
|
echo -e "${GREEN}[++] $1${NC}" 1>&2
|
2018-05-31 11:01:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
einfo() {
|
2018-11-13 09:47:50 +00:00
|
|
|
echo -e "${BLUE}[ii] ${1}${NC}" 1>&2
|
2018-05-31 11:01:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
eerr(){
|
2018-11-13 09:47:50 +00:00
|
|
|
echo -e "${RED}[--] ${1}${NC}" 1>&2
|
2018-05-31 11:01:20 +00:00
|
|
|
}
|
|
|
|
|