#!/bin/bash hvbuild() { rm -rf /usr/src/${PACKAGE} mv ${SRC_DIR} /usr/src cd /usr/src/${PACKAGE} # Install kernel checkpatch script install scripts/checkpatch.pl /usr/bin # Copy kernel configuration file in source tree. cp -v ${SCRDIR}/../config/${KERNEL_CONFIG} .config # Install HV kernel compilation script: COMPILE_SCRIPT=/usr/src/compile-kernel cat > ${COMPILE_SCRIPT} << "EOF" #!/bin/bash set -o errexit MAKEJOBS=4 ROOTDIR=/ DEST=${ROOTDIR}/boot ARCH=_HVL_TARGET_ unset CROSS_COMPILE make -j ${MAKEJOBS} make -j ${MAKEJOBS} modules make INSTALL_MOD_PATH=${ROOTDIR} modules_install KERNEL_VERSION=$(make -s kernelrelease) KERNEL_NAME=vmlinuz cp -v arch/${ARCH}/boot/bzImage ${DEST}/${KERNEL_NAME}-${KERNEL_VERSION} ln -svf ${KERNEL_NAME}-${KERNEL_VERSION} ${DEST}/${KERNEL_NAME} cp -v System.map ${DEST}/System.map-${KERNEL_VERSION} cp -v .config ${DEST}/config-${KERNEL_VERSION} EOF sed -i -e "s!_HVL_TARGET_!${HVL_TARGET}!g" ${COMPILE_SCRIPT} chmod -v u+x ${COMPILE_SCRIPT} # The 'yes' command repeatedly output a line with all specified string, or # 'y' by default. So, you can use it to simply "press enter", which will # result in using the defaults value for the 'make oldconfig' command. yes "" | make oldconfig # Execute compilation script ${COMPILE_SCRIPT} }