forked from osbuild/cockpit-composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm.install
executable file
·32 lines (27 loc) · 1.25 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
#!/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
# overriding osbuild-composer repo with nightly
mkdir -p /etc/osbuild-composer/repositories
cp /home/admin/files/rhel-87.json /etc/osbuild-composer/repositories/rhel-87.json
cp /home/admin/files/rhel-91.json /etc/osbuild-composer/repositories/rhel-91.json
ln -s /etc/osbuild-composer/repositories/rhel-91.json /etc/osbuild-composer/repositories/rhel-91-beta.json
ln -s /etc/osbuild-composer/repositories/rhel-91.json /etc/osbuild-composer/repositories/rhel-91-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; 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