forked from lefeck/ubuntu-autoinstall-generator-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-image.sh
55 lines (51 loc) · 2.27 KB
/
build-image.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# usage of the command line tool
function menu(){
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [h] [1] [2] [3] [4] [q]
💁 This script will create fully-automated Ubuntu release version 20 to 22 installation media.
Available options:
p Get the current menu
s Build the base image
n Build image with installer
a Build image with installer and local services, esxi only
ke Build image with installer and local services, only in the esxi for kvm
khs Build image with installer and local services, only in the hardware for kvm, block device is standard.
khn Build image with installer and local services, only in the hardware for kvm, block device is nvme.
q Exit script
EOF
}
menu
read -p "please input your build images ID: " value
case $value in
p)
menu
exit
;;
s)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-simple.yml -n jammy -d ubuntu22-autoinstall-simple.iso
;;
n)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-kvm-esxi.yml -n jammy -p package-name.txt -d ubuntu-autoinstall-pkgs.iso
;;
a)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-local-service.yml -n jammy -p package-name.txt -c example/config-all.sh \
-j rc.local -s /root/service -d ubuntu-autoinstall-local-service.iso
;;
ke)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-kvm-esxi.yml -n jammy -p package-name.txt -c example/config-kvm.sh \
-j rc-kvm.local -t template/silver-peak-template.xml -s /root/service -d ubuntu-autoinstall-silver-peak.iso -k 0
;;
khs)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-kvm-standard-hardware.yml -n jammy -p package-name.txt -c example/config-kvm.sh \
-j rc-kvm.local -t template/silver-peak-template.xml -s /root/service -d ubuntu22-silverpeak-standard.iso -k 0
;;
khn)
bash -x ubuntu-autoinstall-generator-tools.sh -a -u example/user-data-kvm-nvme-hardware.yml -n jammy -p package-name.txt -c example/config-kvm.sh \
-j rc-kvm.local -t template/silver-peak-template.xml -s /root/service -d ubuntu22-silverpeak-nvme.iso -k 0
;;
q)
exit
;;
esac