rpm-ostree/tests/vmcheck/sync.sh
Colin Walters 687567d3ee Merge daemon binary into main binary
The actual problem I am trying to fix with this is fallout from the
introduction of `/usr/libexec/rpm-ostreed`, which required a SELinux
policy change.  Specifically for CentOS, the base policy is rev'd
slowly.

My hope was that by merging the daemon code back into `/usr/bin/rpm-ostree`
which is labeled `install_exec_t`, starting via systemd would do
the right thing.  It turns out that doesn't happen.

Now later, I'm picking this patch back up because I want to do multprocessing in
the daemon (and in the core), and it makes sense to share code between them,
because multiprocessing will need to go through a re-exec path.

Another benefit is we avoid duplicated text (libglnx, internal helpers) between
the two binaries.

Closes: #292
Approved by: jlebon
2017-02-07 16:07:09 +00:00

34 lines
683 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
if test -z "${INSIDE_VM:-}"; then
# do this in the host
. ${commondir}/libvm.sh
vm_setup
if ! vm_ssh_wait 30; then
echo "ERROR: A running VM is required for 'make vmcheck'."
exit 1
fi
set -x
cd ${topsrcdir}
rm insttree -rf
make install DESTDIR=$(pwd)/insttree
vm_rsync
$SSH "env INSIDE_VM=1 /var/roothome/sync/tests/vmcheck/sync.sh"
exit 0
else
# then do this in the VM
set -x
ostree admin unlock || :
rsync -rlv /var/roothome/sync/insttree/usr/ /usr/
restorecon -v /usr/bin/rpm-ostree
restorecon -v /usr/libexec/rpm-ostreed
systemctl restart rpm-ostreed
fi