Skip to content

Commit

Permalink
Revision Initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed May 5, 2024
1 parent d82c358 commit 7f8faec
Show file tree
Hide file tree
Showing 81 changed files with 7,182 additions and 9,549 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Get Release RR
run: |
REPO="${{ github.server_url }}/${{ github.repository }}"
PRERELEASE="false"
PRERELEASE="true"
TAG=""
if [ "${PRERELEASE}" = "true" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
REPO="${{ github.server_url }}/${{ github.repository }}"
MODEL="${{ env.model }}"
VERSION="${{ env.version }}"
PRERELEASE="false"
PRERELEASE="true"
TAG=""
if [ "${PRERELEASE}" = "true" ]; then
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<h1>RR: <small>redpill’s preinstallation and recovery environment</small></h1>

[![点击数](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/rrorg/rr&edge_flat=true)](https://github.com/rrorg/rr)
[![翻译状态](https://hosted.weblate.org/widget/RROrg/svg-badge.svg)](https://hosted.weblate.org/engage/RROrg/")
[![GitHub Release](https://img.shields.io/github/v/release/rrorg/rr?style=flat-square)](https://github.com/rrorg/rr/releases/latest)
[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/rrorg/rr/total?style=flat-square)](https://github.com/rrorg/rr/releases)
[![GitHub Issues or Pull Requests by label](https://img.shields.io/github/issues-closed-raw/rrorg/rr/custom?style=flat-square&label=custom)](https://rrorg.github.io/rr/)
Expand Down Expand Up @@ -39,12 +38,7 @@ For the packag of has been initialized and build image, please go to [RR-CUSTOM]
- [intel-gpu-i915-backports](https://github.com/MoetaYuko/intel-gpu-i915-backports)

## 5: Contributing
- [Weblate mode](https://hosted.weblate.org/engage/RROrg/)
<a href="https://hosted.weblate.org/engage/RROrg/">
<img src="https://hosted.weblate.org/widget/RROrg/multi-auto.svg" alt="翻译状态" />
</a>

- Manual mode:
* The following is a roughly truncated guide to involve in project localization for internationalization.

```shell
Expand Down
39 changes: 29 additions & 10 deletions docs/issues.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@

var repo = "RROrg/rr"

var _models = {};
var _addons = {};
var _modules = {};

function httpGetAsync(theUrl, callback) {
let xmlHttpReq = new XMLHttpRequest();
xmlHttpReq.onreadystatechange = function () {
Expand All @@ -53,7 +57,7 @@

function init() {
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/models.json", function (result) {
_models = JSON.parse(result);
//_models = JSON.parse(result);
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/addons.json", function (result) {
_addons = JSON.parse(result);
httpGetAsync("https://raw.githubusercontent.com/RROrg/rr/main/docs/modules.json", function (result) {
Expand All @@ -69,7 +73,10 @@
}

function setModels() {
var models = Object.keys(_models).sort();
var models = [];
for (var P in _models) {
models = models.concat(_models[P]["models"]);
}
$("#model")[0].options.length = 0;
for (var i = 0; i < models.length; i++) {
var model = models[i];
Expand All @@ -79,7 +86,13 @@
}
function changeModel() {
model = $("#model").val();
var versions = Object.keys(_models[model]["productvers"]).reverse();
var versions = [];
for (var P in _models) {
if (_models[P]["models"].includes(model)) {
versions = Object.keys(_models[P]["productvers"]).reverse();
break;
}
}
$("#version")[0].options.length = 0;
for (var i = 0; i < versions.length; i++) {
var version = versions[i];
Expand All @@ -102,7 +115,7 @@
}
function createAddonsBtn() {
var language = $("#language").val();
var extstr = $('#addons').val().split(",");
var extstr = $('#addons').val().split(",");
var idx = 1;
var html = `<div class="form-group-body" id="addons_btns">`;
for (var ext in _addons) {
Expand All @@ -113,7 +126,7 @@
var par = "";
if (extstr.includes(ext)) {
par = "btn-danger";
}
}
html += `<button type="button" class="btn btn-primary btn-sm mt-2 ${par}" id="btn_${ext}" ${par} ${dispar} onclick="return onclickext('addons', '${ext}')" autofocus="" title="${_addons[ext]["description"][language]}">${ext}</button>&nbsp;`;
//if (idx++ % 10 == 0) html += "<br />";
}
Expand All @@ -124,7 +137,13 @@
function createModulesBtn() {
var model = $("#model").val();
var version = $("#version").val();
var platform = _models[model]["platform"] + "-" + _models[model]["productvers"][version];
var platform = "";
for (var P in _models) {
if (_models[P]["models"].includes(model)) {
platform = P + "-" + _models[P]["productvers"][version];
break;
}
}
var extstr = [];
var idx = 1;
var html = `<div class="form-group-body" id="modules_btns">`;
Expand Down Expand Up @@ -287,8 +306,8 @@
<label class="color-fg-default text-mono f6">Addons:</label>
</div>
<div class="form-group-body">
<textarea class="textarea-style input-contrast input-sm" type="text" id="addons"
name="inputs[addons]" disabled></textarea>
<textarea class="textarea-style input-contrast input-sm" type="text" id="addons" name="inputs[addons]"
disabled></textarea>
<div class="form-group-body" id="addons_btns">
</div>
</div>
Expand All @@ -298,8 +317,8 @@
<label class="color-fg-default text-mono f6">Modules:</label>
</div>
<div class="form-group-body">
<textarea class="textarea-style input-contrast input-sm" type="text" id="modules"
name="inputs[modules]" disabled></textarea>
<textarea class="textarea-style input-contrast input-sm" type="text" id="modules" name="inputs[modules]"
disabled></textarea>
<div class="form-group-body" id="modules_btns">
</div>
</div>
Expand Down
62 changes: 36 additions & 26 deletions files/initrd/opt/rr/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BUS=$(getBus "${LOADER_DISK}")
# Print text centralized
clear
[ -z "${COLUMNS}" ] && COLUMNS=50
TITLE="$(printf "$(TEXT "Welcome to %s")" "${RR_TITLE}")"
TITLE="$(printf "$(TEXT "Welcome to %s")" "$([ -z "${RR_RELEASE}" ] && echo "${RR_TITLE}" || echo "${RR_TITLE}(${RR_RELEASE})")")"
printf "\033[1;44m%*s\n" ${COLUMNS} ""
printf "\033[1;44m%*s\033[A\n" ${COLUMNS} ""
printf "\033[1;32m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
Expand Down Expand Up @@ -51,7 +51,9 @@ fi
[ -f ${PART1_PATH}/.build ] && rm -f ${PART1_PATH}/.build

# Load necessary variables
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
Expand All @@ -70,11 +72,6 @@ echo -e "$(TEXT "DMI: ") \033[1;36m${DMI}\033[0m"
echo -e "$(TEXT "CPU: ") \033[1;36m${CPU}\033[0m"
echo -e "$(TEXT "MEM: ") \033[1;36m${MEM}\033[0m"

if [ ! -f "${WORK_PATH}/model-configs/${MODEL}.yml" ] || [ -z "$(readModelKey ${MODEL} "productvers.[${PRODUCTVER}]")" ]; then
echo -e "\033[1;33m*** $(printf "$(TEXT "The current version of bootloader does not support booting %s-%s, please upgrade and rebuild.")" "${MODEL}" "${PRODUCTVER}") ***\033[0m"
exit 1
fi

if ! readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q nvmesystem; then
HASATA=0
for D in $(lsblk -dpno NAME); do
Expand All @@ -98,12 +95,9 @@ EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
declare -A CMDLINE

# Automatic values
MODELID="$(readModelKey ${MODEL} "id")"
CMDLINE['syno_hw_version']="${MODELID:-${MODEL}}"
[ -z "${VID}" ] && VID="0x46f4" # Sanity check
[ -z "${PID}" ] && PID="0x0001" # Sanity check
CMDLINE['vid']="${VID}"
CMDLINE['pid']="${PID}"
CMDLINE['vid']="${VID:-"0x46f4"}" # Sanity check
CMDLINE['pid']="${PID:-"0x0001"}" # Sanity check
CMDLINE['sn']="${SN}"

CMDLINE['netif_num']="0"
Expand All @@ -124,14 +118,28 @@ if [ ${EFI} -eq 1 ]; then
else
CMDLINE['noefi']=""
fi
if [ ! "${BUS}" = "usb" ]; then
SZ=$(blockdev --getsz ${LOADER_DISK} 2>/dev/null) # SZ=$(cat /sys/block/${LOADER_DISK/\/dev\//}/size)
SS=$(blockdev --getss ${LOADER_DISK} 2>/dev/null) # SS=$(cat /sys/block/${LOADER_DISK/\/dev\//}/queue/hw_sector_size)
SIZE=$((${SZ:-0} * ${SS:-0} / 1024 / 1024 + 10))
# Read SATADoM type
DOM="$(readModelKey "${MODEL}" "dom")"
CMDLINE['synoboot_satadom']="${DOM}"
CMDLINE['dom_szmax']="${SIZE}"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${WORK_PATH}/platforms.yml")"
KVER=$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kver" "${WORK_PATH}/platforms.yml")
KPRE=$(readConfigKey "platforms.${PLATFORM}.productvers.[${PRODUCTVER}].kpre" "${WORK_PATH}/platforms.yml")
if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 5 ]; then
if [ ! "${BUS}" = "usb" ]; then
SZ=$(blockdev --getsz ${LOADER_DISK} 2>/dev/null) # SZ=$(cat /sys/block/${LOADER_DISK/\/dev\//}/size)
SS=$(blockdev --getss ${LOADER_DISK} 2>/dev/null) # SS=$(cat /sys/block/${LOADER_DISK/\/dev\//}/queue/hw_sector_size)
SIZE=$((${SZ:-0} * ${SS:-0} / 1024 / 1024 + 10))
# Read SATADoM type
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
CMDLINE['synoboot_satadom']="${SATADOM:-2}"
CMDLINE['dom_szmax']="${SIZE}"
fi
CMDLINE["elevator"]="elevator"
fi
if [ "${DT}" = "true" ]; then
CMDLINE["syno_ttyS0"]="serial,0x3f8"
CMDLINE["syno_ttyS1"]="serial,0x2f8"
else
CMDLINE["SMBusHddDynamicPower"]="1"
CMDLINE["syno_hdd_detect"]="0"
CMDLINE["syno_hdd_powerup_seq"]="0"
fi
CMDLINE['panic']="${KERNELPANIC:-0}"
CMDLINE['console']="ttyS0,115200n8"
Expand All @@ -143,21 +151,24 @@ CMDLINE['root']="/dev/md0"
CMDLINE['skip_vender_mac_interfaces']="0,1,2,3,4,5,6,7"
CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE["HddHotplug"]="1"
CMDLINE["vender_format_version"]="2"

if [ -n "$(ls /dev/mmcblk* 2>/dev/null)" ] && [ ! "${BUS}" = "mmc" ] && [ ! "${EMMCBOOT}" = "true" ]; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="sdhci,sdhci_pci,sdhci_acpi"
fi

if [ "$(readModelKey "${MODEL}" "dt")" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "$(readModelKey "${MODEL}" "platform")"; then
if [ "${DT}" = "true" ] && ! echo "epyc7002 purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
[ ! "${CMDLINE['modprobe.blacklist']}" = "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt3sas"
fi
if echo "epyc7002 apollolake geminilake" | grep -wq "${PLATFORM}"; then
CMDLINE["intel_iommu"]="igfx_off"
fi
if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
CMDLINE["SASmodel"]="1"
fi

# Read cmdline
while IFS=': ' read KEY VALUE; do
[ -n "${KEY}" ] && CMDLINE["${KEY}"]="${VALUE}"
done <<<$(readModelMap "${MODEL}" "productvers.[${PRODUCTVER}].cmdline")
while IFS=': ' read KEY VALUE; do
[ -n "${KEY}" ] && CMDLINE["${KEY}"]="${VALUE}"
done <<<$(readConfigMap "cmdline" "${USER_CONFIG_FILE}")
Expand Down Expand Up @@ -270,7 +281,6 @@ else

# Executes DSM kernel via KEXEC
KEXECARGS=""
KVER=$(readModelKey "${MODEL}" "productvers.[${PRODUCTVER}].kver")
if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 4 ] && [ ${EFI} -eq 1 ]; then
echo -e "\033[1;33m$(TEXT "Warning, running kexec with --noefi param, strange things will happen!!")\033[0m"
KEXECARGS="--noefi"
Expand Down
3 changes: 2 additions & 1 deletion files/initrd/opt/rr/include/consts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
RR_VERSION="24.5.1"
RR_RELEASE=""
RR_TITLE="RR v${RR_VERSION}"

# Define paths
Expand Down Expand Up @@ -30,4 +31,4 @@ LKMS_PATH="${PART3_PATH}/lkms"
ADDONS_PATH="${PART3_PATH}/addons"
MODULES_PATH="${PART3_PATH}/modules"
USER_UP_PATH="${PART3_PATH}/users"
SCRIPTS_PATH="${PART3_PATH}/scripts"
SCRIPTS_PATH="${PART3_PATH}/scripts"
Loading

0 comments on commit 7f8faec

Please sign in to comment.