Compare commits

...

40 Commits
1.4.6 ... 1.5.3

Author SHA1 Message Date
AuxXxilium
8143fd521e Merge pull request #6004 from AuxXxilium/dev
Dev
2025-01-27 21:30:14 +01:00
AuxXxilium
0ce9e805d5 platforms: update information
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-27 19:44:18 +01:00
AuxXxilium
f041f8c1c9 arc: update model table
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-27 19:40:51 +01:00
AuxXxilium
53756cade9 Merge pull request #5997 from AuxXxilium/dev
Dev
2025-01-27 17:51:21 +01:00
AuxXxilium
72d15f6241 tree: more changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-27 17:49:33 +01:00
AuxXxilium
9287f17766 arc: more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 20:34:38 +01:00
AuxXxilium
959381e4a1 arc/evo: finally
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 15:28:25 +01:00
AuxXxilium
200d28be38 arc/evo: do a bit more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 15:19:08 +01:00
AuxXxilium
e8ef3a7a48 evo: do a bit more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 14:32:39 +01:00
AuxXxilium
16368e5e28 tree: fix typos
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 14:26:24 +01:00
AuxXxilium
3efca12476 tree: update to latest changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-25 13:50:58 +01:00
AuxXxilium
252708ab5b tree: do more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-24 22:18:58 +01:00
AuxXxilium
54c62791ac tree: rewrite
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-24 21:55:12 +01:00
AuxXxilium
a41fb3f42a tree: more optimization
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-24 21:31:54 +01:00
AuxXxilium
2c5b0a1637 tree: add new
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-24 19:56:27 +01:00
AuxXxilium
c041a9d201 tree: fix some logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-22 20:42:56 +01:00
AuxXxilium
1392db0e26 build: fix more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-21 20:50:42 +01:00
AuxXxilium
e8832fbc11 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-21 20:47:01 +01:00
AuxXxilium
a1966daf4a build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-21 20:33:32 +01:00
AuxXxilium
9b2f7b6f89 tree: merge all to one
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-21 20:06:29 +01:00
AuxXxilium
04dbb73570 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-20 23:48:20 +01:00
AuxXxilium
68187e2f05 tree: add hints
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-20 19:47:03 +01:00
AuxXxilium
fbc5ce8073 tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-20 18:45:07 +01:00
AuxXxilium
9985b68556 credits: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 16:58:54 +01:00
AuxXxilium
1886c8763a build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 16:56:16 +01:00
AuxXxilium
039a663457 grub: rename
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 16:52:40 +01:00
AuxXxilium
e962c7201f ramdisk: remove multiple defines
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 15:44:07 +01:00
AuxXxilium
3152124fd0 grub: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 15:40:27 +01:00
AuxXxilium
cdfb0cc6bd func: fix to match latest changes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-19 02:05:11 +01:00
AuxXxilium
23749d7a95 build: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-18 13:45:31 +01:00
AuxXxilium
70ee266d78 addons/modules: fix syntax
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-18 13:15:20 +01:00
AuxXxilium
ba6a125798 consts: reduce
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-18 11:56:14 +01:00
AuxXxilium
0b5c80cb6a custom: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-17 15:04:25 +01:00
AuxXxilium
1b7bb3078e custom: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-17 14:53:07 +01:00
AuxXxilium
012e825d96 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-16 00:25:47 +01:00
AuxXxilium
f571cae9ba arc: fix model selection on some device
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-15 20:37:49 +01:00
AuxXxilium
bab144cfe0 arc: fix message
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-15 19:56:22 +01:00
AuxXxilium
d8db7bbbab tree: optimize code
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-15 19:54:15 +01:00
AuxXxilium
e084f9c225 grub: update build 2025-01-15 08:51:21 +01:00
AuxXxilium
eec2393740 tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-15 01:46:34 +01:00
27 changed files with 1783 additions and 1017 deletions

View File

@@ -32,18 +32,6 @@ on:
description: "pre release"
default: false
type: boolean
minimal:
description: "minimal"
default: true
type: boolean
microcode:
description: "microcode"
default: true
type: boolean
extended:
description: "extended"
default: false
type: boolean
clean:
description: "clean"
default: false
@@ -64,7 +52,7 @@ jobs:
releases_keep_latest: 1
delete_workflows: false
delete_tags: true
gh_token: ${{ secrets.GITHUB_TOKEN }}
gh_token: ${{ secrets.BUILD_TOKEN }}
# Install Dependencies
- name: Install Dependencies
@@ -98,9 +86,7 @@ jobs:
getOffline "files/p3/configs"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getBuildrootx "brx"
getBuildroots "brs"
getBuildrootm "brm"
getBuildroot "evo" "br"
# Export Dependencies Version to env
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
@@ -110,32 +96,30 @@ jobs:
echo "CUSTOMTAG=${CUSTOMTAG}" >> $GITHUB_ENV
echo "LKMTAG=${LKMTAG}" >> $GITHUB_ENV
echo "THEMETAG=${THEMETAG}" >> $GITHUB_ENV
echo "BRXTAG=${BRXTAG}" >> $GITHUB_ENV
echo "BRSTAG=${BRSTAG}" >> $GITHUB_ENV
echo "BRTAG=${BRTAG}" >> $GITHUB_ENV
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
echo "OK"
# Build incremental
- name: Build extended Image
if: ${{ inputs.extended }}
- name: Build Image
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_BUILD="$(date +'%y%m%d')"
ARC_VERSION="${{ inputs.version }}"
ARC_BRANCH="extended"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
ARC_BRANCH="evo"
echo "${ARC_BUILD}" > "files/p1/ARC-BUILD"
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "${ARC_VERSION}" > "files/p1/ARC-VERSION"
echo "ARC_VERSION=${ARC_VERSION}" >> $GITHUB_ENV
echo "${ARC_BRANCH}" > "files/p1/ARC-BRANCH"
echo "ARC_BRANCH=${ARC_BRANCH}" >> $GITHUB_ENV
echo "Create Arc Image"
IMAGE_FILE="arc_create.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -147,11 +131,11 @@ jobs:
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
[ ! -f "br/bzImage-arc" ] || [ ! -f "br/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
cp -f "br/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "br/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
@@ -166,12 +150,7 @@ jobs:
sudo losetup --detach ${LOOPX}
# Resize Image
resizeImg "${IMAGE_FILE}" "+1024M" "arc.img" 2>/dev/null
rm -f "${IMAGE_FILE}"
echo "Image Converter"
IMAGE_FILE="arc.img"
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
@@ -183,178 +162,7 @@ jobs:
convertova "${IMAGE_FILE}" "arc.ova"
# Zip image and generate checksum
- name: Pack extended Image
if: ${{ inputs.extended }}
run: |
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 }}.vhd.zip" arc.vhd arc.vmc
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)
sha256sum update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip >"update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.hash"
fi
# Cleanup
- name: Cleanup
run: |
rm -rf "arc.img" "arc.vmdk" "arc-dyn.vmdk" "arc-flat.vmdk" "arc.vhd" "arc.ova" "arc.vmc" 2>/dev/null
# Build incremental
- name: Build minimal Image
if: ${{ inputs.minimal }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}"
ARC_BRANCH="minimal"
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_create.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
# Resize Image
resizeImg "${IMAGE_FILE}" "+1024M" "arc.img" 2>/dev/null
rm -f "${IMAGE_FILE}"
echo "Image Converter"
IMAGE_FILE="arc.img"
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
echo "Create Arc vhd"
createvmc "arc.vmc"
qemu-img convert -p -f raw -O vpc ${IMAGE_FILE} arc.vhd
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip image and generate checksum
- name: Pack minimal Image
if: ${{ inputs.minimal }}
run: |
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 }}.vhd.zip" arc.vhd arc.vmc
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)
sha256sum update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.zip >"update-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.hash"
fi
# Cleanup
- name: Cleanup
run: |
rm -rf "arc.img" "arc.vmdk" "arc-dyn.vmdk" "arc-flat.vmdk" "arc.vhd" "arc.ova" "arc.vmc" 2>/dev/null
# Build incremental
- name: Build microcode Image
if: ${{ inputs.microcode }}
run: |
. scripts/func.sh
# Modify Source File
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="${{ inputs.version }}"
ARC_BRANCH="microcode"
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_create.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brm/bzImage-arc" ] || [ ! -f "brm/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brm/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brm/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
# Resize Image
resizeImg "${IMAGE_FILE}" "+1024M" "arc.img" 2>/dev/null
rm -f "${IMAGE_FILE}"
echo "Image Converter"
IMAGE_FILE="arc.img"
qemu-img convert -p -f raw -O vmdk ${IMAGE_FILE} arc-dyn.vmdk
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
echo "Create Arc vhd"
createvmc "arc.vmc"
qemu-img convert -p -f raw -O vpc ${IMAGE_FILE} arc.vhd
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip image and generate checksum
- name: Pack minimal Image
if: ${{ inputs.minimal }}
- name: Pack Image
run: |
if [ -n "${{ env.ARC_VERSION }}" ]; then
zip -9 "arc-${{ env.ARC_VERSION }}-${{ env.ARC_BRANCH }}.img.zip" arc.img
@@ -380,13 +188,9 @@ jobs:
- ${{ inputs.notice }}
### Information:
- Changelog is available in my Discord
- Discord Account for Arc Patch needed
### Versions:
${{ inputs.minimal && '- minimal: Full Image, all dependencies are included (reduced size, faster boot)' || '' }}
${{ inputs.microcode && '- microcode: Minimal + additional Microcode Updates' || '' }}
${{ inputs.extended && '- extended: Full Image, all dependencies are included (new features to test)' || '' }}
- Changelog is available in my Discord
- Based on VisionZ Evolution Code Base
### Dependencies:
- Addons: ${{ env.ADDONTAG }}
@@ -395,8 +199,7 @@ jobs:
- Patches: ${{ env.PATCHTAG }}
- Custom: ${{ env.CUSTOMTAG }}
- LKMs: ${{ env.LKMTAG }}
${{ inputs.minimal && format('- Buildroot minimal: {0}', env.BRSTAG) || '' }}
${{ inputs.extended && format('- Buildroot extended: {0}', env.BRXTAG) || '' }}
- Basesystem: ${{ env.BRTAG }}
### Release
- ${{ env.BUILD_TIME }}

View File

