Compare commits

...

62 Commits
1.4.8 ... 1.5.9

Author SHA1 Message Date
AuxXxilium
6e97b59bf1 modulelist: revert
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-02-01 01:15:59 +01:00
AuxXxilium
0dabe40200 boot: reduce code
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-02-01 00:19:11 +01:00
AuxXxilium
b61222c0d5 boot: fix typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-02-01 00:15:40 +01:00
AuxXxilium
b1737e1a0e modulelist: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 23:44:49 +01:00
AuxXxilium
b4874b6e77 grub: update 2025-01-31 20:56:38 2025-01-31 20:56:38 +01:00
AuxXxilium
1ea4215393 grub: shrink it down
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:47:52 +01:00
AuxXxilium
95c7032602 boot: add more informations
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:39:58 +01:00
AuxXxilium
2877465fb4 boot: back to old
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 20:00:50 +01:00
AuxXxilium
bd156aff6e update: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 19:07:25 +01:00
AuxXxilium
7746eb3ca7 arc: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 17:41:55 +01:00
AuxXxilium
c4a6d4ccd3 tree: rewrite menu function
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:50:23 +01:00
AuxXxilium
5310500b1a arc/evo: rewrite to "no IP"
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:48:41 +01:00
AuxXxilium
b89c67f115 arc: add local backup feature for hardware encryption key
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:47:50 +01:00
AuxXxilium
5b7e4e68cc arc: add offline update feature
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-31 16:22:10 +01:00
AuxXxilium
ac5d39ec71 boot: temp disable boot interrupt
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-30 23:59:10 +01:00
AuxXxilium
23142cefb5 tree: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-30 23:56:11 +01:00
AuxXxilium
6d90c3a187 arc: set correct ports
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-29 21:17:20 +01:00
AuxXxilium
b23429fdc6 tree: more optimization
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-29 17:19:44 +01:00
AuxXxilium
c9c502be88 tree: more styling
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 21:01:31 +01:00
AuxXxilium
d9084b90fc arc: change addons preset
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 20:58:11 +01:00
AuxXxilium
0877680812 tree: more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 20:42:29 +01:00
AuxXxilium
16f166d17a tree: add missing
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 20:27:08 +01:00
AuxXxilium
9f3ac81146 tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 20:14:00 +01:00
AuxXxilium
355f30b899 tree: do more work
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 19:59:56 +01:00
AuxXxilium
2c57429fdb tree: more rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 19:14:06 +01:00
AuxXxilium
8c432b7335 img-gen: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 18:25:15 +01:00
AuxXxilium
bc32568f19 functions: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 18:23:00 +01:00
AuxXxilium
7766f57fef tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 17:16:45 +01:00
AuxXxilium
39d2ce6344 arc: add more informations
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-28 17:04:57 +01:00
AuxXxilium
8e1442eb66 tree: logic fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-01-27 21:42:00 +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
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
27 changed files with 2090 additions and 1932 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: false
type: boolean
extended:
description: "extended"
default: false
type: boolean
clean:
description: "clean"
default: false
@@ -98,15 +86,7 @@ jobs:
getOffline "files/p3/configs"
getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
if [ "${{ inputs.extended }}" = "true" ]; then
getBuildroot "ext" "brx"
fi
if [ "${{ inputs.minimal }}" = "true" ]; then
getBuildroot "min" "brs"
fi
if [ "${{ inputs.microcode }}" = "true" ]; then
getBuildroot "micro" "brm"
fi
getBuildroot "evo" "br"
# Export Dependencies Version to env
echo "ADDONTAG=${ADDONTAG}" >> $GITHUB_ENV
@@ -116,23 +96,20 @@ 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 "BRMTAG=${BRMTAG}" >> $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_VERSION="${{ inputs.version }}"
ARC_BRANCH="extended"
ARC_BRANCH="evo"
echo "${ARC_BUILD}" > "files/p1/ARC-BUILD"
echo "ARC_BUILD=${ARC_BUILD}" >> $GITHUB_ENV
echo "${ARC_VERSION}" > "files/p1/ARC-VERSION"
@@ -154,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"
@@ -185,170 +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
if: ${{ inputs.extended }}
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_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.img"
gzip -dc "files/initrd/opt/arc/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}
echo "Image Converter"
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
if: ${{ inputs.minimal }}
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_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.img"
gzip -dc "files/initrd/opt/arc/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}
echo "Image Converter"
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
@@ -374,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 included (reduced size, faster boot)' || '' }}
${{ inputs.microcode && '- microcode: minimal + additional microcode updates' || '' }}
${{ inputs.extended && '- extended: full image, all dependencies included (new features to test)' || '' }}
- Changelog is available in my Discord
- Based on VisionZ Evolution Code Base
### Dependencies:
- Addons: ${{ env.ADDONTAG }}
@@ -389,9 +199,7 @@ jobs:
- Patches: ${{ env.PATCHTAG }}
- Custom: ${{ env.CUSTOMTAG }}
- LKMs: ${{ env.LKMTAG }}
${{ inputs.minimal && format('- Buildroot minimal: {0}', env.BRSTAG) || '' }}
${{ inputs.microcode && format('- Buildroot microcode: {0}', env.BRMTAG) || '' }}
${{ 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

@@ -1,5 +1,5 @@
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
# Copyright (C) 2025 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
@@ -33,7 +33,7 @@ jobs:
- name: Make Grub
run: |
rm -f grub.img.gz
rm -f "files/initrd/opt/arc/grub.img.gz"
. scripts/grub.sh "grub-2.12" "i386-pc i386-efi x86_64-efi" "ARC"
- name: Check and Push

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,16 +5,14 @@ set -e
. "${ARC_PATH}/include/functions.sh"
arc_mode || die "No bootmode found!"
# Clear logs for dbgutils addons
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
# Get Loader Disk Bus
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
BUS=$(getBus "${LOADER_DISK}")
FBI=$(cat /sys/class/graphics/fb*/name 2>/dev/null | head -1)
EFI=$([ -d /sys/firmware/efi ] && echo 1 || echo 0)
# Print Title centralized
@@ -22,15 +20,14 @@ clear
COLUMNS=${COLUMNS:-50}
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc Loader")"
TITLE="Version:"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD})"
[ -n "${ARC_BRANCH}" ] && TITLE+=" | Branch: ${ARC_BRANCH}"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD}) | Branch: ${ARC_BRANCH}"
printf "\033[1;30m%*s\n" ${COLUMNS} ""
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
TITLE="Boot:"
[ ${EFI} -eq 1 ] && TITLE+=" [UEFI]" || TITLE+=" [BIOS]"
TITLE+=" [${BUS}]"
TITLE+=" | Device: [${BUS}] | Mode: [${ARCMODE}]"
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
# Check if DSM zImage/Ramdisk is changed, patch it if necessary, update Files if necessary
ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"
@@ -51,6 +48,8 @@ PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
BUILDNUM="$(readConfigKey "buildnum" "${USER_CONFIG_FILE}")"
SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
KERNEL="$(readConfigKey "kernel" "${USER_CONFIG_FILE}")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${P_FILE}")"
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
RAMTOTAL="$(awk '/MemTotal:/ {printf "%.0f\n", $2 / 1024 / 1024 + 0.5}' /proc/meminfo 2>/dev/null)"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')"
@@ -60,18 +59,17 @@ DISKINFO="$(readConfigKey "bootscreen.diskinfo" "${USER_CONFIG_FILE}")"
HWIDINFO="$(readConfigKey "bootscreen.hwidinfo" "${USER_CONFIG_FILE}")"
GOVERNOR="$(readConfigKey "governor" "${USER_CONFIG_FILE}")"
USBMOUNT="$(readConfigKey "usbmount" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
# Build Sanity Check
[ "${BUILDDONE}" = "false" ] && die "Loader build not completed!"
if [ -z "${MODELID}" ] || [ "${MODELID}" != "${MODEL}" ]; then
die "Loader build not completed! Model mismatch!"
fi
[[ -z "${MODELID}" || "${MODELID}" != "${MODEL}" ]] && die "Loader build not completed! Model mismatch!"
# HardwareID Check
if [ "${ARCPATCH}" = "true" ]; then
HARDWAREID="$(readConfigKey "arc.hardwareid" "${USER_CONFIG_FILE}")"
HWID="$(genHWID)"
if [ "${HARDWAREID}" != "${HWID}" ]; then
echo "\033[1;31m*** HardwareID does not match! - Loader can't boot to DSM! You need to reconfigure your Loader - Rebooting to Config Mode! ***\033[0m"
echo -e "\033[1;31m*** HardwareID does not match! - Loader can't boot to DSM! You need to reconfigure your Loader - Rebooting to Config Mode! ***\033[0m"
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
writeConfigKey "arc.hardwareid" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.userid" "" "${USER_CONFIG_FILE}"
@@ -85,6 +83,7 @@ if [ "${DSMINFO}" = "true" ]; then
echo -e "Model: \033[1;37m${MODELID:-${MODEL}}\033[0m"
echo -e "Platform: \033[1;37m${PLATFORM}\033[0m"
echo -e "Version: \033[1;37m${PRODUCTVER} (${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))\033[0m"
echo -e "Kernel: \033[1;37m${KVER} (${KERNEL})\033[0m"
echo -e "LKM: \033[1;37m${LKM}\033[0m"
echo
fi
@@ -150,10 +149,9 @@ ETHN=$(echo "${ETHX}" | wc -w)
ETHM=${ETHM:-${ETHN}}
NIC=0
for N in ${ETHX}; do
MAC=$(readConfigKey "${N}" "${USER_CONFIG_FILE}")
MAC=$(readConfigKey "${N}" "${USER_CONFIG_FILE}" 2>/dev/null)
MAC=${MAC:-$(cat /sys/class/net/${N}/address 2>/dev/null | tr '[:upper:]' '[:lower:]')}
NIC=$((NIC + 1))
CMDLINE["mac${NIC}"]="${MAC}"
CMDLINE["mac$((++NIC))"]="${MAC}"
[ ${NIC} -ge ${ETHM} ] && break
done
CMDLINE["netif_num"]="${NIC}"
@@ -210,8 +208,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"
@@ -293,6 +291,7 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
IPCON=""
echo
if [ "${ARCPATCH}" = "true" ]; then
echo -e "\033[1;37mDetected ${ETHN} NIC\033[0m | \033[1;34mUsing ${NIC} NIC for Arc Patch:\033[0m"
else
@@ -300,41 +299,9 @@ elif [ "${DIRECTBOOT}" = "false" ]; then
fi
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
sleep 2
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
MAC="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
while true; do
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED @ Mac: ${MAC}\033[0m"
break
fi
COUNT=$((COUNT + 1))
IP="$(getIP "${N}")"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r${DRIVER} (${SPEED} | ${MAC}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
echo -e "\r${DRIVER} (${SPEED} | ${MAC}): \033[1;37m${IP}\033[0m"
[ -z "${IPCON}" ] && IPCON="${IP}"
fi
break
fi
if [ -z "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER} (${MAC}): \033[1;37mDOWN\033[0m"
break
fi
if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then
echo -e "\r${DRIVER} (${MAC}): \033[1;37mTIMEOUT\033[0m"
break
fi
sleep 1
done
done
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S09dhcpcd restart >/dev/null 2>&1 || true
sleep 3
checkNIC
echo
DSMLOGO="$(readConfigKey "bootscreen.dsmlogo" "${USER_CONFIG_FILE}")"
@@ -345,6 +312,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 || true
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 \

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

@@ -0,0 +1,394 @@
#!/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"
# Get Keymap and Timezone and check System
onlineCheck
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
ARCOFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
systemCheck
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:-(no IP)} | "
BACKTITLE+="Patch: ${ARCPATCH} | "
BACKTITLE+="Config: ${CONFDONE} | "
BACKTITLE+="Build: ${BUILDDONE} | "
BACKTITLE+="${MACHINE}(${BUS}) | "
[ -n "${KEYMAP}" ] && BACKTITLE+="KB: ${KEYMAP}"
[ "${ARCOFFLINE}" = "true" ] && BACKTITLE+=" | Offline"
echo "${BACKTITLE}"
}
###############################################################################
# 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_value "m" "Kernelload" "${KERNELLOAD}"
write_menu_value "E" "eMMC Boot Support" "${EMMCBOOT}"
if [ "${DIRECTBOOT}" = "false" ]; then
write_menu_value "i" "Boot IP Waittime" "${BOOTIPWAIT}"
fi
write_menu_value "q" "Directboot" "${DIRECTBOOT}"
write_menu_value "W" "RD Compression" "${RD_COMPRESSED}"
write_menu_value "X" "Sata DOM" "${SATADOM}"
write_menu_value "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 "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 "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 "Evo UI Advanced" --colors \
--cancel-label "Back" \
--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
}
###############################################################################
###############################################################################
# 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_value "0" "HardwareID" "${HARDWAREID}"
fi
write_menu_value "1" "Model" "${MODEL}"
if [ "${CONFDONE}" = "true" ]; then
write_menu_value "e" "Version" "${PRODUCTVER}"
write_menu_value "=" "DT" "${DT}"
write_menu_value "=" "Platform" "${PLATFORM}"
if [ -n "${USERID}" ] && [ "${ARCOFFLINE}" = "false" ]; then
write_menu_value "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_value "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_value "g" "Scaling Governor" "${GOVERNOR}" ;;
"storagepanel") write_menu_value "P" "StoragePanel" "${STORAGEPANEL:-auto}" ;;
"sequentialio") write_menu_value "Q" "SequentialIO" "${SEQUENTIALIO}" ;;
esac
fi
done
write_menu "d" "Modules"
write_menu_value "O" "Official Driver Priority" "${ODP}"
if [ "${DT}" = "false" ] && [ ${SATACONTROLLER} -gt 0 ]; then
write_menu_value "S" "PortMap" "${REMAP}"
write_menu_value "=" "Mapping" "${PORTMAP}"
fi
if [ "${DT}" = "true" ]; then
write_menu_value "H" "Hotplug/SortDrives" "${HDDSORT}"
else
write_menu_value "h" "USB as Internal" "${USBMOUNT}"
fi
fi
write_menu_value "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
echo "Unknown Mode: ${ARCMODE} - Exiting..."
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

