docker: split minimum setup to separate script

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-17 00:00:00 +00:00
parent 0bd53a46f6
commit c2ac65a807
5 changed files with 18 additions and 9 deletions

View File

@@ -2,3 +2,4 @@
# with a volume.
*
.*
!setup

View File

@@ -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

1
build
View File

@@ -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',

4
run
View File

@@ -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:

12
setup Executable file
View File

@@ -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 \
;