Commit 54f423ae authored by Federico Vaga's avatar Federico Vaga Committed by Adam Wujek

build:kernel: use variable to store version

This way, next time we want to update the kernel we have just to change
the version without touching too much the code
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 722c3364
#!/bin/bash #!/bin/bash
KERVER=2.6.39
# 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
...@@ -11,8 +13,8 @@ fi ...@@ -11,8 +13,8 @@ fi
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE 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-2.6.39.tar.bz2" tarname="linux-${KERVER}.tar.bz2"
patchdir="${WRS_BASE_DIR}/../patches/kernel/v2.6.39" patchdir="${WRS_BASE_DIR}/../patches/kernel/v${KERVER}"
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"
...@@ -20,7 +22,7 @@ mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images" ...@@ -20,7 +22,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-2.6.39" dirname="linux-${KERVER}"
rm -rf $dirname rm -rf $dirname
tar xjf ${WRS_DOWNLOAD_DIR}/$tarname || wrs_die "untar $tarname" tar xjf ${WRS_DOWNLOAD_DIR}/$tarname || wrs_die "untar $tarname"
...@@ -48,7 +50,7 @@ make oldconfig || wrs_die "kernel config" ...@@ -48,7 +50,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/2.6.39/kernel mkdir -p $WRS_OUTPUT_DIR/images/lib/modules/$KERVER/kernel
cp $(find . -name '*.ko') $WRS_OUTPUT_DIR/images/lib/modules/2.6.39/kernel cp $(find . -name '*.ko') $WRS_OUTPUT_DIR/images/lib/modules/$KERVER/kernel
cp arch/$ARCH/boot/zImage $WRS_OUTPUT_DIR/images cp arch/$ARCH/boot/zImage $WRS_OUTPUT_DIR/images
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