Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openSUSE/obs-build
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfinder committed Oct 27, 2015
2 parents 7739422 + 1f2dca6 commit db93181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions build-vm-kvm
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,16 @@ vm_verify_options_kvm() {
done
fi

if test -c /dev/hwrng ; then
rng_dev="/dev/hwrng"
else
rng_dev="/dev/random"
if test -n "$kvm_rng_device" ; then
if test -c /dev/hwrng &&
test -f /sys/class/misc/hw_random/rng_current &&
test "$(cat /sys/class/misc/hw_random/rng_current)" != none; then
rng_dev="/dev/hwrng"
else
rng_dev="/dev/random"
fi
kvm_options="$kvm_options -object rng-random,filename=$rng_dev,id=rng0 -device $kvm_rng_device,rng=rng0"
fi
kvm_options="$kvm_options -object rng-random,filename=$rng_dev,id=rng0 -device $kvm_rng_device,rng=rng0"
}

vm_startup_kvm() {
Expand Down
4 changes: 2 additions & 2 deletions build-vm-lxc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ vm_startup_lxc() {
mount --bind "$BUILD_ROOT" "$LXCROOTFS"
EOF
chmod a+x "$LXCHOOK"
lxc-create -n "$LXCID" -f "$LXCCONF" || cleanup_and_exit 1
lxc-start -n "$LXCID" "$vm_init_script"
lxc-create -n "$LXCID" -t none -f "$LXCCONF" || cleanup_and_exit 1
lxc-start -n "$LXCID" -F "$vm_init_script"
BUILDSTATUS="$?"
test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
cleanup_and_exit "$BUILDSTATUS"
Expand Down

0 comments on commit db93181

Please sign in to comment.