Commit 80d7f4b0 authored by Xiaowu Zhang's avatar Xiaowu Zhang

kwm: extend kvm 's buildout to include UEFI Secure boot

parent be655d15
[buildout]
extends =
../make/buildout.cfg
../git/buildout.cfg
../libuuid/buildout.cfg
../ffmpeg/buildout.cfg
../bison/buildout.cfg
../flex/buildout.cfg
../m4/buildout.cfg
parts =
edk2
[acpica]
recipe = slapos.recipe.cmmi
url = https://acpica.org/sites/acpica/files/acpica-unix-20200717.tar.gz
md5sum = c9b17a05afc285c48ebb3a8cbab006f3
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = :
#XXXX why acpica ends with empty folder
make-targets = ${make:location}/bin/make iasl
&& mv * ${:location}
environment =
PATH=${bison:location}/bin:${flex:location}/bin:${m4:location}/bin:%(PATH)s
[edk2-config]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}/target.txt
template = inline:
ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc
TARGET_ARCH = X64
TARGET = RELEASE
TOOL_CHAIN_CONF = Conf/tools_def.txt
TOOL_CHAIN_TAG = GCC5
MAX_CONCURRENT_THREAD_NUMBER = 1
BUILD_RULE_CONF = Conf/build_rule.txt
[edk2xxxxxxxxxxx]
recipe = slapos.recipe.cmmi
path = ${edk2-src:location}
configure-command = :
make-binary =
make-targets = cd ${edk2-src:location}
&& ${git:location}/bin/git submodule update --init
&& ${make:location}/bin/make -C BaseTools
&& cp ${edk2-config:rendered} Conf/target.txt
&& bash -c ". edksetup.sh && build"
environment =
C_INCLUDE_PATH=${libuuid:location}/include
LIBRARY_PATH=${libuuid:location}/lib
PATH=${acpica:location}/generate/unix/bin:${nasm:location}/bin:%(PATH)s
[edk2UYYYYYYYYYYYYY]
recipe = plone.recipe.command
stop-on-error = true
repository = https://github.com/tianocore/edk2.git
commit= 872f953262d68a11da7bc2fb3ded16df234b8700
location = ${buildout:parts-directory}/${:_buildout_section_name_}
path = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git
#command = export GIT_SSL_NO_VERIFY=true; export HOME=${:location}; (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${:git-binary} submodule update --init && cd support/jsdav && PATH=${nodejs-0.4:location}/bin:$PATH LDFLAGS=-L${libxml2:location}/lib ${:npm-binary} install) || (rm -fr ${:location}; exit 1)
#command = export C_INCLUDE_PATH=${libuuid:location}/include; export LIBRARY_PATH=${libuuid:location}/lib; export PATH=${acpica:location}/generate/unix/bin:${nasm:location}/bin:$PATH; (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${:git-binary} submodule update --init && ${make:location}/bin/make -C BaseTools && cp ${edk2-config:rendered} Conf/target.txt && bash -c ". edksetup.sh && build") || (exit 1)
command = bash -c 'export C_INCLUDE_PATH=${libuuid:location}/include; export LIBRARY_PATH=${libuuid:location}/lib; export PATH=${acpica:location}/generate/unix/bin:${nasm:location}/bin:$PATH; (cd ${:location} && ${make:location}/bin/make -C BaseTools && cp ${edk2-config:rendered} Conf/target.txt && . edksetup.sh && build)'
update-command =
[edk2]
recipe = slapos.recipe.build
repository = https://github.com/tianocore/edk2.git
commit= 872f953262d68a11da7bc2fb3ded16df234b8700
location = ${buildout:parts-directory}/${:_buildout_section_name_}
path = ${buildout:parts-directory}/${:_buildout_section_name_}/Build/OvmfX64/RELEASE_GCC5/FV/OVMF.fd
git-binary = ${git:location}/bin/git
C_INCLUDE_PATH=${libuuid:location}/include
LIBRARY_PATH=${libuuid:location}/lib
PATH=${acpica:location}/generate/unix/bin:${nasm:location}/bin:%(PATH)s
rendered = ${edk2-config:rendered}
install =
import subprocess, os, shutil
env = {
'PATH':options['PATH'] + ':' + os.environ['PATH'],
'C_INCLUDE_PATH':options['C_INCLUDE_PATH'],
'LIBRARY_PATH':options['LIBRARY_PATH']
}
subprocess.check_call('bash -c "(git clone %s %s && cd %s && git reset --hard %s && git submodule update --init && make -C BaseTools && cp %s Conf/target.txt && . edksetup.sh && build -D SECURE_BOOT_ENABLE=TRUE) || (rm -fr %s; exit 1)"' %
(options['repository'], options['location'], options['location'], options['commit'], options['rendered'], options['location']), env=env, shell=True)
...@@ -17,8 +17,8 @@ extends = ...@@ -17,8 +17,8 @@ extends =
[qemu] [qemu]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://download.qemu.org/qemu-4.1.1.tar.xz url = https://download.qemu.org/qemu-4.2.0.tar.xz
md5sum = 53879f792ef2675c6c5e6cbf5cc1ac6c #md5sum = 53879f792ef2675c6c5e6cbf5cc1ac6c
configure-options = configure-options =
--target-list="$(uname -m 2>/dev/null|sed 's,^i[456]86$,i386,')-softmmu" --target-list="$(uname -m 2>/dev/null|sed 's,^i[456]86$,i386,')-softmmu"
--enable-system --enable-system
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = e6d5c7bb627b4f1d3e7c99721b7c58fe #md5sum = 3a8030e2c0fa15ae7faab7fd325ca8af
[template-kvm] [template-kvm]
filename = instance-kvm.cfg.jinja2 filename = instance-kvm.cfg.jinja2
md5sum = 23493c541efef97ac5fe435114910b8e #md5sum = 23493c541efef97ac5fe435114910b8e
[template-kvm-cluster] [template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in filename = instance-kvm-cluster.cfg.jinja2.in
...@@ -55,7 +55,7 @@ md5sum = b7e87479a289f472b634a046b44b5257 ...@@ -55,7 +55,7 @@ md5sum = b7e87479a289f472b634a046b44b5257
[template-kvm-run] [template-kvm-run]
filename = template/template-kvm-run.in filename = template/template-kvm-run.in
md5sum = a97b8462955dd422a30fbe02d6906172 #md5sum = a97b8462955dd422a30fbe02d6906172
[template-kvm-controller] [template-kvm-controller]
filename = template/kvm-controller-run.in filename = template/kvm-controller-run.in
......
...@@ -306,6 +306,7 @@ ipv4 = ${slap-network-information:local-ipv4} ...@@ -306,6 +306,7 @@ ipv4 = ${slap-network-information:local-ipv4}
ipv6 = ${slap-network-information:global-ipv6} ipv6 = ${slap-network-information:global-ipv6}
vnc-ip = ${:ipv4} vnc-ip = ${:ipv4}
vnc-port = 5901 vnc-port = 5901
edk2-path = {{ edk2_path }}
default-cdrom-iso = {{ debian_amd64_netinst_location }} default-cdrom-iso = {{ debian_amd64_netinst_location }}
{% if boot_image_url_list_enabled %} {% if boot_image_url_list_enabled %}
......
...@@ -89,6 +89,7 @@ extra-context = ...@@ -89,6 +89,7 @@ extra-context =
raw novnc_location ${noVNC:location} raw novnc_location ${noVNC:location}
raw netcat_bin ${netcat:location}/bin/netcat raw netcat_bin ${netcat:location}/bin/netcat
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
raw edk2_path ${edk2:path}
raw python_eggs_executable ${buildout:bin-directory}/${python-with-eggs:interpreter} raw python_eggs_executable ${buildout:bin-directory}/${python-with-eggs:interpreter}
raw qemu_executable_location ${qemu:location}/bin/qemu-system-x86_64 raw qemu_executable_location ${qemu:location}/bin/qemu-system-x86_64
raw qemu_img_executable_location ${qemu:location}/bin/qemu-img raw qemu_img_executable_location ${qemu:location}/bin/qemu-img
......
...@@ -12,6 +12,7 @@ extends = ...@@ -12,6 +12,7 @@ extends =
../../component/pycurl/buildout.cfg ../../component/pycurl/buildout.cfg
../../component/numpy/buildout.cfg ../../component/numpy/buildout.cfg
../../component/gzip/buildout.cfg ../../component/gzip/buildout.cfg
../../component/edk2/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../component/nodejs/buildout.cfg ../../component/nodejs/buildout.cfg
../../stack/resilient/buildout.cfg ../../stack/resilient/buildout.cfg
......
...@@ -27,7 +27,7 @@ disk_type = '{{ parameter_dict.get("disk-type") }}' ...@@ -27,7 +27,7 @@ disk_type = '{{ parameter_dict.get("disk-type") }}'
disk_format = '{{ parameter_dict.get("disk-format", "qcow2")}}' disk_format = '{{ parameter_dict.get("disk-format", "qcow2")}}'
disk_format = disk_format \ disk_format = disk_format \
if disk_format in ['qcow2', 'raw', 'vdi', 'vmdk', 'cloop', 'qed'] else 'qcow2' if disk_format in ['qcow2', 'raw', 'vdi', 'vmdk', 'cloop', 'qed'] else 'qcow2'
edk2_path = '{{ parameter_dict.get("edk2-path") }}'
socket_path = '{{ parameter_dict.get("socket-path") }}' socket_path = '{{ parameter_dict.get("socket-path") }}'
nbd_list = (('{{ parameter_dict.get("nbd-host") }}', nbd_list = (('{{ parameter_dict.get("nbd-host") }}',
{{ parameter_dict.get("nbd-port") }}), {{ parameter_dict.get("nbd-port") }}),
...@@ -309,6 +309,7 @@ kvm_argument_list = [qemu_path, ...@@ -309,6 +309,7 @@ kvm_argument_list = [qemu_path,
'-boot', 'order=cd,menu=on', '-boot', 'order=cd,menu=on',
'-qmp', 'unix:%s,server,nowait' % socket_path, '-qmp', 'unix:%s,server,nowait' % socket_path,
'-pidfile', pid_file_path, '-msg', 'timestamp=on', '-pidfile', pid_file_path, '-msg', 'timestamp=on',
'-bios', edk2_path,
'-D', logfile, '-D', logfile,
'-nodefaults', '-nodefaults',
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment