1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-08-31 20:36:46 +00:00

Make source dir based on git tag

This commit is contained in:
Darren Shepherd
2016-07-10 05:07:19 +00:00
parent 65203f5fe5
commit 2206ed6c9e
9 changed files with 65 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
#!/bin/bash
set -e
: ${KERNEL_URL:="https://github.com/rancher/linux/archive/Ubuntu-4.4.0-23.41-rancher2.tar.gz"}
: ${KERNEL_SHA1:="62d171607f7f816b277fb4d4d58fb08a0c7960e5"}
: ${KERNEL_URL:="https://github.com/rancher/linux/archive/Ubuntu-4.4.0-30.49-rancher.tar.gz"}
: ${KERNEL_SHA1:="34b4b41128bed2f8ce585fbee1b893f47b1985da"}
: ${ARTIFACTS:=$(pwd)/assets}
: ${BUILD:=/usr/src}
: ${CONFIG:=$(pwd)/config}

View File

@@ -4,12 +4,13 @@ set -e
cd $(dirname $0)/..
source scripts/build-common
source scripts/version
export CCACHE_DIR="${HOME}/.kernel-ccache"
export CC="ccache gcc"
export PATH="/usr/lib/ccache:$PATH"
KERNEL=$(basename ${KERNEL_URL})
DIR=${KERNEL/.tar.*//}
DIR=${VERSION}
FIRMWARE=$(readlink -f scripts/firmware)
MODULE_LIST=$(readlink -f modules.list)
MODULE_EXTRA_LIST=$(readlink -f modules-extra.list)

11
scripts/entry Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -e
trap "rm -f $HOME/.bash_history" exit
mkdir -p bin
if [ -e ./scripts/$1 ]; then
./scripts/"$@"
else
"$@"
fi

View File

@@ -4,9 +4,10 @@ set -e
cd $(dirname $0)/..
source scripts/build-common
source scripts/version
KERNEL=$(basename ${KERNEL_URL})
DIR=${KERNEL/.tar.*//}
DIR=${VERSION}
mkdir -p ${BUILD}
cd ${BUILD}

14
scripts/version Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi