From 64b6dc8db1065ec6c0c5151a54c71f82ccccbbab Mon Sep 17 00:00:00 2001 From: "msb@google.com" Date: Thu, 12 Nov 2009 18:36:19 +0000 Subject: [PATCH] kernel: move config into kernel git repo Already moved config into the kernel git repo. This change fixes the build to use the config which is in the kernel and removes the configs in the chromeos repo. Also removed a lot of the kernel version hard-coding that is in the build. Review URL: http://chromereview.prom.corp.google.com/1188031 git-svn-id: svn://chrome-svn/chromeos/trunk@214 06c00378-0e64-4dae-be16-12b19f9950a1 --- build_image.sh | 6 ++++-- build_kernel.sh | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/build_image.sh b/build_image.sh index 4790becad6..e121673ac9 100755 --- a/build_image.sh +++ b/build_image.sh @@ -20,8 +20,6 @@ # Script must be run inside the chroot assert_inside_chroot -KERNEL_VERSION=${KERNEL_VERSION:-"2.6.30-chromeos-intel-menlow"} - DEFAULT_PKGLIST="${SRC_ROOT}/package_repo/package-list-prod.txt" # Flags @@ -47,6 +45,10 @@ DEFINE_string suite2 "$DEFAULT_EXT_SUITE" "Suite to use in additional mirror." DEFINE_string pkglist2 "" \ "Name of file listing packages to install from additional mirror." +KERNEL_DEB_PATH=$(find "${FLAGS_build_root}/x86/local_packages" -name "linux-image-*.deb") +KERNEL_DEB=$(basename "${KERNEL_DEB_PATH}" .deb | sed -e 's/linux-image-//' -e 's/_.*//') +KERNEL_VERSION=${KERNEL_VERSION:-${KERNEL_DEB}} + # Parse command line FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" diff --git a/build_kernel.sh b/build_kernel.sh index 7e08be34ff..7a861de62c 100755 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -18,11 +18,12 @@ SRC_ROOT=$(dirname $(readlink -f $(dirname "$0"))) . "${SRC_ROOT}/third_party/shflags/files/src/shflags" -KERNEL_VERSION=${KERNEL_VERSION:-"2.6.30-chromeos-intel-menlow"} +KERNEL_DIR="$SRC_ROOT/third_party/kernel" +KCONFIG="${KERNEL_DIR}/files/chromeos/config/chromeos-intel-menlow" # Flags DEFAULT_BUILD_ROOT=${BUILD_ROOT:-"${SRC_ROOT}/build"} -DEFINE_string config "config.${KERNEL_VERSION}" \ +DEFINE_string config "${KCONFIG}" \ "The kernel configuration file to use. See src/platform/kernel/config/*" DEFINE_integer revision 002 \ "The package revision to use" @@ -39,9 +40,6 @@ eval set -- "${FLAGS_ARGV}" # Die on any errors. set -e -KERNEL_DIR="$SRC_ROOT/third_party/kernel" -KCONFIG="${KERNEL_DIR}/config/${FLAGS_config}" - # TODO: We detect the ARCH below. We can sed the FLAGS_output_root to replace # an ARCH placeholder with the proper architecture rather than assuming x86. mkdir -p "$FLAGS_output_root" @@ -80,9 +78,15 @@ FULLVERSION=$(sed -e '/version/ !d' -e 's/^[^0-9]*//' $KCONFIG) # example MAJOR is 2, MINOR is 6, EXTRA is 30, RELEASE is rc1, LOCAL is # asus-eeepc. RC is optional since it only shows up for release candidates. MAJOR=$(echo $FULLVERSION | sed -e 's/[^0-9].*//') -MINOR=$(echo $FULLVERSION | sed -e 's/[0-9].//' -e 's/[^0-9].*//') -EXTRA=$(echo $FULLVERSION | sed -e 's/[0-9].//' -e 's/[0-9].//' -e 's/[^0-9].*//') -VER_MME="${MAJOR}.${MINOR}.${EXTRA}" +MIDDLE=$(echo $FULLVERSION | sed -e 's/[0-9].//' -e 's/[^0-9].*//') +MINOR=$(echo $FULLVERSION | sed -e 's/[0-9].//' -e 's/[0-9].//' -e 's/[^0-9].*//') +EXTRA=$(echo $FULLVERSION | sed -e 's/[0-9].//' -e 's/[0-9].//' -e 's/[0-9]*.//' -e 's/[^0-9].*//') +if [ ! -z $EXTRA ]; then + VER_MME="${MAJOR}.${MIDDLE}.${MINOR}.${EXTRA}" +else + VER_MME="${MAJOR}.${MIDDLE}.${MINOR}" +fi + LOCAL=$(sed -e '/CONFIG_LOCALVERSION=/ !d' -e 's/.*="-//' -e 's/"//' $KCONFIG) RC=$(echo $FULLVERSION | sed -r \ "s/${VER_MME}-([^-]*)-*${LOCAL}/\1/") @@ -168,6 +172,7 @@ MAKEFLAGS="CONCURRENCY_LEVEL=$CONCURRENCY_LEVEL" \ # make-kpkg dumps the newly created package in the parent directory if [ -e "../${PACKAGE}" ] then + rm "${FLAGS_output_root}"/linux-image-*.deb mv "../${PACKAGE}" "${FLAGS_output_root}" echo "Kernel build successful, check ${FLAGS_output_root}/${PACKAGE}" else