#!/bin/bash # N=$(($(getconf _NPROCESSORS_ONLN) / 2)) N=$(($(getconf _NPROCESSORS_ONLN) * 1)) mkdir -p .git/kbuild if test -f .git/kbuild/config ; then . .git/kbuild/config elif test -f .git/kbuild.conf ; then . .git/kbuild.conf mv .git/kbuild.conf .git/kbuild/config else echo "Missing kbuild configuration file!" exit 1 fi if test ! -d "$BLD_DIR" ; then mkdir -p "$BLD_DIR" if test -f .git/kbuild/kernel-config ; then cp .git/kbuild/kernel-config "$BLD_DIR/.config" fi for i in x509.genkey signing_key.pem signing_key.x509 do if test -f ".git/kbuild/$i" ; then mkdir -p "$BLD_DIR/certs" cp ".git/kbuild/$i" "$BLD_DIR/certs" fi done fi time nice make O="$BLD_DIR" ARCH=${KERN_ARCH:-x86_64} -j$N $* cp "$BLD_DIR/.config" .git/kbuild/kernel-config for i in x509.genkey signing_key.pem signing_key.x509 do if test -f "$BLD_DIR/certs/$i" ; then cp "$BLD_DIR/certs/$i" .git/kbuild fi done