fix cmdlineMenu/synoinfoMenu, fix custom kernel for RR-CUSTOM

This commit is contained in:
Ing 2024-07-21 14:38:06 +08:00
parent 00348889b9
commit 47c5f76868
19 changed files with 6120 additions and 6037 deletions

View File

@ -41,6 +41,7 @@ jobs:
language= ''
model = ''
version = ''
kernel = ''
addons = ''
modules = ''
try:
@ -51,6 +52,7 @@ jobs:
language = jsonbody.get('language', '')
model = jsonbody.get('model', '')
version = jsonbody.get('version', '')
kernel = jsonbody.get('kernel', '')
addons = jsonbody.get('addons', '')
modules = jsonbody.get('modules', '')
except ValueError as e:
@ -67,6 +69,7 @@ jobs:
set_output("language", language)
set_output("model", model)
set_output("version", version)
set_output("kernel", kernel)
set_output("addons", addons)
set_output("modules", modules)
@ -196,12 +199,26 @@ jobs:
exit 1
fi
if [ -n "${{ env.kernel }}" ]; then
echo -en "set kernel"
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
writeConfigKey "kernel" "${{ env.kernel }}" "${USER_CONFIG_FILE}"
echo ""
fi
sudo ./localbuild.sh config "${MODEL}" "${VERSION}"
if [ $? -ne 0 ]; then
echo "config failed"
exit 1
fi
if [ -n "${{ env.kernel }}" ]; then
echo -en "set kernel"
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
writeConfigKey "kernel" "${{ env.kernel }}" "${USER_CONFIG_FILE}"
echo ""
fi
if [ -n "${{ env.addons }}" ]; then
echo -en "set addons"
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
@ -214,7 +231,8 @@ jobs:
done
echo ""
fi
if [ -n "${{ env.modules }}" ]; then
if [ ! "custom" = "${{ env.kernel }}" ] && [ -n "${{ env.modules }}" ]; then
echo -en "set modules"
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
@ -250,9 +268,11 @@ jobs:
echo "" >> README.txt
echo "DSM:" >> README.txt
echo " MODEL: $(readConfigKey "model" "${USER_CONFIG_FILE}")" >> README.txt
echo " PATURL: $(readConfigKey "paturl" "${USER_CONFIG_FILE}")" >> README.txt
echo " PATSUM: $(readConfigKey "patsum" "${USER_CONFIG_FILE}")" >> README.txt
echo " MODEL: $(readConfigKey "model" "${USER_CONFIG_FILE}")" >> README.txt
echo " VERSION: $(readConfigKey "productver" "${USER_CONFIG_FILE}")" >> README.txt
echo " KERNEL: $(readConfigKey "kernel" "${USER_CONFIG_FILE}")" >> README.txt
echo " PATURL: $(readConfigKey "paturl" "${USER_CONFIG_FILE}")" >> README.txt
echo " PATSUM: $(readConfigKey "patsum" "${USER_CONFIG_FILE}")" >> README.txt
echo "" >> README.txt
echo "" >> README.txt

View File

