1
0
mirror of https://github.com/dynup/kpatch synced 2025-03-25 04:16:39 +00:00

Merge pull request from spartacus06/ubuntu-support

Ubuntu support for kpatch-build
This commit is contained in:
Josh Poimboeuf 2014-04-29 11:31:38 -05:00
commit cde0f8d062

View File

@ -176,6 +176,9 @@ elif [[ -d "$SRCDIR" ]]; then
echo "Using cache at $SRCDIR"
else
if grep -q "Fedora" "/etc/issue" || grep -q "Red Hat" "/etc/issue"; then
echo "Fedora/Red Hat distribution detected"
rpm -q --quiet rpmdevtools || die "rpmdevtools not installed"
if [[ -z "$SRCRPM" ]]; then
@ -197,6 +200,24 @@ else
cp "$SRCDIR/.config" "$OBJDIR" || die
echo "-${ARCHVERSION##*-}" > "$SRCDIR/localversion" || die
elif grep -q "Ubuntu" "/etc/issue"; then
echo "Debian/Ubuntu distribution detected"
cd $TEMPDIR
echo "Downloading and unpacking kernel source for $ARCHVERSION"
apt-get source linux || die "'apt-get source linux' failed. you may need to run 'apt-get install dpkg-dev'"
mkdir -p "$OBJDIR"
mv linux-${ARCHVERSION%%-*} "$SRCDIR" || die
cp "/boot/config-${ARCHVERSION}" "$OBJDIR/.config" || die
echo "-${ARCHVERSION#*-}" > "$SRCDIR/localversion" || die
# for some reason the Ubuntu kernel versions don't follow the
# upstream SUBLEVEL; they are always at SUBLEVEL 0
sed -i "s/^SUBLEVEL.*/SUBLEVEL = 0/" "$SRCDIR/Makefile" || die
else
die "Unsupported distribution"
fi
fi
echo "Testing patch file"