Browse Source

Update bootstrap scripts to Ubuntu 20.04

tags/v1.3.0
dump_stack() 4 months ago
parent
commit
81234fc3a6
Signed by: Mikhail Klementev <blame@dumpstack.io> GPG Key ID: BE44DA8C062D87DC
3 changed files with 17 additions and 17 deletions
  1. 4
    4
      qemu/test.config.go
  2. 7
    7
      tools/qemu-debian-img/Dockerfile
  3. 6
    6
      tools/qemu-debian-img/bootstrap.sh

+ 4
- 4
qemu/test.config.go View File

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

+ 7
- 7
tools/qemu-debian-img/Dockerfile View File

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


+ 6
- 6
tools/qemu-debian-img/bootstrap.sh View File

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

Loading…
Cancel
Save