Binary file not shown.

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

@@ -4,19 +4,21 @@ PART2_PATH="/mnt/p2"
PART3_PATH="/mnt/p3"
TMP_PATH="/tmp"
[ -f "${PART1_PATH}/ARC-BRANCH" ] && ARC_BRANCH=$(cat "${PART1_PATH}/ARC-BRANCH") || ARC_BRANCH="null"
[ -f "${PART1_PATH}/ARC-VERSION" ] && ARC_VERSION=$(cat "${PART1_PATH}/ARC-VERSION") || ARC_VERSION="null"
[ -f "${PART1_PATH}/ARC-BUILD" ] && ARC_BUILD=$(cat "${PART1_PATH}/ARC-BUILD") || ARC_BUILD="null"
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
[ -f "${PART1_PATH}/ARC-BRANCH" ] && ARC_BRANCH="$(cat "${PART1_PATH}/ARC-BRANCH")" || ARC_BRANCH="null"
[ -f "${PART1_PATH}/ARC-VERSION" ] && ARC_VERSION="$(cat "${PART1_PATH}/ARC-VERSION")" || ARC_VERSION="null"
[ -f "${PART1_PATH}/ARC-BUILD" ] && ARC_BUILD="$(cat "${PART1_PATH}/ARC-BUILD")" || ARC_BUILD="null"
ARC_TITLE="Arc ${ARC_VERSION}"
RAMDISK_PATH="${TMP_PATH}/ramdisk"
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 +45,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="" || 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