@ -65,6 +65,7 @@
$("#model").on("change", changeModel);
$("#version").on("change", changeVersion);
$("#language").on("change", changeVersion);
$("#kernel").on("change", chanageKernel);
$('#addons').val("acpid,mountloader,reboottoloader");
setModels();
});
@ -112,6 +113,7 @@
function changeVersion() {
createAddonsBtn();
createModulesBtn();
chanageKernel();
}
function createAddonsBtn() {
var language = $("#language").val();
@ -159,6 +161,24 @@
$('#modules').val(extstr.join(","));
}
}
function chanageKernel() {
var model = $("#model").val();
var version = $("#version").val();
var kernel = $("#kernel").val();
if (model == "SA6400" && version == "7.2") {
$("#kernel_item").show();
if (kernel == "custom") {
$('#modules_item').hide();
} else {
$('#modules_item').show();
}
} else {
$('#modules_item').show();
$("#kernel_item").hide();
}
}
function onclickext(type, ext) {
var btnobj = $("#btn_" + ext);
var extstr = $('#' + type).val().split(",");
@ -185,9 +205,10 @@
let formData = new FormData(form);
var title = "custom";
var body = {};
var _parameters = ["title", "format", "language", "model", "version", "addons", "modules"];
var _parameters = ["title", "format", "language", "model", "version", "kernel", "addons", "modules"];
for (var key in _parameters) {
var name = _parameters[key];
if ($("#" + name).is(":hidden")) { continue; }
if (name == "title") {
if ($("#" + name).val()) {
title += " " + $("#" + name).val();
@ -248,16 +269,17 @@
</marquee>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="title_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Title: (Please do not delete the "custom " in the title of the issue creation page.)</label>
<label class="color-fg-default text-mono f6">Title: (Please do not delete the "custom " in the title of
the issue creation page.)</label>
</div>
<div class="form-group-body">
<input class="form-control input-contrast input-sm" type="text" id="title" name="inputs[title]"
value="" />
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="format_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Format:</label>
</div>
@ -271,7 +293,7 @@
</select>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="language_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Language:</label>
</div>
@ -296,7 +318,7 @@
</select>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="model_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Model:</label>
</div>
@ -307,7 +329,7 @@
</select>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="version_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Version:</label>
</div>
@ -318,7 +340,19 @@
</select>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="kernel_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Kernel: (only "custom" supports Hyper-V, Xen.)</label>
</div>
<div class="form-group-body">
<select class="form-select form-control select-sm input-contrast" id="kernel" name="inputs[kernel]"
value="">
<option selected="selected" value="official">official</option>
<option value="custom">custom</option>
</select>
</div>
</div>
<div class="form-group mt-1 mb-2" id="addons_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Addons:</label>
<a href="https://github.com/RROrg/rr/raw/main/docs/addons.xlsx"> Details</a>
@ -330,7 +364,7 @@
</div>
</div>
</div>
<div class="form-group mt-1 mb-2 ">
<div class="form-group mt-1 mb-2" id="modules_item">
<div class="form-group-header">
<label class="color-fg-default text-mono f6">Modules:</label>
<a href="https://github.com/RROrg/rr/raw/main/docs/modules.xlsx"> Details</a>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -189,7 +189,6 @@ function modelMenu() {
done
writeConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "kernel" "official" "${USER_CONFIG_FILE}"
# Remove old files
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" >/dev/null 2>&1 || true
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true
@ -328,9 +327,17 @@ function productversMenu() {
while IFS=': ' read KEY VALUE; do
writeConfigKey "synoinfo.\"${KEY}\"" "${VALUE}" "${USER_CONFIG_FILE}"
done <<<$(readConfigMap "platforms.${PLATFORM}.synoinfo" "${WORK_PATH}/platforms.yml")
# Check addons
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${WORK_PATH}/platforms.yml")"
KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")"
# Check kernel
if [ -f "${CKS_PATH}/bzImage-${PLATFORM}-$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}.gz" ] &&
[ -f "${CKS_PATH}/modules-${PLATFORM}-$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}.tgz" ]; then
:
else
KERNEL='official'
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
fi
# Check addons
while IFS=': ' read ADDON PARAM; do
[ -z "${ADDON}" ] && continue
if ! checkAddonExist "${ADDON}" "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}"; then
@ -884,13 +891,24 @@ function cmdlineMenu() {
MSG+="$(TEXT " * \Z4apparmor.mode=complain\Zn\n Set the AppArmor security module to complain mode.\n")"
MSG+="$(TEXT " * \Z4pci=nommconf\Zn\n Disable the use of Memory-Mapped Configuration for PCI devices(use this parameter cautiously).\n")"
MSG+="$(TEXT " * \Z4consoleblank=300\Zn\n Set the console to auto turnoff display 300 seconds after no activity (measured in seconds).\n")"
MSG+="$(TEXT "\nEnter the parameter name and value you need to add.\n")"
LINENUM=$(($(echo -e "${MSG}" | wc -l) + 10))
RET=0
MSG+="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=0
while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters.
LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG.
dialog --print-maxsize 2>"${TMP_PATH}/maxsize"
DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs)
DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs)
if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then
MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=9
fi
while true; do
[ ${RET} -eq 255 ] && MSG="$(TEXT "Commonly used cmdlines:\n")"
DIALOG --title "$(TEXT "Cmdline")" \
--form "${MSG}" ${LINENUM:-16} 100 2 "Name:" 1 1 "" 1 10 85 0 "Value:" 2 1 "" 2 10 85 0 \
--form "${MSG}" ${LINENUM:-9} 100 2 "Name:" 1 1 "" 1 10 85 0 "Value:" 2 1 "" 2 10 85 0 \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
@ -909,7 +927,7 @@ function cmdlineMenu() {
break
;;
255) # ESC
# break
break
;;
esac
done
@ -1020,13 +1038,24 @@ function synoinfoMenu() {
MSG+="$(TEXT " * \Z4esataportcfg=0x????\Zn\n Esata disks mask(Not apply to DT models).\n")"
MSG+="$(TEXT " * \Z4usbportcfg=0x????\Zn\n USB disks mask(Not apply to DT models).\n")"
MSG+="$(TEXT " * \Z4max_sys_raid_disks=12\Zn\n Maximum number of system partition(md0) raid disks.\n")"
MSG+="$(TEXT "\nEnter the parameter name and value you need to add.\n")"
LINENUM=$(($(echo -e "${MSG}" | wc -l) + 10))
RET=0
MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=0
while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters.
LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG.
dialog --print-maxsize 2>"${TMP_PATH}/maxsize"
DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs)
DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs)
if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then
MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=9
fi
while true; do
[ ${RET} -eq 255 ] && MSG="$(TEXT "Commonly used synoinfo:\n")"
DIALOG --title "$(TEXT "Synoinfo")" \
--form "${MSG}" ${LINENUM:-16} 100 2 "Name:" 1 1 "" 1 10 85 0 "Value:" 2 1 "" 2 10 85 0 \
--form "${MSG}" ${LINENUM:-9} 100 2 "Name:" 1 1 "" 1 10 85 0 "Value:" 2 1 "" 2 10 85 0 \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
@ -1046,7 +1075,7 @@ function synoinfoMenu() {
break
;;
255) # ESC
# break
break
;;
esac
done
@ -2319,7 +2348,7 @@ function advancedMenu() {
echo "i \"$(TEXT "Timeout of get ip in boot:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "w \"$(TEXT "Timeout of boot wait:") \Z4${BOOTWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "k \"$(TEXT "kernel switching method:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
if false; then # Some GPU have compatibility issues, so this function is temporarily disabled. RR_CMDLINE= ... nomodeset
if false; then # Some GPU have compatibility issues, so this function is temporarily disabled. RR_CMDLINE= ... nomodeset
checkCmdline "rr_cmdline" "nomodeset" && POWEROFFDISPLAY="false" || POWEROFFDISPLAY="true"
echo "7 \"$(TEXT "Power off display after boot: ") \Z4${POWEROFFDISPLAY}\Zn\"" >>"${TMP_PATH}/menu"
fi