Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle
2018-09-24 19:31:37 -04:00
parent 5eccef3c66
commit 0ee7b3e78a
2 changed files with 28 additions and 25 deletions

View File

@@ -34,7 +34,8 @@ linux_next(){
git fetch --tags linux-next
)
local branch="next-$(date +%Y%m%d)"
local branch
branch="next-$(date +%Y%m%d)"
echo "Checking out the correct branch ${branch}..."
(
cd "$dir"
@@ -58,7 +59,7 @@ install_kernel(){
if [[ "$VERSION" != "next" ]]; then
local MAJOR_VERSION=${VERSION:0:1}
local V=( ${VERSION//./ } )
local V=( "${VERSION//./ }" )
local MAJOR_MINOR_VERSION="${V[0]}.${V[1]}"
# Get the kernel source.
@@ -69,7 +70,7 @@ install_kernel(){
MAJOR_MINOR_VERSION="${MAJOR_VERSION}.x-rcN"
else
[ -d /usr/src/linux-${VERSION} ] || curl -sSL "https://cdn.kernel.org/pub/linux/kernel/v${MAJOR_VERSION}.x/linux-${VERSION}.tar.xz" | tar -C /usr/src -xJ
[ -d "/usr/src/linux-${VERSION}" ] || curl -sSL "https://cdn.kernel.org/pub/linux/kernel/v${MAJOR_VERSION}.x/linux-${VERSION}.tar.xz" | tar -C /usr/src -xJ
fi
# Git clone and apply the patches for the aufs filesystem.
@@ -77,7 +78,7 @@ install_kernel(){
aufsdir=/aufs4-standalone
echo "Cloning the git patches for the aufs filesystem..."
git clone --depth 1 --branch aufs${MAJOR_MINOR_VERSION} --single-branch https://github.com/sfjro/aufs4-standalone.git $aufsdir
git clone --depth 1 --branch "aufs${MAJOR_MINOR_VERSION}" --single-branch https://github.com/sfjro/aufs4-standalone.git "$aufsdir"
(
cd "$DIR"
@@ -126,7 +127,7 @@ install_kernel(){
cd "$DIR"
echo "Building the kernel..."
make -j$JOBS
make -j"$JOBS"
echo "Installing the modules..."
make modules_install
echo "Installing the kernel..."
@@ -134,7 +135,7 @@ install_kernel(){
)
(
echo "Stripping the modules..."
find /lib/modules/ -name *.ko -exec strip --strip-unneeded {} +
find /lib/modules/ -name "*.ko" -exec strip --strip-unneeded {} +
)
}