From: Martin Pitt Date: Wed, 11 Jan 2017 10:18:27 +0000 (+0100) Subject: Add mockboot: initialize a mock tree (if not already) and nspawn it X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=1441edd81d61db30b1bf617aeac5507539579291;p=bin.git Add mockboot: initialize a mock tree (if not already) and nspawn it --- diff --git a/mockboot b/mockboot new file mode 100755 index 0000000..830427d --- /dev/null +++ b/mockboot @@ -0,0 +1,10 @@ +#!/bin/sh +# initialize a mock tree (if not already) and nspawn it +set -eu +ROOT=$(mock --print-root-path) +[ -d "$ROOT" ] || mock --quiet --init + +mock --offline --install dnf less sudo +mock --quiet --chroot -- sh -ec 'echo root:root | chpasswd; echo mockbuild:a | chpasswd; usermod -aG wheel mockbuild' + +sudo systemd-nspawn --boot --directory="$ROOT" --bind-ro="$HOME" --bind=/tmp