mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 22:29:54 +07:00
tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
474b8bbe03
commit
d9c71d453a
81
.github/workflows/autobuild.yml
vendored
81
.github/workflows/autobuild.yml
vendored
@ -5,10 +5,23 @@
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
name: Build Arc Image Dev
|
||||
name: Build Arc Image Beta
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "version (1.0.0)"
|
||||
required: true
|
||||
type: string
|
||||
next:
|
||||
description: "next"
|
||||
default: true
|
||||
type: boolean
|
||||
stable:
|
||||
description: "stable"
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -30,15 +43,6 @@ jobs:
|
||||
|
||||
df -h
|
||||
|
||||
# calculates the version number and push
|
||||
- name: Calculate Version
|
||||
run: |
|
||||
# Calculate Version
|
||||
VERSION="`date +'%y.%m'`.dev"
|
||||
|
||||
echo "Version: ${VERSION}"
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
|
||||
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get Buildroot
|
||||
run: |
|
||||
@ -62,15 +66,20 @@ jobs:
|
||||
|
||||
# Build incremental
|
||||
- name: Build Next Image
|
||||
if: inputs.next == true
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
ARCBRANCH="dev"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
ARC_BUILD="`date +'%y.%m.%d'`-dev"
|
||||
ARC_VERSION="${{ inputs.version }}"
|
||||
ARC_BRANCH="next"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
||||
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
||||
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
@ -114,12 +123,12 @@ jobs:
|
||||
# Zip image and generate checksum
|
||||
- name: Pack Next Image
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc.vhdx
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-next.zip ./p1 ./p3)
|
||||
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
||||
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
@ -129,12 +138,20 @@ jobs:
|
||||
|
||||
# Build incremental
|
||||
- name: Build Stable Image
|
||||
if: inputs.stable == true
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
ARCBRANCH="dev"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
# Modify Source File
|
||||
ARC_BUILD="`date +'%y.%m.%d'`-dev"
|
||||
ARC_VERSION="${{ inputs.version }}"
|
||||
ARC_BRANCH="stable"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
||||
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
||||
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
@ -178,20 +195,20 @@ jobs:
|
||||
# Zip image and generate checksum
|
||||
- name: Pack Stable Image
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vhdx.zip" arc.vhdx
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-stable.zip ./p1 ./p3)
|
||||
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
||||
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
||||
fi
|
||||
|
||||
# Publish a release if is a tag
|
||||
- name: Release
|
||||
if: success() && env.VERSION != ''
|
||||
if: success() && env.ARC_VERSION != ''
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ env.VERSION }}
|
||||
tag: ${{ env.ARC_VERSION }}-${{ env.ARC_BUILD }}
|
||||
prerelease: true
|
||||
makeLatest: false
|
||||
allowUpdates: true
|
||||
|
84
.github/workflows/build.yml
vendored
84
.github/workflows/build.yml
vendored
@ -11,8 +11,8 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "version"
|
||||
required: false
|
||||
description: "version (1.0.0)"
|
||||
required: true
|
||||
type: string
|
||||
notice:
|
||||
description: "Notice here"
|
||||
@ -70,24 +70,6 @@ jobs:
|
||||
|
||||
df -h
|
||||
|
||||
# calculates the version number and push
|
||||
- name: Calculate Version
|
||||
run: |
|
||||
# Calculate Version
|
||||
VERSION=""
|
||||
if [ -n "${{ inputs.version }}" ]; then
|
||||
VERSION="${{ inputs.version }}"
|
||||
else
|
||||
VERSION="`date +'%y.%m.%d'`"
|
||||
fi
|
||||
|
||||
echo "Version: ${VERSION}"
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
if [ -n "${VERSION}" ]; then
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
fi
|
||||
|
||||
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get Dependencies for all Image
|
||||
run: |
|
||||
@ -115,9 +97,16 @@ jobs:
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
ARCBRANCH="next"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
# Modify Source File
|
||||
ARC_BUILD="`date +'%y.%m.%d'`"
|
||||
ARC_VERSION="${{ inputs.version }}"
|
||||
ARC_BRANCH="next"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
||||
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
||||
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
@ -165,13 +154,13 @@ jobs:
|
||||
- name: Pack Next Image
|
||||
if: inputs.next == true
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip ./p1 ./p3)
|
||||
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
@ -185,9 +174,16 @@ jobs:
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
ARCBRANCH="stable"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
# Modify Source File
|
||||
ARC_BUILD="`date +'%y.%m.%d'`"
|
||||
ARC_VERSION="${{ inputs.version }}"
|
||||
ARC_BRANCH="stable"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
|
||||
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
|
||||
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
@ -235,21 +231,21 @@ jobs:
|
||||
- name: Pack Stable Image
|
||||
if: inputs.stable == true
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip ./p1 ./p3)
|
||||
if [ -n "${{ env.ARC_VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip ./p1 ./p3)
|
||||
fi
|
||||
|
||||
# Publish a release if is a tag
|
||||
- name: Release
|
||||
if: success() && env.VERSION != ''
|
||||
if: success() && env.ARC_VERSION != ''
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ env.VERSION }}
|
||||
tag: ${{ env.ARC_VERSION }}-${{ env.ARC_BUILD }}
|
||||
prerelease: ${{ inputs.prerelease }}
|
||||
makeLatest: ${{ inputs.latest }}
|
||||
allowUpdates: true
|
||||
@ -260,8 +256,8 @@ jobs:
|
||||
Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
||||
|
||||
### Versions:
|
||||
- next: Next Image (Full Image, all dependencies are included, DSM files will be loaded from the Internet, more features/hardware support)
|
||||
- stable: Stable Image (Full Image, all dependencies are included, DSM files will be loaded from the Internet, less features/hardware support)
|
||||
- stable: Stable Image (Full Image, all dependencies are included, less hardware support)
|
||||
- next: Next Image (Full Image, all dependencies are included, more hardware support, new features to test)
|
||||
|
||||
### Release
|
||||
${{ env.BUILD_TIME }}
|
||||
|
@ -1017,8 +1017,7 @@ function sysinfo() {
|
||||
done
|
||||
done
|
||||
# Print Config Informations
|
||||
TEXT+="\n\n\Z4> Arc: ${ARC_VERSION}\Zn"
|
||||
TEXT+="\n Branch: \Zb${ARC_BRANCH}\Zn"
|
||||
TEXT+="\n\n\Z4> Arc: ${ARC_VERSION} (${ARC_BUILD}) ${ARC_BRANCH}\Zn"
|
||||
TEXT+="\n Subversion: \ZbAddons ${ADDONSVERSION} | Configs ${CONFIGSVERSION} | LKM ${LKMVERSION} | Modules ${MODULESVERSION} | Patches ${PATCHESVERSION}\Zn"
|
||||
TEXT+="\n Config | Build: \Zb${CONFDONE} | ${BUILDDONE}\Zn"
|
||||
TEXT+="\n Config Version: \Zb${CONFIGVER}\Zn"
|
||||
@ -1367,7 +1366,7 @@ function staticIPMenu() {
|
||||
function downgradeMenu() {
|
||||
TEXT=""
|
||||
TEXT+="This feature will allow you to downgrade the installation by removing the VERSION file from the first partition of all disks.\n"
|
||||
TEXT+="Therefore, please insert all disks before continuing.\n"
|
||||
TEXT+="Please insert all disks before continuing.\n"
|
||||
TEXT+="Warning:\nThis operation is irreversible. Please backup important data. Do you want to continue?"
|
||||
dialog --backtitle "$(backtitle)" --title "Allow Downgrade" \
|
||||
--yesno "${TEXT}" 0 0
|
||||
@ -1445,7 +1444,8 @@ function resetPassword() {
|
||||
dialog --backtitle "$(backtitle)" --title "Reset Password" \
|
||||
--msgbox "Invalid password" 0 0
|
||||
done
|
||||
NEWPASSWD="$(python -c "from passlib.hash import sha512_crypt;pw=\"${VALUE}\";print(sha512_crypt.using(rounds=5000).hash(pw))")"
|
||||
#NEWPASSWD="$(python -c "from passlib.hash import sha512_crypt;pw=\"${VALUE}\";print(sha512_crypt.using(rounds=5000).hash(pw))")"
|
||||
NEWPASSWD="$(openssl passwd -6 -salt $(openssl rand -hex 8) "${VALUE}")"
|
||||
(
|
||||
mkdir -p "${TMP_PATH}/mdX"
|
||||
for I in ${DSMROOTS}; do
|
||||
@ -1514,6 +1514,156 @@ EOF
|
||||
return
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Change Arc Loader Password
|
||||
function loaderPassword() {
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Password" \
|
||||
--inputbox "New password: (Empty value 'arc')" 0 70 \
|
||||
2>${TMP_PATH}/resp
|
||||
[ $? -ne 0 ] && continue
|
||||
STRPASSWD="$(cat "${TMP_PATH}/resp")"
|
||||
NEWPASSWD="$(openssl passwd -6 -salt $(openssl rand -hex 8) "${STRPASSWD:-arc}")"
|
||||
cp -p /etc/shadow /etc/shadow-
|
||||
sed -i "s|^root:[^:]*|root:${NEWPASSWD}|" /etc/shadow
|
||||
RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
mkdir -p "${RDXZ_PATH}"
|
||||
[ -f "${ARC_RAMDISK_USER_FILE}" ] && (
|
||||
cd "${RDXZ_PATH}"
|
||||
xz -dc <"${ARC_RAMDISK_USER_FILE}" | cpio -idm
|
||||
) >/dev/null 2>&1 || true
|
||||
if [ "${STRPASSWD:-arc}" = "arc" ]; then
|
||||
rm -f ${RDXZ_PATH}/etc/shadow* 2>/dev/null
|
||||
else
|
||||
mkdir -p "${RDXZ_PATH}/etc"
|
||||
cp -p /etc/shadow* ${RDXZ_PATH}/etc && chown root:root ${RDXZ_PATH}/etc/shadow* && chmod 600 ${RDXZ_PATH}/etc/shadow*
|
||||
fi
|
||||
if [ -n "$(ls -A "${RDXZ_PATH}" 2>/dev/null)" ] && [ -n "$(ls -A "${RDXZ_PATH}/etc" 2>/dev/null)" ]; then
|
||||
(
|
||||
cd "${RDXZ_PATH}"
|
||||
RDSIZE=$(du -sb ${RDXZ_PATH} 2>/dev/null | awk '{print $1}')
|
||||
find . 2>/dev/null | cpio -o -H newc -R root:root | pv -n -s ${RDSIZE:-1} | xz -9 --check=crc32 >"${ARC_RAMDISK_USER_FILE}"
|
||||
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Loader Password" \
|
||||
--progressbox "Changing Loader password..." 30 100
|
||||
else
|
||||
rm -f "${ARC_RAMDISK_USER_FILE}"
|
||||
fi
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
[ "${STRPASSWD:-arc}" = "arc" ] && MSG="Loader Password for root restored." || MSG="Loader Password for root changed."
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Password" \
|
||||
--msgbox "${MSG}" 0 0
|
||||
return
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Change Arc Loader Password
|
||||
function loaderPorts() {
|
||||
MSG="Please use a Port between 0-65535: (Leave empty for default value.)"
|
||||
HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
while true; do
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--form "${MSG}" 11 70 3 "HTTP" 1 1 "${HTTPPORT}" 1 10 55 0 "DUFS" 2 1 "${DUFSPORT}" 2 10 55 0 "TTYD" 3 1 "${TTYDPORT}" 3 10 55 0 \
|
||||
2>"${TMP_PATH}/resp"
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
function check_port() {
|
||||
if [ -z "${1}" ]; then
|
||||
return 0
|
||||
else
|
||||
if [[ "${1}" =~ ^[0-9]+$ ]] && [ "${1}" -ge 0 ] && [ "${1}" -le 65535 ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
HTTPPORT=$(sed -n '1p' "${TMP_PATH}/resp")
|
||||
DUFSPORT=$(sed -n '2p' "${TMP_PATH}/resp")
|
||||
TTYDPORT=$(sed -n '3p' "${TMP_PATH}/resp")
|
||||
EP=""
|
||||
for P in "${HTTPPORT}" "${DUFSPORT}" "${TTYDPORT}"; do check_port "${P}" || EP="${EP} ${P}"; done
|
||||
if [ -n "${EP}" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--yesno "Invalid ${EP} Port, retry?" 0 0
|
||||
[ $? -eq 0 ] && continue || break
|
||||
fi
|
||||
rm -f "/etc/arc.conf"
|
||||
[ ! "${HTTPPORT:-7080}" = "7080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf" && /etc/init.d/S90thttpd restart >/dev/null 2>&1
|
||||
[ ! "${DUFSPORT:-7304}" = "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf" && /etc/init.d/S99dufs restart >/dev/null 2>&1
|
||||
[ ! "${TTYDPORT:-7681}" = "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf" && /etc/init.d/S99ttyd restart >/dev/null 2>&1
|
||||
RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
mkdir -p "${RDXZ_PATH}"
|
||||
[ -f "${ARC_RAMDISK_USER_FILE}" ] && (
|
||||
cd "${RDXZ_PATH}"
|
||||
xz -dc <"${ARC_RAMDISK_USER_FILE}" | cpio -idm
|
||||
) >/dev/null 2>&1 || true
|
||||
if [ ! -f "/etc/arc.conf" ]; then
|
||||
rm -f "${RDXZ_PATH}/etc/arc.conf" 2>/dev/null
|
||||
else
|
||||
mkdir -p "${RDXZ_PATH}/etc"
|
||||
cp -p /etc/arc.conf ${RDXZ_PATH}/etc
|
||||
fi
|
||||
if [ -n "$(ls -A "${RDXZ_PATH}" 2>/dev/null)" ] && [ -n "$(ls -A "${RDXZ_PATH}/etc" 2>/dev/null)" ]; then
|
||||
(
|
||||
cd "${RDXZ_PATH}"
|
||||
RDSIZE=$(du -sb ${RDXZ_PATH} 2>/dev/null | awk '{print $1}')
|
||||
find . 2>/dev/null | cpio -o -H newc -R root:root | pv -n -s ${RDSIZE:-1} | xz -9 --check=crc32 >"${ARC_RAMDISK_USER_FILE}"
|
||||
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--progressbox "Changing Ports..." 30 100
|
||||
else
|
||||
rm -f "${ARC_RAMDISK_USER_FILE}"
|
||||
fi
|
||||
rm -rf "${RDXZ_PATH}"
|
||||
[ ! -f "/etc/arc.conf" ] && MSG="Ports for TTYD/DUFS/HTTP restored." || MSG="Ports for TTYD/DUFS/HTTP changed."
|
||||
dialog --backtitle "$(backtitle)" --title "Loader Ports" \
|
||||
--msgbox "${MSG}" 0 0
|
||||
break
|
||||
;;
|
||||
1) # cancel-button
|
||||
break
|
||||
;;
|
||||
255) # ESC
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Disable all scheduled tasks of DSM
|
||||
function disablescheduledTasks {
|
||||
DSMROOTS="$(findDSMRoot)"
|
||||
if [ -z "${DSMROOTS}" ]; then
|
||||
dialog --backtitle "$(backtitle)" --title "Scheduled Tasks" \
|
||||
--msgbox "No DSM system partition(md0) found!\nPlease insert all disks before continuing." 0 0
|
||||
return
|
||||
fi
|
||||
(
|
||||
mkdir -p "${TMP_PATH}/mdX"
|
||||
for I in ${DSMROOTS}; do
|
||||
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
|
||||
[ $? -ne 0 ] && continue
|
||||
if [ -f "${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db" ]; then
|
||||
echo "UPDATE task SET enable = 0;" | sqlite3 ${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db
|
||||
sync
|
||||
echo "true" >${TMP_PATH}/isEnable
|
||||
fi
|
||||
umount "${TMP_PATH}/mdX"
|
||||
done
|
||||
rm -rf "${TMP_PATH}/mdX"
|
||||
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Scheduled Tasks" \
|
||||
--progressbox "Modifying..." 20 100
|
||||
[ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" = "true" ] && MSG="Disable all scheduled tasks successful." || MSG="Disable all scheduled tasks failed."
|
||||
dialog --backtitle "$(backtitle)" --title Scheduled Tasks \
|
||||
--msgbox "${MSG}" 0 0
|
||||
return
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# modify bootipwaittime
|
||||
function bootipwaittime() {
|
||||
|
@ -74,13 +74,13 @@ function backtitle() {
|
||||
}
|
||||
|
||||
function backtitlep() {
|
||||
[ "${STEP}" == "model" ] && BACKTITLEP="CHOOSE MODEL -> " || BACKTITLEP="Choose Model -> "
|
||||
[ "${STEP}" == "version" ] && BACKTITLEP+="CHOOSE VERSION -> " || BACKTITLEP+="Choose Version -> "
|
||||
[ "${STEP}" == "snmac" ] && BACKTITLEP+="SET SN/MAC -> " || BACKTITLEP+="Set Sn/Mac -> "
|
||||
[ "${STEP}" == "network" ] && BACKTITLEP+="SET NETWORK -> " || BACKTITLEP+="Set Network -> "
|
||||
[ "${STEP}" == "storagemap" ] && BACKTITLEP+="SET STORAGEMAP -> " || BACKTITLEP+="Set StorageMap -> "
|
||||
[ "${STEP}" == "addons" ] && BACKTITLEP+="SET ADDONS -> " || BACKTITLEP+="Set Addons -> "
|
||||
[ "${STEP}" == "build" ] && BACKTITLEP+="BUILD LOADER -> " || BACKTITLEP+="Build Loader -> "
|
||||
[ "${STEP}" == "model" ] && BACKTITLEP="CHOOSE MODEL >>> " || BACKTITLEP="Choose Model >>> "
|
||||
[ "${STEP}" == "version" ] && BACKTITLEP+="CHOOSE VERSION >>> " || BACKTITLEP+="Choose Version >>> "
|
||||
[ "${STEP}" == "snmac" ] && BACKTITLEP+="SET SN/MAC >>> " || BACKTITLEP+="Set Sn/Mac >>> "
|
||||
[ "${STEP}" == "network" ] && BACKTITLEP+="SET NETWORK >>> " || BACKTITLEP+="Set Network >>> "
|
||||
[ "${STEP}" == "storagemap" ] && BACKTITLEP+="SET STORAGEMAP >>> " || BACKTITLEP+="Set StorageMap >>> "
|
||||
[ "${STEP}" == "addons" ] && BACKTITLEP+="SET ADDONS >>> " || BACKTITLEP+="Set Addons >>> "
|
||||
[ "${STEP}" == "build" ] && BACKTITLEP+="BUILD LOADER >>> " || BACKTITLEP+="Build Loader >>> "
|
||||
[ "${STEP}" == "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM"
|
||||
echo "${BACKTITLEP}"
|
||||
}
|
||||
@ -157,19 +157,13 @@ function arcModel() {
|
||||
[ ${COMPATIBLE} -eq 1 ] && echo -e "${M} \"\t$(printf "\Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "${A}" "${DTS}" "${IGPUS}" "${HBAS}" "${M_2_CACHE}" "${M_2_STORAGE}" "${USBS}" "${BETA}")\" ">>"${TMP_PATH}/menu"
|
||||
fi
|
||||
done < <(cat "${TMP_PATH}/modellist")
|
||||
if [ -n "${ARCKEY}" ]; then
|
||||
dialog --backtitle "$(backtitlep)" --title "Arc Model" --colors \
|
||||
--cancel-label "Show all" --help-button --help-label "Exit" \
|
||||
--extra-button --extra-label "Info" \
|
||||
--menu "Supported Models for your Hardware (x = supported / + = need Addons)\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")" 0 115 0 \
|
||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||
else
|
||||
dialog --backtitle "$(backtitlep)" --title "Model" --colors \
|
||||
--cancel-label "Show all" --help-button --help-label "Exit" \
|
||||
--extra-button --extra-label "Info" \
|
||||
--menu "Supported Models for your Hardware (x = supported / + = need Addons) | Syno Models can have faulty Values.\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")" 0 115 0 \
|
||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||
fi
|
||||
[ -n "${ARCKEY}" ] && MSG="Supported Models for your Hardware (x = supported / + = need Addons)\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")" || MSG="Supported Models for your Hardware (x = supported / + = need Addons) | Syno Models can have faulty Values.\n$(printf "\Zb%-16s\Zn \Zb%-15s\Zn \Zb%-5s\Zn \Zb%-12s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Intel iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")"
|
||||
[ -n "${ARCKEY}" ] && TITLEMSG="Arc Model" || TITLEMSG="Model"
|
||||
dialog --backtitle "$(backtitlep)" --title "${TITLEMSG}" --colors \
|
||||
--cancel-label "Show all" --help-button --help-label "Exit" \
|
||||
--extra-button --extra-label "Info" \
|
||||
--menu "${MSG}" 0 115 0 \
|
||||
--file "${TMP_PATH}/menu" 2>"${TMP_PATH}/resp"
|
||||
RET=$?
|
||||
case ${RET} in
|
||||
0) # ok-button
|
||||
@ -325,11 +319,7 @@ function arcVersion() {
|
||||
MSG="Do you want to try Automated Mode?\nIf yes, Loader will configure, build and boot DSM."
|
||||
dialog --backtitle "$(backtitlep)" --colors --title "Automated Mode" \
|
||||
--yesno "${MSG}" 6 55
|
||||
if [ $? -eq 0 ]; then
|
||||
ARCMODE="automated"
|
||||
else
|
||||
ARCMODE="config"
|
||||
fi
|
||||
[ $? -eq 0 ] && ARCMODE="automated" || ARCMODE="config"
|
||||
elif [ "${ARCMODE}" == "automated" ] || [ "${ARCRESTORE}" == "true" ]; then
|
||||
VALID="true"
|
||||
fi
|
||||
@ -419,13 +409,8 @@ function arcPatch() {
|
||||
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
|
||||
# Check for Custom Build
|
||||
if [ "${ARCMODE}" == "automated" ]; then
|
||||
if [ -n "${ARCCONF}" ]; then
|
||||
SN=$(generateSerial "${MODEL}" "true")
|
||||
writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}"
|
||||
else
|
||||
SN=$(generateSerial "${MODEL}" "false")
|
||||
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
|
||||
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
||||
elif [ "${ARCMODE}" == "config" ]; then
|
||||
dialog --clear --backtitle "$(backtitlep)" \
|
||||
--nocancel --title "SN/Mac Options"\
|
||||
@ -438,15 +423,8 @@ function arcPatch() {
|
||||
[ -z "${resp}" ] && return 1
|
||||
if [ ${resp} -eq 1 ]; then
|
||||
[ -z "${ARCCONF}" ] && decryptMenu || true
|
||||
if [ -n "${ARCCONF}" ]; then
|
||||
# Read Arc Patch from File
|
||||
SN="$(generateSerial "${MODEL}" "true")"
|
||||
writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}"
|
||||
else
|
||||
# Read Arc Patch from File
|
||||
SN="$(generateSerial "${MODEL}" "false")"
|
||||
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
[ -n "${ARCCONF}" ] && SN="$(generateSerial "${MODEL}" "true")" || SN="$(generateSerial "${MODEL}" "false")"
|
||||
[ -n "${ARCCONF}" ] && writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" || writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
|
||||
elif [ ${resp} -eq 2 ]; then
|
||||
# Generate random Serial
|
||||
SN="$(generateSerial "${MODEL}" "false")"
|
||||
@ -520,11 +498,7 @@ function arcSettings() {
|
||||
governorSelection
|
||||
[ $? -ne 0 ] && return 1
|
||||
elif [ "${ARCMODE}" == "automated" ] && [ "${MACHINE}" == "Native" ] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
|
||||
if [ "${PLATFORM}" == "epyc7002" ]; then
|
||||
writeConfigKey "addons.cpufreqscaling" "schedutil" "${USER_CONFIG_FILE}"
|
||||
else
|
||||
writeConfigKey "addons.cpufreqscaling" "conservative" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
[ "${PLATFORM}" == "epyc7002" ] && writeConfigKey "addons.cpufreqscaling" "schedutil" "${USER_CONFIG_FILE}" || writeConfigKey "addons.cpufreqscaling" "conservative" "${USER_CONFIG_FILE}"
|
||||
fi
|
||||
if [ "${ARCMODE}" == "config" ]; then
|
||||
# Check for DT and HBA/Raid Controller
|
||||
@ -842,13 +816,8 @@ elif [ "${ARCMODE}" == "automated" ]; then
|
||||
make
|
||||
fi
|
||||
else
|
||||
if [ "${BUILDDONE}" == "true" ]; then
|
||||
NEXT="3"
|
||||
elif [ "${CONFDONE}" == "true" ]; then
|
||||
NEXT="2"
|
||||
else
|
||||
NEXT="1"
|
||||
fi
|
||||
[ "${CONFDONE}" == "true" ] && NEXT="2" || NEXT="1"
|
||||
[ "${BUILDDONE}" == "true" ] && NEXT="3" || NEXT="1"
|
||||
while true; do
|
||||
echo "= \"\Z4========== Main ==========\Zn \" " >"${TMP_PATH}/menu"
|
||||
if [ -z "${ARCCONF}" ] && [ "${ARCOFFLINE}" != "true" ]; then
|
||||
@ -921,7 +890,8 @@ else
|
||||
echo "t \"Change User Password \" " >>"${TMP_PATH}/menu"
|
||||
echo "N \"Add new User\" " >>"${TMP_PATH}/menu"
|
||||
echo "J \"Reset Network Config \" " >>"${TMP_PATH}/menu"
|
||||
echo "M \"Mount DSM Storage Pool (not SHR)\" " >>"${TMP_PATH}/menu"
|
||||
echo "M \"Mount DSM Storage Pool (not SHR) \" " >>"${TMP_PATH}/menu"
|
||||
echo "T \"Disable all scheduled Tasks \" " >>"${TMP_PATH}/menu"
|
||||
if [ "${PLATFORM}" == "epyc7002" ]; then
|
||||
echo "K \"Kernel: \Z4${KERNEL}\Zn \" " >>"${TMP_PATH}/menu"
|
||||
fi
|
||||
@ -948,10 +918,12 @@ else
|
||||
echo "X \"Sata DOM: \Z4${SATADOM}\Zn \" " >>"${TMP_PATH}/menu"
|
||||
echo "u \"LKM Version: \Z4${LKM}\Zn \" " >>"${TMP_PATH}/menu"
|
||||
echo "L \"Grep Logs from dbgutils \" " >>"${TMP_PATH}/menu"
|
||||
echo "U \"Change Loader Password \" " >>"${TMP_PATH}/menu"
|
||||
echo "Z \"Change Loader Ports \" " >>"${TMP_PATH}/menu"
|
||||
echo "w \"Reset Loader to Defaults \" " >>"${TMP_PATH}/menu"
|
||||
echo "C \"Clone Loader to another Disk \" " >>"${TMP_PATH}/menu"
|
||||
echo "n \"Grub Bootloader Config \" " >>"${TMP_PATH}/menu"
|
||||
echo "y \"Choose a Keymap for Loader\" " >>"${TMP_PATH}/menu"
|
||||
echo "y \"Choose a Keymap for Loader \" " >>"${TMP_PATH}/menu"
|
||||
echo "F \"\Z1Formate Disks \Zn \" " >>"${TMP_PATH}/menu"
|
||||
fi
|
||||
echo "= \"\Z4========== Misc ==========\Zn \" " >>"${TMP_PATH}/menu"
|
||||
@ -1035,6 +1007,8 @@ else
|
||||
N) addNewDSMUser; NEXT="N" ;;
|
||||
J) resetDSMNetwork; NEXT="J" ;;
|
||||
M) mountDSM; NEXT="M" ;;
|
||||
T) disablescheduledTasks; NEXT="T" ;;
|
||||
Z) loaderPorts; NEXT="Z" ;;
|
||||
K) [ "${KERNEL}" == "official" ] && KERNEL='custom' || KERNEL='official'
|
||||
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
|
||||
dialog --backtitle "$(backtitle)" --title "Kernel" \
|
||||
@ -1103,6 +1077,7 @@ else
|
||||
NEXT="u"
|
||||
;;
|
||||
L) greplogs; NEXT="L" ;;
|
||||
U) loaderPassword; NEXT="U" ;;
|
||||
w) resetLoader; NEXT="w" ;;
|
||||
C) cloneLoader; NEXT="C" ;;
|
||||
n) editGrubCfg; NEXT="n" ;;
|
||||
@ -1131,5 +1106,6 @@ echo -e "IP: \033[1;34m${IPCON}\033[0m"
|
||||
echo -e "User: \033[1;34mroot\033[0m"
|
||||
echo -e "Password: \033[1;34marc\033[0m"
|
||||
echo
|
||||
echo -e "Web Terminal:"
|
||||
echo -e "Address: \033[1;34mhttp://${IPCON}:7681\033[0m"
|
||||
echo -e "Web Terminal: \033[1;34mhttp://${IPCON}:${TTYDPORT}\033[0m"
|
||||
echo -e "Web Filemanager: \033[1;34mhttp://${IPCON}:${DUFSPORT}\033[0m"
|
||||
echo -e "Web Utilities: \033[1;34mhttp://${IPCON}:${HTTPPORT}\033[0m"
|
||||
|
@ -222,14 +222,38 @@ done
|
||||
CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space
|
||||
echo "${CMDLINE_LINE}" >"${PART1_PATH}/cmdline.yml"
|
||||
|
||||
function _bootwait() {
|
||||
# Exec Bootwait to check SSH/Web connection
|
||||
BOOTWAIT=5
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB
|
||||
MSG=""
|
||||
while test ${BOOTWAIT} -ge 0; do
|
||||
MSG="\033[1;33mAccess SSH/Web will interrupt boot...\033[0m"
|
||||
echo -en "\r${MSG}"
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WC
|
||||
if ! diff WB WC >/dev/null 2>&1; then
|
||||
echo -en "\r\033[1;33mAccess SSH/Web detected and boot is interrupted.\033[0m\n"
|
||||
rm -f WB WC
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
BOOTWAIT=$((BOOTWAIT - 1))
|
||||
done
|
||||
rm -f WB WC
|
||||
echo -en "\r$(printf "%$((${#MSG} * 2))s" " ")\n"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Boot
|
||||
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
|
||||
if [ "${DIRECTBOOT}" == "true" ]; then
|
||||
CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars
|
||||
grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}"
|
||||
grub-editenv ${USER_GRUBENVFILE} set next_entry="direct"
|
||||
_bootwait || exit 0
|
||||
echo -e "\033[1;34mReboot with Directboot\033[0m"
|
||||
exec reboot
|
||||
exit 0
|
||||
elif [ "${DIRECTBOOT}" == "false" ]; then
|
||||
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline
|
||||
grub-editenv ${USER_GRUBENVFILE} unset next_entry
|
||||
@ -276,24 +300,7 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
# Exec Bootwait to check SSH/Web connection
|
||||
BOOTWAIT=5
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WB
|
||||
MSG=""
|
||||
while test ${BOOTWAIT} -ge 0; do
|
||||
MSG="\033[1;33mAccess SSH/Web will interrupt boot...\033[0m"
|
||||
echo -en "\r${MSG}"
|
||||
busybox w 2>/dev/null | awk '{print $1" "$2" "$4" "$5" "$6}' >WC
|
||||
if ! diff WB WC >/dev/null 2>&1; then
|
||||
echo -en "\r\033[1;33mAccess SSH/Web detected and boot is interrupted.\033[0m\n"
|
||||
rm -f WB WC
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
BOOTWAIT=$((BOOTWAIT - 1))
|
||||
done
|
||||
rm -f WB WC
|
||||
echo -en "\r$(printf "%$((${#MSG} * 2))s" " ")\n"
|
||||
_bootwait || exit 0
|
||||
|
||||
DSMLOGO="$(readConfigKey "boot.dsmlogo" "${USER_CONFIG_FILE}")"
|
||||
if [ "${DSMLOGO}" == "true" ] && [ -c "/dev/fb0" ]; then
|
||||
@ -311,7 +318,7 @@ elif [ "${DIRECTBOOT}" == "false" ]; then
|
||||
if [ -n "${IPCON}" ]; then
|
||||
[ -w "/dev/${T}" ] && echo -e "Use \033[1;34mhttp://${IPCON}:5000\033[0m or try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes.\033[0m\n" >"/dev/${T}" 2>/dev/null || true
|
||||
else
|
||||
[ -w "/dev/${T}" ] && echo -e "Try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes.\nNo IP found. \033[0m\n" >"/dev/${T}" 2>/dev/null || true
|
||||
[ -w "/dev/${T}" ] && echo -e "Try \033[1;34mhttp://find.synology.com/ \033[0mto find DSM and proceed.\n\n\033[1;37mThis interface will not be operational. Wait a few minutes.\nNo IP found.\033[0m\n" >"/dev/${T}" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -4,12 +4,9 @@ PART2_PATH="/mnt/p2"
|
||||
PART3_PATH="/mnt/p3"
|
||||
TMP_PATH="/tmp"
|
||||
|
||||
if [ -f "${PART1_PATH}/ARC-BRANCH" ]; then
|
||||
ARC_BRANCH=$(cat "${PART1_PATH}/ARC-BRANCH" 2>/dev/null)
|
||||
fi
|
||||
if [ -f "${PART1_PATH}/ARC-VERSION" ]; then
|
||||
ARC_VERSION=$(cat "${PART1_PATH}/ARC-VERSION" 2>/dev/null)
|
||||
fi
|
||||
[ -f "${PART1_PATH}/ARC-BRANCH" ] && ARC_BRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") || ARC_BRANCH="null"
|
||||
[ -f "${PART1_PATH}/ARC-VERSION" ] && ARC_VERSION=$(cat "${PART1_PATH}/ARC-VERSION") || ARC_VERSION="null"
|
||||
[ -f "${PART1_PATH}/ARC-BUILD" ] && ARC_BUILD=$(cat "${PART1_PATH}/ARC-BUILD") || ARC_BUILD="null"
|
||||
ARC_TITLE="Arc ${ARC_VERSION}"
|
||||
|
||||
RAMDISK_PATH="${TMP_PATH}/ramdisk"
|
||||
@ -25,6 +22,7 @@ ORI_ZIMAGE_FILE="${PART2_PATH}/zImage"
|
||||
ORI_RDGZ_FILE="${PART2_PATH}/rd.gz"
|
||||
ARC_BZIMAGE_FILE="${PART3_PATH}/bzImage-arc"
|
||||
ARC_RAMDISK_FILE="${PART3_PATH}/initrd-arc"
|
||||
ARC_RAMDISK_USER_FILE="${PART3_PATH}/initrd-user"
|
||||
MOD_ZIMAGE_FILE="${PART3_PATH}/zImage-dsm"
|
||||
MOD_RDGZ_FILE="${PART3_PATH}/initrd-dsm"
|
||||
|
||||
@ -44,4 +42,11 @@ P_FILE="${MODEL_CONFIG_PATH}/platforms.yml"
|
||||
D_FILE="${MODEL_CONFIG_PATH}/data.yml"
|
||||
|
||||
EXTRACTOR_PATH="${PART3_PATH}/extractor"
|
||||
EXTRACTOR_BIN="syno_extract_system_patch"
|
||||
EXTRACTOR_BIN="syno_extract_system_patch"
|
||||
|
||||
HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
[ -z "${HTTPPORT}" ] && HTTPPORT=7080
|
||||
DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
[ -z "${DUFSPORT}" ] && DUFSPORT=7304
|
||||
TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
|
||||
[ -z "${TTYDPORT}" ] && TTYDPORT=7681
|
@ -157,7 +157,7 @@ elif [ "${ARCMODE}" == "update" ]; then
|
||||
elif [ "${BUILDDONE}" == "true" ] && [ "${ARCMODE}" == "dsm" ]; then
|
||||
echo -e "\033[1;34mStarting DSM Mode...\033[0m"
|
||||
if [ -f "${ARC_PATH}/boot.sh" ]; then
|
||||
exec boot.sh
|
||||
boot.sh && exit 0
|
||||
else
|
||||
echo -e "\033[1;31mError: Can't find Arc System Files...\033[0m"
|
||||
fi
|
||||
@ -189,7 +189,7 @@ for ETH in ${ETHX}; do
|
||||
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
|
||||
else
|
||||
echo -e "\r${DRIVER} (${SPEED}): \033[1;37m${IP}\033[0m"
|
||||
[ -z "${IPCON}" ] && IPCON="${IP}" && ONNIC="${ETH}"
|
||||
[ -z "${IPCON}" ] && IPCON="${IP}"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
@ -217,10 +217,10 @@ mkdir -p "${USER_UP_PATH}"
|
||||
# Load Arc Overlay
|
||||
echo -e "\033[1;34mLoading Arc Overlay...\033[0m"
|
||||
echo
|
||||
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:7681\033[0m to configure Loader."
|
||||
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}:${TTYDPORT}\033[0m to configure Loader."
|
||||
|
||||
# Check memory and load Arc
|
||||
RAM=$(free -m | grep -i mem | awk '{print$2}')
|
||||
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)
|
||||
if [ ${RAM} -le 3500 ]; then
|
||||
echo -e "\033[1;31mYou have less than 4GB of RAM, if errors occur in loader creation, please increase the amount of RAM.\033[0m\n\033[1;31mUse arc.sh to proceed. Not recommended!\033[0m"
|
||||
else
|
||||
|
@ -153,6 +153,7 @@ echo "#!/bin/sh" >"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo 'echo "addons.sh called with params ${@}"' >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export LOADERLABEL=\"ARC\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export LOADERVERSION=\"${ARC_VERSION}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export LOADERBUILD=\"${ARC_BUILD}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export LOADERBRANCH=\"${ARCBRANCH}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export PLATFORM=\"${PLATFORM}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
echo "export PRODUCTVER=\"${PRODUCTVER}\"" >>"${RAMDISK_PATH}/addons/addons.sh"
|
||||
|
@ -99,7 +99,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline}
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
fi
|
||||
@ -110,7 +114,11 @@ if [ -e /automated ]; then
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} automated_arc
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
fi
|
||||
@ -120,7 +128,11 @@ menuentry 'Arc Config Mode' --id config {
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_arc
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
|
||||
@ -130,7 +142,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} update_arc
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
menuentry 'DSM Recovery Mode' --id recovery {
|
||||
@ -138,7 +154,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} recovery
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
menuentry 'DSM Reinstall Mode' --id junior {
|
||||
@ -146,7 +166,11 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
|
||||
echo "Loading Arc Kernel..."
|
||||
linux /bzImage-arc ${ARC_CMDLINE} ${arc_cmdline} force_junior
|
||||
echo "Loading Arc Initramfs..."
|
||||
initrd /initrd-arc
|
||||
if [ -e /initrd-user ]; then
|
||||
initrd /initrd-arc /initrd-user
|
||||
else
|
||||
initrd /initrd-arc
|
||||
fi
|
||||
echo "Booting..."
|
||||
}
|
||||
fi
|
||||
|
10
img-gen-n.sh
10
img-gen-n.sh
@ -37,10 +37,12 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
[[ ! -f "brx/bzImage-arc" || ! -f "brx/initrd-arc" ]] && return 1
|
||||
|
||||
VERSION=$(date +'%y.%m.dev')
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "dev" >files/p1/ARC-BRANCH
|
||||
ARC_BUILD="`date +'%y.%m.%d'`-dev"
|
||||
ARC_VERSION="13.11"
|
||||
ARC_BRANCH="next"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
|
||||
echo "Repack initrd"
|
||||
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
||||
|
10
img-gen-s.sh
10
img-gen-s.sh
@ -37,10 +37,12 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
|
||||
|
||||
VERSION=$(date +'%y.%m.dev')
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "dev" >files/p1/ARC-BRANCH
|
||||
ARC_BUILD="`date +'%y.%m.%d'`-dev"
|
||||
ARC_VERSION="13.11"
|
||||
ARC_BRANCH="stable"
|
||||
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
||||
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
||||
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
||||
|
||||
echo "Repack initrd"
|
||||
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
||||
|
@ -275,7 +275,7 @@ function repackInitrd() {
|
||||
cd "${RDXZ_PATH}"
|
||||
sudo xz -dc <"${INITRD_FILE}" | sudo cpio -idm
|
||||
) || true
|
||||
sudo cp -Rf "${PLUGIN_PATH}/"* "${RDXZ_PATH}/"
|
||||
sudo cp -rf "${PLUGIN_PATH}/"* "${RDXZ_PATH}/"
|
||||
[ -f "${OUTPUT_PATH}" ] && rm -rf "${OUTPUT_PATH}"
|
||||
(
|
||||
cd "${RDXZ_PATH}"
|
||||
|
Loading…
Reference in New Issue
Block a user