mirror of
https://github.com/dynup/kpatch
synced 2025-03-25 04:16:39 +00:00
Merge pull request #153 from spartacus06/ubuntu-support
Ubuntu support for kpatch-build
This commit is contained in:
commit
cde0f8d062
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user