From 81234fc3a678922e627c80f92ab4a3afbb2f24db Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sat, 30 May 2020 11:37:00 +0000 Subject: [PATCH] Update bootstrap scripts to Ubuntu 20.04 --- qemu/test.config.go | 8 ++++---- tools/qemu-debian-img/Dockerfile | 14 +++++++------- tools/qemu-debian-img/bootstrap.sh | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/qemu/test.config.go b/qemu/test.config.go index b5eca3a..74eed8f 100644 --- a/qemu/test.config.go +++ b/qemu/test.config.go @@ -4,7 +4,7 @@ package qemu -const testConfigVmlinuz = "../tools/qemu-debian-img/ubuntu1804.vmlinuz" -const testConfigInitrd = "../tools/qemu-debian-img/ubuntu1804.initrd" -const testConfigRootfs = "../tools/qemu-debian-img/ubuntu1804.img" -const testConfigSampleKo = "../tools/qemu-debian-img/ubuntu1804.ko" +const testConfigVmlinuz = "../tools/qemu-debian-img/ubuntu2004.vmlinuz" +const testConfigInitrd = "../tools/qemu-debian-img/ubuntu2004.initrd" +const testConfigRootfs = "../tools/qemu-debian-img/ubuntu2004.img" +const testConfigSampleKo = "../tools/qemu-debian-img/ubuntu2004.ko" diff --git a/tools/qemu-debian-img/Dockerfile b/tools/qemu-debian-img/Dockerfile index 40c4ec0..3e8f02d 100644 --- a/tools/qemu-debian-img/Dockerfile +++ b/tools/qemu-debian-img/Dockerfile @@ -4,24 +4,24 @@ # # Usage: # -# $ docker build -t gen-ubuntu1804-image . -# $ docker run --privileged -v $(pwd):/shared -t gen-ubuntu1804-image +# $ docker build -t gen-ubuntu2004-image . +# $ docker run --privileged -v $(pwd):/shared -t gen-ubuntu2004-image # -# ubuntu1804.img will be created in current directory. You can change $(pwd) to +# ubuntu2004.img will be created in current directory. You can change $(pwd) to # different directory to use different destination for image. # -FROM ubuntu:18.04 +FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt update -RUN apt install -y debootstrap qemu +RUN apt install -y debootstrap qemu-utils RUN apt install -y linux-image-generic ENV TMPDIR=/tmp/ubuntu ENV IMAGEDIR=/tmp/image -ENV IMAGE=/shared/ubuntu1804.img +ENV IMAGE=/shared/ubuntu2004.img ENV REPOSITORY=http://archive.ubuntu.com/ubuntu -ENV RELEASE=bionic +ENV RELEASE=focal RUN mkdir $IMAGEDIR diff --git a/tools/qemu-debian-img/bootstrap.sh b/tools/qemu-debian-img/bootstrap.sh index a37d9fb..0b9f205 100755 --- a/tools/qemu-debian-img/bootstrap.sh +++ b/tools/qemu-debian-img/bootstrap.sh @@ -1,9 +1,9 @@ #!/bin/sh -eux cd $(dirname $(realpath $0)) -docker build -t gen-ubuntu1804-image . -docker run --privileged -v $(pwd):/shared -t gen-ubuntu1804-image -RUN="docker run -v $(pwd):/shared -t gen-ubuntu1804-image" -$RUN sh -c 'chmod 644 /vmlinuz && cp /vmlinuz /shared/ubuntu1804.vmlinuz' -$RUN sh -c 'cp /initrd.img /shared/ubuntu1804.initrd' -$RUN sh -c 'cp $(find /lib/modules -name test_static_key_base.ko) /shared/ubuntu1804.ko' +docker build -t gen-ubuntu2004-image . +docker run --privileged -v $(pwd):/shared -t gen-ubuntu2004-image +RUN="docker run -v $(pwd):/shared -t gen-ubuntu2004-image" +$RUN sh -c 'chmod 644 /vmlinuz && cp /vmlinuz /shared/ubuntu2004.vmlinuz' +$RUN sh -c 'cp /initrd.img /shared/ubuntu2004.initrd' +$RUN sh -c 'cp $(find /lib/modules -name test_static_key_base.ko) /shared/ubuntu2004.ko'