-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy path00-dx.sh
More file actions
executable file
·140 lines (123 loc) · 3.53 KB
/
Copy path00-dx.sh
File metadata and controls
executable file
·140 lines (123 loc) · 3.53 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/bash
echo "::group:: ===$(basename "$0")==="
set -ouex pipefail
# Load secure COPR helpers
# shellcheck source=build_scripts/shared/copr-helpers.sh
source /ctx/build_scripts/shared/copr-helpers.sh
# NOTE:
# Packages are split into FEDORA_PACKAGES and COPR_PACKAGES to prevent
# malicious COPRs from injecting fake versions of Fedora packages.
# Fedora packages are installed first in bulk (safe).
# COPR packages are installed individually with isolated enablement.
# DX packages from Fedora repos - common to all versions
FEDORA_PACKAGES=(
android-tools
bcc
bcvk
bpftop
bpftrace
cockpit-bridge
cockpit-machines
cockpit-networkmanager
cockpit-ostree
cockpit-podman
cockpit-selinux
cockpit-storaged
cockpit-system
edk2-ovmf
flatpak-builder
incus
incus-agent
iotop
libvirt
libvirt-nss
lxc
nicstat
numactl
osbuild-selinux
p7zip
p7zip-plugins
podman-compose
podman-machine
podman-tui
qemu
qemu-char-spice
qemu-device-display-virtio-gpu
qemu-device-display-virtio-vga
qemu-device-usb-redirect
qemu-img
qemu-system-x86-core
qemu-user-binfmt
qemu-user-static
sysprof
trace-cmd
udica
virt-manager
virt-v2v
virt-viewer
ydotool
)
# rocm doesn't work well on nvidia
if [[ ! "${IMAGE_NAME}" =~ nvidia ]]; then
FEDORA_PACKAGES+=("rocm-hip" "rocm-opencl" "rocm-smi")
fi
echo "Installing ${#FEDORA_PACKAGES[@]} DX packages from Fedora repos..."
dnf5 -y install "${FEDORA_PACKAGES[@]}"
# Docker packages from their repo
dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo
sed -i "s/enabled=.*/enabled=0/g" /etc/yum.repos.d/docker-ce.repo
dnf -y install --enablerepo=docker-ce-stable \
containerd.io \
docker-buildx-plugin \
docker-ce \
docker-ce-cli \
docker-compose-plugin \
docker-model-plugin
# VSCode package from Microsoft repo
echo "Installing VSCode from official repo..."
tee /etc/yum.repos.d/vscode.repo <<'EOF'
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF
sed -i "s/enabled=.*/enabled=0/g" /etc/yum.repos.d/vscode.repo
dnf -y install --enablerepo=code \
code
# DX Copr packages using isolated enablement (secure)
echo "Installing DX COPR packages with isolated repo enablement..."
copr_install_isolated "karmab/kcli" "kcli"
copr_install_isolated "ublue-os/packages" "ublue-os-libvirt-workarounds"
# DX packages to exclude - common to all versions
EXCLUDED_PACKAGES=()
# Version-specific package exclusions for DX
case "$FEDORA_MAJOR_VERSION" in
43)
EXCLUDED_PACKAGES+=()
;;
esac
# Remove excluded packages if they are installed
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
readarray -t INSTALLED_EXCLUDED < <(rpm -qa --queryformat='%{NAME}\n' "${EXCLUDED_PACKAGES[@]}" 2>/dev/null || true)
if [[ "${#INSTALLED_EXCLUDED[@]}" -gt 0 ]]; then
dnf5 -y remove "${INSTALLED_EXCLUDED[@]}"
else
echo "No excluded packages found to remove."
fi
fi
# Enable DX services
if rpm -q docker-ce >/dev/null; then
systemctl enable docker.socket
fi
systemctl enable podman.socket
systemctl enable ublue-os-libvirt-workarounds.service
systemctl enable --global aurora-dx-user-vscode.service
# Disable RPM Fusion repos
for i in /etc/yum.repos.d/rpmfusion-*.repo; do
if [[ -f "$i" ]]; then
sed -i 's@enabled=1@enabled=0@g' "$i"
fi
done
echo "::endgroup::"