Compare commits

...

2 Commits

7 changed files with 20 additions and 9 deletions

View File

@ -234,6 +234,11 @@ CMDLINE['nowatchdog']=""
CMDLINE['modprobe.blacklist']="${MODBLACKLIST}" CMDLINE['modprobe.blacklist']="${MODBLACKLIST}"
CMDLINE['mev']="${MEV:-physical}" CMDLINE['mev']="${MEV:-physical}"
if [ "${MEV:-physical}" = "vmware" ]; then
CMDLINE['tsc']="reliable"
CMDLINE['pmtmr']="0x0"
fi
if [ "${HDDSORT}" = "true" ]; then if [ "${HDDSORT}" = "true" ]; then
CMDLINE['hddsort']="" CMDLINE['hddsort']=""
fi fi

View File

@ -23,10 +23,10 @@ function checkBootLoader() {
[ ! -w "${PART1_PATH}" ] && return 1 [ ! -w "${PART1_PATH}" ] && return 1
[ ! -w "${PART2_PATH}" ] && return 1 [ ! -w "${PART2_PATH}" ] && return 1
[ ! -w "${PART3_PATH}" ] && return 1 [ ! -w "${PART3_PATH}" ] && return 1
type awk >/dev/null 2>&1 || return 1 type -p awk || return 1
type cut >/dev/null 2>&1 || return 1 type -p cut || return 1
type sed >/dev/null 2>&1 || return 1 type -p sed || return 1
type tar >/dev/null 2>&1 || return 1 type -p tar || return 1
return 0 return 0
} }
@ -220,7 +220,7 @@ function _set_conf_kv() {
# @ - url list # @ - url list
function _get_fastest() { function _get_fastest() {
local speedlist="" local speedlist=""
if type ping >/dev/null 2>&1; then if type -p ping; then
for I in "$@"; do for I in "$@"; do
speed=$(LC_ALL=C ping -c 1 -W 5 "${I}" 2>/dev/null | awk -F'[= ]' '/time=/ {for(i=1;i<=NF;i++) if ($i=="time") print $(i+1)}') speed=$(LC_ALL=C ping -c 1 -W 5 "${I}" 2>/dev/null | awk -F'[= ]' '/time=/ {for(i=1;i<=NF;i++) if ($i=="time") print $(i+1)}')
speedlist+="${I} ${speed:-999}\n" # Assign default value 999 if speed is empty speedlist+="${I} ${speed:-999}\n" # Assign default value 999 if speed is empty

View File

@ -8,7 +8,7 @@
[ -z "${WORK_PATH}" ] || [ ! -d "${WORK_PATH}/include" ] && WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../" >/dev/null 2>&1 && pwd)" [ -z "${WORK_PATH}" ] || [ ! -d "${WORK_PATH}/include" ] && WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../" >/dev/null 2>&1 && pwd)"
type gettext >/dev/null 2>&1 && alias TEXT='gettext "rr"' || alias TEXT='echo' type -p gettext && alias TEXT='gettext "rr"' || alias TEXT='echo'
shopt -s expand_aliases shopt -s expand_aliases
[ -d "${WORK_PATH}/lang" ] && export TEXTDOMAINDIR="${WORK_PATH}/lang" [ -d "${WORK_PATH}/lang" ] && export TEXTDOMAINDIR="${WORK_PATH}/lang"

View File

@ -12,6 +12,12 @@ set -e
. "${WORK_PATH}/include/functions.sh" . "${WORK_PATH}/include/functions.sh"
. "${WORK_PATH}/include/addons.sh" . "${WORK_PATH}/include/addons.sh"
if type -p vmware-toolbox-cmd; then
if [ ! "Enabled" = "$(vmware-toolbox-cmd timesync status 2>/dev/null)" ]; then
vmware-toolbox-cmd timesync enable >/dev/null 2>&1 || true
fi
fi
[ -z "${LOADER_DISK}" ] && die "$(TEXT "Loader is not init!")" [ -z "${LOADER_DISK}" ] && die "$(TEXT "Loader is not init!")"
checkBootLoader || die "$(TEXT "The loader is corrupted, please rewrite it!")" checkBootLoader || die "$(TEXT "The loader is corrupted, please rewrite it!")"

View File

@ -39,7 +39,7 @@ function create() {
sudo apt install -y locales busybox dialog gettext sed gawk jq curl sudo apt install -y locales busybox dialog gettext sed gawk jq curl
sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd
# sudo snap install yq # sudo snap install yq
if ! type yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then if ! type -p yq || ! yq --version 2>/dev/null | grep -q "v4."; then
sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
fi fi

View File

@ -329,7 +329,7 @@ function createvmx() {
local BLIMAGE=${1} local BLIMAGE=${1}
local VMNAME=${2} local VMNAME=${2}
if ! type qemu-img &>/dev/null; then if ! type -p qemu-img; then
sudo apt install -y qemu-utils sudo apt install -y qemu-utils
fi fi

View File

@ -9,7 +9,7 @@
# sudo apt install -y locales busybox dialog gettext sed gawk jq curl # sudo apt install -y locales busybox dialog gettext sed gawk jq curl
# sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd # sudo apt install -y python-is-python3 python3-pip libelf-dev qemu-utils dosfstools cpio xz-utils lz4 lzma bzip2 gzip zstd
# # sudo snap install yq # # sudo snap install yq
# if ! type yq &>/dev/null || ! yq --version 2>/dev/null | grep -q "v4."; then # if ! type -p yq || ! yq --version 2>/dev/null | grep -q "v4."; then
# sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq # sudo curl -kL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && sudo chmod a+x /usr/bin/yq
# fi # fi
# #