aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/config-no-initial-setup.sh
blob: f65e4d3a31e5221a01823ced86a73dab68b46adc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
image="$1"
if test "$image" = ""; then
	echo "usage: $0 <image>"
	exit 1
fi

WORK="${TMPDIR-/tmp}/${0##*/}-$$"
mkdir "$WORK" || exit 1
trap 'rm -rf "$WORK"' EXIT

cat <<EOF > "$WORK/script"

# turn off initial-setup
delete /etc/systemd/system/multi-user.target.wants/initial-setup.service
delete /etc/systemd/system/graphical.target.wants/initial-setup.service

EOF

set -ex
virt-customize -a "$image" --no-network --commands-from-file "$WORK/script"