[ Name ] Kernel_unstable [ Phase ] Download Build Update [ KModule_Name ] [ Download_Cmdline ] local DATE=$(date +%F) local arch= uname -i | grep i386 if [ $? -eq 0 ]; then arch=ia32 else arch=ia32e fi cd ${BUILD_ROOT}/Kernel_unstable/||return 1 if [ -d drm-intel ]; then cd drm-intel && make mrproper ||return 1 git reset --hard HEAD || return 1 git clean -x -d -f # if [ $? -eq 128 ]; then # git clean -x -d | grep clean.requireForce # if [ $? -eq 0 ]; then # git clean -x -d -f # else # return 1 # fi # fi # [ $? -ne 0 ] && git clean -x -d if [ $? -ne 0 ]; then git clean -x -d fi make mrproper || return 1 git reset --hard HEAD || return 1 git branch | grep drm-intel-nightly if [ $? -eq 0 ]; then echo "drm-intel-nightly exists!" else tsocks git fetch origin drm-intel-nightly:drm-intel-nightly fi git checkout drm-intel-nightly || return 1 tsocks git pull origin +drm-intel-nightly:drm-intel-nightly || return 1 if [ "database" == "$1" ]; then cd /GFX/Test/Infrastructure/infrastructure/script/auto_bisect COMMIT=$(./get_commit_for_build.py -d $DATE -c Kernel -m unstable -b $arch) echo $COMMIT cd - git reset --hard "$COMMIT" cd .. else tsocks git pull origin +drm-intel-nightly:drm-intel-nightly || return 1 fi else git clone git://tinderbox.sh.intel.com/git/drm-intel || return 1 cd drm-intel || return 1 tsocks git fetch origin +drm-intel-nightly:drm-intel-nightly || return 1 git checkout drm-intel-nightly || return 1 git reset --hard HEAD ||return 1 fi return 0 [ Building_Cmdline ] cd ${BUILD_ROOT}/Kernel_unstable/drm-intel ||return 1 git reset --hard HEAD ||return 1 ## get origin version version=`cat Makefile |grep "^EXTRAVERSION"` DATE=`date +%Y%m%d` machine_name=`uname -n` ## patch kernel # patch -p1 < ${RUN_ROOT}/tools/kernel/configs/e1000e.patch || return 1 # patch -p1 < ${RUN_ROOT}/tools/kernel/configs/usb.patch || return 1 # if [ ${ARCH} == "x86_64" ]; then # patch -p1 --dry-run < /home/fbc.patch # if [ $? -eq 0 ]; then # patch -p1 < /home/fbc.patch # fi # fi ## configure if [ ${ARCH} == "x86_64" ]; then if [ ${debug} == "enable" ]; then echo "${RUN_ROOT}/tools/kernel/configs/kms-config-x86_64_debug" cp ${RUN_ROOT}/tools/kernel/configs/kms-config-x86_64_debug .config || return 1 ## set new version new_version=${version}_unstable_debug_${DATE} sed -in-place -e "s/${version}/${new_version}/g" Makefile else echo "${RUN_ROOT}/tools/kernel/configs/kms-config-x86_64" cp ${RUN_ROOT}/tools/kernel/configs/kms-config-x86_64 .config || return 1 ## set new version new_version=${version}_unstable_${DATE} sed -in-place -e "s/${version}/${new_version}/g" Makefile fi elif [ ${machine_name} == "x-aspire2"]; then cp ${RUN_ROOT}/tools/kernel/configs/kms-config-x-aspire2 .config || return 1 else if [ ${debug} == "enable" ]; then echo "${RUN_ROOT}/tools/kernel/configs/kms-config-i386_debug" cp ${RUN_ROOT}/tools/kernel/configs/kms-config-i386_debug .config || return 1 ## set new version new_version=${version}_unstable_debug_${DATE} sed -in-place -e "s/${version}/${new_version}/g" Makefile else echo "${RUN_ROOT}/tools/kernel/configs/kms-config-i386" cp ${RUN_ROOT}/tools/kernel/configs/kms-config-i386 .config || return 1 ## set new version new_version=${version}_unstable_${DATE} sed -in-place -e "s/${version}/${new_version}/g" Makefile fi fi yes "" | make oldconfig || return 1 ## make make -j6 || return 1 make -j6 modules || return 1 ## make install KERNEL_INSTALL_ROOT=/home/kernel/unstable/dist if [ -d ${KERNEL_INSTALL_ROOT} ]; then make -j6 INSTALL_MOD_PATH=${KERNEL_INSTALL_ROOT} modules_install || return 1 else mkdir -p ${KERNEL_INSTALL_ROOT} ||return 1 make -j6 INSTALL_MOD_PATH=${KERNEL_INSTALL_ROOT} modules_install || return 1 fi if [ -d ${KERNEL_INSTALL_ROOT}/boot ];then make -j6 INSTALL_PATH=${KERNEL_INSTALL_ROOT}/boot install || return 1 else mkdir -p ${KERNEL_INSTALL_ROOT}/boot ||return 1 make -j6 INSTALL_PATH=${KERNEL_INSTALL_ROOT}/boot install || return 1 fi ## make rpm package KERNEL_SOURCE_DIR=${BUILD_ROOT}/Kernel_unstable/drm-intel rm -f $KERNEL_SOURCE_DIR/scripts/package/mkspec cp $HOME/rpmbuild/scripts/mkspec.unstable $KERNEL_SOURCE_DIR/scripts/package/mkspec make binrpm-pkg arch_for_rpm=`uname -i` # rename rc "-rc" $HOME/rpmbuild/RPMS/${arch_for_rpm}/* # rename unstable "-unstable-$DATE" $HOME/rpmbuild/RPMS/${arch_for_rpm}/* mv $HOME/rpmbuild/RPMS/${arch_for_rpm}/* $HOME/rpmbuild/archive ## clean make clean ## kernel information for backing up commit=`git log | head -1 | awk '{print $2}'` branch=`git branch |grep '*' | awk '{print $2}'` #touch ${KERNEL_INSTALL_ROOT}/version cd ${KERNEL_INSTALL_ROOT}/lib/modules/* version_path=`pwd` touch version cd - echo "unstable" > ${version_path}/version echo '('${branch}')'${commit} >> ${version_path}/version echo "Kernel: (${branch}) ${commit}" > /opt/Kernel_unstable.log return 0 [ Version ] cd ${BUILD_ROOT}/Kernel_unstable/drm-intel COMMIT=`git log | head -1 | awk '{print $2}'` BRANCH=`git branch |grep '*' | awk '{print $2}'` echo '('${BRANCH}')'${COMMIT} cd .. [ Sync_Path ] ${INSTALL_ROOT} [ EOF ]