Skip to content

Commit

Permalink
update kernel build
Browse files Browse the repository at this point in the history
build kernel/modules in the hyperstart-dev:latest container
remove build/modules/ directroy and add modules.tar instead

Signed-off-by: Lai Jiangshan <[email protected]>
  • Loading branch information
laijs committed May 27, 2016
1 parent aea6029 commit f4493e5
Show file tree
Hide file tree
Showing 109 changed files with 39 additions and 598 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ initrd-local:
@echo finish make initrd
cbfs-local:
@echo finish make cbfs
kernel-local:
@echo finish make kernel
29 changes: 29 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM centos:7
MAINTAINER Hyper Developers <[email protected]>

RUN yum install -y patch gcc ncurses-devel make openssl-devel bc

ENV KERNEL_VERSION 4.4.7
ENV LOCALVERSION -hyper
ENV KERNEL_RELEASE ${KERNEL_VERSION}${LOCALVERSION}

ENV KBUILD_BUILD_USER dev
ENV KBUILD_BUILD_HOST hyper.sh
ENV KBUILD_BUILD_VERSION 1

RUN mkdir /root/build/ && mkdir /root/build/result/
RUN curl -fSL https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.gz | tar -zx -C /root/build

COPY kernel_config /root/build/linux-${KERNEL_VERSION}/.config
COPY kernel_patch/ /root/build/kernel_patch/

RUN cd /root/build/linux-${KERNEL_VERSION}/ && for patch in /root/build/kernel_patch/*.patch; do patch -p1 <$patch || exit 1; done
RUN cd /root/build/linux-${KERNEL_VERSION}/ && make silentoldconfig && make -j 8

# install to /root/build/result/ so that we can get them from it
RUN cp /root/build/linux-${KERNEL_VERSION}/arch/x86_64/boot/bzImage /root/build/result/kernel
RUN mkdir /root/build/result/modules &&\
cd /root/build/linux-${KERNEL_VERSION}/ && make modules_install INSTALL_MOD_PATH="/root/build/result/modules" &&\
cd /root/build/result/modules/lib/modules/ && rm -f ${KERNEL_RELEASE}/{build,source} &&\
tar -cf /root/build/result/modules.tar ${KERNEL_RELEASE}/ && rm -rf /root/build/result/modules
RUN cp /root/build/linux-${KERNEL_VERSION}/.config /root/build/result/kernel_config
5 changes: 5 additions & 0 deletions build/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ endif

cbfs-local:
bash ./make-initrd.sh cbfs

kernel-local:
hyperctl build -t hyperstart-dev:latest .
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/kernel >kernel.new && mv -f kernel.new kernel
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/modules.tar >modules.tar
Binary file modified build/kernel
Binary file not shown.
2 changes: 1 addition & 1 deletion build/kernel_config
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CONFIG_BUILDTIME_EXTABLE_SORT=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION="-hyper"
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
Expand Down
2 changes: 0 additions & 2 deletions build/kernel_version

This file was deleted.

2 changes: 1 addition & 1 deletion build/make-initrd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mkdir -p root/lib

cp ../src/init ./root
cp busybox ./root
cp modules -R ./root/lib/
tar -xf modules.tar -C ./root/lib/

ldd ./root/init | while read line
do
Expand Down
Binary file added build/modules.tar
Binary file not shown.
Binary file removed build/modules/4.4.7-hyper+/kernel/drivers/net/tun.ko
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed build/modules/4.4.7-hyper+/kernel/lib/ts_bm.ko
Binary file not shown.
Binary file removed build/modules/4.4.7-hyper+/kernel/lib/ts_fsm.ko
Binary file not shown.
Binary file removed build/modules/4.4.7-hyper+/kernel/lib/ts_kmp.ko
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
107 changes: 0 additions & 107 deletions build/modules/4.4.7-hyper+/modules.alias

This file was deleted.

Binary file removed build/modules/4.4.7-hyper+/modules.alias.bin
Binary file not shown.
75 changes: 0 additions & 75 deletions build/modules/4.4.7-hyper+/modules.builtin

This file was deleted.

Binary file removed build/modules/4.4.7-hyper+/modules.builtin.bin
Binary file not shown.
89 changes: 0 additions & 89 deletions build/modules/4.4.7-hyper+/modules.dep

This file was deleted.

Binary file removed build/modules/4.4.7-hyper+/modules.dep.bin
Binary file not shown.
2 changes: 0 additions & 2 deletions build/modules/4.4.7-hyper+/modules.devname

This file was deleted.

Loading

0 comments on commit f4493e5

Please sign in to comment.