Skip to content

Commit d3f524e

Browse files
committed
ubuntu-18.04.1.0-live-server-amd64.sh factor out with desktop
1 parent 4c8ee24 commit d3f524e

5 files changed

+20
-23
lines changed

ubuntu-18.04-server-cloudimg-amd64.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
# Tested on: Ubuntu 18.10.
4+
35
set -eux
46

57
# Parameters.
@@ -46,7 +48,8 @@ EOF
4648
cloud-localds "$user_data_img" "$user_data"
4749
fi
4850

49-
# Run.
51+
# Run. The first boot will spend some time generating keys
52+
# on "cloud-init job", but further boots will be faster.
5053
qemu-system-x86_64 \
5154
-drive "file=${img_snapshot},format=qcow2" \
5255
-drive "file=${user_data_img},format=raw" \
@@ -56,5 +59,5 @@ qemu-system-x86_64 \
5659
-netdev user,id=net0 \
5760
-serial mon:stdio \
5861
-smp 2 \
59-
-vga virtio \
62+
"$@" \
6063
;

ubuntu-18.04-server-cloudimg-arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ qemu-system-aarch64 \
5959
-cpu cortex-a57 \
6060
-device rtl8139,netdev=net0 \
6161
-device virtio-blk-device,drive=hd0 \
62-
-drive "file=${user_data_img},format=raw" \
6362
-drive "if=none,file=${img_snapshot},id=hd0" \
63+
-drive "file=${user_data_img},format=raw" \
6464
-m 2G \
6565
-netdev user,id=net0 \
6666
-nographic \

ubuntu-18.04.1-desktop-amd64.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55

66
set -eux
77

8-
# Parameters.
98
id=ubuntu-18.04.1-desktop-amd64
9+
OPTIND=1
10+
while getopts i: OPT; do
11+
case "$OPT" in
12+
i)
13+
id="$OPTARG"
14+
;;
15+
esac
16+
done
17+
shift "$(($OPTIND - 1))"
18+
1019
disk_img="${id}.img.qcow2"
1120
disk_img_snapshot="${id}.snapshot.qcow2"
1221
iso="${id}.iso"
@@ -43,6 +52,7 @@ qemu-system-x86_64 \
4352
-drive "file=${disk_img_snapshot},format=qcow2" \
4453
-enable-kvm \
4554
-m 2G \
55+
-serial mon:stdio \
4656
-smp 2 \
4757
-soundhw hda \
4858
-vga virtio \

ubuntu-18.04.1-server-arm64.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -eux
44

5+
# TODO: installer step "Select and install software" fails.
6+
# Where can I find logs saying exactly what failed?
57
# Tested on Ubuntu 18.10.
68
# - https://superuser.com/questions/942657/how-to-test-arm-ubuntu-under-qemu-the-easiest-way
79
# - https://askubuntu.com/questions/797599/how-to-run-ubuntu-16-04-arm-in-qemu

ubuntu-18.04.1.0-live-server-amd64.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,4 @@ set -eu
33
# Tested on host: Ubuntu 18.10.
44
# TODO: get working without GUI:
55
# https://askubuntu.com/questions/1108334/how-to-boot-and-install-the-ubuntu-server-image-on-qemu-nographic-without-the-g
6-
id=ubuntu-18.04.1.0-live-server-amd64
7-
iso="${id}.iso"
8-
img="${id}.img.qcow2"
9-
if [ ! -f "$iso" ]; then
10-
wget "http://releases.ubuntu.com/18.04/${iso}"
11-
fi
12-
if [ ! -f "$img" ]; then
13-
qemu-img create -f qcow2 "$img" 1T
14-
fi
15-
qemu-system-x86_64 \
16-
-cdrom "$iso" \
17-
-drive "file=${img},format=qcow2" \
18-
-enable-kvm \
19-
-m 2G \
20-
-serial mon:stdio \
21-
-smp 2 \
22-
-vga virtio \
23-
"$@" \
24-
;
6+
./ubuntu-18.04.1-desktop-amd64.sh -i ubuntu-18.04.1.0-live-server-amd64 -- "$@"

0 commit comments

Comments
 (0)