From 1441edd81d61db30b1bf617aeac5507539579291 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 11 Jan 2017 11:18:27 +0100 Subject: [PATCH] Add mockboot: initialize a mock tree (if not already) and nspawn it --- mockboot | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 mockboot 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 -- 2.39.5