mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-02-12 11:21:56 +00:00
Update omr-admin, add kernel 6.12 support
This commit is contained in:
parent
2a0501172f
commit
4b590a13eb
1 changed files with 38 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
|||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
KERNEL=${KERNEL:-5.4}
|
||||
KERNEL=${KERNEL:-6.6}
|
||||
UPSTREAM=${UPSTREAM:-no}
|
||||
[ "$UPSTREAM" = "yes" ] && KERNEL="6.1"
|
||||
UPSTREAM6=${UPSTREAM6:-no}
|
||||
|
@ -78,8 +78,8 @@ MLVPN_BINARY_VERSION="3.0.0+20211028.git.ddafba3"
|
|||
UBOND_VERSION="31af0f69ebb6d07ed9348dca2fced33b956cedee"
|
||||
OBFS_VERSION="486bebd9208539058e57e23a12f23103016e09b4"
|
||||
OBFS_BINARY_VERSION="0.0.5-1"
|
||||
OMR_ADMIN_VERSION="8caecd236d8d8239e7d77fa3f6de62619bd564ee"
|
||||
OMR_ADMIN_BINARY_VERSION="0.14+20241025"
|
||||
OMR_ADMIN_VERSION="be866bf752119b3460d907f92572fcac773c1a97"
|
||||
OMR_ADMIN_BINARY_VERSION="0.14+20241125"
|
||||
#OMR_ADMIN_BINARY_VERSION="0.3+20220827"
|
||||
DSVPN_VERSION="3b99d2ef6c02b2ef68b5784bec8adfdd55b29b1a"
|
||||
DSVPN_BINARY_VERSION="0.1.4-2"
|
||||
|
@ -116,7 +116,7 @@ echo "Check user..."
|
|||
if [ "$(id -u)" -ne 0 ]; then echo 'Please run as root.' >&2; exit 1; fi
|
||||
|
||||
# Check Kernel
|
||||
if [ "$KERNEL" != "5.4" ] && [ "$KERNEL" != "6.1" ] && [ "$KERNEL" != "6.6" ] && [ "$KERNEL" != "6.10" ] && [ "$KERNEL" != "6.11" ]; then
|
||||
if [ "$KERNEL" != "5.4" ] && [ "$KERNEL" != "6.1" ] && [ "$KERNEL" != "6.6" ] && [ "$KERNEL" != "6.10" ] && [ "$KERNEL" != "6.11" ] && [ "$KERNEL" != "6.12" ]; then
|
||||
echo "Only kernels 5.4, 6.1, 6.6, 6.10 and 6.11 are currently supported"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -498,6 +498,32 @@ elif [ "$KERNEL" = "6.11" ] && [ "$ARCH" = "amd64" ]; then
|
|||
dpkg --force-all -i -B /tmp/linux-headers-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
dpkg --force-all -i -B /tmp/linux-image-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
|
||||
# wget -qO - https://dl.xanmod.org/archive.key | gpg --batch --yes --dearmor -vo /usr/share/keyrings/xanmod-archive-keyring.gpg
|
||||
# echo 'deb [signed-by=/usr/share/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main' | tee /etc/apt/sources.list.d/xanmod-release.list
|
||||
# apt-get update
|
||||
# apt-get -y install linux-xanmod-lts-x64v3
|
||||
[ -f /etc/default/grub ] && {
|
||||
sed -i "s@^\(GRUB_DEFAULT=\).*@\1\"0\"@" /etc/default/grub >/dev/null 2>&1
|
||||
[ -f /boot/grub/grub.cfg ] && grub-mkconfig -o /boot/grub/grub.cfg >/dev/null 2>&1
|
||||
}
|
||||
elif [ "$KERNEL" = "6.12" ] && [ "$ARCH" = "amd64" ]; then
|
||||
# awk command from xanmod website
|
||||
PSABI=$(awk 'BEGIN { while (!/flags/) if (getline < "/proc/cpuinfo" != 1) exit 1; if (/lm/&&/cmov/&&/cx8/&&/fpu/&&/fxsr/&&/mmx/&&/syscall/&&/sse2/) level = 1; if (level == 1 && /cx16/&&/lahf/&&/popcnt/&&/sse4_1/&&/sse4_2/&&/ssse3/) level = 2; if (level == 2 && /avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/) level = 3; if (level == 3 && /avx512f/&&/avx512bw/&&/avx512cd/&&/avx512dq/&&/avx512vl/) level = 4; if (level > 0) { print "x64v" level; exit level + 1 }; exit 1;}' | tr -d "\n")
|
||||
if [ "$PSABI" = "x64v1" ]; then
|
||||
echo "psABI x86-64-v1 not supported by Xanmod kernel 6.11, use an older kernel"
|
||||
exit 0
|
||||
fi
|
||||
if [ "$PSABI" = "x64v4" ]; then
|
||||
PSABI="x64v3"
|
||||
fi
|
||||
KERNEL_VERSION="6.12.1"
|
||||
KERNEL_REV="0~20241122.ge695ae7"
|
||||
wget -O /tmp/linux-image-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb ${VPSURL}kernel/linux-image-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
wget -O /tmp/linux-headers-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb ${VPSURL}kernel/linux-headers-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
echo "Install kernel linux-image-${KERNEL_VERSION}-${PSABI}-xanmod1 source release"
|
||||
dpkg --force-all -i -B /tmp/linux-headers-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
dpkg --force-all -i -B /tmp/linux-image-${KERNEL_VERSION}-${PSABI}-xanmod1_${KERNEL_VERSION}-${PSABI}-xanmod1-${KERNEL_REV}_amd64.deb
|
||||
|
||||
# wget -qO - https://dl.xanmod.org/archive.key | gpg --batch --yes --dearmor -vo /usr/share/keyrings/xanmod-archive-keyring.gpg
|
||||
# echo 'deb [signed-by=/usr/share/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main' | tee /etc/apt/sources.list.d/xanmod-release.list
|
||||
# apt-get update
|
||||
|
@ -1203,7 +1229,7 @@ if [ "$XRAY" = "yes" ]; then
|
|||
jq -M 'del(.users[0].openmptcprouter.xray)' /etc/openmptcprouter-vps-admin/omr-admin-config.json > /etc/openmptcprouter-vps-admin/omr-admin-config.json.new
|
||||
mv -f /etc/openmptcprouter-vps-admin/omr-admin-config.json /etc/openmptcprouter-vps-admin/omr-admin-config.json.bak
|
||||
mv -f /etc/openmptcprouter-vps-admin/omr-admin-config.json.new /etc/openmptcprouter-vps-admin/omr-admin-config.json
|
||||
#if [ ! -f /etc/xray/xray-server.json ]; then
|
||||
if [ ! -f /etc/xray/xray-server.json ] || [ -z "$(grep -i mptcp /etc/xray/xray-server.json | grep true)" ]; then
|
||||
wget -O /etc/xray/xray-server.json ${VPSURL}${VPSPATH}/xray-server.json
|
||||
sed -i "s:XRAY_UUID:$XRAY_UUID:g" /etc/xray/xray-server.json
|
||||
sed -i "s:V2RAY_UUID:$XRAY_UUID:g" /etc/xray/xray-server.json
|
||||
|
@ -1218,8 +1244,13 @@ if [ "$XRAY" = "yes" ]; then
|
|||
sed -i "s:XRAY_UUID:$XRAY_UUID:g" /etc/xray/xray-vless-reality.json
|
||||
sed -i "s:XRAY_X25519_PRIVATE_KEY:$XRAY_X25519_PRIVATE_KEY:g" /etc/xray/xray-vless-reality.json
|
||||
sed -i "s:XRAY_X25519_PUBLIC_KEY:$XRAY_X25519_PUBLIC_KEY:g" /etc/xray/xray-vless-reality.json
|
||||
|
||||
#fi
|
||||
#for xrayuser in $(cat /etc/openmptcprouter-vps-admin/omr-admin-config.json | jq -r '.users[0][].username'); do
|
||||
# if [ "$xrayuser" != "admin" ] && [ "$xrayuser" != "openmptcprouter" ]; then
|
||||
# jq '. + {"level": 0, "alterId": 0, "email": $xrayuser,"id": $xrayid}' /etc/xray/xray-server.json > /etc/xray/xray-server.json.tmp
|
||||
# mv /etc/xray/xray-server.json.tmp /etc/xray/xray-server.json
|
||||
# fi
|
||||
#done
|
||||
fi
|
||||
#if ([ "$UPSTREAM" = "yes" ] || [ "$UPSTREAM6" = "yes" ]) && [ -z "$(grep mptcp /etc/xray/xray-server.json | grep true)" ]; then
|
||||
# sed -i 's/"sockopt": {/&\n "mptcp": true,/' /etc/xray/xray-server.json
|
||||
#fi
|
||||
|
|
Loading…
Reference in a new issue