1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-09-28 05:48:50 +00:00

the header and extras image code from the rancher/os repo

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2016-11-14 15:37:18 +10:00
parent 2c077b810b
commit be37a79440
5 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
FROM alpine:3.4
# FROM arm64=skip arm=skip
RUN apk --purge --no-cache add kmod bash openssl
COPY extra.sh /usr/bin
CMD ["extra.sh"]

19
images/10-extras/extra.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
DIR=$(readlink /lib/modules/$(uname -r)/build)
STAMP=/lib/modules/$(uname -r)/.extra-done
VER=$(basename $DIR)
URL=${KERNEL_EXTRAS_URL:-https://github.com/rancher/os-kernel/releases/download/${VER}/extra.tar.gz}
if [ -e $STAMP ]; then
echo Kernel extras already installed. Delete $STAMP to reinstall
exit 0
fi
echo Downloading $URL
wget -O - $URL | gzip -dc | tar xf - -C /
depmod -a
touch $STAMP
echo Kernel extras installed

View File

@@ -0,0 +1,3 @@
FROM rancher/os-base
COPY headers.sh /
CMD ["/headers.sh"]

24
images/10-headers/headers.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
DIR=$(readlink /lib/modules/$(uname -r)/build)
STAMP=${DIR}/.done
VER=$(basename $DIR)
if [ "$VER" = "Ubuntu-4.4.0-23.41-rancher2" ]; then
VER=Ubuntu-4.4.0-23.41-rancher2-2
fi
KERNEL_HEADERS_URL=${KERNEL_HEADERS_URL:-https://github.com/rancher/os-kernel/releases/download/${VER}/build.tar.gz}
if [ -e $STAMP ]; then
echo Headers already installed in $DIR
exit 0
fi
echo Downloading $KERNEL_HEADERS_URL
mkdir -p $DIR
wget -O - $KERNEL_HEADERS_URL | gzip -dc | tar xf - -C $DIR
touch $STAMP
echo Headers installed at $DIR

25
scripts/build-images Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e
export ARCH=${ARCH:-"amd64"}
BASE=images
source $(dirname $0)/version
cd $(dirname $0)/..
for i in $BASE/[0-9]*; do
name="os-$(echo ${i} | cut -f2 -d-)"
tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
echo Building ${tag}
if [ -x ${i}/prebuild.sh ]; then
${i}/prebuild.sh
fi
if dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}; then
docker tag rancher/${name} ${tag}
elif [ "$?" != "42" ]; then
exit 1
else
echo "WARN: Skipping ${tag}"
fi
done