forked from ublue-os/ucore-kmods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-prep.sh
executable file
·64 lines (48 loc) · 1.61 KB
/
build-prep.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
61
62
63
64
#!/bin/sh
set -oeux pipefail
### PREPARE REPOS
ARCH="$(rpm -E '%_arch')"
RELEASE="$(rpm -E '%fedora')"
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-cisco-openh264.repo
# repo for nvidia builds
curl -sL --output-dir /etc/yum.repos.d --remote-name \
https://negativo17.org/repos/fedora-nvidia.repo
# enable testing repos if not enabled on testing stream
if [[ "testing" == "${COREOS_VERSION}" ]]; then
for REPO in $(ls /etc/yum.repos.d/fedora-updates-testing{,-modular}.repo); do
if [[ "$(grep enabled=1 ${REPO} > /dev/null; echo $?)" == "1" ]]; then
echo "enabling $REPO" && \
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' ${REPO};
fi;
done;
fi
# enable RPMs with alternatives to create them in this image build
mkdir -p /var/lib/alternatives
find /tmp/
rpm-ostree install \
fedora-repos-archive
### PREPARE BUILD ENV
# stuff for akmods
rpm-ostree install \
akmods \
dnf \
mock
# stuff for dkms
rpm-ostree install \
autoconf \
automake \
dkms \
git \
libtool \
ncompress
if [[ ! -s "/tmp/certs/private_key.priv" ]]; then
echo "WARNING: Using test signing key. Run './generate-akmods-key' for production builds."
cp /tmp/certs/private_key.priv{.test,}
cp /tmp/certs/public_key.der{.test,}
fi
install -Dm644 /tmp/certs/public_key.der /etc/pki/akmods/certs/public_key.der
install -Dm644 /tmp/certs/private_key.priv /etc/pki/akmods/private/private_key.priv
# protect against incorrect permissions in tmp dirs which can break akmods builds
chmod 1777 /tmp /var/tmp
# create a directory for later copying of resulting artifacts
mkdir -p /var/cache/rpms/kmods