mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-25 11:13:15 +00:00
configure-hypervisor: Add option to build static qemu.
Add option to get configuration for an static qemu. Fixes: #66 Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
3dab5aabfc
commit
eebe067a50
@ -55,6 +55,7 @@ Options:
|
|||||||
is specified.
|
is specified.
|
||||||
-h : Display this help.
|
-h : Display this help.
|
||||||
-m : Display options one per line (includes continuation characters).
|
-m : Display options one per line (includes continuation characters).
|
||||||
|
-s : Generate options to build static
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@ -204,7 +205,7 @@ main()
|
|||||||
|
|
||||||
action=""
|
action=""
|
||||||
|
|
||||||
while getopts "dhm" opt
|
while getopts "dhms" opt
|
||||||
do
|
do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
d)
|
d)
|
||||||
@ -219,6 +220,9 @@ main()
|
|||||||
m)
|
m)
|
||||||
action="multi"
|
action="multi"
|
||||||
;;
|
;;
|
||||||
|
s)
|
||||||
|
static="true"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -304,6 +308,10 @@ main()
|
|||||||
qemu_options+=(security:--disable-static)
|
qemu_options+=(security:--disable-static)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n ${static} ]; then
|
||||||
|
qemu_options+=(misc:--static)
|
||||||
|
fi
|
||||||
|
|
||||||
# Not required as "-uuid ..." is always passed to the qemu binary
|
# Not required as "-uuid ..." is always passed to the qemu binary
|
||||||
qemu_options+=(size:--disable-uuid)
|
qemu_options+=(size:--disable-uuid)
|
||||||
|
|
||||||
@ -348,7 +356,7 @@ main()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Support Ceph RADOS Block Device (RBD)
|
# Support Ceph RADOS Block Device (RBD)
|
||||||
qemu_options+=(functionality:--enable-rbd)
|
[ -z "${static}" ] && qemu_options+=(functionality:--enable-rbd)
|
||||||
|
|
||||||
# In "passthrough" security mode
|
# In "passthrough" security mode
|
||||||
# (-fsdev "...,security_model=passthrough,..."), qemu uses a helper
|
# (-fsdev "...,security_model=passthrough,..."), qemu uses a helper
|
||||||
@ -398,7 +406,7 @@ main()
|
|||||||
# SECURITY: Link binary as a Position Independant Executable,
|
# SECURITY: Link binary as a Position Independant Executable,
|
||||||
# and take advantage of ASLR, making ROP attacks much harder to perform.
|
# and take advantage of ASLR, making ROP attacks much harder to perform.
|
||||||
# (https://wiki.debian.org/Hardening)
|
# (https://wiki.debian.org/Hardening)
|
||||||
_qemu_ldflags+=" -pie"
|
[ -z "${static}" ] && _qemu_ldflags+=" -pie"
|
||||||
|
|
||||||
# SECURITY: Disallow executing code on the stack.
|
# SECURITY: Disallow executing code on the stack.
|
||||||
_qemu_ldflags+=" -z noexecstack"
|
_qemu_ldflags+=" -z noexecstack"
|
||||||
|
Loading…
Reference in New Issue
Block a user