Simplify kernel output and main Dockerfile

Signed-off-by: Justin Cormack <justin@specialbusservice.com>
This commit is contained in:
Justin Cormack
2016-09-11 00:05:31 +01:00
committed by Justin Cormack
parent 92642978a1
commit c51a0b831e
7 changed files with 32 additions and 36 deletions

View File

@@ -1,2 +1,5 @@
x86_64
arm
x86_64/
etc/
lib/
usr/
sbin/

View File

@@ -66,13 +66,10 @@ RUN if [ $DEBUG -ne "0" ]; then \
# Apply local patches
COPY patches /patches
RUN cd /linux && \
mkdir /etc/kernel-patches && \
set -e && for patch in /patches/*.patch; do \
echo "Applying $patch"; \
cp "$patch" /etc/kernel-patches; \
patch -p1 < "$patch"; \
done && \
cd /etc/kernel-patches && tar cf /kernel-patches.tar .
done
RUN jobs=$(nproc); \
cd /linux && \

View File

@@ -8,21 +8,17 @@ $(ARCH)/mobykernel-build: Dockerfile kernel_config
docker build --build-arg DEBUG=$(DEBUG) -t mobykernel:build .
touch $@
$(ARCH)/aufs-utils.tar $(ARCH)/kernel-source-info $(ARCH)/kernel-patches.tar $(ARCH)/kernel-modules.tar: $(ARCH)/mobykernel-build
docker run --rm mobykernel:build cat /$(notdir $@) > $@ || ! rm $@
$(ARCH)/bzImage $(ARCH)/zImage: $(ARCH)/aufs-utils.tar $(ARCH)/kernel-source-info $(ARCH)/kernel-patches.tar $(ARCH)/kernel-modules.tar $(ARCH)/mobykernel-build
$(ARCH)/bzImage: $(ARCH)/mobykernel-build
docker run --rm mobykernel:build cat /linux/arch/$(ARCH)/boot/$(notdir $@) > $@ || ! rm $@
$(ARCH)/vmlinux: $(ARCH)/bzImage
docker run --rm mobykernel:build cat /linux/vmlinux > $@ || ! rm $@
docker run --rm --net=none mobykernel:build cat /kernel-modules.tar | tar xf -
docker run --rm mobykernel:build cat /aufs-utils.tar | tar xf -
docker run --rm mobykernel:build cat /kernel-source-info > etc/kernel-source-info
mkdir -p etc
cp -a patches etc/kernel-patches
$(ARCH)/vmlinuz64: $(ARCH)/bzImage
cp $< $@
clean-arch:
rm -rf $(ARCH)
docker images -q mobykernel:build | xargs docker rmi -f || true
clean:
$(MAKE) clean-arch ARCH=x86_64
rm -rf $(ARCH) lib etc usr sbin
docker images -q mobykernel:build | xargs docker rmi -f || true