summaryrefslogtreecommitdiff
path: root/server-build/my-simple-cdd/02-setup-system.sh
blob: 5d89a543d1229a7f2ae1082601b130887eec0513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Run QEMU with the installer.iso image (created via make-iso.sh) to
# create a system image "talerwoo.img".
#

TARGET=talerwoo.img

if [ -f $TARGET ]
then
	echo "Confirm removal of existing $TARGET by pressing \"y\":"
	rm -i $TARGET
	if [ -f $TARGET ]
	then
		echo "proceed with installation (see 00-README)"
		exit 0
	fi
fi

# Create target image file.  Note: Debian has a minimum
# size for automatic partitioning >= 10G these days!
qemu-img create -q -f qcow2 $TARGET 32G > /dev/null 2>&1

echo "installing system - please be patient (approx. 5-10 minutes)!"

qemu-system-x86_64 -m 4G -enable-kvm -hda $TARGET \
	-cdrom installer.iso -display none > /dev/null 2>&1

echo "run system (first run) - please be patient (approx 10-15 minutes)!"

qemu-system-x86_64 -m 4G -enable-kvm -net nic,model=rtl8139 \
	-net user,hostfwd=tcp::2222-:22,hostfwd=tcp::7776-:7776,hostfwd=tcp::9999-:80 \
	-hda $TARGET -display none > /dev/null 2>&1

echo "proceed with installation (see 00-README)"