Skip to content

Commit

Permalink
Update patch-realsense-ubuntu-xenial.sh
Browse files Browse the repository at this point in the history
Modify it in order to support both 4.4.xx and 4.8.xx kernel versions.

My name is Zhe Hu.
I agree to the terms of the Intel® RealSense™ Cross Platform API CLA.
  • Loading branch information
JJHu1993 authored Jun 13, 2017
1 parent c875428 commit c290a2b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions scripts/patch-realsense-ubuntu-xenial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ LINUX_BRANCH=$(uname -r)
kernel_name="ubuntu-xenial"

# Download the latest the linux kernel sources from ubuntu-xenial tree
[ ! -d ${kernel_name} ] && git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git --depth 1
# If LINUX_BRANCH is 4.8.xx
if [ "${LINUX_BRANCH:0:4}" == "4.8." ];
then
[ ! -d ${kernel_name} ] && git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git --depth 1 -b hwe --single-branch
# If LINUX_BRANCH is 4.4.xx
elif [ "${LINUX_BRANCH:0:4}" == "4.4." ];
then
[ ! -d ${kernel_name} ] && git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git --depth 1
else
echo -e "\e[41mKernel Version: $LINUX_BRANCH is not officially supported.Please change it to 4.8.xx or 4.4.xx\e[0m"
exit 1
fi
cd ${kernel_name}

# Verify that there are no trailing changes., warn the user to make corrective action if needed
Expand All @@ -43,7 +54,15 @@ then
printf "Resetting local changes in %s folder\n " ${kernel_name}
git reset --hard
echo -e "\e[32mUpdate the folder content with the latest from mainline branch\e[0m"
git pull origin master
if [ "${LINUX_BRANCH:0:4}" == "4.8." ];
then
git pull origin hwe --depth 1
fi
if [ "${LINUX_BRANCH:0:4}" == "4.4." ];
then
git pull origin master
fi

fi
fi

Expand Down

0 comments on commit c290a2b

Please sign in to comment.