@@ -3,6 +3,7 @@
. "${ARC_PATH}/include/consts.sh"
. "${ARC_PATH}/include/configFile.sh"
. "${ARC_PATH}/include/addons.sh"
. "${ARC_PATH}/include/modules.sh"
###############################################################################
# Check loader disk
@@ -11,7 +12,7 @@ function checkBootLoader() {
[ -z "${KNAME}" ] && continue
[ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
done < <(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1
[ ! -w "${PART2_PATH}" ] && return 1
[ ! -w "${PART3_PATH}" ] && return 1
@@ -22,6 +23,61 @@ function checkBootLoader() {
return 0
}
###############################################################################
# Check boot mode
function arc_mode() {
if grep -q 'automated_arc' /proc/cmdline; then
ARCMODE="automated"
elif grep -q 'update_arc' /proc/cmdline; then
ARCMODE="update"
elif grep -q 'force_arc' /proc/cmdline; then
ARCMODE="config"
else
ARCMODE="dsm"
fi
[ "$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")" ] && ARCCONF="true" || true
}
###############################################################################
# Check for NIC and IP
function checkNIC() {
# Get Amount of NIC
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
for N in ${ETHX}; do
COUNT=0
DRIVER=$(basename "$(readlink -f /sys/class/net/${N}/device/driver 2>/dev/null)")
while true; do
CARRIER=$(cat /sys/class/net/${N}/carrier 2>/dev/null)
if [ "${CARRIER}" = "0" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((COUNT + 1))
IP=$(getIP "${N}")
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${N} 2>/dev/null | awk '/Speed:/ {print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
echo -e "\r${DRIVER} (${SPEED}): \033[1;37m${IP}\033[0m"
[ -z "${IPCON}" ] && IPCON="${IP}"
fi
break
fi
if [ -z "${CARRIER}" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi
if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then
echo -e "\r${DRIVER}: \033[1;37mTIMEOUT\033[0m"
break
fi
sleep 1
done
done
}
###############################################################################
# Just show error message and dies
function die() {
@@ -256,8 +312,8 @@ function _sort_netif() {
# sort
if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
/etc/init.d/S41dhcpcd stop >/dev/null 2>&1
/etc/init.d/S40network stop >/dev/null 2>&1
/etc/init.d/S09dhcpcd stop >/dev/null 2>&1
/etc/init.d/S07network stop >/dev/null 2>&1
for i in $(seq 0 $((${ETHNUM:0} - 1))); do
ip link set dev eth${i} name tmp${i}
done
@@ -266,8 +322,8 @@ function _sort_netif() {
ip link set dev tmp${i} name eth${I}
I=$((${I} + 1))
done
/etc/init.d/S40network start >/dev/null 2>&1
/etc/init.d/S41dhcpcd start >/dev/null 2>&1
/etc/init.d/S07network start >/dev/null 2>&1
/etc/init.d/S09dhcpcd start >/dev/null 2>&1
fi
return 0
}
@@ -419,7 +475,7 @@ function checkBIOS_VT_d() {
###############################################################################
# Rebooting
function rebootTo() {
local MODES="config recovery junior automated update bios memtest"
local MODES="config recovery junior automated update uefi memtest"
[ -z "${1}" ] && exit 1
if ! echo "${MODES}" | grep -wq "${1}"; then exit 1; fi
[ "${1}" = "automated" ] && echo "arc-${MODEL}-${PRODUCTVER}-${ARC_VERSION}" >"${PART3_PATH}/automated"
@@ -563,6 +619,7 @@ function onlineCheck() {
if [ -n "${NEWTAG}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
updateOffline
checkHardwareID
else
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
fi
@@ -589,23 +646,20 @@ function systemCheck () {
else
AESSYS="true"
fi
# Check for ACPI Support
if ! grep -q "^flags.*acpi.*" /proc/cpuinfo; then
ACPISYS="false"
else
ACPISYS="true"
fi
# Check for CPU Frequency Scaling
CPUFREQUENCIES=$(ls -ltr /sys/devices/system/cpu/cpufreq/* 2>/dev/null | wc -l)
if [ ${CPUFREQUENCIES} -gt 1 ]; then
CPUFREQUENCIES=$(ls -l /sys/devices/system/cpu/cpufreq/*/* 2>/dev/null | wc -l)
if [ ${CPUFREQUENCIES} -gt 0 ]; then
CPUFREQ="true"
ACPISYS="true"
else
CPUFREQ="false"
ACPISYS="false"
fi
# Check for Arc Patch
ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
arc_mode
[ -z "${ARCCONF}" ] && writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
# Check for Disks
getnetinfo
getdiskinfo
getmap
}
@@ -676,4 +730,82 @@ function fixDSMRootPart() {
mdadm --assemble --scan >/dev/null 2>&1
fsck "${1}" >/dev/null 2>&1
fi
}
###############################################################################
# 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}")"
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
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
# Get Config/Build Status
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
}
###############################################################################
# Menu functions
function write_menu() {
echo "$1 \"$2\" " >>"${TMP_PATH}/menu"
}
function write_menu_value() {
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

@@ -1,49 +0,0 @@
# Get Network Config for Loader
function getnet() {
generate_and_write_macs() {
local patch=$1
local macs=($(generateMacAddress "${MODEL}" "${ETHN}" "${patch}"))
for i in $(seq 1 "${ETHN}"); do
local mac="${macs[$((i - 1))]}"
writeConfigKey "eth$((i - 1))" "${mac}" "${USER_CONFIG_FILE}"
done
}
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
MODEL=$(readConfigKey "model" "${USER_CONFIG_FILE}")
ARCPATCH=$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")
ETHN=$(echo "${ETHX}" | wc -w)
if [ "${ARCPATCH}" != "user" ]; then
generate_and_write_macs "${ARCPATCH}"
else
for N in ${ETHX}; do
while true; do
dialog --backtitle "$(backtitle)" --title "Mac Setting" \
--inputbox "Type a custom Mac for ${N} (Eq. 001132a1b2c3).\nA custom Mac will not be applied to NIC!" 8 50 \
2>"${TMP_PATH}/resp"
[ $? -ne 0 ] && break
MAC=$(cat "${TMP_PATH}/resp")
[ -z "${MAC}" ] && MAC=$(readConfigKey "${N}" "${USER_CONFIG_FILE}")
[ -z "${MAC}" ] && MAC=$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g')
MAC=$(echo "${MAC}" | tr '[:upper:]' '[:lower:]')
if [ ${#MAC} -eq 12 ]; then
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Set Mac for ${N} to ${MAC}!" 5 50
writeConfigKey "${N}" "${MAC}" "${USER_CONFIG_FILE}"
break
else
dialog --backtitle "$(backtitle)" --title "Mac Setting" --msgbox "Invalid MAC - Try again!" 5 50
fi
done
done
fi
}
# Get Amount of NIC
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
# Get actual IP
for N in ${ETHX}; do
IPCON="$(getIP "${N}")"
[ -n "${IPCON}" ] && break
done

View File

@@ -1,237 +0,0 @@
# Get PortMap for Loader
function getmap() {
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
}
# Sata Disks
SATADRIVES=0
if [ $(lspci -d ::106 2>/dev/null | wc -l) -gt 0 ]; then
# Clean old files
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)
DISKIDXMAPIDX=$((DISKIDXMAPIDX + CONPORTS))
DISKIDXMAPMAX+=$(printf "%02x" $DISKIDXMAPIDXMAX)
DISKIDXMAPIDXMAX=$((DISKIDXMAPIDXMAX + NUMPORTS))
SATADRIVES=$((SATADRIVES + CONPORTS))
done
fi
# SAS Disks
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
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
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
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
if [ $(ls -l /sys/class/scsi_host 2>/dev/null | grep usb | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::c03 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)
[ ${PORTNUM} -eq 0 ] && continue
USBDRIVES=$((USBDRIVES + PORTNUM))
done
fi
# MMC Disks
MMCDRIVES=0
if [ $(ls -l /sys/block/mmc* 2>/dev/null | wc -l) -gt 0 ]; then
for PCI in $(lspci -d ::805 | awk '{print $1}'); do
PORTNUM=$(ls -l /sys/block/mmc* | grep "${PCI}" | wc -l 2>/dev/null)
[ ${PORTNUM} -eq 0 ] && continue
MMCDRIVES=$((MMCDRIVES + PORTNUM))
done
fi
# Disk Count for MaxDisks
DRIVES=$((${SATADRIVES} + ${SASDRIVES} + ${SCSIDRIVES} + ${RAIDDRIVES} + ${USBDRIVES} + ${MMCDRIVES} + ${NVMEDRIVES}))
HARDDRIVES=$((${SATADRIVES} + ${SASDRIVES} + ${SCSIDRIVES} + ${RAIDDRIVES} + ${NVMEDRIVES}))
writeConfigKey "device.satadrives" "${SATADRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.sasdrives" "${SASDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.scsidrives" "${SCSIDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.raiddrives" "${RAIDDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.usbdrives" "${USBDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.mmcdrives" "${MMCDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.nvmedrives" "${NVMEDRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.drives" "${DRIVES}" "${USER_CONFIG_FILE}"
writeConfigKey "device.harddrives" "${HARDDRIVES}" "${USER_CONFIG_FILE}"
# Check for Sata Boot
if [ $(lspci -d ::106 2>/dev/null | wc -l) -gt 0 ]; then
LASTDRIVE=0
while read -r D; do
if [ "${BUS}" = "sata" ] && [ "${MACHINE}" != "Native" ] && [ ${D} -eq 0 ]; then
MAXDISKS=${DRIVES}
echo -n "${D}>${MAXDISKS}:" >>"${TMP_PATH}/remap"
elif [ ${D} -ne ${LASTDRIVE} ]; then
echo -n "${D}>${LASTDRIVE}:" >>"${TMP_PATH}/remap"
LASTDRIVE=$((LASTDRIVE + 1))
else
LASTDRIVE=$((D + 1))
fi
done < "${TMP_PATH}/ports"
fi
}
function getmapSelection() {
# Compute PortMap Options
SATAPORTMAPMAX=$(awk '{print $1}' "${TMP_PATH}/drivesmax")
SATAPORTMAP=$(awk '{print $1}' "${TMP_PATH}/drivescon")
SATAREMAP=$(awk '{print $1}' "${TMP_PATH}/remap" | sed 's/.$//')
EXTERNALCONTROLLER=$(readConfigKey "device.externalcontroller" "${USER_CONFIG_FILE}")
ARCMODE=$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")
if [ "${ARCMODE}" = "config" ]; then
# Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
REMAP2="*"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
REMAP3="*"
else
REMAP1="*"
fi
show_dialog
set_remap
else
# Show recommended Option to user
if [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "true" ] && [ "${MACHINE}" = "Native" ]; then
writeConfigKey "arc.remap" "maxports" "${USER_CONFIG_FILE}"
elif [ -n "${SATAREMAP}" ] && [ "${EXTERNALCONTROLLER}" = "false" ]; then
writeConfigKey "arc.remap" "remap" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.remap" "acports" "${USER_CONFIG_FILE}"
fi
fi
# Check Remap for correct config
REMAP="$(readConfigKey "arc.remap" "${USER_CONFIG_FILE}")"
deleteConfigKey "cmdline.SataPortMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.DiskIdxMap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.sata_remap" "${USER_CONFIG_FILE}"
deleteConfigKey "cmdline.ahci_remap" "${USER_CONFIG_FILE}"
case "${REMAP}" in
"acports")
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAP}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAP}" "${USER_CONFIG_FILE}"
;;
"maxports")
writeConfigKey "cmdline.SataPortMap" "${SATAPORTMAPMAX}" "${USER_CONFIG_FILE}"
writeConfigKey "cmdline.DiskIdxMap" "${DISKIDXMAPMAX}" "${USER_CONFIG_FILE}"
;;
"remap")
writeConfigKey "cmdline.sata_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
;;
"ahci")
writeConfigKey "cmdline.ahci_remap" "${SATAREMAP}" "${USER_CONFIG_FILE}"
;;
esac
return
}
# Check for Controller // 104=RAID // 106=SATA // 107=SAS // 100=SCSI // c03=USB
declare -A controllers=(
[satacontroller]=106
[sascontroller]=107
[scsicontroller]=100
[raidcontroller]=104
)
external_controller=false
for controller in "${!controllers[@]}"; do
count=$(lspci -d ::${controllers[$controller]} 2>/dev/null | wc -l)
writeConfigKey "device.${controller}" "${count}" "${USER_CONFIG_FILE}"
if [ "${controller}" != "satacontroller" ] && [ ${count} -gt 0 ]; then
external_controller=true
fi
done
writeConfigKey "device.externalcontroller" "${external_controller}" "${USER_CONFIG_FILE}"

View File

@@ -2,66 +2,66 @@
# Update Loader
function updateLoader() {
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
local ARC_BRANCH="$(readConfigKey "arc.branch" "${USER_CONFIG_FILE}")"
local ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
local ARCCONF="$(readConfigKey "${MODEL:-SA6400}.serial" "${S_FILE}")"
local TAG="${1}"
[ -n "${ARCCONF}" ] && cp -f "${S_FILE}" "${TMP_PATH}/bak.yml"
if [ -z "${TAG}" ]; then
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
if [ "${ARC_BRANCH}" = "dev" ]; then
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
else
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
fi
if [ -n "${TAG}" ]; then
break
fi
sleep 3
idx=$((${idx} + 1))
done
fi
if [ -n "${TAG}" ]; then
export URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.zip"
export TAG="${TAG}"
{
{
curl -kL "${URL}" -o ${TMP_PATH}/update.zip 2>&3 3>&-
} 3>&1 >&4 4>&- |
perl -C -lane '
BEGIN {$header = "Downloading $ENV{URL}...\n\n"; $| = 1}
$pcent = $F[0];
$_ = join "", unpack("x3 a7 x4 a9 x8 a9 x7 a*") if length > 20;
s/ /\xa0/g; # replacing space with nbsp as dialog squashes spaces
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' 4>&- |
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
} 4>&1
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
HASHURL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.hash"
HASH="$(curl -skL "${HASHURL}" | awk '{print $1}')"
if [ "${HASH}" != "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed - Hash mismatch!\nTry again later." 0 0
if [ "${TAG}" != "zip" ]; then
if [ -z "${TAG}" ]; then
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
if [ "${ARC_BRANCH}" = "dev" ]; then
TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep "dev" | sort -rV | head -1)"
else
TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
fi
if [ -n "${TAG}" ]; then
break
fi
sleep 3
exec reboot
else
rm -rf "/mnt/update"
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
idx=$((${idx} + 1))
done
fi
if [ -n "${TAG}" ]; then
export URL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.zip"
export TAG="${TAG}"
{
{
curl -kL "${URL}" -o ${TMP_PATH}/update.zip 2>&3 3>&-
} 3>&1 >&4 4>&- |
perl -C -lane '
BEGIN {$header = "Downloading $ENV{URL}...\n\n"; $| = 1}
$pcent = $F[0];
$_ = join "", unpack("x3 a7 x4 a9 x8 a9 x7 a*") if length > 20;
s/ /\xa0/g; # replacing space with nbsp as dialog squashes spaces
if ($. <= 3) {
$header .= "$_\n";
$/ = "\r" if $. == 2
} else {
print "XXX\n$pcent\n$header$_\nXXX"
}' 4>&- |
dialog --gauge "Download Update: ${TAG}..." 14 72 4>&-
} 4>&1
fi
if [ -f "${TMP_PATH}/update.zip" ] && [ $(ls -s "${TMP_PATH}/update.zip" | cut -d' ' -f1) -gt 300000 ]; then
if [ "${TAG}" != "zip" ]; then
HASHURL="https://github.com/AuxXxilium/arc/releases/download/${TAG}/update-${TAG}-${ARC_BRANCH}.hash"
HASH="$(curl -skL "${HASHURL}" | awk '{print $1}')"
if [ "${HASH}" != "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" --aspect 18 \
--infobox "Update failed - Hash mismatch!\nTry again later." 0 0
sleep 3
exec reboot
fi
fi
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ]; then
rm -rf "/mnt/update"
mkdir -p "${TMP_PATH}/update"
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Updating Loader..." 3 50
if unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}/update"; then
cp -rf "${TMP_PATH}/update"/* "/mnt"
rm -rf "${TMP_PATH}/update"
rm -f "${TMP_PATH}/update.zip"
fi
if [ "$(cat "${PART1_PATH}/ARC-VERSION")" = "${TAG}" ] || [ "${TAG}" = "zip" ]; then
dialog --backtitle "$(backtitle)" --title "Update Loader" \
--infobox "Update Loader successful!" 3 50
sleep 2

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

@@ -8,6 +8,7 @@ set -e
# Get Loader Disk Bus
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
checkBootLoader || die "The loader is corrupted, please rewrite it!"
arc_mode || die "No bootmode found!"
[ -f "${HOME}/.initialized" ] && exec arc.sh || true
[ -f "${USER_CONFIG_FILE}" ] && sed -i "s/'/\"/g" "${USER_CONFIG_FILE}" >/dev/null 2>&1 || true
@@ -20,15 +21,14 @@ clear
COLUMNS=${COLUMNS:-50}
BANNER="$(figlet -c -w "$(((${COLUMNS})))" "Arc Loader")"
TITLE="Version:"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD})"
[ -n "${ARC_BRANCH}" ] && TITLE+=" | Branch: ${ARC_BRANCH}"
TITLE+=" ${ARC_VERSION} (${ARC_BUILD}) | Branch: ${ARC_BRANCH}"
printf "\033[1;30m%*s\n" ${COLUMNS} ""
printf "\033[1;30m%*s\033[A\n" ${COLUMNS} ""
printf "\033[1;34m%*s\033[0m\n" ${COLUMNS} "${BANNER}"
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
TITLE="Boot:"
[ ${EFI} -eq 1 ] && TITLE+=" [UEFI]" || TITLE+=" [BIOS]"
TITLE+=" [${BUS}]"
TITLE+=" | Device: [${BUS}] | Mode: [${ARCMODE}]"
printf "\033[1;34m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
# Check for Config File
@@ -84,45 +84,35 @@ initConfigKey "synoinfo" "{}" "${USER_CONFIG_FILE}"
initConfigKey "time" "{}" "${USER_CONFIG_FILE}"
initConfigKey "usbmount" "false" "${USER_CONFIG_FILE}"
initConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
if grep -q "automated_arc" /proc/cmdline; then
writeConfigKey "arc.mode" "automated" "${USER_CONFIG_FILE}"
elif grep -q "update_arc" /proc/cmdline; then
writeConfigKey "arc.mode" "update" "${USER_CONFIG_FILE}"
elif grep -q "force_arc" /proc/cmdline; then
writeConfigKey "arc.mode" "config" "${USER_CONFIG_FILE}"
else
writeConfigKey "arc.mode" "dsm" "${USER_CONFIG_FILE}"
fi
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
if [ -n "${ARC_BRANCH}" ]; then
writeConfigKey "arc.branch" "${ARC_BRANCH}" "${USER_CONFIG_FILE}"
fi
# Sort network interfaces
if arrayExistItem "sortnetif:" $(readConfigMap "addons" "${USER_CONFIG_FILE}"); then
echo -e "Sorting NIC: \033[1;34mactive\033[0m"
_sort_netif "$(readConfigKey "addons.sortnetif" "${USER_CONFIG_FILE}")"
echo
fi
# Read/Write IP/Mac to config
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for N in ${ETHX}; do
MACR="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ] && [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev "${N}"
ip addr add "${IPRA[0]}/${IPRA[1]:-"255.255.255.0"}" dev "${N}"
if [ -n "${IPRA[2]}" ]; then
ip route add default via "${IPRA[2]}" dev "${N}"
fi
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
echo "nameserver ${IPRA[3]:-${IPRA[2]}}" >>/etc/resolv.conf
fi
sleep 1
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth)
for N in ${ETHX}; do
MACR="$(cat /sys/class/net/${N}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
IPR="$(readConfigKey "network.${MACR}" "${USER_CONFIG_FILE}")"
if [ -n "${IPR}" ] && [ "1" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
IFS='/' read -r -a IPRA <<<"${IPR}"
ip addr flush dev "${N}"
ip addr add "${IPRA[0]}/${IPRA[1]:-"255.255.255.0"}" dev "${N}"
if [ -n "${IPRA[2]}" ]; then
ip route add default via "${IPRA[2]}" dev "${N}"
fi
[ "${N::3}" = "eth" ] && ethtool -s "${N}" wol g 2>/dev/null || true
# [ "${N::3}" = "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true
initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}"
done
if [ -n "${IPRA[3]:-${IPRA[2]}}" ]; then
sed -i "/nameserver ${IPRA[3]:-${IPRA[2]}}/d" /etc/resolv.conf
echo "nameserver ${IPRA[3]:-${IPRA[2]}}" >>/etc/resolv.conf
fi
sleep 1
fi
[ "${N::3}" = "eth" ] && ethtool -s "${N}" wol g 2>/dev/null || true
# [ "${N::3}" = "eth" ] && ethtool -K ${N} rxhash off 2>/dev/null || true
initConfigKey "${N}" "${MACR}" "${USER_CONFIG_FILE}"
done
ETHN=$(echo ${ETHX} | wc -w)
writeConfigKey "device.nic" "${ETHN}" "${USER_CONFIG_FILE}"
# No network devices
@@ -152,7 +142,6 @@ writeConfigKey "pid" "${PID}" "${USER_CONFIG_FILE}"
# Decide if boot automatically
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
ARCMODE="$(readConfigKey "arc.mode" "${USER_CONFIG_FILE}")"
if [ "${ARCMODE}" = "config" ]; then
echo -e "\033[1;34mStarting Config Mode...\033[0m"
elif [ "${ARCMODE}" = "automated" ]; then
@@ -169,42 +158,13 @@ echo
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
[ -z "${BOOTIPWAIT}" ] && BOOTIPWAIT=30
echo
echo -e "\033[1;37mDetected ${ETHN} NIC:\033[0m"
IPCON=""
echo
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S41dhcpcd restart >/dev/null 2>&1 || true
[ ! -f /var/run/dhcpcd/pid ] && /etc/init.d/S09dhcpcd restart >/dev/null 2>&1 || true
sleep 3
for N in ${ETHX}; do
COUNT=0
DRIVER=$(ls -ld /sys/class/net/${N}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')
while true; do
if [ "0" = "$(cat /sys/class/net/${N}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mNOT CONNECTED\033[0m"
break
fi
COUNT=$((COUNT + 1))
IP="$(getIP "${N}")"
if [ -n "${IP}" ]; then
SPEED=$(ethtool ${N} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then
echo -e "\r${DRIVER} (${SPEED}): \033[1;37mLINK LOCAL (No DHCP server found.)\033[0m"
else
echo -e "\r${DRIVER} (${SPEED}): \033[1;37m${IP}\033[0m"
[ -z "${IPCON}" ] && IPCON="${IP}"
fi
break
fi
if [ -z "$(cat /sys/class/net/${N}}/carrier 2>/dev/null)" ]; then
echo -e "\r${DRIVER}: \033[1;37mDOWN\033[0m"
break
fi
if [ ${COUNT} -ge ${BOOTIPWAIT} ]; then
echo -e "\r${DRIVER}: \033[1;37mTIMEOUT\033[0m"
break
fi
sleep 1
done
done
checkNIC
echo
mkdir -p "${ADDONS_PATH}"
@@ -221,7 +181,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

@@ -117,21 +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"
_set_conf_kv "SN" "${SN}" "${RAMDISK_PATH}/etc/synoinfo.conf" || exit 1
_set_conf_kv "SN" "${SN}" "${RAMDISK_PATH}/etc.defaults/synoinfo.conf" || exit 1
} >>"${LOG_FILE}" 2>&1
for KEY in "${!SYNOINFO[@]}"; do
{
echo "Set synoinfo ${KEY}"
_set_conf_kv "${KEY}" "${SYNOINFO[${KEY}]}" "${RAMDISK_PATH}/etc/synoinfo.conf" || exit 1
_set_conf_kv "${KEY}" "${SYNOINFO[${KEY}]}" "${RAMDISK_PATH}/etc.defaults/synoinfo.conf" || exit 1
} >>"${LOG_FILE}" 2>&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"
@@ -203,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
@@ -218,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

@@ -28,9 +28,7 @@ getLKMs "files/p3/lkms"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
case "${1}" in
min) getBuildroot "${1}" "br" ;;
ext) getBuildroot "${1}" "br" ;;
micro) getBuildroot "${1}" "br" ;;
evo) getBuildroot "${1}" "br" ;;
*) echo "Invalid option specified" ;;
esac
@@ -53,10 +51,9 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
ARC_BUILD="$(date +'%y%m%d')"
ARC_VERSION="13.3.7"
ARC_BRANCH="dev"
for file in ARC_BUILD ARC_VERSION ARC_BRANCH; do
echo "${!file}" > "files/p1/${file}"
done
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 "br/bzImage-arc" ] && [ -f "br/initrd-arc" ]; then
@@ -69,7 +66,7 @@ fi
echo "Copying files"
sudo cp -rf "files/p1/"* "/tmp/p1"
sudo cp -rf "files/p3/"* "/tmp/p3"
sync
sudo sync
echo "Unmount image file"
sudo umount "/tmp/p1"

View File

@@ -194,36 +194,18 @@ function getBuildroot() {
local REPO=""
local ZIP_NAME=""
local TAG_VAR=""
case "${TYPE}" in
min)
REPO="arc-buildroot-s"
TAG_VAR="BRSTAG"
;;
ext)
REPO="arc-buildroot-x"
TAG_VAR="BRXTAG"
;;
micro)
REPO="arc-buildroot-m"
TAG_VAR="BRMTAG"
;;
*)
echo "Invalid type specified"
return 1
;;
esac
local REPO="arc-buildroot-${TYPE}"
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 ${TAG_VAR}="${TAG}"
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/${REPO}/releases/assets/${ID}" -o "${DEST_PATH}/br.zip"
echo "Buildroot-${TYPE}: ${TAG}"
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"

View File

@@ -29,7 +29,7 @@ done
popd
rm -f grub.img
dd if=/dev/zero of=grub.img bs=1M seek=2048 count=0
dd if=/dev/zero of=grub.img bs=1M seek=1000 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