X-Git-Url: http://popeye.lapinbilly.eu/git/?p=fbsd-stable-mgmt.git;a=blobdiff_plain;f=update_stage0.sh;fp=update_stage0.sh;h=2a299b585a93910c75248a2fa02bfc549202a223;hp=0000000000000000000000000000000000000000;hb=a334edfe5246e8c012e02fac0db3b8b0e0ecfa23;hpb=bcfab84067673d2619215e6660d4f5357f16fc87 diff --git a/update_stage0.sh b/update_stage0.sh new file mode 100755 index 0000000..2a299b5 --- /dev/null +++ b/update_stage0.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +usage() { + echo 'Usage: ...' + echo '-u svn update' + echo '-j jobs to be handled' + echo 'default to ' ${jarg} + echo '---------------------' +} + +parse() { + RED='\033[0;31m' + NC='\033[0m' # No Color + while getopts "uj:" option + do + case ${option} in + u) + update="1" + ;; + j) + case ${OPTARG} in + (*[!0-9]*|'') + echo -e "${RED}number expected for jobs${NC}; default value used." + ;; + (*) + jarg=${OPTARG} + ;; + esac + ;; + esac + done +} + + +jarg=`sysctl -n hw.ncpu` + + +if [ $? -ne 0 ] +then + usage +else + parse ${*} +fi + +[ ${update} ] && svn update /usr/src + +echo Cleaning +chflags -R noschg /usr/obj/* && rm -rf /usr/obj +echo building process on ${jarg} jobs +cd /usr/src && \ +make -j${jarg} buildworld && make -j${jarg} kernel KERNCONF=PEPINS && \ +echo "Reboot the system." + +