mirror of
https://github.com/dynup/kpatch
synced 2025-04-04 23:29:23 +00:00
kpatch-build: add debian support
This commit is contained in:
parent
d3550bfc3a
commit
0459810dd3
@ -256,6 +256,12 @@ elif [[ $DISTRO = ubuntu ]]; then
|
|||||||
[[ -z $VMLINUX ]] && VMLINUX=/usr/lib/debug/boot/vmlinux-$ARCHVERSION
|
[[ -z $VMLINUX ]] && VMLINUX=/usr/lib/debug/boot/vmlinux-$ARCHVERSION
|
||||||
[[ -e "$VMLINUX" ]] || die "linux-image-$ARCHVERSION-dbgsym not installed"
|
[[ -e "$VMLINUX" ]] || die "linux-image-$ARCHVERSION-dbgsym not installed"
|
||||||
|
|
||||||
|
export PATH=/usr/lib/ccache:$PATH
|
||||||
|
|
||||||
|
elif [[ $DISTRO = debian ]]; then
|
||||||
|
[[ -z $VMLINUX ]] && VMLINUX=/usr/lib/debug/lib/modules/$ARCHVERSION/vmlinux
|
||||||
|
[[ -e "$VMLINUX" ]] || die "linux-image-$ARCHVERSION-dbg not installed"
|
||||||
|
|
||||||
export PATH=/usr/lib/ccache:$PATH
|
export PATH=/usr/lib/ccache:$PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -307,7 +313,7 @@ else
|
|||||||
|
|
||||||
elif [[ $DISTRO = ubuntu ]]; then
|
elif [[ $DISTRO = ubuntu ]]; then
|
||||||
|
|
||||||
echo "Debian/Ubuntu distribution detected"
|
echo "Ubuntu distribution detected"
|
||||||
|
|
||||||
# url may be changed for a different mirror
|
# url may be changed for a different mirror
|
||||||
url="http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux"
|
url="http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux"
|
||||||
@ -333,6 +339,34 @@ else
|
|||||||
sed -i "s/^SUBLEVEL.*/SUBLEVEL = 0/" "$SRCDIR/Makefile" || die
|
sed -i "s/^SUBLEVEL.*/SUBLEVEL = 0/" "$SRCDIR/Makefile" || die
|
||||||
echo $ARCHVERSION > "$VERSIONFILE" || die
|
echo $ARCHVERSION > "$VERSIONFILE" || die
|
||||||
|
|
||||||
|
elif [[ $DISTRO = debian ]]; then
|
||||||
|
|
||||||
|
echo "Debian distribution detected"
|
||||||
|
|
||||||
|
# url may be changed for a different mirror
|
||||||
|
url="http://ftp.debian.org/debian/pool/main/l/linux"
|
||||||
|
# The linux-source packages are formatted like the following: linux-source-3.14_3.14.7-1_all.deb
|
||||||
|
pkgver="${ARCHVERSION%%-*}_$(dpkg-query -W -f='${Version}' linux-image-$(uname -r))"
|
||||||
|
pkgname="linux-source-${pkgver}_all"
|
||||||
|
|
||||||
|
cd $TEMPDIR
|
||||||
|
echo "Downloading the kernel source for $ARCHVERSION"
|
||||||
|
# Download source deb pkg
|
||||||
|
(wget "$url/${pkgname}.deb" 2>&1) >> "$LOGFILE" || die "wget: Could not fetch $url/${pkgname}.deb"
|
||||||
|
# Unpack
|
||||||
|
echo "Unpacking kernel source"
|
||||||
|
dpkg -x ${pkgname}.deb $TEMPDIR >> "$LOGFILE" || die "dpkg: Could not extract ${pkgname}.deb"
|
||||||
|
# extract and move to SRCDIR
|
||||||
|
tar xvf usr/src/linux-source-${ARCHVERSION%%-*}.tar.xz >> "$LOGFILE" || die "tar: Failed to extract kernel source package"
|
||||||
|
clean_cache
|
||||||
|
mv linux-source-${ARCHVERSION%%-*} "$SRCDIR" || die
|
||||||
|
cp "/boot/config-${ARCHVERSION}" "$OBJDIR/.config" || die
|
||||||
|
echo "-${ARCHVERSION#*-}" > "$SRCDIR/localversion" || die
|
||||||
|
# for some reason the Debian kernel versions don't follow the
|
||||||
|
# upstream SUBLEVEL; they are always at SUBLEVEL 0
|
||||||
|
sed -i "s/^SUBLEVEL.*/SUBLEVEL = 0/" "$SRCDIR/Makefile" || die
|
||||||
|
echo $ARCHVERSION > "$VERSIONFILE" || die
|
||||||
|
|
||||||
else
|
else
|
||||||
die "Unsupported distribution"
|
die "Unsupported distribution"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user