-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·84 lines (72 loc) · 2.59 KB
/
build
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
#!/bin/bash
set -euo pipefail
. /etc/os-release
# The main pet container (:latest) is the one based on cosa's version.
# Everything else is just for the buildroot.
matches_cosa_fver=
if [ "${ID}" = fedora ]; then
cosa_fver=$(curl -L https://raw.githubusercontent.com/coreos/coreos-assembler/main/Dockerfile | grep '^FROM ' | cut -f2 -d:)
if [ "${cosa_fver}" = "${VERSION_ID}" ]; then
matches_cosa_fver=1
fi
fi
# disable unneeded repos
(
cd /etc/yum.repos.d
if test -f fedora-cisco-openh264.repo; then
sed -i -e 's/enabled=1/enabled=0/' fedora-cisco-openh264.repo
fi
)
# chezmoi
curl -Lo chezmoi.rpm https://github.com/twpayne/chezmoi/releases/download/v2.47.1/chezmoi-2.47.1-x86_64.rpm
digest=$(sha256sum chezmoi.rpm | cut -f1 -d' ')
[ "${digest}" = 08b693d7bac64198ff73898a088b862ebf951f669b9fe50049d70751488ddf92 ]
dnf install -y chezmoi.rpm && rm chezmoi.rpm
# This gets pulled in by a weak dep of crypto-policies-scripts and conflicts with grub
if rpm -q sdubby &>/dev/null; then rpm -e sdubby; fi
# cosa deps
if [ "${matches_cosa_fver}" = 1 ]; then
git clone https://github.com/coreos/coreos-assembler
(
cd coreos-assembler
./build.sh configure_yum_repos
./build.sh install_rpms
./build.sh install_ocp_tools
)
fi
# rpm-ostree test deps
git clone https://github.com/coreos/rpm-ostree
(
cd rpm-ostree
ci/install-test-deps.sh
)
# everything in the FCOS buildroot image
git clone https://github.com/coreos/fedora-coreos-config
(
cd fedora-coreos-config
# The multi-arch hack added for SRPMs is currently breaking things, so
# temporarily revert it for now. We just care about x86_64 here anyway.
git config user.name 'User Name'
git config user.email '[email protected]'
git revert d972c54e3e0da491be26d02d43aae190ff70da5a
if [ "${ID}" != fedora ]; then
# Temporarily don't include ostree buildreqs on CentOS because of composefs
# https://github.com/ostreedev/ostree/pull/3255#issuecomment-2136070745
sed -i -e '/ostree/ d' ci/buildroot/buildroot-buildreqs.txt
# No matching package to install: 'opencsd-devel >= 1.2.1'
sed -i -e '/kernel/ d' ci/buildroot/buildroot-buildreqs.txt
# on CentOS, that repo doesn't exist
sed -i -e '/updates-testing/ d' ci/buildroot/install-buildroot.sh
fi
ci/buildroot/install-buildroot.sh
)
if [ "${ID}" != fedora ]; then
dnf config-manager --set-enabled crb
dnf install -y epel-release epel-next-release
fi
# install our packages
grep -hv '^#' deps.txt ${matches_cosa_fver:+deps-pet.txt} | xargs dnf install -y
# we want the host srv
rmdir /srv && ln -sT /run/host/srv /srv
# install rhsetup
cp rhsetup /usr/bin