@@ -161,64 +161,41 @@ jobs:
cp -f "${IMAGE_FILE}" "arc.img"
if [ "${{ env.FORMAT }}" = "dyn" ]; then
# Zip image and generate checksum
- name: Convert & Pack
run: |
rm -rf arc-*.zip 2>/dev/null
if [ "${{ env.FORMAT }}" = "img" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.img.zip" arc.img
elif [ "${{ env.FORMAT }}" = "dyn" ]; then
echo "Image Converter -> dyn"
qemu-img convert arc.img -O vmdk -o adapter_type=lsilogic,compat6 arc-dyn.vmdk
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
elif [ "${{ env.FORMAT }}" = "flat" ]; then
echo "Image Converter -> flat"
qemu-img convert arc.img -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat,compat6 arc.vmdk
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
elif [ "${{ env.FORMAT }}" = "vhdx" ]; then
echo "Image Converter -> vhdx"
qemu-img convert arc.img -O vhdx -o subformat=dynamic arc.vhdx
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vhdx.zip" arc.vhdx
elif [ "${{ env.FORMAT }}" = "ova" ]; then
echo "Image Converter -> ova"
convertova "arc.img" "arc.ova"
fi
# Zip image and generate checksum
- name: Pack
run: |
if [ "${{ env.FORMAT }}" = "img" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.img.zip" arc.img
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.img.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "dyn" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-dyn.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "flat" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vmdk-flat.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "vhdx" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.vhdx.zip" arc.vhdx
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.vhdx.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
elif [ "${{ env.FORMAT }}" = "ova" ]; then
zip -9 "arc-${{ env.MODEL }}-${{ env.VERSION }}.ova.zip" arc.ova
UPLOAD="$(curl -k -F "file=@arc-${{ env.MODEL }}-${{ env.VERSION }}.ova.zip" "https://file.io")"
if ! echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+'; then
echo "Upload failed"
exit 1
fi
fi
EMAIL=$(curl -s -H "Authorization: token ${{ secrets.ACTION }}" "https://api.github.com/users/${{ github.event.issue.user.login }}" | jq -r '.email')
FIOURL="$(echo "${UPLOAD}" | grep -oP '"link":\s*"\K[^"]+')"
echo "EMAIL=${EMAIL}" >> $GITHUB_ENV
echo "FIOURL=${FIOURL}" >> $GITHUB_ENV
# Upload artifact
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: arc-${{ env.MODEL }}-${{ env.VERSION }}-${{ github.run_id }}
path: |
arc-*.zip
retention-days: 1
- name: Send mail
if: success() && env.EMAIL != 'null'
@@ -232,7 +209,12 @@ jobs:
to: ${{ env.EMAIL }}
from: ${{ secrets.MAIL_USERNAME }}
body: |
${{ env.FIOURL }}
Hi @${{ github.event.issue.user.login }}.
arc-${{ env.MODEL }}-${{ env.VERSION }} is ready to download:
> ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
If this isn't working, do not use customized Versions!
----
- name: Update Comment Success
if: success()
@@ -244,7 +226,7 @@ jobs:
update-mode: replace
body: |
Hi @${{ github.event.issue.user.login }}.
arc-${{ env.MODEL }}-${{ env.VERSION }} is ready to download: ${{ env.FIOURL }}
arc-${{ env.MODEL }}-${{ env.VERSION }} is ready to download:
> ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
If this isn't working, do not use customized Versions!

View File

@@ -40,6 +40,7 @@ jobs:
if: success() && inputs.push == true
run: |
if [ -f "grub.img.gz" ]; then
mv -f "grub.img.gz" "files/initrd/opt/arc/grub.img.gz"
echo "Git push ..."
git pull
status=$(git status -s | grep -E 'grub.img.gz' | awk '{printf " %s", $2}')

View File

@@ -3,17 +3,11 @@
version: "3"
tasks:
build-ext:
build-evo:
cmds:
- git reset --hard
- git pull
- ./img-ext.sh
build-min:
cmds:
- git reset --hard
- git pull
- ./img-min.sh
- ./img-gen.sh evo
compile-kpatch:
dir: kpatch

View File

@@ -1,3 +1,230 @@
###############################################################################
# Read Data
function readData() {
# Get DSM Data from Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ]; then
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
fi
# Get Arc Data from Config
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
HARDWAREID="$(genHWID)"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
SATACONTROLLER="$(readConfigKey "device.satacontroller" "${USER_CONFIG_FILE}")"
SCSICONTROLLER="$(readConfigKey "device.scsicontroller" "${USER_CONFIG_FILE}")"
RAIDCONTROLLER="$(readConfigKey "device.raidcontroller" "${USER_CONFIG_FILE}")"
SASCONTROLLER="$(readConfigKey "device.sascontroller" "${USER_CONFIG_FILE}")"
# Advanced Config
if [ "${CONFDONE}" = "true" ]; then
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")"
GOVERNOR="$(readConfigKey "governor" "${USER_CONFIG_FILE}")"
STORAGEPANEL="$(readConfigKey "addons.storagepanel" "${USER_CONFIG_FILE}")"
SEQUENTIALIO="$(readConfigKey "addons.sequentialio" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
RD_COMPRESSED="$(readConfigKey "rd-compressed" "${USER_CONFIG_FILE}")"
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
if [ "${REMAP}" = "acports" ] || [ "${REMAP}" = "maxports" ]; then
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "remap" ]; then
PORTMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "ahci" ]; then
PORTMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
elif [ "${REMAP}" = "user" ]; then
PORTMAP="user"
fi
if [[ "${REMAP}" = "acports" || "${REMAP}" = "maxports" ]]; then
SPORTMAP="SataPortMap: ${PORTMAP} | ${DISKMAP}"
elif [ "${REMAP}" = "remap" ]; then
SPORTMAP="SataRemap: ${PORTMAP}"
elif [ "${REMAP}" = "ahci" ]; then
SPORTMAP="AHCIRemap: ${PORTMAP}"
elif [ "${REMAP}" = "user" ]; then
SPORTMAP=""
[ -n "${PORTMAP}" ] && SPORTMAP+="SataPortMap: ${PORTMAP}"
[ -n "${DISKMAP}" ] && SPORTMAP+="DiskIdxMap: ${DISKMAP}"
[ -n "${PORTREMAP}" ] && SPORTMAP+="SataRemap: ${PORTREMAP}"
[ -n "${AHCIPORTREMAP}" ] && SPORTMAP+="AHCIRemap: ${AHCIPORTREMAP}"
fi
fi
# Get Config/Build Status
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
}
###############################################################################
# Advanced Menu
function advancedMenu() {
NEXT="a"
while true; do
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== System ====\Zn"
if [ "${CONFDONE}" = "true" ]; then
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "6" "\Z1Hide Boot Options\Zn"
write_menu_with_color "m" "Kernelload" "${KERNELLOAD}"
write_menu_with_color "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_with_color "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_with_color "q" "Directboot" "${DIRECTBOOT}"
write_menu_with_color "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_with_color "X" "Sata DOM" "${SATADOM}"
write_menu_with_color "u" "LKM Version" "${LKM}"
else
write_menu "6" "\Z1Show Boot Options\Zn"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "7" "\Z1Hide DSM Options\Zn"
write_menu "=" "\Z4===== DSM =====\Zn"
write_menu "j" "Cmdline"
write_menu "k" "Synoinfo"
write_menu "N" "Add new User"
write_menu "t" "Change User Password"
write_menu "J" "Reset Network Config"
write_menu "T" "Disable all scheduled Tasks"
write_menu "M" "Mount DSM Storage Pool"
write_menu "l" "Edit User Config"
write_menu "s" "Allow Downgrade Version"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "8" "\Z1Hide Loader Options\Zn"
write_menu "=" "\Z4===== Loader =====\Zn"
write_menu "D" "StaticIP for Loader/DSM"
write_menu "f" "Bootscreen Options"
write_menu "U" "Change Loader Password"
write_menu "Z" "Change Loader Ports"
write_menu "w" "Reset Loader to Defaults"
write_menu "L" "Grep Logs from dbgutils"
write_menu "B" "Grep DSM Config from Backup"
write_menu "=" "\Z1== Edit with caution! ==\Zn"
write_menu "C" "Clone Loader to another Disk"
write_menu "n" "Grub Bootloader Config"
write_menu "y" "Choose a Keymap for Loader"
write_menu "F" "\Z1Formate Disks\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Arc Config" --colors \
--cancel-label "Exit" \
--menu "" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
case ${resp} in
# DSM Section
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
j) cmdlineMenu; NEXT="j" ;;
k) synoinfoMenu; NEXT="k" ;;
l) editUserConfig; NEXT="l" ;;
s) downgradeMenu; NEXT="s" ;;
t) resetPassword; NEXT="t" ;;
N) addNewDSMUser; NEXT="N" ;;
J) resetDSMNetwork; NEXT="J" ;;
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
D) staticIPMenu; NEXT="D" ;;
f) bootScreen; NEXT="f" ;;
Z) loaderPorts; NEXT="Z" ;;
U) loaderPassword; NEXT="U" ;;
L) greplogs; NEXT="L" ;;
w) resetLoader; NEXT="w" ;;
C) cloneLoader; NEXT="C" ;;
n) editGrubCfg; NEXT="n" ;;
y) keymapMenu; NEXT="y" ;;
F) formatDisks; NEXT="F" ;;
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
m) [ "${KERNELLOAD}" = "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}"
NEXT="m"
;;
E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" = "false" ]; then
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}"
elif [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="E"
;;
W) RD_COMPRESSED=$([ "${RD_COMPRESSED}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "rd-compressed" "${RD_COMPRESSED}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="W"
;;
X) satadomMenu; NEXT="X" ;;
u) [ "${LKM}" = "prod" ] && LKM='dev' || LKM='prod'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="u"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
esac
;;
*)
break
;;
esac
done
return
}
###############################################################################
# Permits user edit the user config
function editUserConfig() {
@@ -39,53 +266,41 @@ function addonSelection() {
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
# read addons from user config
unset ADDONS
declare -A ADDONS
while IFS=': ' read -r KEY VALUE; do
[ -n "${KEY}" ] && ADDONS["${KEY}"]="${VALUE}"
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
rm -f "${TMP_PATH}/opts" >/dev/null
rm -f "${TMP_PATH}/opts"
touch "${TMP_PATH}/opts"
while read -r ADDON DESC; do
arrayExistItem "${ADDON}" "${!ADDONS[@]}" && ACT="on" || ACT="off"
if [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]] && [ -z "${ARCCONF}" ]; then
continue
elif [ "${ADDON}" = "codecpatch" ] && [ -n "${ARCCONF}" ]; then
if { [[ "${ADDON}" = "amepatch" || "${ADDON}" = "arcdns" ]] && [ -z "${ARCCONF}" ]; } || { [ "${ADDON}" = "codecpatch" ] && [ -n "${ARCCONF}" ]; }; then
continue
else
echo -e "${ADDON} \"${DESC}\" ${ACT}" >>"${TMP_PATH}/opts"
fi
done < <(availableAddons "${PLATFORM}")
if [ "${STEP}" = "addons" ]; then
dialog --backtitle "$(backtitlep)" --title "Addons" --colors --aspect 18 \
--checklist "Select Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat ${TMP_PATH}/resp)
else
dialog --backtitle "$(backtitle)" --title "Addons" --colors --aspect 18 \
--checklist "Select Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat ${TMP_PATH}/resp)
fi
unset ADDONS
dialog --backtitle "$(backtitle)" --title "Addons" --colors --aspect 18 \
--checklist "Select Addons to include.\nAddons: \Z1System Addon\Zn | \Z4App Addon\Zn\nSelect with SPACE, Confirm with ENTER!" 0 0 0 \
--file "${TMP_PATH}/opts" 2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
declare -A ADDONS
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
for ADDON in ${resp}; do
ADDONS["${ADDON}"]=""
writeConfigKey "addons.\"${ADDON}\"" "" "${USER_CONFIG_FILE}"
done
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
if [ "${STEP}" = "addons" ]; then
dialog --backtitle "$(backtitlep)" --title "Addons" \
--msgbox "Addons selected:\n${ADDONSINFO}" 7 70
else
dialog --backtitle "$(backtitle)" --title "Addons" \
--msgbox "Addons selected:\n${ADDONSINFO}" 7 70
fi
return
dialog --backtitle "$(backtitle)" --title "Addons" \
--msgbox "Addons selected:\n${ADDONSINFO}" 7 70
}
###############################################################################
@@ -709,23 +924,20 @@ function backupMenu() {
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ] && [ "${CONFDONE}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
4 "Restore Arc Config from Online" \
5 "Backup Arc Config to Online" \
2 "Restore Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
4 "Backup Arc Config to Online" \
2>"${TMP_PATH}/resp"
elif [ -n "${USERID}" ] && [ "${ARCOFFLINE}" != "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
4 "Restore Arc Config from Online" \
2 "Restore Hardware Key from DSM" \
3 "Restore Arc Config from Online" \
2>"${TMP_PATH}/resp"
else
dialog --backtitle "$(backtitle)" --title "Backup" --cancel-label "Exit" --menu "Choose an Option" 0 0 0 \
1 "Restore Arc Config from DSM" \
2 "Restore HW Encryption Key from DSM" \
3 "Backup HW Encryption Key to DSM" \
2 "Restore Hardware Key from DSM" \
2>"${TMP_PATH}/resp"
fi
[ $? -ne 0 ] && break
@@ -812,43 +1024,6 @@ function backupMenu() {
fi
;;
3)
BACKUPKEY="false"
DSMROOTS="$(findDSMRoot)"
if [ -z "${DSMROOTS}" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--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
while true; do
# fixDSMRootPart "${I}"
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
if [ -f "${PART2_PATH}/machine.key" ]; then
mkdir -p "${TMP_PATH}/mdX/usr/arc/backup/p2"
cp -f "${PART2_PATH}/machine.key" "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key"
if [ -f "${TMP_PATH}/mdX/usr/arc/backup/p2/machine.key" ]; then
BACKUPKEY="true"
sync
break
fi
fi
umount "${TMP_PATH}/mdX"
done
done
rm -rf "${TMP_PATH}/mdX" >/dev/null
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--progressbox "Backup Encryption Key ..." 20 70
if [ "${BACKUPKEY}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "Encryption Key backup successful!" 0 0
else
dialog --backtitle "$(backtitle)" --title "Backup Encrytion Key" \
--msgbox "No Encryption Key found!" 0 0
fi
;;
4)
[ -f "${USER_CONFIG_FILE}" ] && mv -f "${USER_CONFIG_FILE}" "${USER_CONFIG_FILE}.bak"
HWID="$(genHWID)"
if curl -skL "https://arc.auxxxilium.tech?cdown=${HWID}" -o "${USER_CONFIG_FILE}" 2>/dev/null; then
@@ -879,7 +1054,7 @@ function backupMenu() {
sleep 2
rm -f "${HOME}/.initialized" && exec init.sh
;;
5)
4)
HWID="$(genHWID)"
curl -sk -X POST -F "file=@${USER_CONFIG_FILE}" "https://arc.auxxxilium.tech?cup=${HWID}&userid=${USERID}" 2>/dev/null
if [ $? -eq 0 ]; then
@@ -942,20 +1117,14 @@ function updateMenu() {
4)
dialog --backtitle "$(backtitle)" --title "Switch Arc Branch" \
--menu "Choose a Branch" 0 0 0 \
1 "minimal - reduced size and faster boot" \
2 "microcode - minimal with microcode" \
3 "extended - new features to test" \
4 "dev - Development only" \
1 "evolution - Stable System" \
3 "dev - Development System" \
2>"${TMP_PATH}/opts"
[ $? -ne 0 ] && break
opts=$(cat ${TMP_PATH}/opts)
if [ ${opts} -eq 1 ]; then
ARC_BRANCH="minimal"
ARC_BRANCH="stable"
elif [ ${opts} -eq 2 ]; then
ARC_BRANCH="microcode"
elif [ ${opts} -eq 3 ]; then
ARC_BRANCH="extended"
elif [ ${opts} -eq 4 ]; then
ARC_BRANCH="dev"
fi
writeConfigKey "arc.branch" "${ARC_BRANCH}" "${USER_CONFIG_FILE}"
@@ -1048,7 +1217,7 @@ function sysinfo() {
PATCHESVERSION="$(cat "${PATCH_PATH}/VERSION")"
TIMEOUT=5
# Print System Informations
TEXT="\n\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
TEXT="\n\Z4> System: ${MACHINE} | ${BOOTSYS} | ${BUS}\Zn"
TEXT+="\n Vendor: \Zb${VENDOR}\Zn"
TEXT+="\n CPU: \Zb${CPU}\Zn"
if [ $(lspci -d ::300 | wc -l) -gt 0 ]; then
@@ -1372,12 +1541,12 @@ function credits() {
TEXT+="\n"
TEXT+="\n\Z4>> Developer:\Zn"
TEXT+="\n Arc Loader: \ZbAuxXxilium / Fulcrum\Zn"
TEXT+="\n Arc Evo Base: \ZbVisionZ\Zn"
TEXT+="\n"
TEXT+="\n\Z4>> Based on:\Zn"
TEXT+="\n Redpill: \ZbTTG / Pocopico\Zn"
TEXT+="\n ARPL/RR: \Zbfbelavenuto / wjz304\Zn"
TEXT+="\n Others: \Zb007revad / more...\Zn"
TEXT+="\n System: \ZbBuildroot\Zn"
TEXT+="\n Others: \Zb007revad / PeterSuh-Q3 / more...\Zn"
TEXT+="\n DSM: \ZbSynology Inc.\Zn"
TEXT+="\n"
TEXT+="\n\Z4>> Note:\Zn"
@@ -1686,7 +1855,7 @@ function loaderPorts() {
MSG="Modify Ports (0-65535) (Leave empty for default):"
unset HTTPPORT DUFSPORT TTYDPORT
[ -f "/etc/arc.conf" ] && source "/etc/arc.conf" 2>/dev/null
local HTTP=${HTTPPORT:-8080}
local HTTP=${HTTPPORT:-80}
local DUFS=${DUFSPORT:-7304}
local TTYD=${TTYDPORT:-7681}
while true; do
@@ -1695,7 +1864,7 @@ function loaderPorts() {
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0) # ok-button
0)
HTTP=$(sed -n '1p' "${TMP_PATH}/resp" 2>/dev/null)
DUFS=$(sed -n '2p' "${TMP_PATH}/resp" 2>/dev/null)
TTYD=$(sed -n '3p' "${TMP_PATH}/resp" 2>/dev/null)
@@ -1707,7 +1876,7 @@ function loaderPorts() {
[ $? -eq 0 ] && continue || break
fi
rm -f "/etc/arc.conf"
[ "${HTTPPORT:-8080}" != "8080" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"
[ "${HTTPPORT:-80}" != "80" ] && echo "HTTP_PORT=${HTTPPORT}" >>"/etc/arc.conf"
[ "${DUFSPORT:-7304}" != "7304" ] && echo "DUFS_PORT=${DUFSPORT}" >>"/etc/arc.conf"
[ "${TTYDPORT:-7681}" != "7681" ] && echo "TTYD_PORT=${TTYDPORT}" >>"/etc/arc.conf"
RDXZ_PATH="${TMP_PATH}/rdxz_tmp"
@@ -1762,7 +1931,7 @@ function loaderPorts() {
--msgbox "${MSG}" 0 0
rm -f "${TMP_PATH}/restartS.sh"
{
[ ! "${HTTP:-8080}" = "${HTTPPORT:-8080}" ] && echo "/etc/init.d/S90thttpd restart"
[ ! "${HTTP:-80}" = "${HTTPPORT:-80}" ] && echo "/etc/init.d/S90thttpd restart"
[ ! "${DUFS:-7304}" = "${DUFSPORT:-7304}" ] && echo "/etc/init.d/S99dufs restart"
[ ! "${TTYD:-7681}" = "${TTYDPORT:-7681}" ] && echo "/etc/init.d/S99ttyd restart"
} >"${TMP_PATH}/restartS.sh"
@@ -1792,19 +1961,25 @@ function disablescheduledTasks {
for I in ${DSMROOTS}; do
# fixDSMRootPart "${I}"
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
[ $? -ne 0 ] && continue
if [ $? -ne 0 ]; then
continue
fi
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
echo "UPDATE task SET enable = 0;" | sqlite3 "${TMP_PATH}/mdX/usr/syno/etc/esynoscheduler/esynoscheduler.db"
sync
echo "true" >${TMP_PATH}/isEnable
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 \
if [ "$(cat ${TMP_PATH}/isEnable 2>/dev/null)" = "true" ]; then
MSG="Disable all scheduled tasks successful."
else
MSG="Disable all scheduled tasks failed."
fi
dialog --backtitle "$(backtitle)" --title "Scheduled Tasks" \
--msgbox "${MSG}" 0 0
return
}
@@ -2371,7 +2546,7 @@ function getpatfiles() {
VALID="false"
if [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "false" ]; then
rm -f ${USER_UP_PATH}/*.tar
dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \
dialog --backtitle "$(backtitle)" --colors --title "DSM Boot Files" \
--infobox "Downloading DSM Boot Files..." 3 40
# Get new Files
DSM_URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/files/${MODEL/+/%2B}/${PRODUCTVER}/${PAT_HASH}.tar"
@@ -2380,7 +2555,7 @@ function getpatfiles() {
fi
elif [ ! -f "${DSM_FILE}" ] && [ "${ARCOFFLINE}" = "true" ]; then
rm -f ${USER_UP_PATH}/*.tar
dialog --backtitle "$(backtitlep)" --colors --title "DSM Boot Files" \
dialog --backtitle "$(backtitle)" --colors --title "DSM Boot Files" \
--msgbox "Please upload the DSM Boot File to ${USER_UP_PATH}.\nUse ${IPCON}:7304 to upload and press OK after it's finished.\nLink: https://github.com/AuxXxilium/arc-dsm/blob/main/files/${MODEL}/${PRODUCTVER}/${PAT_HASH}.tar" 8 120
[ $? -ne 0 ] && VALID="false"
if [ -f "${DSM_FILE}" ]; then
@@ -2391,7 +2566,7 @@ function getpatfiles() {
fi
mkdir -p "${UNTAR_PAT_PATH}"
if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "DSM Boot Files" --aspect 18 \
dialog --backtitle "$(backtitle)" --title "DSM Boot Files" --aspect 18 \
--infobox "Copying DSM Boot Files..." 3 40
tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null
copyDSMFiles "${UNTAR_PAT_PATH}" 2>/dev/null
@@ -2417,7 +2592,7 @@ function genHardwareID() {
writeConfigKey "arc.userid" "${USERID}" "${USER_CONFIG_FILE}"
writeConfigKey "bootscreen.hwidinfo" "true" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "HardwareID" \
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!" 6 70
--msgbox "HardwareID: ${HWID}\nYour HardwareID is registered to UserID: ${USERID}!\nMake sure you select Arc Patch while configure." 7 70
break
else
USERID=""

View File

@@ -18,42 +18,7 @@ KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
systemCheck
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
# Get DSM Data from Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
if [ -n "${MODEL}" ]; then
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
fi
# Get Arc Data from Config
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
USERID="$(readConfigKey "arc.userid" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "kernelpanic" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
RD_COMPRESSED="$(readConfigKey "rd-compressed" "${USER_CONFIG_FILE}")"
SATADOM="$(readConfigKey "satadom" "${USER_CONFIG_FILE}")"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
SATACONTROLLER="$(readConfigKey "device.satacontroller" "${USER_CONFIG_FILE}")"
SCSICONTROLLER="$(readConfigKey "device.scsicontroller" "${USER_CONFIG_FILE}")"
RAIDCONTROLLER="$(readConfigKey "device.raidcontroller" "${USER_CONFIG_FILE}")"
SASCONTROLLER="$(readConfigKey "device.sascontroller" "${USER_CONFIG_FILE}")"
# Get Config/Build Status
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
readData
###############################################################################
# Mounts backtitle dynamically
@@ -71,26 +36,14 @@ function backtitle() {
echo "${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}" = "boot" ] && BACKTITLEP+="BOOT DSM" || BACKTITLEP+="Boot DSM"
echo "${BACKTITLEP}"
}
###############################################################################
# Model Selection
function arcModel() {
STEP="model"
[ "${ARCOFFLINE}" != "true" ] && checkHardwareID || true
dialog --backtitle "$(backtitlep)" --title "Model" \
dialog --backtitle "$(backtitle)" --title "Model" \
--infobox "Reading Models..." 3 25
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
# Loop menu
RESTRICT=1
PS="$(readConfigEntriesArray "platforms" "${P_FILE}" | sort)"
@@ -127,15 +80,14 @@ function arcModel() {
[ "${DT}" = "true" ] && HBAS="" || HBAS="x"
[ "${M}" = "SA6400" ] && HBAS="x"
[ "${DT}" = "false" ] && USBS="int/ext" || USBS="ext"
[[ "${M}" = "DS718+" || "${M}" = "DS918+" || "${M}" = "DS1019+" || "${M}" = "DS1621xs+" || "${M}" = "RS1619xs+" ]] && M_2_CACHE="+" || M_2_CACHE="x"
M_2_CACHE="x"
[[ "${M}" = "DS220+" || "${M}" = "DS224+" ]] && M_2_CACHE=""
[[ "${M}" = "DS220+" || "${M}" = "DS224+" || "${M}" = "DS718+" || "${M}" = "DS918+" || "${M}" = "DS1019+" || "${M}" = "DS1621xs+" || "${M}" = "RS1619xs+" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
[[ "${M}" = "DS220+" || "${M}" = "DS224+" || "${DT}" = "false" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
# Check id model is compatible with CPU
if [ ${RESTRICT} -eq 1 ]; then
for F in "${FLAGS}"; do
for F in ${FLAGS}; do
if ! grep -q "^flags.*${F}.*" /proc/cpuinfo; then
COMPATIBLE=0
break
fi
done
if [ "${A}" != "epyc7002" ] && [ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ]; then
@@ -165,7 +117,7 @@ function arcModel() {
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && 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%-5s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "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%-5s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")"
[ -n "${ARCCONF}" ] && TITLEMSG="Arc Model" || TITLEMSG="Model"
dialog --backtitle "$(backtitlep)" --title "${TITLEMSG}" --colors \
dialog --backtitle "$(backtitle)" --title "${TITLEMSG}" --colors \
--cancel-label "Show all" --help-button --help-label "Exit" \
--extra-button --extra-label "Info" \
--menu "${MSG}" 0 115 0 \
@@ -183,7 +135,7 @@ function arcModel() {
3)
resp=$(cat ${TMP_PATH}/resp)
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -n 1)"
dialog --backtitle "$(backtitlep)" --colors \
dialog --backtitle "$(backtitle)" --colors \
--title "Platform Info" --textbox "./informations/${PLATFORM}.yml" 70 80
;;
*)
@@ -233,12 +185,12 @@ function arcModel() {
###############################################################################
# Arc Version Section
function arcVersion() {
STEP="version"
# Read Model Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
# Get PAT Data from Config
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
@@ -246,7 +198,7 @@ function arcVersion() {
if [ "${ARCMODE}" = "config" ] && [ "${ARCRESTORE}" != "true" ]; then
# Select Build for DSM
ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)"
dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitlep)" \
dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitle)" \
--no-items --menu "Select DSM Version" 7 30 0 ${ITEMS} \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return
@@ -263,7 +215,7 @@ function arcVersion() {
writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
fi
dialog --backtitle "$(backtitlep)" --title "Version" \
dialog --backtitle "$(backtitle)" --title "Version" \
--infobox "Reading DSM Build..." 3 25
PAT_URL=""
PAT_HASH=""
@@ -280,7 +232,7 @@ function arcVersion() {
PREV="${V}"
done < <(echo "${PVS}")
DSMPVS="$(cat ${TMP_PATH}/versions)"
dialog --backtitle "$(backtitlep)" --colors --title "DSM Build" \
dialog --backtitle "$(backtitle)" --colors --title "DSM Build" \
--no-items --menu "Select DSM Build" 0 0 0 ${DSMPVS} \
2>${TMP_PATH}/resp
RET=$?
@@ -299,7 +251,7 @@ function arcVersion() {
MSG="Failed to get PAT Data.\n"
MSG+="Please manually fill in the URL and Hash of PAT.\n"
MSG+="You will find these Data at: https://github.com/AuxXxilium/arc-dsm/blob/main/webdata.txt"
dialog --backtitle "$(backtitlep)" --colors --title "Arc Build" --default-button "OK" \
dialog --backtitle "$(backtitle)" --colors --title "Arc Build" --default-button "OK" \
--form "${MSG}" 11 120 2 "Url" 1 1 "${PAT_URL}" 1 8 110 0 "Hash" 2 1 "${PAT_HASH}" 2 8 110 0 \
2>"${TMP_PATH}/resp"
RET=$?
@@ -318,7 +270,7 @@ function arcVersion() {
fi
if [ "${ONLYVERSION}" != "true" ]; then
MSG="Do you want to try Automated Mode?\nIf yes, Loader will configure, build and boot DSM."
dialog --backtitle "$(backtitlep)" --colors --title "Automated Mode" \
dialog --backtitle "$(backtitle)" --colors --title "Automated Mode" \
--yesno "${MSG}" 6 55
if [ $? -eq 0 ]; then
writeConfigKey "arc.mode" "automated" "${USER_CONFIG_FILE}"
@@ -332,8 +284,8 @@ function arcVersion() {
fi
# Change Config if Files are valid
if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitlep)" --title "Arc Config" \
--infobox "Reconfiguring Addons, Cmdline, Modules and Synoinfo" 3 60
dialog --backtitle "$(backtitle)" --title "Arc Config" \
--infobox "Reconfiguring Cmdline, Modules and Synoinfo" 3 60
# Reset Synoinfo
writeConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
while IFS=': ' read -r KEY VALUE; do
@@ -400,7 +352,7 @@ function arcVersion() {
arcPatch
fi
else
dialog --backtitle "$(backtitlep)" --title "Arc Config" --aspect 18 \
dialog --backtitle "$(backtitle)" --title "Arc Config" --aspect 18 \
--infobox "Arc Config failed!\nExit." 4 40
writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
@@ -412,12 +364,11 @@ function arcVersion() {
###############################################################################
# Arc Patch Section
function arcPatch() {
STEP="snmac"
# Read Model Values
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "automated" ] && [ "${ARCPATCH}" != "user" ]; then
if [ -n "${ARCCONF}" ]; then
generate_and_write_serial "true"
@@ -426,7 +377,7 @@ function arcPatch() {
fi
elif [ "${ARCMODE}" = "config" ]; then
if [ -n "${ARCCONF}" ]; then
dialog --clear --backtitle "$(backtitlep)" \
dialog --clear --backtitle "$(backtitle)" \
--nocancel --title "SN/Mac Options" \
--menu "Choose an Option" 7 60 0 \
1 "Use Arc Patch (AME, QC, Push Notify and more)" \
@@ -434,7 +385,7 @@ function arcPatch() {
3 "Use my own SN/Mac (Be sure your Data is valid)" \
2>"${TMP_PATH}/resp"
else
dialog --clear --backtitle "$(backtitlep)" \
dialog --clear --backtitle "$(backtitle)" \
--nocancel --title "SN/Mac Options" \
--menu "Choose an Option" 7 60 0 \
2 "Use random SN/Mac (Reduced DSM Features)" \
@@ -454,7 +405,7 @@ function arcPatch() {
;;
3)
while true; do
dialog --backtitle "$(backtitlep)" --colors --title "Serial" \
dialog --backtitle "$(backtitle)" --colors --title "Serial" \
--inputbox "Please enter a valid SN!" 7 50 "" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break 2
@@ -475,24 +426,20 @@ function arcPatch() {
###############################################################################
# Arc Settings Section
function arcSettings() {
STEP="build"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
# Network Config for Loader
if [ "${ARCMODE}" = "config" ]; then
STEP="network"
dialog --backtitle "$(backtitlep)" --colors --title "Network Config" \
--infobox "Generating Network Config..." 3 40
sleep 2
getnet || return
fi
dialog --backtitle "$(backtitle)" --colors --title "Network Config" \
--infobox "Generating Network Config..." 3 40
sleep 2
getnet || return
if [ "${ONLYPATCH}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
@@ -502,8 +449,7 @@ function arcSettings() {
# Select Portmap for Loader
if [ "${DT}" = "false" ] && [ ${SATADRIVES} -gt 0 ]; then
STEP="storagemap"
dialog --backtitle "$(backtitlep)" --colors --title "Storage Map" \
dialog --backtitle "$(backtitle)" --colors --title "Storage Map" \
--infobox "Generating Storage Map..." 3 40
sleep 2
getmapSelection || return
@@ -511,8 +457,7 @@ function arcSettings() {
# Select Addons
if [ "${ARCMODE}" = "config" ]; then
STEP="addons"
dialog --backtitle "$(backtitlep)" --colors --title "Addons" \
dialog --backtitle "$(backtitle)" --colors --title "Addons" \
--infobox "Loading Addons Table..." 3 40
addonSelection || return
fi
@@ -520,7 +465,7 @@ function arcSettings() {
# CPU Frequency Scaling & Governor
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
if [ "${ARCMODE}" = "config" ] && [ "${MACHINE}" = "Native" ]; then
dialog --backtitle "$(backtitlep)" --colors --title "CPU Frequency Scaling" \
dialog --backtitle "$(backtitle)" --colors --title "CPU Frequency Scaling" \
--infobox "Generating Governor Table..." 3 40
governorSelection || return
elif [ "${ARCMODE}" = "automated" ] && [ "${MACHINE}" = "Native" ]; then
@@ -534,13 +479,13 @@ function arcSettings() {
# Warnings and Checks
if [ "${ARCMODE}" = "config" ]; then
[ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && dialog --backtitle "$(backtitlep)" --title "Arc Warning" --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70
[ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
MODELNIC="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
[ ${DEVICENIC} -gt 8 ] && dialog --backtitle "$(backtitlep)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than 8 NIC.\nOnly 8 supported by DSM." 6 60
[ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" = "true" ] && dialog --backtitle "$(backtitlep)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than supported by Model (${MODELNIC}).\nOnly the first ${MODELNIC} are used by Arc Patch." 6 80
[ "${AESSYS}" = "false" ] && dialog --backtitle "$(backtitlep)" --title "Arc Warning" --msgbox "WARN: Your System doesn't support Hardware encryption in DSM. (AES)" 5 70
[[ "${CPUFREQ}" = "false" || "${ACPISYS}" = "false" ]] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling" && dialog --backtitle "$(backtitlep)" --title "Arc Warning" --msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80
[ ${DEVICENIC} -gt 8 ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than 8 NIC.\nOnly 8 supported by DSM." 6 60
[ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" = "true" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than supported by Model (${MODELNIC}).\nOnly the first ${MODELNIC} are used by Arc Patch." 6 80
[ "${AESSYS}" = "false" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: Your System doesn't support Hardware encryption in DSM. (AES)" 5 70
[[ "${CPUFREQ}" = "false" || "${ACPISYS}" = "false" ]] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling" && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80
fi
# eMMC Boot Support
@@ -556,8 +501,9 @@ function arcSettings() {
# Final Config Check
if [ -n "${PLATFORM}" ] && [ -n "${MODEL}" ] && [ -n "${KVER}" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
writeConfigKey "arc.confdone" "true" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "config" ]; then
dialog --clear --backtitle "$(backtitlep)" --title "Config done" \
dialog --clear --backtitle "$(backtitle)" --title "Config done" \
--no-cancel --menu "Build now?" 7 40 0 \
1 "Yes - Build Arc Loader now" \
2 "No - I want to make changes" \
@@ -577,7 +523,6 @@ function arcSettings() {
###############################################################################
# Show Summary of Config
function arcSummary() {
STEP="build"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
@@ -642,7 +587,7 @@ function arcSummary() {
SUMMARY+="\n>> Additional Controller: \Zb${EXTERNALCONTROLLER}\Zn"
SUMMARY+="\n"
dialog --backtitle "$(backtitlep)" --colors --title "Config Summary" \
dialog --backtitle "$(backtitle)" --colors --title "Config Summary" \
--extra-button --extra-label "Cancel" --msgbox "${SUMMARY}" 0 0
RET=$?
@@ -659,7 +604,6 @@ function arcSummary() {
###############################################################################
# Building Loader
function make() {
STEP="build"
# Read Model Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
@@ -693,7 +637,7 @@ function make() {
(
livepatch
sleep 3
) 2>&1 | dialog --backtitle "$(backtitlep)" --colors --title "Build Loader" \
) 2>&1 | dialog --backtitle "$(backtitle)" --colors --title "Build Loader" \
--progressbox "Patching DSM Files..." 20 70
else
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
@@ -723,9 +667,9 @@ function make() {
###############################################################################
# Finish Building Loader
function arcFinish() {
STEP="boot"
rm -f "${LOG_FILE}" >/dev/null 2>&1 || true
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ -n "${MODELID}" ]; then
writeConfigKey "arc.builddone" "true" "${USER_CONFIG_FILE}"
@@ -752,6 +696,7 @@ function juniorboot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
@@ -772,6 +717,7 @@ function boot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
@@ -789,7 +735,6 @@ function boot() {
###############################################################################
###############################################################################
# Main loop
# Check for Arc Mode
if [ "${ARCMODE}" = "update" ]; then
if [ "${ARCOFFLINE}" != "true" ]; then
updateLoader
@@ -800,7 +745,6 @@ if [ "${ARCMODE}" = "update" ]; then
exec reboot
fi
elif [ "${ARCMODE}" = "automated" ]; then
# Check for Custom Build
if [ "${BUILDDONE}" = "false" ] || [ "${MODEL}" != "${MODELID}" ]; then
arcModel
else
@@ -810,276 +754,313 @@ elif [ "${ARCMODE}" = "config" ]; then
[ "${CONFDONE}" = "true" ] && NEXT="2" || NEXT="1"
[ "${BUILDDONE}" = "true" ] && NEXT="3" || NEXT="1"
while true; do
echo "= \"\Z4===== Main =====\Zn \" " >"${TMP_PATH}/menu"
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== Main =====\Zn"
if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
echo "0 \"HardwareID for Arc Patch\" " >>"${TMP_PATH}/menu"
write_menu "0" "HardwareID for Arc Patch"
fi
echo "1 \"Choose Model \" " >>"${TMP_PATH}/menu"
if [ "${CONFDONE}" = "true" ] && [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
echo "2 \"Rebuild Loader \" " >>"${TMP_PATH}/menu"
elif [ "${CONFDONE}" = "true" ]; then
echo "2 \"Build Loader \" " >>"${TMP_PATH}/menu"
write_menu "1" "Choose Model"
if [ "${CONFDONE}" = "true" ]; then
if [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
write_menu "2" "Rebuild Loader"
else
write_menu "2" "Build Loader"
fi
fi
if [ "${BUILDDONE}" = "true" ]; then
echo "3 \"Boot Loader \" " >>"${TMP_PATH}/menu"
write_menu "3" "Boot Loader"
fi
echo "= \"\Z4===== Info =====\Zn \" " >>"${TMP_PATH}/menu"
echo "a \"Sysinfo \" " >>"${TMP_PATH}/menu"
echo "A \"Networkdiag \" " >>"${TMP_PATH}/menu"
echo "= \"\Z4===== System ====\Zn \" " >>"${TMP_PATH}/menu"
write_menu "=" "\Z4===== Info =====\Zn"
write_menu "a" "Sysinfo"
write_menu "A" "Networkdiag"
if [ "${CONFDONE}" = "true" ]; then
if [ "${ARCOPTS}" = "true" ]; then
echo "4 \"\Z1Hide Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
write_menu "4" "\Z1Hide Arc DSM Options\Zn"
else
echo "4 \"\Z1Show Arc DSM Options\Zn \" " >>"${TMP_PATH}/menu"
write_menu "4" "\Z1Show Arc DSM Options\Zn"
fi
if [ "${ARCOPTS}" = "true" ]; then
echo "= \"\Z4==== Arc DSM ====\Zn \" " >>"${TMP_PATH}/menu"
echo "b \"Addons \" " >>"${TMP_PATH}/menu"
echo "d \"Modules \" " >>"${TMP_PATH}/menu"
echo "e \"Version \" " >>"${TMP_PATH}/menu"
echo "p \"SN/Mac Options \" " >>"${TMP_PATH}/menu"
if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
echo "S \"Sata PortMap \" " >>"${TMP_PATH}/menu"
fi
if [ "${DT}" = "true" ]; then
echo "o \"DTS Map Options \" " >>"${TMP_PATH}/menu"
fi
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
echo "g \"Frequency Scaling Governor\" " >>"${TMP_PATH}/menu"
fi
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "storagepanel"; then
echo "P \"StoragePanel Options \" " >>"${TMP_PATH}/menu"
fi
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "sequentialio"; then
echo "Q \"SequentialIO Options \" " >>"${TMP_PATH}/menu"
fi
if [ "${PLATFORM}" = "epyc7002" ]; then
echo "K \"Kernel: \Z4${KERNEL}\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DT}" = "true" ]; then
echo "H \"Hotplug/SortDrives: \Z4${HDDSORT}\Zn \" " >>"${TMP_PATH}/menu"
else
echo "h \"USB Mount as Internal: \Z4${USBMOUNT}\Zn \" " >>"${TMP_PATH}/menu"
fi
fi
if [ "${BOOTOPTS}" = "true" ]; then
echo "6 \"\Z1Hide Boot Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "6 \"\Z1Show Boot Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${BOOTOPTS}" = "true" ]; then
echo "= \"\Z4===== Boot =====\Zn \" " >>"${TMP_PATH}/menu"
echo "m \"Boot Kernelload: \Z4${KERNELLOAD}\Zn \" " >>"${TMP_PATH}/menu"
echo "E \"eMMC Boot Support: \Z4${EMMCBOOT}\Zn \" " >>"${TMP_PATH}/menu"
if [ "${DIRECTBOOT}" = "false" ]; then
echo "i \"Boot IP Waittime: \Z4${BOOTIPWAIT}\Zn \" " >>"${TMP_PATH}/menu"
fi
echo "q \"Directboot: \Z4${DIRECTBOOT}\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DSMOPTS}" = "true" ]; then
echo "7 \"\Z1Hide DSM Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "7 \"\Z1Show DSM Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${DSMOPTS}" = "true" ]; then
echo "= \"\Z4===== DSM =====\Zn \" " >>"${TMP_PATH}/menu"
echo "j \"Cmdline \" " >>"${TMP_PATH}/menu"
echo "k \"Synoinfo \" " >>"${TMP_PATH}/menu"
echo "N \"Add new User\" " >>"${TMP_PATH}/menu"
echo "t \"Change User Password \" " >>"${TMP_PATH}/menu"
echo "J \"Reset Network Config \" " >>"${TMP_PATH}/menu"
echo "T \"Disable all scheduled Tasks \" " >>"${TMP_PATH}/menu"
if [ "${PLATFORM}" = "epyc7002" ]; then
echo "M \"Mount DSM Storage Pool \" " >>"${TMP_PATH}/menu"
fi
echo "l \"Edit User Config \" " >>"${TMP_PATH}/menu"
echo "s \"Allow Downgrade Version \" " >>"${TMP_PATH}/menu"
echo "O \"Official Driver Priority: \Z4${ODP}\Zn \" " >>"${TMP_PATH}/menu"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
echo "8 \"\Z1Hide Loader Options\Zn \" " >>"${TMP_PATH}/menu"
else
echo "8 \"\Z1Show Loader Options\Zn \" " >>"${TMP_PATH}/menu"
fi
if [ "${LOADEROPTS}" = "true" ]; then
echo "= \"\Z4===== Loader =====\Zn \" " >>"${TMP_PATH}/menu"
echo "c \"Offline Mode: \Z4${ARCOFFLINE}\Zn \" " >>"${TMP_PATH}/menu"
echo "D \"StaticIP for Loader/DSM \" " >>"${TMP_PATH}/menu"
echo "f \"Bootscreen Options \" " >>"${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 "L \"Grep Logs from dbgutils \" " >>"${TMP_PATH}/menu"
echo "B \"Grep DSM Config from Backup \" " >>"${TMP_PATH}/menu"
echo "= \"\Z1== Edit with caution! ==\Zn \" " >>"${TMP_PATH}/menu"
echo "W \"RD Compression: \Z4${RD_COMPRESSED}\Zn \" " >>"${TMP_PATH}/menu"
echo "X \"Sata DOM: \Z4${SATADOM}\Zn \" " >>"${TMP_PATH}/menu"
echo "u \"LKM Version: \Z4${LKM}\Zn \" " >>"${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 "F \"\Z1Formate Disks \Zn \" " >>"${TMP_PATH}/menu"
fi
echo "= \"\Z4===== Misc =====\Zn \" " >>"${TMP_PATH}/menu"
echo "x \"Backup/Restore/Recovery \" " >>"${TMP_PATH}/menu"
[ "${ARCOFFLINE}" = "false" ] && echo "z \"Update Menu \" " >>"${TMP_PATH}/menu"
echo "I \"Power/Service Menu \" " >>"${TMP_PATH}/menu"
echo "V \"Credits \" " >>"${TMP_PATH}/menu"
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --colors \
--cancel-label "Exit" --title "Arc Menu" --menu "" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
case "$(cat ${TMP_PATH}/resp)" in
# Main Section
0) genHardwareID; NEXT="0" ;;
1) arcModel; NEXT="2" ;;
2) arcSummary; NEXT="3" ;;
3) boot; NEXT="3" ;;
# Info Section
a) sysinfo; NEXT="a" ;;
A) networkdiag; NEXT="A" ;;
# System Section
# Arc Section
4) [ "${ARCOPTS}" = "true" ] && ARCOPTS='false' || ARCOPTS='true'
ARCOPTS="${ARCOPTS}"
NEXT="4"
;;
b) addonMenu; NEXT="b" ;;
d) modulesMenu; NEXT="d" ;;
e) ONLYVERSION="true" && arcVersion; NEXT="e" ;;
p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;;
S) storageMenu; NEXT="S" ;;
o) dtsMenu; NEXT="o" ;;
g) governorMenu; NEXT="g" ;;
P) storagepanelMenu; NEXT="P" ;;
Q) sequentialIOMenu; NEXT="Q" ;;
# Boot Section
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
m) [ "${KERNELLOAD}" = "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}"
NEXT="m"
;;
E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" = "false" ]; then
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}"
elif [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
if [ "${ARCOPTS}" = "true" ]; then
write_menu "=" "\Z4==== Arc DSM ====\Zn"
write_menu "b" "Addons"
write_menu "d" "Modules"
write_menu "e" "Version"
write_menu "p" "SN/Mac Options"
if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
write_menu "S" "Sata PortMap"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="E"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
# DSM Section
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
j) cmdlineMenu; NEXT="j" ;;
k) synoinfoMenu; NEXT="k" ;;
l) editUserConfig; NEXT="l" ;;
s) downgradeMenu; NEXT="s" ;;
t) resetPassword; NEXT="t" ;;
N) addNewDSMUser; NEXT="N" ;;
J) resetDSMNetwork; NEXT="J" ;;
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
K) KERNEL=$([ "${KERNEL}" = "official" ] && echo 'custom' || echo 'official')
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Kernel" \
--infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50
if [ "${ODP}" = "true" ]; then
ODP="false"
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
if [ "${DT}" = "true" ]; then
write_menu "o" "DTS Map Options"
fi
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "${KVERP}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
for addon in "cpufreqscaling" "storagepanel" "sequentialio"; do
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "${addon}"; then
case "${addon}" in
"cpufreqscaling") write_menu "g" "Scaling Governor" ;;
"storagepanel") write_menu "P" "StoragePanel" ;;
"sequentialio") write_menu "Q" "SequentialIO" ;;
esac
fi
done
if [ "${PLATFORM}" = "epyc7002" ]; then
write_menu_with_color "K" "Kernel" "${KERNEL}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="K"
if [ "${DT}" = "true" ]; then
write_menu_with_color "H" "Hotplug/SortDrives" "${HDDSORT}"
else
write_menu_with_color "h" "USB as Internal" "${USBMOUNT}"
fi
fi
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "6" "\Z1Hide Boot Options\Zn"
else
write_menu "6" "\Z1Show Boot Options\Zn"
fi
if [ "${BOOTOPTS}" = "true" ]; then
write_menu "=" "\Z4===== Boot =====\Zn"
write_menu_with_color "m" "Boot Kernelload" "${KERNELLOAD}"
write_menu_with_color "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_with_color "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_with_color "q" "Directboot" "${DIRECTBOOT}"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "7" "\Z1Hide DSM Options\Zn"
else
write_menu "7" "\Z1Show DSM Options\Zn"
fi
if [ "${DSMOPTS}" = "true" ]; then
write_menu "=" "\Z4===== DSM =====\Zn"
write_menu "j" "Cmdline"
write_menu "k" "Synoinfo"
write_menu "N" "Add new User"
write_menu "t" "Change User Password"
write_menu "J" "Reset Network Config"
write_menu "T" "Disable all scheduled Tasks"
write_menu "M" "Mount DSM Storage Pool"
write_menu "l" "Edit User Config"
write_menu "s" "Allow Downgrade Version"
write_menu_with_color "O" "Official Driver Priority" "${ODP}"
fi
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "8" "\Z1Hide Loader Options\Zn"
else
write_menu "8" "\Z1Show Loader Options\Zn"
fi
if [ "${LOADEROPTS}" = "true" ]; then
write_menu "=" "\Z4===== Loader =====\Zn"
write_menu_with_color "c" "Offline Mode" "${ARCOFFLINE}"
write_menu "D" "StaticIP for Loader/DSM"
write_menu "f" "Bootscreen Options"
write_menu "U" "Change Loader Password"
write_menu "Z" "Change Loader Ports"
write_menu "w" "Reset Loader to Defaults"
write_menu "L" "Grep Logs from dbgutils"
write_menu "B" "Grep DSM Config from Backup"
write_menu "=" "\Z1== Edit with caution! ==\Zn"
write_menu_with_color "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_with_color "X" "Sata DOM" "${SATADOM}"
write_menu_with_color "u" "LKM Version" "${LKM}"
write_menu "C" "Clone Loader to another Disk"
write_menu "n" "Grub Bootloader Config"
write_menu "y" "Choose a Keymap for Loader"
write_menu "F" "\Z1Formate Disks\Zn"
fi
write_menu_with_color "=" "\Z4===== Misc =====\Zn"
write_menu "x" "Backup/Restore/Recovery"
[ "${ARCOFFLINE}" = "false" ] && write_menu "z" "Update Menu"
write_menu "I" "Power/Service Menu"
write_menu "V" "Credits"
if [ "$TERM" != "xterm-256color" ]; then
WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}"
else
WEBCONFIG=""
fi
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Classic UI" --colors \
--cancel-label "Evo" --help-button --help-label "Exit" \
--menu "${WEBCONFIG}" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
case ${resp} in
# Main Section
0) genHardwareID; NEXT="0" ;;
1) arcModel; NEXT="2" ;;
2) arcSummary; NEXT="3" ;;
3) boot; NEXT="3" ;;
# Info Section
a) sysinfo; NEXT="a" ;;
A) networkdiag; NEXT="A" ;;
# System Section
# Arc Section
4) [ "${ARCOPTS}" = "true" ] && ARCOPTS='false' || ARCOPTS='true'
ARCOPTS="${ARCOPTS}"
NEXT="4"
;;
b) addonMenu; NEXT="b" ;;
d) modulesMenu; NEXT="d" ;;
e) ONLYVERSION="true" && arcVersion; NEXT="e" ;;
p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;;
S) storageMenu; NEXT="S" ;;
o) dtsMenu; NEXT="o" ;;
g) governorMenu; NEXT="g" ;;
P) storagepanelMenu; NEXT="P" ;;
Q) sequentialIOMenu; NEXT="Q" ;;
# Boot Section
6) [ "${BOOTOPTS}" = "true" ] && BOOTOPTS='false' || BOOTOPTS='true'
BOOTOPTS="${BOOTOPTS}"
NEXT="6"
;;
m) [ "${KERNELLOAD}" = "kexec" ] && KERNELLOAD='power' || KERNELLOAD='kexec'
writeConfigKey "kernelload" "${KERNELLOAD}" "${USER_CONFIG_FILE}"
NEXT="m"
;;
E) [ "${EMMCBOOT}" = "true" ] && EMMCBOOT='false' || EMMCBOOT='true'
if [ "${EMMCBOOT}" = "false" ]; then
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.disk_swap" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.supportraid" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_emmc_boot" "${USER_CONFIG_FILE}"
deleteConfigKey "synoinfo.support_install_only_dev" "${USER_CONFIG_FILE}"
elif [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "emmcboot" "true" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.disk_swap" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.supportraid" "no" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_emmc_boot" "yes" "${USER_CONFIG_FILE}"
writeConfigKey "synoinfo.support_install_only_dev" "yes" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="E"
;;
i) bootipwaittime; NEXT="i" ;;
q) [ "${DIRECTBOOT}" = "false" ] && DIRECTBOOT='true' || DIRECTBOOT='false'
grub-editenv ${USER_GRUBENVFILE} create
writeConfigKey "directboot" "${DIRECTBOOT}" "${USER_CONFIG_FILE}"
NEXT="q"
;;
# DSM Section
7) [ "${DSMOPTS}" = "true" ] && DSMOPTS='false' || DSMOPTS='true'
DSMOPTS="${DSMOPTS}"
NEXT="7"
;;
j) cmdlineMenu; NEXT="j" ;;
k) synoinfoMenu; NEXT="k" ;;
l) editUserConfig; NEXT="l" ;;
s) downgradeMenu; NEXT="s" ;;
t) resetPassword; NEXT="t" ;;
N) addNewDSMUser; NEXT="N" ;;
J) resetDSMNetwork; NEXT="J" ;;
M) mountDSM; NEXT="M" ;;
T) disablescheduledTasks; NEXT="T" ;;
K) KERNEL=$([ "${KERNEL}" = "official" ] && echo 'custom' || echo 'official')
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Kernel" \
--infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50
if [ "${ODP}" = "true" ]; then
ODP="false"
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
fi
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "${KVERP}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="K"
;;
H) [ "${HDDSORT}" = "true" ] && HDDSORT='false' || HDDSORT='true'
writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="H"
;;
h) [ "${USBMOUNT}" = "true" ] && USBMOUNT='false' || USBMOUNT='true'
writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="h"
;;
O) [ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="O"
;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
c) ARCOFFLINE=$([ "${ARCOFFLINE}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}"
[ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c"
;;
D) staticIPMenu; NEXT="D" ;;
f) bootScreen; NEXT="f" ;;
Z) loaderPorts; NEXT="Z" ;;
U) loaderPassword; NEXT="U" ;;
W) RD_COMPRESSED=$([ "${RD_COMPRESSED}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "rd-compressed" "${RD_COMPRESSED}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="W"
;;
X) satadomMenu; NEXT="X" ;;
u) [ "${LKM}" = "prod" ] && LKM='dev' || LKM='prod'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="u"
;;
L) greplogs; NEXT="L" ;;
w) resetLoader; NEXT="w" ;;
C) cloneLoader; NEXT="C" ;;
n) editGrubCfg; NEXT="n" ;;
y) keymapMenu; NEXT="y" ;;
F) formatDisks; NEXT="F" ;;
# Misc Settings
x) backupMenu; NEXT="x" ;;
z) updateMenu; NEXT="z" ;;
I) rebootMenu; NEXT="I" ;;
V) credits; NEXT="V" ;;
esac
;;
H) [ "${HDDSORT}" = "true" ] && HDDSORT='false' || HDDSORT='true'
writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="H"
1)
exec evo.sh
;;
h) [ "${USBMOUNT}" = "true" ] && USBMOUNT='false' || USBMOUNT='true'
writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="h"
*)
break
;;
O) [ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="O"
;;
B) getbackup; NEXT="B" ;;
# Loader Section
8) [ "${LOADEROPTS}" = "true" ] && LOADEROPTS='false' || LOADEROPTS='true'
LOADEROPTS="${LOADEROPTS}"
NEXT="8"
;;
c) ARCOFFLINE=$([ "${ARCOFFLINE}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}"
[ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c"
;;
D) staticIPMenu; NEXT="D" ;;
f) bootScreen; NEXT="f" ;;
Z) loaderPorts; NEXT="Z" ;;
U) loaderPassword; NEXT="U" ;;
W) RD_COMPRESSED=$([ "${RD_COMPRESSED}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "rd-compressed" "${RD_COMPRESSED}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="W"
;;
X) satadomMenu; NEXT="X" ;;
u) [ "${LKM}" = "prod" ] && LKM='dev' || LKM='prod'
writeConfigKey "lkm" "${LKM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="u"
;;
L) greplogs; NEXT="L" ;;
w) resetLoader; NEXT="w" ;;
C) cloneLoader; NEXT="C" ;;
n) editGrubCfg; NEXT="n" ;;
y) keymapMenu; NEXT="y" ;;
F) formatDisks; NEXT="F" ;;
# Misc Settings
x) backupMenu; NEXT="x" ;;
z) updateMenu; NEXT="z" ;;
I) rebootMenu; NEXT="I" ;;
V) credits; NEXT="V" ;;
esac
done
clear
@@ -1090,8 +1071,7 @@ fi
# Inform user
echo -e "Call \033[1;34marc.sh\033[0m to configure Loader"
echo
echo -e "Web Terminal: \033[1;34mhttp://${IPCON}:${TTYDPORT:-7681}\033[0m"
echo -e "Web Filemanager: \033[1;34mhttp://${IPCON}:${DUFSPORT:-7304}\033[0m"
echo -e "Web Config: \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m"
echo
echo -e "SSH Access:"
echo -e "IP: \033[1;34m${IPCON}\033[0m"

View File

@@ -210,8 +210,8 @@ CMDLINE['loglevel']="15"
CMDLINE['log_buf_len']="32M"
CMDLINE['rootwait']=""
CMDLINE['panic']="${KERNELPANIC:-0}"
# CMDLINE['intremap']="off" # no need
# CMDLINE['amd_iommu_intr']="legacy" # no need
# CMDLINE['intremap']="off" # workaround for mlx5_core througput issues from linux mailing list (need more testing)
# CMDLINE['amd_iommu_intr']="legacy" # workaround for mlx5_core througput issues from linux mailing list (need more testing)
CMDLINE['pcie_aspm']="off"
# CMDLINE['intel_pstate']="disable"
# CMDLINE['amd_pstate']="disable"
@@ -345,6 +345,9 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
[ -f "${TMP_PATH}/qrcode_boot.png" ] && echo | fbv -acufi "${TMP_PATH}/qrcode_boot.png" >/dev/null 2>/dev/null || true
fi
# Wait for boot interrupt
_bootwait
for T in $(busybox w 2>/dev/null | grep -v 'TTY' | awk '{print $2}'); do
if [ -w "/dev/${T}" ]; then
[ -n "${IPCON}" ] && 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 - Network will be unreachable until DSM boot.\033[0m\n" >"/dev/${T}" 2>/dev/null \

940
files/initrd/opt/arc/evo.sh Executable file
View File

@@ -0,0 +1,940 @@
#!/usr/bin/env bash
###############################################################################
# Overlay Init Section
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
. "${ARC_PATH}/include/functions.sh"
. "${ARC_PATH}/arc-functions.sh"
. "${ARC_PATH}/include/addons.sh"
. "${ARC_PATH}/include/modules.sh"
. "${ARC_PATH}/include/update.sh"
. "${ARC_PATH}/include/storage.sh"
. "${ARC_PATH}/include/network.sh"
# Get Keymap and Timezone and check System
onlineCheck
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
systemCheck
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
readData
###############################################################################
# Mounts backtitle dynamically
function backtitle() {
BACKTITLE="${ARC_TITLE}$([ -n "${NEWTAG}" ] && [ -n "${ARC_VERSION}" ] && [ ${ARC_VERSION//[!0-9]/} -lt ${NEWTAG//[!0-9]/} ] && echo " > ${NEWTAG}") | "
BACKTITLE+="${MODEL:-(Model)} | "
BACKTITLE+="${PRODUCTVER:-(Version)} | "
BACKTITLE+="${IPCON:-(IP)} | "
BACKTITLE+="Patch: ${ARCPATCH} | "
BACKTITLE+="Config: ${CONFDONE} | "
BACKTITLE+="Build: ${BUILDDONE} | "
BACKTITLE+="${MACHINE}(${BUS}) | "
[ -n "${KEYMAP}" ] && BACKTITLE+="KB: ${KEYMAP}"
[ "${ARCOFFLINE}" = "true" ] && BACKTITLE+=" | Offline"
echo "${BACKTITLE}"
}
###############################################################################
# Model Selection
function arcModel() {
[ "${ARCOFFLINE}" != "true" ] && checkHardwareID || true
dialog --backtitle "$(backtitle)" --title "Model" \
--infobox "Reading Models..." 3 25
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
# Loop menu
RESTRICT=1
PS="$(readConfigEntriesArray "platforms" "${P_FILE}" | sort)"
echo -n "" >"${TMP_PATH}/modellist"
while read -r P; do
PM="$(readConfigEntriesArray "${P}" "${D_FILE}" | sort)"
while read -r M; do
echo "${M} ${P}" >>"${TMP_PATH}/modellist"
done < <(echo "${PM}")
done < <(echo "${PS}")
if [ "${ARCMODE}" = "config" ]; then
while true; do
echo -n "" >"${TMP_PATH}/menu"
while read -r M A; do
COMPATIBLE=1
DT="$(readConfigKey "platforms.${A}.dt" "${P_FILE}")"
FLAGS="$(readConfigArray "platforms.${A}.flags" "${P_FILE}")"
ARCCONFM="$(readConfigKey "${M}.serial" "${S_FILE}")"
ARC=""
BETA=""
[ -n "${ARCCONFM}" ] && ARC="x" || ARC=""
[ "${DT}" = "true" ] && DTS="x" || DTS=""
IGPU=""
IGPUS=""
IGPUID="$(lspci -nd ::300 2>/dev/null | grep "8086" | cut -d' ' -f3 | sed 's/://g')"
if [ -n "${IGPUID}" ]; then grep -iq "${IGPUID}" ${ARC_PATH}/include/i915ids && IGPU="all" || IGPU="epyc7002"; else IGPU=""; fi
if [[ "${A}" = "apollolake" || "${A}" = "geminilake" ]] && [ "${IGPU}" = "all" ]; then
IGPUS="+"
elif [ "${A}" = "epyc7002" ] && [[ "${IGPU}" = "epyc7002" || "${IGPU}" = "all" ]]; then
IGPUS="x"
else
IGPUS=""
fi
[ "${DT}" = "true" ] && HBAS="" || HBAS="x"
[ "${M}" = "SA6400" ] && HBAS="x"
[ "${DT}" = "false" ] && USBS="int/ext" || USBS="ext"
M_2_CACHE="x"
[[ "${M}" = "DS220+" || "${M}" = "DS224+" ]] && M_2_CACHE=""
[[ "${M}" = "DS220+" || "${M}" = "DS224+" || "${DT}" = "false" ]] && M_2_STORAGE="" || M_2_STORAGE="+"
# Check id model is compatible with CPU
if [ ${RESTRICT} -eq 1 ]; then
for F in ${FLAGS}; do
if ! grep -q "^flags.*${F}.*" /proc/cpuinfo; then
COMPATIBLE=0
fi
done
if [ "${A}" != "epyc7002" ] && [ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ]; then
COMPATIBLE=0
fi
if [ "${A}" != "epyc7002" ] && [ ${SATACONTROLLER} -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0
fi
if [ "${A}" = "epyc7002" ] && [[ ${SCSICONTROLLER} -ne 0 || ${RAIDCONTROLLER} -ne 0 ]]; then
COMPATIBLE=0
fi
if [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" = "usb" ] && [ ${SATADRIVES} -eq 0 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0
elif [ "${A}" != "epyc7002" ] && [ ${NVMEDRIVES} -gt 0 ] && [ "${BUS}" = "sata" ] && [ ${SATADRIVES} -eq 1 ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
COMPATIBLE=0
fi
[ -z "$(grep -w "${M}" "${S_FILE}")" ] && COMPATIBLE=0
fi
[ -n "$(grep -w "${M}" "${S_FILE}")" ] && BETA="Arc" || BETA="Syno"
[ -z "$(grep -w "${A}" "${P_FILE}")" ] && COMPATIBLE=0
if [ -n "${ARCCONF}" ]; then
[ ${COMPATIBLE} -eq 1 ] && echo -e "${M} \"\t$(printf "\Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "${A}" "${DTS}" "${ARC}" "${IGPUS}" "${HBAS}" "${M_2_CACHE}" "${M_2_STORAGE}" "${USBS}" "${BETA}")\" ">>"${TMP_PATH}/menu"
else
[ ${COMPATIBLE} -eq 1 ] && echo -e "${M} \"\t$(printf "\Zb%-15s\Zn \Zb%-5s\Zn \Zb%-5s\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")
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
[ -n "${ARCCONF}" ] && 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%-5s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "Arc" "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%-5s\Zn \Zb%-5s\Zn \Zb%-10s\Zn \Zb%-12s\Zn \Zb%-10s\Zn \Zb%-10s\Zn" "Model" "Platform" "DT" "iGPU" "HBA" "M.2 Cache" "M.2 Volume" "USB Mount" "Source")"
[ -n "${ARCCONF}" ] && TITLEMSG="Arc Model" || TITLEMSG="Model"
dialog --backtitle "$(backtitle)" --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)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
break
;;
1)
[ ${RESTRICT} -eq 1 ] && RESTRICT=0 || RESTRICT=1
;;
3)
resp=$(cat ${TMP_PATH}/resp)
PLATFORM="$(grep -w "${resp}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -n 1)"
dialog --backtitle "$(backtitle)" --colors \
--title "Platform Info" --textbox "./informations/${PLATFORM}.yml" 70 80
;;
*)
return
break
;;
esac
done
fi
# Reset Model Config if changed
if [ "${ARCMODE}" = "config" ] && [ "${MODEL}" != "${resp}" ]; then
MODEL="${resp}"
writeConfigKey "addons" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.remap" "" "${USER_CONFIG_FILE}"
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline" "{}" "${USER_CONFIG_FILE}"
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
writeConfigKey "hddsort" "false" "${USER_CONFIG_FILE}"
writeConfigKey "kernel" "official" "${USER_CONFIG_FILE}"
writeConfigKey "odp" "false" "${USER_CONFIG_FILE}"
writeConfigKey "model" "${MODEL}" "${USER_CONFIG_FILE}"
writeConfigKey "paturl" "" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "" "${USER_CONFIG_FILE}"
writeConfigKey "platform" "${PLATFORM}" "${USER_CONFIG_FILE}"
writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
writeConfigKey "ramdisk-hash" "" "${USER_CONFIG_FILE}"
writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "sn" "" "${USER_CONFIG_FILE}"
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
fi
PLATFORM="$(grep -w "${MODEL}" "${TMP_PATH}/modellist" | awk '{print $2}' | head -1)"
writeConfigKey "platform" "${PLATFORM}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
# Read Platform Data
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
arcVersion
}
###############################################################################
# Arc Version Section
function arcVersion() {
# Read Model Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
# Get PAT Data from Config
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check for Custom Build
if [ "${ARCMODE}" = "config" ] && [ "${ARCRESTORE}" != "true" ]; then
# Select Build for DSM
ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)"
dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitle)" \
--no-items --menu "Select DSM Version" 7 30 0 ${ITEMS} \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
if [ "${PRODUCTVER}" != "${resp}" ]; then
PRODUCTVER="${resp}"
writeConfigKey "productver" "${PRODUCTVER}" "${USER_CONFIG_FILE}"
# Reset Config if changed
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "paturl" "" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "" "${USER_CONFIG_FILE}"
writeConfigKey "ramdisk-hash" "" "${USER_CONFIG_FILE}"
writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
fi
dialog --backtitle "$(backtitle)" --title "Version" \
--infobox "Reading DSM Build..." 3 25
PAT_URL=""
PAT_HASH=""
URLVER=""
while true; do
PVS="$(readConfigEntriesArray "${PLATFORM}.\"${MODEL}\"" "${D_FILE}" | sort -r)"
echo -n "" >"${TMP_PATH}/versions"
while read -r V; do
if [ "${V:0:3}" != "${PRODUCTVER}" ] || [ "${V}" = "${PREV}" ]; then
continue
else
echo "${V}" >>"${TMP_PATH}/versions"
fi
PREV="${V}"
done < <(echo "${PVS}")
DSMPVS="$(cat ${TMP_PATH}/versions)"
dialog --backtitle "$(backtitle)" --colors --title "DSM Build" \
--no-items --menu "Select DSM Build" 0 0 0 ${DSMPVS} \
2>${TMP_PATH}/resp
RET=$?
[ ${RET} -ne 0 ] && return
PV=$(cat ${TMP_PATH}/resp)
PAT_URL="$(readConfigKey "${PLATFORM}.\"${MODEL}\".\"${PV}\".url" "${D_FILE}")"
PAT_HASH="$(readConfigKey "${PLATFORM}.\"${MODEL}\".\"${PV}\".hash" "${D_FILE}")"
writeConfigKey "productver" "${PV:0:3}" "${USER_CONFIG_FILE}"
if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
VALID="true"
break
fi
done
if [ -z "${PAT_URL}" ] || [ -z "${PAT_HASH}" ]; then
while true; do
MSG="Failed to get PAT Data.\n"
MSG+="Please manually fill in the URL and Hash of PAT.\n"
MSG+="You will find these Data at: https://github.com/AuxXxilium/arc-dsm/blob/main/webdata.txt"
dialog --backtitle "$(backtitle)" --colors --title "Arc Build" --default-button "OK" \
--form "${MSG}" 11 120 2 "Url" 1 1 "${PAT_URL}" 1 8 110 0 "Hash" 2 1 "${PAT_HASH}" 2 8 110 0 \
2>"${TMP_PATH}/resp"
RET=$?
[ ${RET} -ne 0 ] && return
PAT_URL="$(cat "${TMP_PATH}/resp" | sed -n '1p')"
PAT_HASH="$(cat "${TMP_PATH}/resp" | sed -n '2p')"
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && VALID="true" && break
done
fi
if [ "${PAT_URL}" != "${PAT_URL_CONF}" ] || [ "${PAT_HASH}" != "${PAT_HASH_CONF}" ]; then
writeConfigKey "paturl" "${PAT_URL}" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "${PAT_HASH}" "${USER_CONFIG_FILE}"
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" >/dev/null 2>&1 || true
rm -f "${USER_UP_PATH}/"*.tar >/dev/null 2>&1 || true
fi
if [ "${ONLYVERSION}" != "true" ]; then
MSG="Do you want to try Automated Mode?\nIf yes, Loader will configure, build and boot DSM."
dialog --backtitle "$(backtitle)" --colors --title "Automated Mode" \
--yesno "${MSG}" 6 55
if [ $? -eq 0 ]; then
writeConfigKey "arc.mode" "automated" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.mode" "config" "${USER_CONFIG_FILE}"
fi
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
fi
elif [ "${ARCMODE}" = "automated" ] || [ "${ARCRESTORE}" = "true" ]; then
VALID="true"
fi
# Change Config if Files are valid
if [ "${VALID}" = "true" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Config" \
--infobox "Reconfiguring Cmdline, Modules and Synoinfo" 3 60
# Reset Synoinfo
writeConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
while IFS=': ' read -r KEY VALUE; do
writeConfigKey "synoinfo.\"${KEY}\"" "${VALUE}" "${USER_CONFIG_FILE}"
done < <(readConfigMap "platforms.${PLATFORM}.synoinfo" "${P_FILE}")
# Reset Modules
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "${KVERP}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
fi
# Check Addons for Platform
ADDONS="$(readConfigKey "addons" "${USER_CONFIG_FILE}")"
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
if [ "${ADDONS}" = "{}" ]; then
initConfigKey "addons.acpid" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.cpuinfo" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.storagepanel" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.updatenotify" "" "${USER_CONFIG_FILE}"
if [ ${NVMEDRIVES} -gt 0 ]; then
if [ "${PLATFORM}" = "epyc7002" ] && [ ${SATADRIVES} -eq 0 ] && [ ${SASDRIVES} -eq 0 ]; then
initConfigKey "addons.nvmesystem" "" "${USER_CONFIG_FILE}"
elif [ "${MODEL}" = "DS918+" ] || [ "${MODEL}" = "DS1019+" ] || [ "${MODEL}" = "DS1621xs+" ] || [ "${MODEL}" = "RS1619xs+" ]; then
initConfigKey "addons.nvmecache" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
else
initConfigKey "addons.nvmevolume" "" "${USER_CONFIG_FILE}"
fi
fi
if [ "${MACHINE}" = "Native" ]; then
initConfigKey "addons.cpufreqscaling" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.powersched" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.sensors" "" "${USER_CONFIG_FILE}"
fi
if [ "${PLATFORM}" = "apollolake" ] || [ "${PLATFORM}" = "geminilake" ]; then
if [ -n "${IGPUID}" ]; then grep -iq "${IGPUID}" ${ARC_PATH}/include/i915ids && IGPU="all" || IGPU="epyc7002"; else IGPU=""; fi
[ "${IGPU}"="all" ] && initConfigKey "addons.i915" "" "${USER_CONFIG_FILE}" || true
fi
if echo "${PAT_URL}" 2>/dev/null | grep -q "7.2.2"; then
initConfigKey "addons.allowdowngrade" "" "${USER_CONFIG_FILE}"
fi
if [ -n "${ARCCONF}" ]; then
initConfigKey "addons.arcdns" "" "${USER_CONFIG_FILE}"
fi
if [ ${SASDRIVES} -gt 0 ] && [ "${DT}" = "false" ]; then
initConfigKey "addons.smartctl" "" "${USER_CONFIG_FILE}"
fi
fi
while IFS=': ' read -r ADDON PARAM; do
[ -z "${ADDON}" ] && continue
if ! checkAddonExist "${ADDON}" "${PLATFORM}"; then
deleteConfigKey "addons.\"${ADDON}\"" "${USER_CONFIG_FILE}"
fi
done < <(readConfigMap "addons" "${USER_CONFIG_FILE}")
# Check for Only Version
if [ "${ONLYVERSION}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ONLYVERSION="false"
return
else
arcPatch
fi
else
dialog --backtitle "$(backtitle)" --title "Arc Config" --aspect 18 \
--infobox "Arc Config failed!\nExit." 4 40
writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
sleep 5
return
fi
}
###############################################################################
# Arc Patch Section
function arcPatch() {
# Read Model Values
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "automated" ] && [ "${ARCPATCH}" != "user" ]; then
if [ -n "${ARCCONF}" ]; then
generate_and_write_serial "true"
else
generate_and_write_serial "false"
fi
elif [ "${ARCMODE}" = "config" ]; then
if [ -n "${ARCCONF}" ]; then
dialog --clear --backtitle "$(backtitle)" \
--nocancel --title "SN/Mac Options" \
--menu "Choose an Option" 7 60 0 \
1 "Use Arc Patch (AME, QC, Push Notify and more)" \
2 "Use random SN/Mac (Reduced DSM Features)" \
3 "Use my own SN/Mac (Be sure your Data is valid)" \
2>"${TMP_PATH}/resp"
else
dialog --clear --backtitle "$(backtitle)" \
--nocancel --title "SN/Mac Options" \
--menu "Choose an Option" 7 60 0 \
2 "Use random SN/Mac (Reduced DSM Features)" \
3 "Use my own SN/Mac (Be sure your Data is valid)" \
2>"${TMP_PATH}/resp"
fi
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
case ${resp} in
1)
generate_and_write_serial "true"
;;
2)
generate_and_write_serial "false"
;;
3)
while true; do
dialog --backtitle "$(backtitle)" --colors --title "Serial" \
--inputbox "Please enter a valid SN!" 7 50 "" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break 2
SN="$(cat "${TMP_PATH}/resp" | tr '[:lower:]' '[:upper:]')"
[ -z "${SN}" ] && return
break
done
writeConfigKey "arc.patch" "user" "${USER_CONFIG_FILE}"
writeConfigKey "sn" "${SN}" "${USER_CONFIG_FILE}"
;;
esac
fi
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
arcSettings
}
###############################################################################
# Arc Settings Section
function arcSettings() {
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
# Network Config for Loader
dialog --backtitle "$(backtitle)" --colors --title "Network Config" \
--infobox "Generating Network Config..." 3 40
sleep 2
getnet || return
if [ "${ONLYPATCH}" = "true" ]; then
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
ONLYPATCH="false"
return 0
fi
# Select Portmap for Loader
if [ "${DT}" = "false" ] && [ ${SATADRIVES} -gt 0 ]; then
dialog --backtitle "$(backtitle)" --colors --title "Storage Map" \
--infobox "Generating Storage Map..." 3 40
sleep 2
getmapSelection || return
fi
# Select Addons
if [ "${ARCMODE}" = "config" ]; then
dialog --backtitle "$(backtitle)" --colors --title "Addons" \
--infobox "Loading Addons Table..." 3 40
addonSelection || return
fi
# CPU Frequency Scaling & Governor
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling"; then
if [ "${ARCMODE}" = "config" ] && [ "${MACHINE}" = "Native" ]; then
dialog --backtitle "$(backtitle)" --colors --title "CPU Frequency Scaling" \
--infobox "Generating Governor Table..." 3 40
governorSelection || return
elif [ "${ARCMODE}" = "automated" ] && [ "${MACHINE}" = "Native" ]; then
if [ "${PLATFORM}" = "epyc7002" ]; then
writeConfigKey "governor" "schedutil" "${USER_CONFIG_FILE}"
else
writeConfigKey "governor" "conservative" "${USER_CONFIG_FILE}"
fi
fi
fi
# Warnings and Checks
if [ "${ARCMODE}" = "config" ]; then
[ "${DT}" = "true" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental." 6 70
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
MODELNIC="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
[ ${DEVICENIC} -gt 8 ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than 8 NIC.\nOnly 8 supported by DSM." 6 60
[ ${DEVICENIC} -gt ${MODELNIC} ] && [ "${ARCPATCH}" = "true" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: You have more NIC (${DEVICENIC}) than supported by Model (${MODELNIC}).\nOnly the first ${MODELNIC} are used by Arc Patch." 6 80
[ "${AESSYS}" = "false" ] && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: Your System doesn't support Hardware encryption in DSM. (AES)" 5 70
[[ "${CPUFREQ}" = "false" || "${ACPISYS}" = "false" ]] && readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "cpufreqscaling" && dialog --backtitle "$(backtitle)" --title "Arc Warning" --msgbox "WARN: It is possible that CPU Frequency Scaling is not working properly with your System." 6 80
fi
# eMMC Boot Support
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
if [ "${EMMCBOOT}" = "true" ]; then
writeConfigKey "modules.mmc_block" "" "${USER_CONFIG_FILE}"
writeConfigKey "modules.mmc_core" "" "${USER_CONFIG_FILE}"
else
deleteConfigKey "modules.mmc_block" "${USER_CONFIG_FILE}"
deleteConfigKey "modules.mmc_core" "${USER_CONFIG_FILE}"
fi
# Final Config Check
if [ -n "${PLATFORM}" ] && [ -n "${MODEL}" ] && [ -n "${KVER}" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
writeConfigKey "arc.confdone" "true" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "config" ]; then
dialog --clear --backtitle "$(backtitle)" --title "Config done" \
--no-cancel --menu "Build now?" 7 40 0 \
1 "Yes - Build Arc Loader now" \
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
[ ${resp} -eq 1 ] && arcSummary || dialog --clear --no-items --backtitle "$(backtitle)"
else
make
fi
else
dialog --backtitle "$(backtitle)" --title "Config failed" --msgbox "ERROR: Config failed!\nExit." 6 40
return 1
fi
}
###############################################################################
# Show Summary of Config
function arcSummary() {
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ADDONSINFO="$(readConfigEntriesArray "addons" "${USER_CONFIG_FILE}")"
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
# Read remap configurations
PORTMAP="$(readConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}")"
DISKMAP="$(readConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}")"
PORTREMAP="$(readConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}")"
AHCIPORTREMAP="$(readConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
KERNELLOAD="$(readConfigKey "kernelload" "${USER_CONFIG_FILE}")"
HDDSORT="$(readConfigKey "hddsort" "${USER_CONFIG_FILE}")"
NIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
EXTERNALCONTROLLER="$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")"
HARDDRIVES="$(readConfigKey "device.harddrives" "${USER_CONFIG_FILE}")"
DRIVES="$(readConfigKey "device.drives" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "emmcboot" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
# Check for user-defined remap values
if [ "${DT}" = "false" ] && [ "${REMAP}" = "user" ] && [ -z "${PORTMAP}${DISKMAP}${PORTREMAP}${AHCIPORTREMAP}" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Error" \
--msgbox "ERROR: You selected Portmap: User and not set any values. -> Can't build Loader!\nGo need to go Cmdline Options and add your Values." 6 80
return 1
fi
# Print Summary
SUMMARY="\Z4> DSM Information\Zn"
SUMMARY+="\n>> Model: \Zb${MODEL}\Zn"
SUMMARY+="\n>> Version: \Zb${PRODUCTVER}\Zn"
SUMMARY+="\n>> Platform: \Zb${PLATFORM}\Zn"
SUMMARY+="\n>> DT: \Zb${DT}\Zn"
SUMMARY+="\n>> PAT URL: \Zb${PAT_URL}\Zn"
SUMMARY+="\n>> PAT Hash: \Zb${PAT_HASH}\Zn"
[ "${MODEL}" = "SA6400" ] && SUMMARY+="\n>> Kernel: \Zb${KERNEL}\Zn"
SUMMARY+="\n>> Kernel Version: \Zb${KVER}\Zn"
SUMMARY+="\n"
SUMMARY+="\n\Z4> Arc Information\Zn"
SUMMARY+="\n>> Arc Patch: \Zb${ARCPATCH}\Zn"
[ -n "${PORTMAP}" ] && SUMMARY+="\n>> SataPortmap: \Zb${PORTMAP}\Zn"
[ -n "${DISKMAP}" ] && SUMMARY+="\n>> DiskIdxMap: \Zb${DISKMAP}\Zn"
[ -n "${PORTREMAP}" ] && SUMMARY+="\n>> SataRemap: \Zb${PORTREMAP}\Zn"
[ -n "${AHCIPORTREMAP}" ] && SUMMARY+="\n>> AhciRemap: \Zb${AHCIPORTREMAP}\Zn"
[ "${DT}" = "true" ] && SUMMARY+="\n>> Sort Drives: \Zb${HDDSORT}\Zn"
SUMMARY+="\n>> Directboot: \Zb${DIRECTBOOT}\Zn"
SUMMARY+="\n>> eMMC Boot: \Zb${EMMCBOOT}\Zn"
SUMMARY+="\n>> Kernelload: \Zb${KERNELLOAD}\Zn"
SUMMARY+="\n>> Addons: \Zb${ADDONSINFO}\Zn"
SUMMARY+="\n"
SUMMARY+="\n\Z4> Device Information\Zn"
SUMMARY+="\n>> NIC: \Zb${NIC}\Zn"
SUMMARY+="\n>> Total Disks: \Zb${DRIVES}\Zn"
SUMMARY+="\n>> Internal Disks: \Zb${HARDDRIVES}\Zn"
SUMMARY+="\n>> Additional Controller: \Zb${EXTERNALCONTROLLER}\Zn"
SUMMARY+="\n"
dialog --backtitle "$(backtitle)" --colors --title "Config Summary" \
--extra-button --extra-label "Cancel" --msgbox "${SUMMARY}" 0 0
RET=$?
case ${RET} in
0)
make
;;
3|255)
return 0
;;
esac
}
###############################################################################
# Building Loader
function make() {
# Read Model Config
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
if [ -z "${ARCCONF}" ] || [ "${ARCPATCH}" = "false" ]; then
deleteConfigKey "addons.amepatch" "${USER_CONFIG_FILE}"
deleteConfigKey "addons.arcdns" "${USER_CONFIG_FILE}"
fi
# Max Memory for DSM
RAMCONFIG="$((${RAMTOTAL} * 1024 * 2))"
writeConfigKey "synoinfo.mem_max_mb" "${RAMCONFIG}" "${USER_CONFIG_FILE}"
if [ -n "${IPCON}" ]; then
getpatfiles
else
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
--infobox "Could not build Loader!\nNetwork Connection needed." 4 40
# Set Build to false
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return
fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ "${CONFDONE}" = "true" ] && [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
(
livepatch
sleep 3
) 2>&1 | dialog --backtitle "$(backtitle)" --colors --title "Build Loader" \
--progressbox "Patching DSM Files..." 20 70
else
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
--infobox "Configuration issue found.\nCould not build Loader!\nExit." 5 40
# Set Build to false
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return
fi
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ] && [ -f "${MOD_ZIMAGE_FILE}" ] && [ -f "${MOD_RDGZ_FILE}" ]; then
MODELID="$(echo ${MODEL} | sed 's/d$/D/; s/rp$/RP/; s/rp+/RP+/')"
writeConfigKey "modelid" "${MODELID}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.version" "${ARC_VERSION}" "${USER_CONFIG_FILE}"
arcFinish
else
dialog --backtitle "$(backtitle)" --title "Build Loader" --aspect 18 \
--infobox "Could not build Loader!\nExit." 4 40
# Set Build to false
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
sleep 2
return
fi
}
###############################################################################
# Finish Building Loader
function arcFinish() {
rm -f "${LOG_FILE}" >/dev/null 2>&1 || true
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ -n "${MODELID}" ]; then
writeConfigKey "arc.builddone" "true" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "automated" ] || [ "${UPDATEMODE}" = "true" ]; then
boot
else
# Ask for Boot
dialog --clear --backtitle "$(backtitle)" --title "Build done" \
--no-cancel --menu "Boot now?" 7 40 0 \
1 "Yes - Boot DSM now" \
2 "No - I want to make changes" \
2>"${TMP_PATH}/resp"
resp=$(cat "${TMP_PATH}/resp")
[ "${resp}" -eq 1 ] && boot || return
fi
fi
}
###############################################################################
# Calls boot.sh to boot into DSM Reinstall Mode
function juniorboot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then
arcSummary
fi
else
dialog --backtitle "$(backtitle)" --title "Arc Boot" \
--infobox "Booting DSM Reinstall Mode...\nPlease stay patient!" 4 30
sleep 3
rebootTo junior
fi
}
###############################################################################
# Calls boot.sh to boot into DSM kernel/ramdisk
function boot() {
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
MODELID="$(readConfigKey "modelid" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [[ "${BUILDDONE}" = "false" && "${ARCMODE}" != "automated" ]] || [ "${MODEL}" != "${MODELID}" ]; then
dialog --backtitle "$(backtitle)" --title "Alert" \
--yesno "Config changed, you need to rebuild the Loader?" 0 0
if [ $? -eq 0 ]; then
arcSummary
fi
else
dialog --backtitle "$(backtitle)" --title "Arc Boot" \
--infobox "Booting DSM...\nPlease stay patient!" 4 25
sleep 2
exec reboot
fi
}
###############################################################################
###############################################################################
# Main loop
if [ "${ARCMODE}" = "update" ]; then
if [ "${ARCOFFLINE}" != "true" ]; then
updateLoader
else
dialog --backtitle "$(backtitle)" --title "Arc Update" \
--infobox "Update is not possible in Offline Mode!" 5 40
sleep 3
exec reboot
fi
elif [ "${ARCMODE}" = "automated" ]; then
if [ "${BUILDDONE}" = "false" ] || [ "${MODEL}" != "${MODELID}" ]; then
arcModel
else
make
fi
elif [ "${ARCMODE}" = "config" ]; then
NEXT="1"
while true; do
rm -f "${TMP_PATH}/menu" "${TMP_PATH}/resp" >/dev/null 2>&1 || true
write_menu "=" "\Z4===== Main =====\Zn"
if [ -z "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
write_menu_with_color "0" "HardwareID" "${HARDWAREID}"
fi
write_menu_with_color "1" "Model" "${MODEL}"
if [ "${CONFDONE}" = "true" ]; then
write_menu_with_color "e" "Version" "${PRODUCTVER}"
write_menu_with_color "=" "DT" "${DT}"
write_menu_with_color "=" "Platform" "${PLATFORM}"
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
write_menu_with_color "p" "Arc Patch" "${ARCPATCH}"
elif [ "${ARCOFFLINE}" = "false" ]; then
write_menu "p" "Arc Patch: \Z4Register HardwareID first\Zn"
else
write_menu "p" "SN/Mac Options"
fi
if [ "${PLATFORM}" = "epyc7002" ]; then
CPUINFO="$(cat /proc/cpuinfo | wc -l)"
if [ ${CPUINFO} -gt 24 ]; then
write_menu "=" "Custom Kernel should be used for this CPU"
fi
write_menu_with_color "K" "Kernel" "${KERNEL}"
fi
write_menu "b" "Addons"
for addon in "cpufreqscaling" "storagepanel" "sequentialio"; do
if readConfigMap "addons" "${USER_CONFIG_FILE}" | grep -q "${addon}"; then
case "${addon}" in
"cpufreqscaling") write_menu_with_color "g" "Scaling Governor" "${GOVERNOR}" ;;
"storagepanel") write_menu_with_color "P" "StoragePanel" "${STORAGEPANEL:-auto}" ;;
"sequentialio") write_menu_with_color "Q" "SequentialIO" "${SEQUENTIALIO}" ;;
esac
fi
done
write_menu "d" "Modules"
write_menu_with_color "O" "Official Driver Priority" "${ODP}"
if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
write_menu_with_color "S" "PortMap" "${REMAP}"
write_menu_with_color "=" "Mapping" "${PORTMAP}"
fi
if [ "${DT}" = "true" ]; then
write_menu_with_color "H" "Hotplug/SortDrives" "${HDDSORT}"
else
write_menu_with_color "h" "USB as Internal" "${USBMOUNT}"
fi
fi
write_menu_with_color "c" "Offline Mode" "${ARCOFFLINE}"
write_menu "9" "Advanced Options"
write_menu "=" "\Z4===== Diag =====\Zn"
write_menu "a" "Sysinfo"
write_menu "A" "Networkdiag"
write_menu "=" "\Z4===== Misc =====\Zn"
write_menu "x" "Backup/Restore/Recovery"
[ "${ARCOFFLINE}" = "false" ] && write_menu "z" "Update Menu"
write_menu "I" "Power/Service Menu"
write_menu "V" "Credits"
if [ "${CONFDONE}" = "false" ]; then
EXTRA_LABEL="Config"
elif [ "${CONFDONE}" = "true" ]; then
EXTRA_LABEL="Build"
elif [ "${BUILDDONE}" = "true" ]; then
EXTRA_LABEL="Boot"
fi
if [ "$TERM" != "xterm-256color" ]; then
WEBCONFIG="Webconfig: http://${IPCON}${HTTPPORT:+:$HTTPPORT}"
else
WEBCONFIG=""
fi
dialog --clear --default-item ${NEXT} --backtitle "$(backtitle)" --title "Evo UI" --colors \
--cancel-label "Classic" --help-button --help-label "Exit" \
--extra-button --extra-label "${EXTRA_LABEL}" \
--menu "${WEBCONFIG}" 0 0 0 --file "${TMP_PATH}/menu" \
2>"${TMP_PATH}/resp"
RET=$?
case ${RET} in
0)
resp=$(cat ${TMP_PATH}/resp)
[ -z "${resp}" ] && return
case ${resp} in
0) genHardwareID; NEXT="0" ;;
1) arcModel; NEXT="2" ;;
b) addonMenu; NEXT="b" ;;
d) modulesMenu; NEXT="d" ;;
e) ONLYVERSION="true" && arcVersion; NEXT="e" ;;
p) ONLYPATCH="true" && checkHardwareID && arcPatch; NEXT="p" ;;
S) storageMenu; NEXT="S" ;;
g) governorMenu; NEXT="g" ;;
P) storagepanelMenu; NEXT="P" ;;
Q) sequentialIOMenu; NEXT="Q" ;;
K) KERNEL=$([ "${KERNEL}" = "official" ] && echo 'custom' || echo 'official')
writeConfigKey "kernel" "${KERNEL}" "${USER_CONFIG_FILE}"
dialog --backtitle "$(backtitle)" --title "Kernel" \
--infobox "Switching Kernel to ${KERNEL}! Stay patient..." 4 50
if [ "${ODP}" = "true" ]; then
ODP="false"
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
fi
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
[ "${PLATFORM}" = "epyc7002" ] && KVERP="${PRODUCTVER}-${KVER}" || KVERP="${KVER}"
if [ -n "${PLATFORM}" ] && [ -n "${KVERP}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "${KVERP}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
fi
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="K"
;;
H) [ "${HDDSORT}" = "true" ] && HDDSORT='false' || HDDSORT='true'
writeConfigKey "hddsort" "${HDDSORT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="H"
;;
h) [ "${USBMOUNT}" = "true" ] && USBMOUNT='false' || USBMOUNT='true'
writeConfigKey "usbmount" "${USBMOUNT}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="h"
;;
O) [ "${ODP}" = "false" ] && ODP='true' || ODP='false'
writeConfigKey "odp" "${ODP}" "${USER_CONFIG_FILE}"
writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
NEXT="O"
;;
c) ARCOFFLINE=$([ "${ARCOFFLINE}" = "true" ] && echo 'false' || echo 'true')
writeConfigKey "arc.offline" "${ARCOFFLINE}" "${USER_CONFIG_FILE}"
[ "${ARCOFFLINE}" = "false" ] && exec arc.sh
NEXT="c"
;;
# Diag Section
a) sysinfo; NEXT="a" ;;
A) networkdiag; NEXT="A" ;;
# Misc Settings
x) backupMenu; NEXT="x" ;;
z) updateMenu; NEXT="z" ;;
I) rebootMenu; NEXT="I" ;;
V) credits; NEXT="V" ;;
9) advancedMenu; NEXT="9" ;;
esac
;;
1)
exec arc.sh
;;
3)
if [ "${CONFDONE}" = "false" ]; then
arcModel
elif [ "${CONFDONE}" = "true" ]; then
arcSummary
elif [ "${BUILDDONE}" = "true" ]; then
boot
fi
;;
*)
break
;;
esac
done
else
exec reboot
fi
# Inform user
echo -e "Call \033[1;34marc.sh\033[0m to configure Loader"
echo
echo -e "Web Config: \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m"
echo
echo -e "SSH Access:"
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

View File

@@ -11,7 +11,7 @@ function availableAddons() {
local PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
for D in $(find "${ADDONS_PATH}" -maxdepth 1 -type d 2>/dev/null | sort); do
[ ! -f "${D}/manifest.yml" ] && continue
local ADDON=$(basename ${D})
local ADDON=$(basename "${D}")
local AVAILABLE="$(readConfigKey "${1}" "${D}/manifest.yml")"
[ "${AVAILABLE}" = false ] && continue
local SYSTEM=$(readConfigKey "system" "${D}/manifest.yml")

View File

@@ -13,10 +13,11 @@ RAMDISK_PATH="${TMP_PATH}/ramdisk"
LOG_FILE="${TMP_PATH}/log.txt"
TMP_UP_PATH="${TMP_PATH}/upload"
USER_GRUB_CONFIG="${PART1_PATH}/boot/grub/grub.cfg"
USER_GRUBENVFILE="${PART1_PATH}/boot/grub/grubenv"
USER_CONFIG_FILE="${PART1_PATH}/user-config.yml"
GRUB_PATH="${PART1_PATH}/boot/grub"
USER_GRUB_CONFIG="${GRUB_PATH}/grub.cfg"
USER_GRUBENVFILE="${GRUB_PATH}/grubenv"
USER_CONFIG_FILE="${PART1_PATH}/user-config.yml"
HW_KEY="${PART2_PATH}/machine.key"
ORI_ZIMAGE_FILE="${PART2_PATH}/zImage"
ORI_RDGZ_FILE="${PART2_PATH}/rd.gz"
@@ -43,7 +44,7 @@ EXTRACTOR_PATH="${PART3_PATH}/extractor"
EXTRACTOR_BIN="syno_extract_system_patch"
HTTPPORT=$(grep -i '^HTTP_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
[ -z "${HTTPPORT}" ] && HTTPPORT=8080 || true
[ -z "${HTTPPORT}" ] && HTTPPORT=5000 || true
DUFSPORT=$(grep -i '^DUFS_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)
[ -z "${DUFSPORT}" ] && DUFSPORT=7304 || true
TTYDPORT=$(grep -i '^TTYD_PORT=' /etc/arc.conf 2>/dev/null | cut -d'=' -f2)

View File

@@ -676,4 +676,14 @@ function fixDSMRootPart() {
mdadm --assemble --scan >/dev/null 2>&1
fsck "${1}" >/dev/null 2>&1
fi
}
###############################################################################
# Menu functions
function write_menu() {
echo "$1 \"$2\" " >>"${TMP_PATH}/menu"
}
function write_menu_with_color() {
echo "$1 \"$2: \Z4${3:-none}\Zn\" " >>"${TMP_PATH}/menu"
}

View File

@@ -49,9 +49,9 @@ function getAllModules() {
# Get list of all modules
for F in $(ls ${TMP_PATH}/modules/*.ko 2>/dev/null); do
local X=$(basename ${F})
local X=$(basename "${F}")
local M=${X:0:-3}
local DESC=$(modinfo ${F} | awk -F':' '/description:/{ print $2}' | awk '{sub(/^[ ]+/,""); print}')
local DESC=$(modinfo "${F}" | awk -F':' '/description:/{ print $2}' | awk '{sub(/^[ ]+/,""); print}')
[ -z "${DESC}" ] && DESC="${X}"
echo "${M} \"${DESC}\""
done
@@ -78,19 +78,19 @@ function installModules() {
local ODP="$(readConfigKey "odp" "${USER_CONFIG_FILE}")"
for F in $(ls "${TMP_PATH}/modules/"*.ko 2>/dev/null); do
local M=$(basename ${F})
local M=$(basename "${F}")
[ "${ODP}" = "true" ] && [ -f "${RAMDISK_PATH}/usr/lib/modules/${M}" ] && continue
if echo "${MLIST}" | grep -wq "${M:0:-3}"; then
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}"
cp -f "${F}" "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}"
else
rm -f "${RAMDISK_PATH}/usr/lib/modules/${M}"
rm -f "${RAMDISK_PATH}/usr/lib/modules/${M}" 2>"${LOG_FILE}"
fi
done
mkdir -p "${RAMDISK_PATH}/usr/lib/firmware"
if [ "${KERNEL}" = "custom" ]; then
tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware"
tar -zxf "${CUSTOM_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
else
tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware"
tar -zxf "${MODULES_PATH}/firmware.tgz" -C "${RAMDISK_PATH}/usr/lib/firmware" 2>"${LOG_FILE}"
fi
if [ $? -ne 0 ]; then
return 1
@@ -118,7 +118,7 @@ function addToModules() {
unpackModules "${PLATFORM}" "${KVER}"
cp -f ${KOFILE} ${TMP_PATH}/modules
cp -f "${KOFILE}" "${TMP_PATH}/modules"
packModules "${PLATFORM}" "${KVER}"
}
@@ -140,7 +140,7 @@ function delToModules() {
unpackModules "${PLATFORM}" "${KVER}"
rm -f ${TMP_PATH}/modules/${KONAME}
rm -f "${TMP_PATH}/modules/${KONAME}"
packModules "${PLATFORM}" "${KVER}"
}
@@ -173,7 +173,7 @@ function getdepends() {
unpackModules "${PLATFORM}" "${KVER}"
local DPS=($(_getdepends ${KONAME} | tr ' ' '\n' | sort -u))
local DPS=($(_getdepends "${KONAME}" | tr ' ' '\n' | sort -u))
echo ${DPS[@]}
rm -rf "${TMP_PATH}/modules"
}

View File

@@ -12,12 +12,12 @@ function getnet() {
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
MODEL=$(readConfigKey "model" "${USER_CONFIG_FILE}")
ARCPATCH=$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
ARCCONF="$(readConfigKey "${MODEL}.serial" "${S_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
ETHN=$(echo "${ETHX}" | wc -w)
if [ "${ARCPATCH}" != "user" ]; then
generate_and_write_macs "${ARCPATCH}"
else
if [ "${ARCPATCH}" = "user" ]; then
for N in ${ETHX}; do
while true; do
dialog --backtitle "$(backtitle)" --title "Mac Setting" \
@@ -37,6 +37,10 @@ function getnet() {
fi
done
done
elif [ "${ARCPATCH}" != "user" ] && [ -n "${ARCCONF}" ]; then
generate_and_write_macs "${ARCPATCH}"
else
generate_and_write_macs "false"
fi
}
@@ -45,5 +49,5 @@ ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
# Get actual IP
for N in ${ETHX}; do
IPCON="$(getIP "${N}")"
[ -n "${IPCON}" ] && break
[ -n "${IPCON}" ] && break || IPCON="noip"
done

View File

@@ -1,46 +1,27 @@
# Get PortMap for Loader
function detect_drives() {
local pci_id=$1
local drive_var=$2
local class_path=$3
local grep_pattern=$4
local sed_pattern=$5
eval "${drive_var}=0"
if [ $(lspci -d ::${pci_id} 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::${pci_id} 2>/dev/null | awk '{print $1}'); do
PORT=$(ls -l ${class_path} | grep "${PCI}" | awk -F'/' '{print $NF}' | sed "${sed_pattern}" | sort -n 2>/dev/null)
PORTNUM=$(lsscsi -b | grep -v - | grep "${grep_pattern}${PORT}:" | wc -l)
eval "${drive_var}=\$((\${${drive_var}} + \${PORTNUM}))"
done
fi
}
function show_dialog() {
dialog --backtitle "$(backtitle)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \
2 "DiskIdxMap: Max Ports ${REMAP2}" \
3 "SataRemap: Remove empty Ports ${REMAP3}" \
4 "AhciRemap: Remove empty Ports (new) ${REMAP4}" \
5 "Set my own Portmap in Config" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
}
function set_remap() {
case ${resp} in
1) writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}" ;;
2) writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}" ;;
3) writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}" ;;
4) writeConfigKey "arc.remap" "ahci" "${USER_CONFIG_FILE}" ;;
5) writeConfigKey "arc.remap" "user" "${USER_CONFIG_FILE}" ;;
esac
}
function getmap() {
function show_and_set_remap() {
dialog --backtitle "$(backtitle)" --title "Sata Portmap" \
--menu "Choose a Portmap for Sata!?\n* Recommended Option" 8 60 0 \
1 "DiskIdxMap: Active Ports ${REMAP1}" \
2 "DiskIdxMap: Max Ports ${REMAP2}" \
3 "SataRemap: Remove empty Ports ${REMAP3}" \
4 "AhciRemap: Remove empty Ports (new) ${REMAP4}" \
5 "Set my own Portmap in Config" \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && return 1
resp=$(cat "${TMP_PATH}/resp")
[ -z "${resp}" ] && return 1
case ${resp} in
1) writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}" ;;
2) writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}" ;;
3) writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}" ;;
4) writeConfigKey "arc.remap" "ahci" "${USER_CONFIG_FILE}" ;;
5) writeConfigKey "arc.remap" "user" "${USER_CONFIG_FILE}" ;;
esac
}
# Sata Disks
SATADRIVES=0
if [ $(lspci -d ::106 2>/dev/null | wc -l) -gt 0 ]; then
@@ -48,34 +29,34 @@ function getmap() {
for file in drivesmax drivescon ports remap; do
> "${TMP_PATH}/${file}"
done
DISKIDXMAPIDX=0
DISKIDXMAP=""
DISKIDXMAPIDXMAX=0
DISKIDXMAPMAX=""
for PCI in $(lspci -d ::106 2>/dev/null | awk '{print $1}'); do
NUMPORTS=0
CONPORTS=0
declare -A HOSTPORTS
while read -r LINE; do
PORT=$(echo ${LINE} | grep -o 'ata[0-9]*' | sed 's/ata//')
HOSTPORTS[${PORT}]=$(echo ${LINE} | grep -o 'host[0-9]*$')
done < <(ls -l /sys/class/scsi_host | grep -F "${PCI}")
for PORT in $(echo ${!HOSTPORTS[@]} | tr ' ' '\n' | sort -n); do
ATTACH=$(ls -l /sys/block | grep -F -q "${PCI}/ata${PORT}" && echo 1 || echo 0)
PCMD=$(cat /sys/class/scsi_host/${HOSTPORTS[${PORT}]}/ahci_port_cmd)
DUMMY=$([ ${PCMD} = 0 ] && echo 1 || echo 0)
[ ${ATTACH} = 1 ] && CONPORTS=$((CONPORTS + 1)) && echo $((PORT - 1)) >>"${TMP_PATH}/ports"
NUMPORTS=$((NUMPORTS + 1))
done
NUMPORTS=$((NUMPORTS > 8 ? 8 : NUMPORTS))
CONPORTS=$((CONPORTS > 8 ? 8 : CONPORTS))
echo -n "${NUMPORTS}" >>"${TMP_PATH}/drivesmax"
echo -n "${CONPORTS}" >>"${TMP_PATH}/drivescon"
DISKIDXMAP+=$(printf "%02x" $DISKIDXMAPIDX)
@@ -87,16 +68,44 @@ function getmap() {
fi
# SAS Disks
detect_drives "107" "SASDRIVES" "/sys/class/scsi_host" "\[${PORT}:" "s/host//"
SASDRIVES=0
if [ $(lspci -d ::107 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::107 2>/dev/null | awk '{print $1}'); do
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
SASDRIVES=$((SASDRIVES + PORTNUM))
done
fi
# SCSI Disks
detect_drives "100" "SCSIDRIVES" "/sys/class/scsi_host" "\[${PORT}:" "s/host//"
SCSIDRIVES=0
if [ $(lspci -d ::100 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::100 2>/dev/null | awk '{print $1}'); do
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
SCSIDRIVES=$((SCSIDRIVES + PORTNUM))
done
fi
# Raid Disks
detect_drives "104" "RAIDDRIVES" "/sys/class/scsi_host" "\[${PORT}:" "s/host//"
RAIDDRIVES=0
if [ $(lspci -d ::104 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::104 2>/dev/null | awk '{print $1}'); do
PORT=$(ls -l /sys/class/scsi_host | grep "${PCI}" | awk -F'/' '{print $NF}' | sed 's/host//' | sort -n 2>/dev/null)
PORTNUM=$(lsscsi -b | grep -v - | grep "\[${PORT}:" | wc -l)
RAIDDRIVES=$((RAIDDRIVES + PORTNUM))
done
fi
# NVMe Disks
detect_drives "108" "NVMEDRIVES" "/sys/class/nvme" "\[N:${PORT}:" "s/nvme//"
NVMEDRIVES=0
if [ $(ls -l /sys/class/nvme 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::108 2>/dev/null | awk '{print $1}'); do
PORTNUM=$(ls -l /sys/class/nvme | grep "${PCI}" | wc -l 2>/dev/null)
[ ${PORTNUM} -eq 0 ] && continue
NVMEDRIVES=$((NVMEDRIVES + PORTNUM))
done
fi
# USB Disks
USBDRIVES=0
@@ -166,14 +175,7 @@ function getmapSelection() {
else
REMAP1="*"
fi
if [ "${STEP}" = "storagemap" ]; then
show_dialog
set_remap
else
show_dialog
set_remap
fi
show_and_set_remap
else
# Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then

View File

@@ -24,6 +24,6 @@ As external: yes
Community Package required *
- NVMe
Cache: yes (sometimes addon required)
Storage: Addon required
Cache: yes
Storage: no
System (NVMe only): no

View File

@@ -24,6 +24,6 @@ Unsupported
Community Package required *
- NVMe
Cache: yes (sometimes addon required)
Storage: Addon required
Cache: yes
Storage: no
System (NVMe only): no

View File

@@ -24,6 +24,6 @@ Unsupported
Community Package required *
- NVMe
Cache: yes (sometimes addon required)
Storage: Addon required
Cache: yes
Storage: no
System (NVMe only): no

View File

@@ -26,6 +26,6 @@ Partially natively supported
Community Package required *
- NVMe
Cache: yes (sometimes addon required)
Storage: Addon required
Cache: yes
Storage: no
System (NVMe only): no

View File

@@ -221,7 +221,7 @@ touch "${HOME}/.initialized"
# 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}:${TTYDPORT:-7681}\033[0m to configure Loader."
echo -e "Use \033[1;34mDisplay Output\033[0m or \033[1;34mhttp://${IPCON}${HTTPPORT:+:$HTTPPORT}\033[0m to configure Loader."
# Check memory and load Arc
RAM=$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo 2>/dev/null)

View File

@@ -46,21 +46,19 @@ PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check if DSM Version changed
. "${RAMDISK_PATH}/etc/VERSION"
if [[ -n "${PRODUCTVER}" && -n "${BUILDNUM}" && -n "${SMALLNUM}" ]] &&
([[ "${PRODUCTVER}" != "${majorversion}.${minorversion}" ]] || [[ "${BUILDNUM}" != "${buildnumber}" ]] || [[ "${SMALLNUM}" != "${smallfixnumber}" ]]); then
if [[ -n "${BUILDNUM}" && ("${PRODUCTVER}" != "${majorversion}.${minorversion}" || "${BUILDNUM}" != "${buildnumber}" || "${SMALLNUM}" != "${smallfixnumber}") ]]; then
OLDVER="${PRODUCTVER}(${BUILDNUM}$([[ ${SMALLNUM:-0} -ne 0 ]] && echo "u${SMALLNUM}"))"
NEWVER="${majorversion}.${minorversion}(${buildnumber}$([[ ${smallfixnumber:-0} -ne 0 ]] && echo "u${smallfixnumber}"))"
PAT_URL=""
PAT_HASH=""
echo "Version changed from ${OLDVER} to ${NEWVER}"
echo "\nVersion changed from ${OLDVER} to ${NEWVER}"
fi
[ "${PATURL:0:1}" = "#" ] && PATURL=""
[ "${PATSUM:0:1}" = "#" ] && PATSUM=""
# Re-read PAT_URL and PAT_HASH if they are empty
if [ -z "${PAT_URL}" ] || [ -z "${PAT_HASH}" ]; then
# Re-read PAT_URL and PAT_HASH if they are empty or commented out
if [[ -z "${PAT_URL}" || "${PAT_URL:0:1}" == "#" ]]; then
PAT_URL="$(readConfigKey "${PLATFORM}.\"${MODEL}\".\"${majorversion}.${minorversion}\".url" "${D_FILE}")"
fi
if [[ -z "${PAT_HASH}" || "${PAT_HASH:0:1}" == "#" ]]; then
PAT_HASH="$(readConfigKey "${PLATFORM}.\"${MODEL}\".\"${majorversion}.${minorversion}\".hash" "${D_FILE}")"
fi
@@ -119,17 +117,6 @@ for PATCH in "${PATCHES[@]}"; do
done
done
# Add serial number to synoinfo.conf, to help to recover an installed DSM
echo "Set synoinfo SN" >>"${LOG_FILE}"
_set_conf_kv "SN" "${SN}" "${RAMDISK_PATH}/etc/synoinfo.conf" >>"${LOG_FILE}" 2>&1 || exit 1
_set_conf_kv "SN" "${SN}" "${RAMDISK_PATH}/etc.defaults/synoinfo.conf" >>"${LOG_FILE}" 2>&1 || exit 1
for KEY in "${!SYNOINFO[@]}"; do
echo "Set synoinfo ${KEY}" >>"${LOG_FILE}"
_set_conf_kv "${KEY}" "${SYNOINFO[${KEY}]}" "${RAMDISK_PATH}/etc/synoinfo.conf" >>"${LOG_FILE}" 2>&1 || exit 1
_set_conf_kv "${KEY}" "${SYNOINFO[${KEY}]}" "${RAMDISK_PATH}/etc.defaults/synoinfo.conf" >>"${LOG_FILE}" 2>&1 || exit 1
done
# Patch /sbin/init.post
grep -v -e '^[\t ]*#' -e '^$' "${PATCH_PATH}/config-manipulators.sh" >"${TMP_PATH}/rp.txt"
sed -e "/@@@CONFIG-MANIPULATORS-TOOLS@@@/ {" -e "r ${TMP_PATH}/rp.txt" -e 'd' -e '}' -i "${RAMDISK_PATH}/sbin/init.post"
@@ -201,7 +188,7 @@ echo "inetd" >>"${RAMDISK_PATH}/addons/addons.sh"
echo "Modify files" >"${LOG_FILE}"
# Remove function from scripts
[ "2" = "${PRODUCTVER:0:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh")
[ "2" = "${PRODUCTVER:2:1}" ] && sed -i 's/function //g' $(find "${RAMDISK_PATH}/addons/" -type f -name "*.sh")
# Build modules dependencies
# ${ARC_PATH}/depmod -a -b ${RAMDISK_PATH} 2>/dev/null
@@ -216,7 +203,7 @@ fi
# backup current loader configs
BACKUP_PATH="${RAMDISK_PATH}/usr/arc/backup"
rm -rf "${BACKUP_PATH}"
for F in "${USER_GRUB_CONFIG}" "${USER_CONFIG_FILE}" "${USER_UP_PATH}"; do
for F in "${USER_GRUB_CONFIG}" "${USER_CONFIG_FILE}" "${USER_UP_PATH}" "${HW_KEY}"; do
if [ -f "${F}" ]; then
FD="$(dirname "${F}")"
mkdir -p "${FD/\/mnt/${BACKUP_PATH}}"

View File

@@ -1 +0,0 @@
23.1.1

View File

@@ -182,31 +182,30 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
}
fi
menuentry 'Enter UEFI Setup' ${menuentry_id_option} uefi {
menuentry 'System UEFI Setup' ${menuentry_id_option} uefi {
fwsetup
}
menuentry 'Start Memtest86+' ${menuentry_id_option} memtest {
menuentry 'System Memtest86+' ${menuentry_id_option} memtest {
echo "Loading memtest86+..."
linux ${prefix}/memtest
}
menuentry 'Poweroff' ${menuentry_id_option} poweroff {
menuentry 'System Poweroff' ${menuentry_id_option} poweroff {
echo "System is powering off..."
halt
}
if [ ${vesa_mode} = 1 ]; then
menuentry 'Change Vesa to Text Output' ${menuentry_id_option} videomode {
set vesa_mode=0
save_env vesa_mode
if [ "${linux_gfx_mode}" = "keep" ]; then
menuentry 'Change vesa to text video mode' ${menuentry_id_option} videomode {
set linux_gfx_mode=text
save_env linux_gfx_mode
configfile ${prefix}/grub.cfg
}
else
menuentry 'Change Text to Vesa Output' ${menuentry_id_option} videomode {
set vesa_mode=1
save_env vesa_mode
reboot
menuentry 'Change text to vesa video mode' ${menuentry_id_option} videomode {
set linux_gfx_mode=keep
save_env linux_gfx_mode
configfile ${prefix}/grub.cfg
}
fi

View File

@@ -1,82 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (C) 2025 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh "${AUX_TOKEN}"
# Unmount Image File
sudo umount "/tmp/p1" 2>/dev/null || true
sudo umount "/tmp/p3" 2>/dev/null || true
# Get extractor, LKM, addons and Modules
echo "Get Dependencies"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
mkdir -p "brx"
[ ! -f "../brx/bzImage" ] && getBuildrootx "brx" || copyBuildroot "brx"
# Sbase
IMAGE_FILE="arc_create.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
ARC_BUILD="`date +'%y%m%d'`"
ARC_VERSION="13.3.7"
ARC_BRANCH="extended"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
echo "Repack initrd"
if [ -f "brx/bzImage-arc" ] && [ -f "brx/initrd-arc" ]; then
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
exit 1
fi
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
sudo losetup --detach ${LOOPX}
# Resize Image
resizeImg "${IMAGE_FILE}" "+1024M" "arc.img" 2>/dev/null
rm -f "${IMAGE_FILE}"
IMAGE_FILE="arc.img"
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk

View File

@@ -27,11 +27,14 @@ getCustom "files/p3/custom"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
[ -f "../brs/bzImage" ] && copyBuildroot "brs" || getBuildroots "brs"
case "${1}" in
evo) getBuildroot "${1}" "br" ;;
*) echo "Invalid option specified" ;;
esac
# Sbase
IMAGE_FILE="arc_create.img"
gzip -dc "grub.img.gz" >"${IMAGE_FILE}"
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
@@ -45,17 +48,17 @@ mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
ARC_BUILD="`date +'%y%m%d'`"
ARC_BUILD="$(date +'%y%m%d')"
ARC_VERSION="13.3.7"
ARC_BRANCH="minimal"
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
ARC_BRANCH="dev"
echo "${ARC_VERSION}" >"files/p1/ARC-VERSION"
echo "${ARC_BUILD}" >"files/p1/ARC-BUILD"
echo "${ARC_BRANCH}" >"files/p1/ARC-BRANCH"
echo "Repack initrd"
if [ -f "brs/bzImage-arc" ] && [ -f "brs/initrd-arc" ]; then
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
if [ -f "br/bzImage-arc" ] && [ -f "br/initrd-arc" ]; then
cp -f "br/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "br/initrd-arc" "files/initrd" "files/p3/initrd-arc"
else
exit 1
fi
@@ -73,9 +76,4 @@ sudo rm -rf "/tmp/p3"
sudo losetup --detach ${LOOPX}
# Resize Image
resizeImg "${IMAGE_FILE}" "+1024M" "arc.img" 2>/dev/null
rm -f "${IMAGE_FILE}"
IMAGE_FILE="arc.img"
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk

View File

@@ -185,73 +185,33 @@ function getTheme() {
done < <(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-theme/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Buildroot-X
# $1 path
function getBuildrootx() {
echo "Getting Buildroot-X begin"
local DEST_PATH="${1}"
# Get latest Buildroot
# $1 type (min for S, ext for X, micro for M)
# $2 path
function getBuildroot() {
local TYPE="${1}"
local DEST_PATH="${2}"
local REPO=""
local ZIP_NAME=""
local TAG_VAR=""
local REPO="arc-buildroot-${TYPE}"
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRXTAG="${TAG}"
echo "Getting Buildroot-${TYPE} begin"
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/${REPO}/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRTAG="${TAG}-${TYPE}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
rm -f "${DEST_PATH}/initrd-arc"
while read -r ID NAME; do
if [ "${NAME}" = "buildroot-${TAG}.zip" ]; then
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/assets/${ID}" -o "${DEST_PATH}/brx.zip"
echo "Buildroot-X: ${TAG}"
unzip -o "${DEST_PATH}/brx.zip" -d "${DEST_PATH}"
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/${REPO}/releases/assets/${ID}" -o "${DEST_PATH}/br.zip"
echo "Buildroot: ${TAG}-${TYPE}"
unzip -o "${DEST_PATH}/br.zip" -d "${DEST_PATH}"
mv -f "${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
mv -f "${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
[ -f "${DEST_PATH}/bzImage-arc" ] && [ -f "${DEST_PATH}/initrd-arc" ] && break
fi
done < <(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Buildroot-S
# $1 path
function getBuildroots() {
echo "Getting Buildroot-S begin"
local DEST_PATH="${1}"
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRSTAG="${TAG}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
rm -f "${DEST_PATH}/initrd-arc"
while read -r ID NAME; do
if [ "${NAME}" = "buildroot-${TAG}.zip" ]; then
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/assets/${ID}" -o "${DEST_PATH}/brs.zip"
echo "Buildroot-S: ${TAG}"
unzip -o "${DEST_PATH}/brs.zip" -d "${DEST_PATH}"
mv -f "${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
mv -f "${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
[ -f "${DEST_PATH}/bzImage-arc" ] && [ -f "${DEST_PATH}/initrd-arc" ] && break
fi
done < <(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Buildroot-M
# $1 path
function getBuildrootm() {
echo "Getting Buildroot-M begin"
local DEST_PATH="${1}"
TAG=$(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-m/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
export BRSTAG="${TAG}"
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
rm -f "${DEST_PATH}/initrd-arc"
while read -r ID NAME; do
if [ "${NAME}" = "buildroot-${TAG}.zip" ]; then
curl -kL -H "Authorization: token ${TOKEN}" -H "Accept: application/octet-stream" "https://api.github.com/repos/AuxXxilium/arc-buildroot-m/releases/assets/${ID}" -o "${DEST_PATH}/brm.zip"
echo "Buildroot-M: ${TAG}"
unzip -o "${DEST_PATH}/brm.zip" -d "${DEST_PATH}"
mv -f "${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
mv -f "${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
[ -f "${DEST_PATH}/bzImage-arc" ] && [ -f "${DEST_PATH}/initrd-arc" ] && break
fi
done < <(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/arc-buildroot-m/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
done < <(curl -skL -H "Authorization: token ${TOKEN}" "https://api.github.com/repos/AuxXxilium/${REPO}/releases/tags/${TAG}" | jq -r '.assets[] | "\(.id) \(.name)"')
}
# Get latest Offline
@@ -317,36 +277,46 @@ function repackInitrd() {
sudo rm -rf "${RDXZ_PATH}"
}
# resizeimg
# resizeImg
# $1 input file
# $2 changsize MB eg: +50M -50M
# $2 change size MB e.g., +50M -50M
# $3 output file
function resizeImg() {
INPUT_FILE="${1}"
CHANGE_SIZE="${2}"
OUTPUT_FILE="${3:-${INPUT_FILE}}"
local INPUT_FILE="${1}"
local CHANGE_SIZE="${2}"
local OUTPUT_FILE="${3:-${INPUT_FILE}}"
[[ -z "${INPUT_FILE}" || ! -f "${INPUT_FILE}" ]] && exit 1
[ -z "${CHANGE_SIZE}" ] && exit 1
[[ -z "${INPUT_FILE}" || ! -f "${INPUT_FILE}" ]] && { echo "Input file not specified or does not exist"; exit 1; }
[[ -z "${CHANGE_SIZE}" ]] && { echo "Change size not specified"; exit 1; }
INPUT_FILE="$(realpath "${INPUT_FILE}")"
OUTPUT_FILE="$(realpath "${OUTPUT_FILE}")"
local CURRENT_SIZE
CURRENT_SIZE=$(du -m "${INPUT_FILE}" | awk '{print $1}')
local SIZE
SIZE=$((CURRENT_SIZE + ${CHANGE_SIZE//M/}))
SIZE=$(($(du -m "${INPUT_FILE}" | awk '{print $1}')$(echo "${CHANGE_SIZE}" | sed 's/M//g; s/b//g')))
[[ -z "${SIZE}" || "${SIZE}" -lt 0 ]] && exit 1
[[ -z "${SIZE}" || "${SIZE}" -lt 0 ]] && { echo "Invalid size calculated"; exit 1; }
if [ ! "${INPUT_FILE}" = "${OUTPUT_FILE}" ]; then
if [[ "${INPUT_FILE}" != "${OUTPUT_FILE}" ]]; then
sudo cp -f "${INPUT_FILE}" "${OUTPUT_FILE}"
fi
sudo truncate -s ${SIZE}M "${OUTPUT_FILE}"
echo -e "d\n\nn\n\n\n\n\nn\nw" | sudo fdisk "${OUTPUT_FILE}"
sudo truncate -s "${SIZE}M" "${OUTPUT_FILE}"
# Use `parted` to resize partition 3
sudo parted "${OUTPUT_FILE}" --script -- resizepart 3 "${SIZE}M"
local LOOPX
LOOPX=$(sudo losetup -f)
sudo losetup -P ${LOOPX} "${OUTPUT_FILE}"
sudo e2fsck -fp $(ls ${LOOPX}* | sort -n | tail -1)
sudo resize2fs $(ls ${LOOPX}* | sort -n | tail -1)
sudo losetup -d ${LOOPX}
sudo losetup -P "${LOOPX}" "${OUTPUT_FILE}"
local PARTITION
PARTITION=$(ls "${LOOPX}p3")
sudo e2fsck -fp "${PARTITION}"
sudo tune2fs -l "${PARTITION}" | grep "Block size"
sudo resize2fs "${PARTITION}"
sudo losetup -d "${LOOPX}"
}
# createvmx
@@ -522,4 +492,4 @@ function copyBuildroot() {
mkdir -p "${DEST_PATH}"
cp -f "../${DEST_PATH}/bzImage" "${DEST_PATH}/bzImage-arc"
cp -f "../${DEST_PATH}/rootfs.cpio.zst" "${DEST_PATH}/initrd-arc"
}
}

View File

@@ -29,7 +29,7 @@ done
popd
rm -f grub.img
dd if=/dev/zero of=grub.img bs=1M seek=1024 count=0
dd if=/dev/zero of=grub.img bs=1M seek=2048 count=0
echo -e "n\np\n1\n\n+50M\nn\np\n2\n\n+50M\nn\np\n3\n\n\na\n1\nw\nq\n" | fdisk grub.img
fdisk -l grub.img
@@ -71,4 +71,4 @@ sudo umount ${LOOPX}p1
sudo losetup -d ${LOOPX}
sudo rm -rf ${NAME}1
gzip grub.img
gzip grub.img