summaryrefslogtreecommitdiff
path: root/others/vm3/image
diff options
context:
space:
mode:
Diffstat (limited to 'others/vm3/image')
-rwxr-xr-xothers/vm3/image/fedora.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/others/vm3/image/fedora.sh b/others/vm3/image/fedora.sh
index 109f4fc..cd05e10 100755
--- a/others/vm3/image/fedora.sh
+++ b/others/vm3/image/fedora.sh
@@ -8,15 +8,16 @@
8 8
9image_url="https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2" 9image_url="https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2"
10 10
11sshkeysdir="/root/keys" 11sshkeysdir="/root/k"
12 12
13scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #&& echo $scriptdir 13scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #&& echo $scriptdir
14dir_path="/var/lib/libvirt/images/.image_store" 14dir_path="/var/lib/libvirt/images/.image_store"
15src_file="${dir_path}/fedora40.qcow2" 15src_file="${dir_path}/fedora40.qcow2"
16config_dir="/var/lib/libvirt/images/.temp" 16config_dir="/var/lib/libvirt/images/.temp"
17user_data="${config_dir}/user_data" 17user_data="${config_dir}/user-data"
18meta_data="${config_dir}/meta_data" 18meta_data="${config_dir}/meta-data"
19seed_iso="${config_dir}/seed.iso" 19seed_iso="${config_dir}/seed.iso"
20# note that cloud init specifically looks for "user-data" and "meta-data" in the seed.iso disk. do not deviate from the naming convention.
20 21
21if [ $# -ne 1 ]; then 22if [ $# -ne 1 ]; then
22 echo "Usage: $0 <vm-name>" 23 echo "Usage: $0 <vm-name>"
@@ -43,13 +44,14 @@ cat >> "$user_data" << 'EOF'
43 sudo: ['ALL=(ALL) NOPASSWD:ALL'] 44 sudo: ['ALL=(ALL) NOPASSWD:ALL']
44 groups: wheel 45 groups: wheel
45 shell: /bin/bash 46 shell: /bin/bash
47 password: 123
46runcmd: 48runcmd:
47 - sudo growpart /dev/sda 1 49 - sudo growpart /dev/sda 1
48 - sudo xfs_growfs / 50 - sudo xfs_growfs /
49 - sudo dnf install -y vim git 51 - sudo dnf install -y vim git
50 - cd /home/user 52 - cd /home/user
51 - git clone https://git.0nom.ch/setup 53 - #git clone https://git.0nom.ch/setup
52 - sudo ./setup/setup.sh 54 - #sudo ./setup/setup.sh
53 - touch /home/user/runcmd_done 55 - touch /home/user/runcmd_done
54EOF 56EOF
55 57