update 2022-12-06 20:18:48

This commit is contained in:
github-actions[bot] 2022-12-06 20:18:48 +08:00
parent 36e6e29ce9
commit f8f48e3caa
4 changed files with 79 additions and 71 deletions

View File

@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=dnsproxy PKG_NAME:=dnsproxy
PKG_VERSION:=0.46.2 PKG_VERSION:=0.46.4
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=8ce720f258747b0ff74b9889c93c616efe3b7267d04283a1338d2ff1e24d661e PKG_HASH:=5c959bd2f08b2304306b8f0b933b20d31a3a3d1ebeb0f349740799e5089fd4ae
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org> PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0

View File

@ -16,7 +16,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-amlogic PKG_NAME:=luci-app-amlogic
PKG_VERSION:=3.1.144 PKG_VERSION:=3.1.145
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 License PKG_LICENSE:=GPL-2.0 License

View File

@ -9,7 +9,7 @@
# It is recommended to install MAINLINE_UBOOT for kernel versions above 5.10.y # It is recommended to install MAINLINE_UBOOT for kernel versions above 5.10.y
# openwrt-kernel ${AUTO_MAINLINE_UBOOT} # openwrt-kernel ${AUTO_MAINLINE_UBOOT}
# E.g: openwrt-kernel yes # E.g: openwrt-kernel yes
# E.g: openwrt-kernel no # openwrt-kernel no
# #
#================================== Functions list ================================== #================================== Functions list ==================================
# #
@ -17,6 +17,8 @@
# get_textoffset : Get kernel TEXT_OFFSET # get_textoffset : Get kernel TEXT_OFFSET
# init_var : Initialize all variables # init_var : Initialize all variables
# check_kernel : Check kernel files list # check_kernel : Check kernel files list
# chech_files_same : Check file consistency
# restore_kernel : Restore current kernel
# update_kernel : Update the kernel # update_kernel : Update the kernel
# update_uboot : Update the uboot # update_uboot : Update the uboot
# #
@ -60,7 +62,7 @@ init_var() {
# Check release file # Check release file
if [[ -s "${release_file}" ]]; then if [[ -s "${release_file}" ]]; then
source "${release_file}" 2>/dev/null source "${release_file}"
PLATFORM="${PLATFORM}" PLATFORM="${PLATFORM}"
UBOOT_OVERLOAD="${UBOOT_OVERLOAD}" UBOOT_OVERLOAD="${UBOOT_OVERLOAD}"
MAINLINE_UBOOT="${MAINLINE_UBOOT}" MAINLINE_UBOOT="${MAINLINE_UBOOT}"
@ -108,7 +110,7 @@ init_var() {
esac esac
P4_PATH="/mnt/${EMMC_NAME}${PARTITION_NAME}4" P4_PATH="/mnt/${EMMC_NAME}${PARTITION_NAME}4"
# Move kernel related files to the ${P4_PATH} directory # Move kernel related files to the ${P4_PATH} directory
mv -f /tmp/upload/* ${P4_PATH} 2>/dev/null && sync mv -f /tmp/upload/* ${P4_PATH} 2>/dev/null
echo -e "Current device: ${MYDEVICE_NAME} [ ${PLATFORM} ], Use in [ ${EMMC_NAME} ]" echo -e "Current device: ${MYDEVICE_NAME} [ ${PLATFORM} ], Use in [ ${EMMC_NAME} ]"
sync && echo "" sync && echo ""
@ -173,6 +175,42 @@ check_kernel() {
sync && echo "" sync && echo ""
} }
# Check the consistency of amlogic device files
chech_files_same() {
i="0"
max_try="5"
while [[ "${i}" -le "${max_try}" ]]; do
if [[ "$(sha256sum "${1}" | awk '{print $1}')" == "$(sha256sum "${2}" | awk '{print $1}')" ]]; then
echo "" && break
else
cp -f ${1} ${2}
i="$((i + 1))"
fi
done
[[ "${i}" -gt "${max_try}" ]] && echo "God, it's different after ${max_try} copies: [ ${1} ]"
}
# Restore the kernel when the update fails
restore_kernel() {
(
cd /boot
rm -rf \
config-${kernel_name} \
System.map-${kernel_name} \
initrd.img-${kernel_name} \
uInitrd-${kernel_name} \
vmlinuz-${kernel_name} \
initrd.img \
uInitrd \
zImage \
Image \
vmlinuz \
dtb* 2>/dev/null
tar -xzf /tmp/boot-backup.tar.gz 2>/dev/null
)
error_msg "Kernel update failed and has been reverted."
}
# Update the kernel # Update the kernel
update_kernel() { update_kernel() {
local cur_kernel_name=$(uname -r) local cur_kernel_name=$(uname -r)
@ -180,7 +218,7 @@ update_kernel() {
echo -e "Start unpacking the kernel..." echo -e "Start unpacking the kernel..."
# 01. for /boot five files # 01. for /boot five files
# backup the current_kernel # Backup the current_kernel
( (
cd /boot cd /boot
tar -czf /tmp/boot-backup.tar.gz \ tar -czf /tmp/boot-backup.tar.gz \
@ -208,10 +246,10 @@ update_kernel() {
vmlinuz \ vmlinuz \
dtb* 2>/dev/null dtb* 2>/dev/null
) )
# extract the new kernel # Extract the new kernel
tar -xf ${P4_PATH}/boot-${kernel_name}.tar.gz -C /boot && sync tar -xf ${P4_PATH}/boot-${kernel_name}.tar.gz -C /boot
local f # Check if the file exists
local valid_files local valid_files
if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then
valid_files="vmlinuz-${kernel_name} initrd.img-${kernel_name} config-${kernel_name} System.map-${kernel_name}" valid_files="vmlinuz-${kernel_name} initrd.img-${kernel_name} config-${kernel_name} System.map-${kernel_name}"
@ -220,43 +258,25 @@ update_kernel() {
valid_files="vmlinuz-${kernel_name} uInitrd-${kernel_name} config-${kernel_name} System.map-${kernel_name}" valid_files="vmlinuz-${kernel_name} uInitrd-${kernel_name} config-${kernel_name} System.map-${kernel_name}"
rm -f /boot/initrd.img* rm -f /boot/initrd.img*
fi fi
for f in ${valid_files}; do [[ -f "/boot/${f}" ]] || restore_kernel; done
for f in $valid_files; do # Check if the files are the same
if [[ ! -f "/boot/${f}" ]]; then
(
cd /boot
rm -rf \
config-${kernel_name} \
System.map-${kernel_name} \
initrd.img-${kernel_name} \
uInitrd-${kernel_name} \
vmlinuz-${kernel_name} \
initrd.img \
uInitrd \
zImage \
Image \
vmlinuz \
dtb* 2>/dev/null
tar -xzf /tmp/boot-backup.tar.gz 2>/dev/null
)
error_msg "The file: ${f} is not exists."
fi
done
( (
cd /boot cd /boot
if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then
ln -sf initrd.img-${kernel_name} initrd.img && ln -sf initrd.img-${kernel_name} initrd.img
ln -sf vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ} ln -sf vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ}
elif [[ "$boot_fstype" == "vfat" ]]; then elif [[ "$boot_fstype" == "vfat" ]]; then
cp -f uInitrd-${kernel_name} uInitrd && cp -f uInitrd-${kernel_name} uInitrd
cp -f vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ} && [[ -z "$(chech_files_same uInitrd-${kernel_name} uInitrd)" ]] || restore_kernel
sync cp -f vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ}
[[ -z "$(chech_files_same vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ})" ]] || restore_kernel
else else
ln -sf uInitrd-${kernel_name} uInitrd && ln -sf uInitrd-${kernel_name} uInitrd
ln -sf vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ} ln -sf vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ}
fi fi
) )
echo -e "(1/3) Unpacking [ boot-${kernel_name}.tar.gz ] done." echo -e "(1/3) Unpacking [ boot-${kernel_name}.tar.gz ] done."
if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then if [[ "${PLATFORM}" == "qemu-aarch64" ]]; then
@ -264,39 +284,30 @@ update_kernel() {
else else
# 02. for /boot/dtb/${PLATFORM}/* # 02. for /boot/dtb/${PLATFORM}/*
if [[ "${boot_fstype}" == "vfat" ]]; then if [[ "${boot_fstype}" == "vfat" ]]; then
( (cd /boot && mkdir -p dtb/${PLATFORM})
cd /boot &&
mkdir -p dtb/${PLATFORM}
)
else else
( (cd /boot && mkdir -p dtb-${kernel_name}/${PLATFORM} && ln -sf dtb-${kernel_name} dtb)
cd /boot &&
mkdir -p dtb-${kernel_name}/${PLATFORM} &&
ln -sf dtb-${kernel_name} dtb
)
fi fi
tar -xf ${P4_PATH}/dtb-${PLATFORM}-${kernel_name}.tar.gz -C /boot/dtb/${PLATFORM} && sync tar -xf ${P4_PATH}/dtb-${PLATFORM}-${kernel_name}.tar.gz -C /boot/dtb/${PLATFORM}
[ "$(ls /boot/dtb/${PLATFORM} -l 2>/dev/null | grep "^-" | wc -l)" -ge "1" ] || error_msg "/boot/dtb/${PLATFORM} file is missing." [[ "$(ls /boot/dtb/${PLATFORM} -l 2>/dev/null | grep "^-" | wc -l)" -ge "1" ]] || error_msg "/boot/dtb/${PLATFORM} file is missing."
echo -e "(2/3) Unpacking [ dtb-${PLATFORM}-${kernel_name}.tar.gz ] done." echo -e "(2/3) Unpacking [ dtb-${PLATFORM}-${kernel_name}.tar.gz ] done."
fi fi
# 03. for /lib/modules/* # 03. for /lib/modules/*
rm -rf /lib/modules/* 2>/dev/null && sync rm -rf /lib/modules/*
tar -xf ${P4_PATH}/modules-${kernel_name}.tar.gz -C /lib/modules && sync tar -xf ${P4_PATH}/modules-${kernel_name}.tar.gz -C /lib/modules
( (
cd /lib/modules/${kernel_name} cd /lib/modules/${kernel_name}
rm -f *.ko 2>/dev/null rm -f *.ko
find ./ -type f -name '*.ko' -exec ln -s {} ./ \; find ./ -type f -name '*.ko' -exec ln -s {} ./ \;
sync && sleep 3 sync && sleep 3
x=$(ls *.ko -l 2>/dev/null | grep "^l" | wc -l) x=$(ls *.ko -l 2>/dev/null | grep "^l" | wc -l)
if [ "${x}" -eq "0" ]; then [[ "${x}" -eq "0" ]] && error_msg "Error *.ko Files not found."
error_msg "Error *.ko Files not found."
fi
) )
echo -e "(3/3) Unpacking [ modules-${kernel_name}.tar.gz ] done." echo -e "(3/3) Unpacking [ modules-${kernel_name}.tar.gz ] done."
# Delete kernel tmpfiles # Delete kernel tmpfiles
rm -f ${P4_PATH}/*-${kernel_name}.tar.gz ${P4_PATH}/sha256sums 2>/dev/null rm -f ${P4_PATH}/*-${kernel_name}.tar.gz ${P4_PATH}/sha256sums
sync && echo "" sync && echo ""
} }
@ -307,11 +318,11 @@ update_uboot() {
if [[ "${PLATFORM}" == "amlogic" ]]; then if [[ "${PLATFORM}" == "amlogic" ]]; then
# Copy u-boot.ext and u-boot.emmc # Copy u-boot.ext and u-boot.emmc
if [[ "${K510}" -eq "1" && -n "${UBOOT_OVERLOAD}" && -f "/boot/${UBOOT_OVERLOAD}" ]]; then if [[ "${K510}" -eq "1" && -n "${UBOOT_OVERLOAD}" && -f "/boot/${UBOOT_OVERLOAD}" ]]; then
[[ ! -f "/boot/u-boot.ext" ]] && cp -f "/boot/${UBOOT_OVERLOAD}" /boot/u-boot.ext && sync && chmod +x /boot/u-boot.ext [[ ! -f "/boot/u-boot.ext" ]] && cp -f "/boot/${UBOOT_OVERLOAD}" /boot/u-boot.ext && chmod +x /boot/u-boot.ext
[[ ! -f "/boot/u-boot.emmc" ]] && cp -f "/boot/u-boot.ext" /boot/u-boot.emmc && sync && chmod +x /boot/u-boot.emmc [[ ! -f "/boot/u-boot.emmc" ]] && cp -f "/boot/u-boot.ext" /boot/u-boot.emmc && chmod +x /boot/u-boot.emmc
echo -e "The ${UBOOT_OVERLOAD} file copy is complete." echo -e "The ${UBOOT_OVERLOAD} file copy is complete."
elif [[ "${K510}" -eq "0" ]]; then elif [[ "${K510}" -eq "0" ]]; then
rm -f "/boot/u-boot.ext" "/boot/u-boot.emmc" 2>/dev/null rm -f "/boot/u-boot.ext" "/boot/u-boot.emmc"
fi fi
# Write Mainline bootloader # Write Mainline bootloader
@ -324,13 +335,10 @@ update_uboot() {
fi fi
# Update release file # Update release file
sed -i '/KERNEL_VERSION/d' /etc/flippy-openwrt-release 2>/dev/null sed -i "s|^KERNEL_VERSION=.*|KERNEL_VERSION='${kernel_name}'|g" ${release_file} 2>/dev/null
echo "KERNEL_VERSION='${kernel_name}'" >>/etc/flippy-openwrt-release 2>/dev/null sed -i "s|^K510=.*|K510='${K510}'|g" ${release_file} 2>/dev/null
# # Update banner file
sed -i '/K510/d' /etc/flippy-openwrt-release 2>/dev/null sed -i "s| Kernel.*| Kernel: ${kernel_name}|g" /etc/banner 2>/dev/null
echo "K510='${K510}'" >>/etc/flippy-openwrt-release 2>/dev/null
#
sed -i "s/ Kernel.*/ Kernel: ${kernel_name}/g" /etc/banner 2>/dev/null
sync && echo "" sync && echo ""
} }

