kpatch-build: download fedora src rpms from koji

yumdownloader is problematic because it doesn't allow you to download
anything but the latest released kernel.  It can also be slow at times.
Instead, for Fedora, download the RPMs from koji.
This commit is contained in:
Josh Poimboeuf 2014-09-12 10:47:36 -05:00
parent 6176353f8d
commit 74316588e8
2 changed files with 9 additions and 6 deletions

View File

@ -42,7 +42,7 @@ sudo yum install gcc kernel-devel elfutils elfutils-devel
Install the dependencies for the "kpatch-build" command:
```bash
sudo yum install rpmdevtools pesign yum-utils openssl
sudo yum install rpmdevtools pesign yum-utils openssl wget
sudo yum-builddep kernel
sudo debuginfo-install kernel

View File

@ -313,13 +313,16 @@ else
echo "Fedora/Red Hat distribution detected"
rpm -q --quiet rpmdevtools || die "rpmdevtools not installed"
echo "Downloading kernel source for $ARCHVERSION"
if [[ -z "$SRCRPM" ]]; then
rpm -q --quiet yum-utils || die "yum-utils not installed"
echo "Downloading kernel source for $ARCHVERSION"
yumdownloader --source --destdir "$TEMPDIR" "kernel-$ARCHVERSION" >> "$LOGFILE" 2>&1 || die
SRCRPM="$TEMPDIR/kernel-$KVER-$KREL.src.rpm"
if [[ $DISTRO = fedora ]]; then
(cd $TEMPDIR && wget http://kojipkgs.fedoraproject.org/packages/kernel/$KVER/$KREL/src/kernel-$KVER-$KREL.src.rpm >> "$LOGFILE" 2>&1 || die)
else
rpm -q --quiet yum-utils || die "yum-utils not installed"
yumdownloader --source --destdir "$TEMPDIR" "kernel-$ARCHVERSION" >> "$LOGFILE" 2>&1 || die
fi
fi
SRCRPM="$TEMPDIR/kernel-$KVER-$KREL.src.rpm"
echo "Unpacking kernel source"
rpmdev-setuptree >> "$LOGFILE" 2>&1 || die