1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-04-27 10:20:49 +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

3
.gitignore vendored
View File

@ -1,3 +1,5 @@
/.dapper
/bin
/assets
/build
/.buildroot-ccache
@ -7,3 +9,4 @@
/.dl
/Dockerfile
*.swp
/.trash-cache

View File

@ -11,3 +11,6 @@ ENV DAPPER_OUTPUT ./dist
ENV SHELL /bin/bash
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]

23
Makefile Normal file
View File

@ -0,0 +1,23 @@
TARGETS := $(shell ls scripts)
.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
$(TARGETS): .dapper
./.dapper $@
trash: .dapper
./.dapper -m bind trash
trash-keep: .dapper
./.dapper -m bind trash -k
deps: trash
.DEFAULT_GOAL := ci
.PHONY: $(TARGETS)

View File

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.4.10 Kernel Configuration
# Linux/x86 4.4.13 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
@ -4439,6 +4439,7 @@ CONFIG_ACPI_WMI=m
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_IPS is not set
# CONFIG_IBM_RTL is not set
# CONFIG_SAMSUNG_LAPTOP is not set
@ -5374,6 +5375,9 @@ CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_TEXTSEARCH=y

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