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