-
Notifications
You must be signed in to change notification settings - Fork 49
/
vm.install
executable file
·43 lines (38 loc) · 1.9 KB
/
vm.install
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
#!/bin/sh
# image-customize script to enable cockpit and osbuild-composer in test VMs
# The application RPM will be installed separately
set -eux
# on virt-install images with LVM, resize root partition to fill free space
VG=$(vgs --noheadings -o vg_name)
if [ -n "$VG" ]; then
echo -en "n\n\n\n\n\nw\n" | fdisk /dev/vda
pvcreate /dev/vda3
vgextend $VG /dev/vda3
lvextend -r -l +100%FREE $VG/root
fi
# Repositories in /etc/osbuild-composer/repositories are used only for on-premise
sudo mkdir -p /etc/osbuild-composer/repositories
sudo mkdir -p /etc/osbuild-composer/blueprints
# Copy rhel nightly overrides
if [ -d /home/admin/files ]; then
cp /home/admin/files/rhel-95.json /etc/osbuild-composer/repositories/rhel-95.json
cp /home/admin/files/rhel-9.6.json /etc/osbuild-composer/repositories/rhel-9.6.json
cp /home/admin/files/rhel-10.json /etc/osbuild-composer/repositories/rhel-10.0.json
cp /home/admin/files/*.toml /etc/osbuild-composer/blueprints/
else
cp test/files/rhel-95.json /etc/osbuild-composer/repositories/rhel-95.json
cp test/files/rhel-9.6.json /etc/osbuild-composer/repositories/rhel-9.6.json
cp test/files/rhel-10.json /etc/osbuild-composer/repositories/rhel-10.0.json
cp test/files/*.toml /etc/osbuild-composer/blueprints/
fi
ln -s /etc/osbuild-composer/repositories/rhel-95.json /etc/osbuild-composer/repositories/rhel-95-beta.json
ln -s /etc/osbuild-composer/repositories/rhel-95.json /etc/osbuild-composer/repositories/rhel-95-ga.json
# Allow cockpit port (9090) in INPUT chain
# Do not reload firewall rule during image generation
if type firewall-cmd >/dev/null 2>&1 && firewall-cmd --state > /dev/null 2>&1; then
firewall-cmd --add-service=cockpit --permanent
fi
# Make cockpit.socket auto-start when system started
systemctl enable --now cockpit.socket
# Make osbuild-composer.socket auto-start when system started
systemctl enable --now osbuild-composer.socket