1
0
mirror of https://github.com/rancher/os.git synced 2025-07-17 16:41:04 +00:00

move the kernel headers and extras images to os repo

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2016-11-01 15:56:17 +10:00
parent 100d85149f
commit d65f376ed9
4 changed files with 51 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