1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-03-09 15:50:00 +00:00

Use Debian package for kernel

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-03-10 09:30:19 +00:00
parent 0ddc538c87
commit 96eb181b40

View file

@ -194,22 +194,29 @@ apt-get update
sleep 2 sleep 2
apt-get -y install dirmngr patch apt-get -y install dirmngr patch
wget -O /tmp/linux-image-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-image-${KERNEL_RELEASE}_amd64.deb if [ "$SOURCES" = "yes" ]; then
wget -O /tmp/linux-headers-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-headers-${KERNEL_RELEASE}_amd64.deb wget -O /tmp/linux-image-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-image-${KERNEL_RELEASE}_amd64.deb
# Rename bzImage to vmlinuz, needed when custom kernel was used wget -O /tmp/linux-headers-${KERNEL_RELEASE}_amd64.deb ${VPSURL}kernel/linux-headers-${KERNEL_RELEASE}_amd64.deb
cd /boot # Rename bzImage to vmlinuz, needed when custom kernel was used
apt-get -y install rename curl libcurl4 unzip git cd /boot
rename 's/^bzImage/vmlinuz/s' * >/dev/null 2>&1 apt-get -y install rename curl libcurl4 unzip git
#apt-get -y install linux-mptcp rename 's/^bzImage/vmlinuz/s' * >/dev/null 2>&1
#dpkg --remove --force-remove-reinstreq linux-image-${KERNEL_VERSION}-mptcp #apt-get -y install linux-mptcp
#dpkg --remove --force-remove-reinstreq linux-headers-${KERNEL_VERSION}-mptcp #dpkg --remove --force-remove-reinstreq linux-image-${KERNEL_VERSION}-mptcp
if [ "$(dpkg -l | grep linux-image-${KERNEL_VERSION} | grep ${KERNEL_PACKAGE_VERSION})" = "" ]; then #dpkg --remove --force-remove-reinstreq linux-headers-${KERNEL_VERSION}-mptcp
if [ "$(dpkg -l | grep linux-image-${KERNEL_VERSION} | grep ${KERNEL_PACKAGE_VERSION})" = "" ]; then
echo "Install kernel linux-image-${KERNEL_RELEASE}"
echo "\033[1m !!! if kernel install fail run: dpkg --remove --force-remove-reinstreq linux-image-${KERNEL_VERSION}-mptcp !!! \033[0m"
dpkg --force-all -i -B /tmp/linux-headers-${KERNEL_RELEASE}_amd64.deb
dpkg --force-all -i -B /tmp/linux-image-${KERNEL_RELEASE}_amd64.deb
fi
else
cd /boot
rename 's/^bzImage/vmlinuz/s' * >/dev/null 2>&1
echo "Install kernel linux-image-${KERNEL_RELEASE}" echo "Install kernel linux-image-${KERNEL_RELEASE}"
echo "\033[1m !!! if kernel install fail run: dpkg --remove --force-remove-reinstreq linux-image-${KERNEL_VERSION}-mptcp !!! \033[0m" echo "\033[1m !!! if kernel install fail run: dpkg --remove --force-remove-reinstreq linux-image-${KERNEL_VERSION}-mptcp !!! \033[0m"
dpkg --force-all -i -B /tmp/linux-headers-${KERNEL_RELEASE}_amd64.deb apt-get -y install linux-image=${KERNEL_RELEASE} linux-headers=${KERNEL_RELEASE}
dpkg --force-all -i -B /tmp/linux-image-${KERNEL_RELEASE}_amd64.deb
fi fi
# Check if mptcp kernel is grub default kernel # Check if mptcp kernel is grub default kernel
echo "Set MPTCP kernel as grub default..." echo "Set MPTCP kernel as grub default..."
if [ "$LOCALFILES" = "no" ]; then if [ "$LOCALFILES" = "no" ]; then
@ -594,7 +601,11 @@ fi
if [ "$V2RAY" = "yes" ]; then if [ "$V2RAY" = "yes" ]; then
#apt-get -y -o Dpkg::Options::="--force-overwrite" install v2ray #apt-get -y -o Dpkg::Options::="--force-overwrite" install v2ray
wget -O /tmp/v2ray-${V2RAY_VERSION}-amd64.deb ${VPSURL}/debian/v2ray-${V2RAY_VERSION}-amd64.deb if [ "$SOURCES" = "yes" ]; then
wget -O /tmp/v2ray-${V2RAY_VERSION}-amd64.deb ${VPSURL}/debian/v2ray-${V2RAY_VERSION}-amd64.deb
else
apt-get -y install v2ray=${V2RAY_VERSION}
fi
if [ -f /etc/v2ray/v2ray-server.conf ] && [ ! -f /etc/systemd/system/v2ray.service ]; then if [ -f /etc/v2ray/v2ray-server.conf ] && [ ! -f /etc/systemd/system/v2ray.service ]; then
wget -O /etc/systemd/system/v2ray.service ${VPSURL}${VPSPATH}/old-v2ray.service wget -O /etc/systemd/system/v2ray.service ${VPSURL}${VPSPATH}/old-v2ray.service
fi fi