-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-debian.sh
executable file
·60 lines (57 loc) · 4.07 KB
/
create-debian.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
56
57
58
59
60
#!/bin/bash
echo "------ creating debian 10 buster ------"
rm -rf ./images/debian-10-buster.qcow2
wget https://cloud.debian.org/images/cloud/buster/latest/debian-10-genericcloud-amd64.qcow2 -O ./images/debian-10-buster.qcow2
echo "------ install pkg ------"
sudo virt-customize --install nfs-common --selinux-relabel -a ./images/debian-10-buster.qcow2
sudo virt-customize --install cifs-utils --selinux-relabel -a ./images/debian-10-buster.qcow2
sudo virt-customize --install qemu-guest-agent --selinux-relabel -a ./images/debian-10-buster.qcow2
echo "------ customize settings ------"
sudo virt-customize --run-command "mkdir /etc/docker" -a ./images/debian-10-buster.qcow2
cp ./config/debian/getty-d10 ./config/debian/getty@tty1.service
cp ./config/debian/cloud-d10.cfg ./config/debian/cloud.cfg
sudo virt-copy-in './config/debian/getty@tty1.service' /lib/systemd/system/ -a ./images/debian-10-buster.qcow2
sudo virt-copy-in './config/debian/cloud.cfg' /etc/cloud/ -a ./images/debian-10-buster.qcow2
sudo virt-copy-in './config/daemon.json' /etc/docker/ -a ./images/debian-10-buster.qcow2
echo "------ disable kernel auto update ------"
sudo virt-copy-in './config/ubuntu/20auto-upgrades' /etc/apt/apt.conf.d/ -a ./images/debian-10-buster.qcow2
sudo virt-sysprep -a ./images/debian-10-buster.qcow2
echo "------ Done ------"
echo "------ creating debian 11 bulleye ------"
rm -rf ./images/debian-11-bulleye.qcow2
wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2 -O ./images/debian-11-bulleye.qcow2
echo "------ install pkg ------"
sudo virt-customize --install nfs-common --selinux-relabel -a ./images/debian-11-bulleye.qcow2
sudo virt-customize --install cifs-utils --selinux-relabel -a ./images/debian-11-bulleye.qcow2
sudo virt-customize --install qemu-guest-agent --selinux-relabel -a ./images/debian-11-bulleye.qcow2
echo "------ customize settings ------"
sudo virt-customize --run-command "mkdir /etc/docker" -a ./images/debian-11-bulleye.qcow2
cp ./config/debian/getty-d11 ./config/debian/getty@tty1.service
cp ./config/debian/cloud-d11.cfg ./config/debian/cloud.cfg
sudo virt-copy-in './config/debian/getty@tty1.service' /lib/systemd/system/ -a ./images/debian-11-bulleye.qcow2
sudo virt-copy-in './config/debian/cloud.cfg' /etc/cloud/ -a ./images/debian-11-bulleye.qcow2
sudo virt-copy-in './config/daemon.json' /etc/docker/ -a ./images/debian-11-bulleye.qcow2
echo "------ disable kernel auto update ------"
sudo virt-copy-in './config/ubuntu/20auto-upgrades' /etc/apt/apt.conf.d/ -a ./images/debian-11-bulleye.qcow2
sudo virt-sysprep -a ./images/debian-11-bulleye.qcow2
echo "------ Done ------"
echo "------ creating debian 12 bookworm ------"
rm -rf ./images/debian-12-bookworm.qcow2
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2 -O ./images/debian-12-bookworm.qcow2
echo "------ install pkg ------"
sudo virt-customize --install nfs-common --selinux-relabel -a ./images/debian-12-bookworm.qcow2
sudo virt-customize --install cifs-utils --selinux-relabel -a ./images/debian-12-bookworm.qcow2
sudo virt-customize --install qemu-guest-agent --selinux-relabel -a ./images/debian-12-bookworm.qcow2
echo "------ customize settings ------"
sudo virt-customize --run-command "mkdir /etc/docker" -a ./images/debian-12-bookworm.qcow2
cp ./config/debian/getty-d12 ./config/debian/getty@tty1.service
cp ./config/debian/cloud-d12.cfg ./config/debian/cloud.cfg
sudo virt-copy-in './config/debian/getty@tty1.service' /lib/systemd/system/ -a ./images/debian-12-bookworm.qcow2
sudo virt-copy-in './config/debian/cloud.cfg' /etc/cloud/ -a ./images/debian-12-bookworm.qcow2
sudo virt-copy-in './config/daemon.json' /etc/docker/ -a ./images/debian-12-bookworm.qcow2
echo "------ disable kernel auto update ------"
sudo virt-copy-in './config/ubuntu/20auto-upgrades' /etc/apt/apt.conf.d/ -a ./images/debian-12-bookworm.qcow2
# echo "------ disable TCP Segmentation Offload (TSO) -----"
# sudo virt-copy-in './config/98-disable-tso.cfg' /etc/cloud/cloud.cfg.d/ -a ./images/debian-12-bookworm.qcow2
sudo virt-sysprep -a ./images/debian-12-bookworm.qcow2
echo "------ Done ------"