Commit 6b6075a0 authored by Federico Vaga's avatar Federico Vaga Committed by Adam Wujek

build: use a single source for the kernel version

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent c820bd3b
#!/bin/bash #!/bin/bash
KERVER=3.16.37
# check variables, like all scripts herein do # check variables, like all scripts herein do
WRS_SCRIPT_NAME=$(basename $0) WRS_SCRIPT_NAME=$(basename $0)
if [ -z "$WRS_BASE_DIR" ]; then if [ -z "$WRS_BASE_DIR" ]; then
...@@ -14,8 +12,8 @@ wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE ...@@ -14,8 +12,8 @@ wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
wrs_echo "--- Linux kernel for switch" wrs_echo "--- Linux kernel for switch"
tarname="linux-${KERVER}.tar.gz" tarname="linux-${KVER}.tar.gz"
patchdir="${WRS_BASE_DIR}/../patches/kernel/v${KERVER}" patchdir="${WRS_BASE_DIR}/../patches/kernel/v${KVER}"
wrs_download $tarname wrs_download $tarname
mkdir -p $WRS_OUTPUT_DIR/build || wrs_die "mkdir build" mkdir -p $WRS_OUTPUT_DIR/build || wrs_die "mkdir build"
...@@ -23,7 +21,7 @@ mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images" ...@@ -23,7 +21,7 @@ mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images"
# go to the build dir and compile it, using our configuration # go to the build dir and compile it, using our configuration
cd $WRS_OUTPUT_DIR/build cd $WRS_OUTPUT_DIR/build
dirname="linux-${KERVER}" dirname="linux-${KVER}"
rm -rf $dirname rm -rf $dirname
tar xzf ${WRS_DOWNLOAD_DIR}/$tarname || wrs_die "untar $tarname" tar xzf ${WRS_DOWNLOAD_DIR}/$tarname || wrs_die "untar $tarname"
...@@ -51,7 +49,7 @@ make oldconfig || wrs_die "kernel config" ...@@ -51,7 +49,7 @@ make oldconfig || wrs_die "kernel config"
make $WRS_MAKE_J zImage modules || wrs_die "kernel compilation" make $WRS_MAKE_J zImage modules || wrs_die "kernel compilation"
mkdir -p $WRS_OUTPUT_DIR/images/lib/modules/$KERVER/kernel mkdir -p $WRS_OUTPUT_DIR/images/lib/modules/$KVER/kernel
cp $(find . -name '*.ko') $WRS_OUTPUT_DIR/images/lib/modules/$KERVER/kernel cp $(find . -name '*.ko') $WRS_OUTPUT_DIR/images/lib/modules/$KVER/kernel
cp arch/$ARCH/boot/zImage $WRS_OUTPUT_DIR/images cp arch/$ARCH/boot/zImage $WRS_OUTPUT_DIR/images
...@@ -16,7 +16,7 @@ mkdir -p $WRS_OUTPUT_DIR/build || wrs_die "mkdir build" ...@@ -16,7 +16,7 @@ mkdir -p $WRS_OUTPUT_DIR/build || wrs_die "mkdir build"
mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images" mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images"
# check that the kernel has been compiled (or at least configured) # check that the kernel has been compiled (or at least configured)
export LINUX="$WRS_OUTPUT_DIR/build/linux-2.6.39" export LINUX="$WRS_OUTPUT_DIR/build/linux-$KVER"
test -f $LINUX/.config || wrs_die "no kernel in $LINUX" test -f $LINUX/.config || wrs_die "no kernel in $LINUX"
cd $WRS_BASE_DIR/../kernel cd $WRS_BASE_DIR/../kernel
make $WRS_MAKE_J || wrs_die "white rabbit kernel modules" make $WRS_MAKE_J || wrs_die "white rabbit kernel modules"
......
...@@ -21,7 +21,7 @@ make clean ...@@ -21,7 +21,7 @@ make clean
# we need LINUX and CROSS_COMPILE. The latter is there for sure # we need LINUX and CROSS_COMPILE. The latter is there for sure
if [ "x$LINUX" == "x" ]; then if [ "x$LINUX" == "x" ]; then
export LINUX="$WRS_OUTPUT_DIR/build/linux-2.6.39" export LINUX="$WRS_OUTPUT_DIR/build/linux-$KVER"
fi fi
......
...@@ -17,7 +17,7 @@ installdir="$WRS_OUTPUT_DIR/images/wr" ...@@ -17,7 +17,7 @@ installdir="$WRS_OUTPUT_DIR/images/wr"
# This time build is done in-place, but the output is a tree in images/wr. # This time build is done in-place, but the output is a tree in images/wr.
# Some of the makefiles inside use # Some of the makefiles inside use
export LINUX="$WRS_OUTPUT_DIR/build/linux-2.6.39" export LINUX="$WRS_OUTPUT_DIR/build/linux-$KVER"
cd $sourcedir cd $sourcedir
make clean || wrs_die "Error cleaning user space" make clean || wrs_die "Error cleaning user space"
......
...@@ -48,6 +48,9 @@ fi ...@@ -48,6 +48,9 @@ fi
export WRS_SCRIPTS_DIR=${WRS_BASE_DIR}/scripts export WRS_SCRIPTS_DIR=${WRS_BASE_DIR}/scripts
# Export Linux kernel version in use
export KVER="3.16.37"
# Export Buildroot version in use # Export Buildroot version in use
export BRVER="2016.02" export BRVER="2016.02"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment