Skip to content

Commit

Permalink
create-installimg: split yum config templates to allow reuse for inst…
Browse files Browse the repository at this point in the history
…all iso
  • Loading branch information
ydirson committed Apr 18, 2023
1 parent 1e15b1e commit 8f719ff
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 84 deletions.
20 changes: 20 additions & 0 deletions configs/8.2.testing/yum-repos.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-testing]
name=xcpng-$releasever - Testing
baseurl=@@SRCURL@@/testing/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
22 changes: 0 additions & 22 deletions configs/8.2.testing/yum.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,3 @@ best=1
protected_packages=
skip_missing_names_on_install=0
tsflags=nodocs

# repos
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-testing]
name=xcpng-$releasever - Testing
baseurl=@@SRCURL@@/testing/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
13 changes: 13 additions & 0 deletions configs/8.2.updates/yum-repos.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
15 changes: 0 additions & 15 deletions configs/8.2.updates/yum.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,3 @@ best=1
protected_packages=
skip_missing_names_on_install=0
tsflags=nodocs

# repos
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
6 changes: 6 additions & 0 deletions configs/8.3.0/yum-repos.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
8 changes: 0 additions & 8 deletions configs/8.3.0/yum.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ best=1
protected_packages=
skip_missing_names_on_install=0
tsflags=nodocs

# repos
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
20 changes: 20 additions & 0 deletions configs/8.3.testing/yum-repos.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-testing]
name=xcpng-$releasever - Testing
baseurl=@@SRCURL@@/testing/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
22 changes: 0 additions & 22 deletions configs/8.3.testing/yum.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,3 @@ best=1
protected_packages=
skip_missing_names_on_install=0
tsflags=nodocs

# repos
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-testing]
name=xcpng-$releasever - Testing
baseurl=@@SRCURL@@/testing/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
13 changes: 13 additions & 0 deletions configs/8.3.updates/yum-repos.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
15 changes: 0 additions & 15 deletions configs/8.3.updates/yum.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,3 @@ best=1
protected_packages=
skip_missing_names_on_install=0
tsflags=nodocs

# repos
[xcpng-base]
name=xcpng-$releasever - Base
baseurl=@@SRCURL@@/base/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False

[xcpng-updates]
name=xcpng-$releasever - Updates
baseurl=@@SRCURL@@/updates/@@RPMARCH@@/
gpgkey=https://xcp-ng.org/RPM-GPG-KEY-xcpng
failovermethod=priority
skip_if_unavailable=False
6 changes: 4 additions & 2 deletions scripts/create-installimg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ DIST="$1"
confdir="$topdir/configs/$DIST"

[ -r "$confdir/yum.conf.tmpl" ] || die "cannot find yum config for '$DIST'"
[ -r "$confdir/yum-repos.conf.tmpl" ] || die "cannot find yum-repos config for '$DIST'"
[ -r "$confdir/packages.lst" ] || die "cannot find package list for '$DIST'"
maybe_set_srcurl "$DIST"
[ -n "$OUTPUT_IMG" ] || OUTPUT_IMG="install-$DIST-$RPMARCH.img"
Expand All @@ -72,10 +73,11 @@ command -v yum >/dev/null || die "required tool not found: yum"
# expand template
YUMCONF=$(mktemp yum-XXXXXX.conf)
CLEANUP_FILES+=("$YUMCONF")
sed \
cat "$confdir/yum.conf.tmpl" "$confdir/yum-repos.conf.tmpl" |
sed \
-e "s,@@SRCURL@@,$SRCURL," \
-e "s,@@RPMARCH@@,$RPMARCH," \
< "$confdir/yum.conf.tmpl" > "$YUMCONF"
> "$YUMCONF"
[ -z "$VERBOSE" ] || cat "$YUMCONF"

ROOTFS=$(mktemp -d "$PWD/rootfs-XXXXXX")
Expand Down

0 comments on commit 8f719ff

Please sign in to comment.