From c2ac65a807bd4349d37a0bdf01f68c0bd5e0225a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sat, 17 Nov 2018 00:00:00 +0000 Subject: [PATCH] docker: split minimum setup to separate script --- .dockerignore | 1 + Dockerfile | 9 ++------- build | 1 + run | 4 ++-- setup | 12 ++++++++++++ 5 files changed, 18 insertions(+), 9 deletions(-) create mode 100755 setup diff --git a/.dockerignore b/.dockerignore index 8da20e9..437c572 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ # with a volume. * .* +!setup diff --git a/Dockerfile b/Dockerfile index c0b895b..c5c815b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,5 @@ # https://github.com/cirosantilli/linux-kernel-module-cheat#docker FROM ubuntu:18.04 -RUN apt update -# Minimum requirements to run ./build --download-dependencies -RUN apt-get install -y \ - git \ - python3 \ - python3-distutils \ - ; +COPY setup / +RUN /setup -y CMD bash diff --git a/build b/build index 2a5cb92..aa271f4 100755 --- a/build +++ b/build @@ -125,6 +125,7 @@ name_to_component_map = { # TODO test it out on Docker and answer that question properly: # https://askubuntu.com/questions/350475/how-can-i-install-gem5 apt_get_pkgs={ + 'device-tree-compiler', 'diod', 'libgoogle-perftools-dev', 'protobuf-compiler', diff --git a/run b/run index 02abb25..b9af464 100755 --- a/run +++ b/run @@ -333,7 +333,7 @@ def main(args, extra_args=None): ]) virtio_gpu_pci = [] else: - virtio_gpu_pci = ['-device', 'virtio-gpu-pci'] + virtio_gpu_pci = ['-device', 'virtio-gpu-pci', common.Newline] if args.arch == 'x86_64': append = ['-append', '{} nopat {}'.format(root, kernel_cli), common.Newline] cmd.extend([ @@ -346,7 +346,7 @@ def main(args, extra_args=None): cpu = 'cortex-a15' else: cpu = 'cortex-a57' - append = ['-append', '{} {}'.format(root, kernel_cli)] + append = ['-append', '{} {}'.format(root, kernel_cli), common.Newline] cmd.extend( [ # highmem=off needed since v3.0.0 due to: diff --git a/setup b/setup new file mode 100755 index 0000000..0f1e99f --- /dev/null +++ b/setup @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Minimum requirements to run ./build --download-dependencies +y= +if [ $# -eq 1 ]; then + y=-y +fi +apt-get update +apt-get install $y \ + git \ + python3 \ + python3-distutils \ +;