View File

@ -538,7 +538,7 @@ run_global() {
echo $default_node > $TMP_ID_PATH/global_default echo $default_node > $TMP_ID_PATH/global_default
echo $main_node > $TMP_ID_PATH/global_main echo $main_node > $TMP_ID_PATH/global_main
} }
if [ $PROXY_IPV6 == "1" ]; then if [ $PROXY_IPV6 == "1" ]; then
echolog "开启实验性IPv6透明代理(TProxy)请确认您的节点及类型支持IPv6" echolog "开启实验性IPv6透明代理(TProxy)请确认您的节点及类型支持IPv6"
PROXY_IPV6_UDP=1 PROXY_IPV6_UDP=1
@ -678,7 +678,7 @@ start_crontab() {
echo "$t lua $APP_PATH/rule_update.lua log > /dev/null 2>&1 &" >>/etc/crontabs/root echo "$t lua $APP_PATH/rule_update.lua log > /dev/null 2>&1 &" >>/etc/crontabs/root
echolog "配置定时任务:自动更新规则。" echolog "配置定时任务:自动更新规则。"
fi fi
TMP_SUB_PATH=$TMP_PATH/sub_crontabs TMP_SUB_PATH=$TMP_PATH/sub_crontabs
mkdir -p $TMP_SUB_PATH mkdir -p $TMP_SUB_PATH
for item in $(uci show ${CONFIG} | grep "=subscribe_list" | cut -d '.' -sf 2 | cut -d '=' -sf 1); do for item in $(uci show ${CONFIG} | grep "=subscribe_list" | cut -d '.' -sf 2 | cut -d '=' -sf 1); do
@ -691,7 +691,7 @@ start_crontab() {
echolog "配置定时任务:自动更新【$remark】订阅。" echolog "配置定时任务:自动更新【$remark】订阅。"
fi fi
done done
[ -d "${TMP_SUB_PATH}" ] && { [ -d "${TMP_SUB_PATH}" ] && {
for name in $(ls ${TMP_SUB_PATH}); do for name in $(ls ${TMP_SUB_PATH}); do
week_update=$(echo $name | awk -F '_' '{print $1}') week_update=$(echo $name | awk -F '_' '{print $1}')
@ -745,7 +745,7 @@ start() {
echolog "程序已启动,无需重复启动!" echolog "程序已启动,无需重复启动!"
return 0 return 0
fi fi
ulimit -n 65535 ulimit -n 65535
start_socks start_socks