mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 21:59:53 +07:00
build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
120e70c3b0
commit
dc80125b75
162
.github/workflows/autobuild.yml
vendored
162
.github/workflows/autobuild.yml
vendored
@ -1,11 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
||||
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
name: Build Arc Dev
|
||||
name: Build Arc Base Dev
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@ -43,49 +43,41 @@ jobs:
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
|
||||
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get Buildroot
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
getLKMs "files/p3/lkms"
|
||||
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
|
||||
echo "Get Dependencies"
|
||||
getAddons "files/p3/addons"
|
||||
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
|
||||
getModules "files/p3/modules"
|
||||
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
|
||||
getConfigs "files/p3/configs"
|
||||
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
|
||||
getPatches "files/p3/patches"
|
||||
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
|
||||
getCustom "files/p3/custom"
|
||||
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
|
||||
getOffline "files/p3/system/include"
|
||||
getLKMs "files/p3/lkms"
|
||||
getTheme "files/p1/boot/grub"
|
||||
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
|
||||
getBuildrootx "latest" "brx"
|
||||
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
|
||||
getBuildroots "latest" "brs"
|
||||
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
|
||||
getOffline "files/p3/offline"
|
||||
getBuildrootx "brx"
|
||||
getBuildroots "brs"
|
||||
|
||||
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
|
||||
|
||||
echo "OK"
|
||||
|
||||
# Build incremental
|
||||
- name: Build Image S
|
||||
- name: Build Next Image
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
if [ -n "${VERSION}" ]; then
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "stable" >files/p1/ARC-BRANCH
|
||||
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
||||
fi
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
ARCBRANCH="dev"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
||||
gzip -dc "files/p3/image/grub.img.gz" >"${IMAGE_FILE}"
|
||||
fdisk -l "${IMAGE_FILE}"
|
||||
|
||||
LOOPX=$(sudo losetup -f)
|
||||
@ -97,11 +89,12 @@ jobs:
|
||||
sudo mount ${LOOPX}p1 "/tmp/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
|
||||
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/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"
|
||||
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
||||
cp -f "brx/initrd-arc" "files/p3/initrd-arc"
|
||||
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
||||
|
||||
echo "Copying files"
|
||||
sudo cp -Rf "files/p1/"* "/tmp/p1"
|
||||
@ -119,37 +112,36 @@ jobs:
|
||||
echo "Image Converter"
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
||||
|
||||
echo "Create Arc ova"
|
||||
convertova "${IMAGE_FILE}" "arc.ova"
|
||||
# Zip image and generate checksum
|
||||
- name: Pack
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc.vhdx
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-next.zip .)
|
||||
fi
|
||||
|
||||
# Zip update and generate checksum
|
||||
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
|
||||
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
|
||||
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
|
||||
cd files/p3
|
||||
zip -9 update.zip -r .
|
||||
sha256sum update.zip >checksum.sha256
|
||||
mv update.zip ../../
|
||||
mv checksum.sha256 ../../
|
||||
cd -
|
||||
# Cleanup
|
||||
- name: Cleanup
|
||||
run: |
|
||||
rm -rf "arc.img" "arc.ova" "arc.vmdk" "arc-dyn.vmdk" "arc.vhdx" "arc-flat.vmdk"
|
||||
|
||||
# Build incremental
|
||||
- name: Build Image X
|
||||
# Build incremental
|
||||
- name: Build Stable Image
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
if [ -n "${VERSION}" ]; then
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "next" >files/p1/ARC-BRANCH
|
||||
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
||||
fi
|
||||
ARCBRANCH="dev"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc-next.img"
|
||||
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
||||
IMAGE_FILE="arc.img"
|
||||
gzip -dc "files/p3/image/grub.img.gz" >"${IMAGE_FILE}"
|
||||
fdisk -l "${IMAGE_FILE}"
|
||||
|
||||
LOOPX=$(sudo losetup -f)
|
||||
@ -161,11 +153,12 @@ jobs:
|
||||
sudo mount ${LOOPX}p1 "/tmp/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
|
||||
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/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 "brs/bzImage-arc" "files/p3/bzImage-arc"
|
||||
cp -f "brs/initrd-arc" "files/p3/initrd-arc"
|
||||
# repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
||||
|
||||
echo "Copying files"
|
||||
sudo cp -Rf "files/p1/"* "/tmp/p1"
|
||||
@ -181,40 +174,24 @@ jobs:
|
||||
sudo losetup --detach ${LOOPX}
|
||||
|
||||
echo "Image Converter"
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
||||
|
||||
echo "Create Arc ova"
|
||||
convertova "${IMAGE_FILE}" "arc-next.ova"
|
||||
# Zip update and generate checksum
|
||||
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
|
||||
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
|
||||
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
|
||||
cd files/p3
|
||||
zip -9 update-next.zip -r .
|
||||
sha256sum update-next.zip >checksum-next.sha256
|
||||
mv update-next.zip ../../
|
||||
mv checksum-next.sha256 ../../
|
||||
cd -
|
||||
convertova "${IMAGE_FILE}" "arc.ova"
|
||||
|
||||
# Zip image and generate checksum
|
||||
- name: Pack
|
||||
- name: Pack Stable Image
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
# XBase
|
||||
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
|
||||
# SBase
|
||||
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-stable.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-stable.zip .)
|
||||
fi
|
||||
echo "24.01.01" >check.update
|
||||
|
||||
# Publish a release if is a tag
|
||||
- name: Release
|
||||
@ -229,25 +206,10 @@ jobs:
|
||||
### Information:
|
||||
Notice: Development Build
|
||||
|
||||
- Version:
|
||||
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
|
||||
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
|
||||
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
||||
Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
||||
|
||||
### Versions:
|
||||
Addons: ${{ env.ADDONSTAG }}
|
||||
Configs: ${{ env.CONFIGSTAG }}
|
||||
Modules: ${{ env.MODULESTAG }}
|
||||
Patches: ${{ env.PATCHESTAG }}
|
||||
Custom: ${{ env.CUSTOMTAG }}
|
||||
Theme: ${{ env.THEMETAG }}
|
||||
LKM: ${{ env.LKMTAG }}
|
||||
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
|
||||
Release: ${{ env.BUILD_TIME }}
|
||||
### Release
|
||||
${{ env.BUILD_TIME }}
|
||||
artifacts: |
|
||||
arc-*.zip
|
||||
update.zip
|
||||
update-next.zip
|
||||
checksum.sha256
|
||||
checksum-next.sha256
|
||||
check.update
|
||||
update-*.zip
|
248
.github/workflows/build.yml
vendored
248
.github/workflows/build.yml
vendored
@ -1,11 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
||||
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
name: Build Arc
|
||||
name: Build Arc Image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@ -26,18 +26,22 @@ on:
|
||||
description: "pre release"
|
||||
default: false
|
||||
type: boolean
|
||||
next:
|
||||
description: "next"
|
||||
default: true
|
||||
type: boolean
|
||||
stable:
|
||||
description: "stable"
|
||||
default: true
|
||||
type: boolean
|
||||
clean:
|
||||
description: "clean"
|
||||
default: false
|
||||
type: boolean
|
||||
update_version:
|
||||
description: "update min version"
|
||||
default: "24.09.22"
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@main
|
||||
@ -79,48 +83,112 @@ jobs:
|
||||
|
||||
echo "Version: ${VERSION}"
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
if [ -n "${VERSION}" ]; then
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
fi
|
||||
|
||||
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get Dependencies for all Image
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
getLKMs "files/p3/lkms"
|
||||
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
|
||||
echo "Get Dependencies"
|
||||
getAddons "files/p3/addons"
|
||||
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
|
||||
getModules "files/p3/modules"
|
||||
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
|
||||
getConfigs "files/p3/configs"
|
||||
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
|
||||
getPatches "files/p3/patches"
|
||||
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
|
||||
getCustom "files/p3/custom"
|
||||
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
|
||||
getOffline "files/initrd/include"
|
||||
getLKMs "files/p3/lkms"
|
||||
getTheme "files/p1/boot/grub"
|
||||
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
|
||||
getBuildrootx "latest" "brx"
|
||||
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
|
||||
getBuildroots "latest" "brs"
|
||||
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
|
||||
getOffline "files/p3/offline"
|
||||
getBuildrootx "brx"
|
||||
getBuildroots "brs"
|
||||
|
||||
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
|
||||
|
||||
echo "OK"
|
||||
|
||||
# Build incremental
|
||||
- name: Build Image S
|
||||
- name: Build Next Image
|
||||
if: inputs.next == true
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
if [ -n "${VERSION}" ]; then
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "stable" >files/p1/ARC-BRANCH
|
||||
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
||||
ARCBRANCH="next"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $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 "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
|
||||
|
||||
echo "Repack initrd"
|
||||
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
|
||||
cp -f "brx/initrd-arc" "files/p3/initrd-arc"
|
||||
repackInitrd "brx/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"
|
||||
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 ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
||||
|
||||
echo "Create Arc ova"
|
||||
convertova "${IMAGE_FILE}" "arc.ova"
|
||||
|
||||
# Zip image and generate checksum
|
||||
- name: Pack Next Image
|
||||
if: inputs.next == true
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip .)
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
- name: Cleanup
|
||||
run: |
|
||||
rm -rf "arc.img" "arc.ova" "arc.vmdk" "arc-dyn.vmdk" "arc.vhdx" "arc-flat.vmdk"
|
||||
|
||||
# Build incremental
|
||||
- name: Build Stable Image
|
||||
if: inputs.stable == true
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
ARCBRANCH="stable"
|
||||
echo "${ARCBRANCH}" >files/p1/ARC-BRANCH
|
||||
echo "ARCBRANCH=${ARCBRANCH}" >> $GITHUB_ENV
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
||||
@ -139,6 +207,7 @@ jobs:
|
||||
|
||||
echo "Repack initrd"
|
||||
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
||||
cp -f "brs/initrd-arc" "files/p3/initrd-arc"
|
||||
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
||||
|
||||
echo "Copying files"
|
||||
@ -157,103 +226,23 @@ jobs:
|
||||
echo "Image Converter"
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx
|
||||
|
||||
echo "Create Arc ova"
|
||||
convertova "${IMAGE_FILE}" "arc.ova"
|
||||
|
||||
# Zip update and generate checksum
|
||||
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
|
||||
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
|
||||
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
|
||||
cd files/p3
|
||||
zip -9 update.zip -r .
|
||||
sha256sum update.zip >checksum.sha256
|
||||
mv update.zip ../../
|
||||
mv checksum.sha256 ../../
|
||||
cd -
|
||||
|
||||
# Build incremental
|
||||
- name: Build Image X
|
||||
run: |
|
||||
. scripts/func.sh
|
||||
|
||||
if [ -n "${VERSION}" ]; then
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
echo "next" >files/p1/ARC-BRANCH
|
||||
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
||||
fi
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc-next.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 "brx/bzImage-arc" ] || [ ! -f "brx/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"
|
||||
|
||||
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"
|
||||
rmdir "/tmp/p1"
|
||||
rmdir "/tmp/p3"
|
||||
|
||||
sudo losetup --detach ${LOOPX}
|
||||
|
||||
echo "Image Converter"
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
|
||||
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
|
||||
|
||||
echo "Create Arc ova"
|
||||
convertova "${IMAGE_FILE}" "arc-next.ova"
|
||||
|
||||
# Zip update and generate checksum
|
||||
cp -f files/p1/ARC-VERSION files/p3/ARC-VERSION
|
||||
cp -f files/p1/ARC-BRANCH files/p3/ARC-BRANCH
|
||||
cp -f files/p1/boot/grub/grub.cfg files/p3/grub.cfg
|
||||
cd files/p3
|
||||
zip -9 update-next.zip -r .
|
||||
sha256sum update-next.zip >checksum-next.sha256
|
||||
mv update-next.zip ../../
|
||||
mv checksum-next.sha256 ../../
|
||||
cd -
|
||||
|
||||
# Zip image and generate checksum
|
||||
- name: Pack
|
||||
- name: Pack Stable Image
|
||||
if: inputs.stable == true
|
||||
run: |
|
||||
if [ -n "${{ env.VERSION }}" ]; then
|
||||
# XBase
|
||||
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
|
||||
# SBase
|
||||
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.img.zip" arc.img
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-dyn.zip" arc-dyn.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.vhdx.zip" arc.vhdx
|
||||
zip -9 "arc-${{ env.VERSION }}-${{ env.ARCBRANCH }}.ova.zip" arc.ova
|
||||
(cd files && zip -r ../update-${{ env.VERSION }}-${{ env.ARCBRANCH }}.zip .)
|
||||
fi
|
||||
echo "${{ inputs.update_version }}" >check.update
|
||||
|
||||
# Publish a release if is a tag
|
||||
- name: Release
|
||||
@ -268,25 +257,14 @@ jobs:
|
||||
### Information:
|
||||
Notice: ${{ inputs.notice }}
|
||||
|
||||
- Version:
|
||||
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
|
||||
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
|
||||
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
||||
Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
|
||||
|
||||
### Versions:
|
||||
Addons: ${{ env.ADDONSTAG }}
|
||||
Configs: ${{ env.CONFIGSTAG }}
|
||||
Modules: ${{ env.MODULESTAG }}
|
||||
Patches: ${{ env.PATCHESTAG }}
|
||||
Custom: ${{ env.CUSTOMTAG }}
|
||||
Theme: ${{ env.THEMETAG }}
|
||||
LKM: ${{ env.LKMTAG }}
|
||||
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
|
||||
Release: ${{ env.BUILD_TIME }}
|
||||
- next: Next Image (Full Image, all dependencies are included, DSM files will be loaded from the Internet, more features/hardware support)
|
||||
- stable: Stable Image (Full Image, all dependencies are included, DSM files will be loaded from the Internet, less features/hardware support)
|
||||
|
||||
### Release
|
||||
${{ env.BUILD_TIME }}
|
||||
artifacts: |
|
||||
arc-*.zip
|
||||
update.zip
|
||||
update-next.zip
|
||||
checksum.sha256
|
||||
checksum-next.sha256
|
||||
check.update
|
||||
update-*.zip
|
||||
|
7
.github/workflows/grub.yml
vendored
7
.github/workflows/grub.yml
vendored
@ -35,13 +35,6 @@ jobs:
|
||||
run: |
|
||||
. scripts/grub.sh "grub-2.12" "i386-pc i386-efi x86_64-efi"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: grub
|
||||
path: |
|
||||
grub.img.gz
|
||||
|
||||
- name: Check and Push
|
||||
if: success() && inputs.push == true
|
||||
run: |
|
||||
|
329
scripts/func.sh
329
scripts/func.sh
@ -1,289 +1,256 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
||||
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
# Get Extractor
|
||||
# Get latest Arc
|
||||
# $1 path
|
||||
function getExtractor() {
|
||||
echo "Getting syno extractor begin"
|
||||
local DEST_PATH="${1:-extractor}"
|
||||
local CACHE_DIR="/tmp/pat"
|
||||
rm -rf "${CACHE_DIR}"
|
||||
mkdir -p "${CACHE_DIR}"
|
||||
# Download pat file
|
||||
# global.synologydownload.com, global.download.synology.com, cndl.synology.cn
|
||||
local PAT_URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat"
|
||||
local PAT_FILE="DSM_DS3622xs+_42218.pat"
|
||||
local STATUS=$(curl -# -w "%{http_code}" -L "${PAT_URL}" -o "${CACHE_DIR}/${PAT_FILE}")
|
||||
if [ $? -ne 0 ] || [ ${STATUS} -ne 200 ]; then
|
||||
echo "[E] DSM_DS3622xs%2B_42218.pat download error!"
|
||||
rm -rf ${CACHE_DIR}
|
||||
function getArcSystem() {
|
||||
echo "Getting ArcSystem begin"
|
||||
local DEST_PATH="${1}"
|
||||
local RELEASE="${2}"
|
||||
local CACHE_FILE="/tmp/system.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ "${RELEASE}" = "dev" ]; then
|
||||
local TAG="$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-system/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-system/releases" | jq -r ".[].tag_name" | grep -v "dev" | sort -rV | head -1)"
|
||||
fi
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-system/releases/download/${TAG}/system-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip LKMs
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting ArcSystem end - ${TAG}"
|
||||
else
|
||||
echo "Failed to get ArcSystem"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${CACHE_DIR}/ramdisk"
|
||||
tar -C "${CACHE_DIR}/ramdisk/" -xf "${CACHE_DIR}/${PAT_FILE}" rd.gz 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "[E] extractor rd.gz error!"
|
||||
rm -rf ${CACHE_DIR}
|
||||
exit 1
|
||||
fi
|
||||
(
|
||||
cd "${CACHE_DIR}/ramdisk"
|
||||
xz -dc <rd.gz | cpio -idm
|
||||
) >/dev/null 2>&1 || true
|
||||
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
|
||||
# Copy only necessary files
|
||||
for f in libcurl.so.4 libmbedcrypto.so.5 libmbedtls.so.13 libmbedx509.so.1 libmsgpackc.so.2 libsodium.so libsynocodesign-ng-virtual-junior-wins.so.7; do
|
||||
cp -f "${CACHE_DIR}/ramdisk/usr/lib/${f}" "${DEST_PATH}"
|
||||
done
|
||||
cp -f "${CACHE_DIR}/ramdisk/usr/syno/bin/scemd" "${DEST_PATH}/syno_extract_system_patch"
|
||||
|
||||
# Clean up
|
||||
rm -rf ${CACHE_DIR}
|
||||
echo "Getting syno extractor end"
|
||||
}
|
||||
|
||||
# Get latest LKMs
|
||||
# $1 path
|
||||
function getLKMs() {
|
||||
echo "Getting LKMs begin"
|
||||
local DEST_PATH="${1:-lkms}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/rp-lkms.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${LKMTAG}" ]; then
|
||||
TAG="${LKMTAG}"
|
||||
TAG="$(curl -s "https://api.github.com/repos/AuxXxilium/arc-lkm/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip LKMs
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting LKMs end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s "https://api.github.com/repos/AuxXxilium/arc-lkm/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get LKMs"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip LKMs
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting LKMs end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Addons
|
||||
# $1 path
|
||||
function getAddons() {
|
||||
echo "Getting Addons begin"
|
||||
local DEST_PATH="${1:-addons}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_DIR="/tmp/addons"
|
||||
local CACHE_FILE="/tmp/addons.zip"
|
||||
if [ -n "${ADDONSTAG}" ]; then
|
||||
TAG="${ADDONSTAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Addons
|
||||
rm -rf "${CACHE_DIR}"
|
||||
mkdir -p "${CACHE_DIR}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${CACHE_DIR}"
|
||||
echo "Installing Addons to ${DEST_PATH}"
|
||||
[ -f /tmp/addons/VERSION ] && cp -f /tmp/addons/VERSION ${DEST_PATH}/
|
||||
for PKG in $(ls ${CACHE_DIR}/*.addon); do
|
||||
ADDON=$(basename "${PKG}" .addon)
|
||||
mkdir -p "${DEST_PATH}/${ADDON}"
|
||||
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
|
||||
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
|
||||
done
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Addons end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-addons/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Addons"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
# Install Addons
|
||||
rm -rf "${CACHE_DIR}"
|
||||
mkdir -p "${CACHE_DIR}"
|
||||
unzip "${CACHE_FILE}" -d "${CACHE_DIR}"
|
||||
echo "Installing Addons to ${DEST_PATH}"
|
||||
[ -f /tmp/addons/VERSION ] && cp -f /tmp/addons/VERSION ${DEST_PATH}/
|
||||
for PKG in $(ls ${CACHE_DIR}/*.addon); do
|
||||
ADDON=$(basename "${PKG}" .addon)
|
||||
mkdir -p "${DEST_PATH}/${ADDON}"
|
||||
echo "Extracting ${PKG} to ${DEST_PATH}/${ADDON}"
|
||||
tar -xaf "${PKG}" -C "${DEST_PATH}/${ADDON}"
|
||||
done
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Addons end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Modules
|
||||
# $1 path
|
||||
function getModules() {
|
||||
echo "Getting Modules begin"
|
||||
local DEST_PATH="${1:-modules}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/modules.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${MODULESTAG}" ]; then
|
||||
TAG="${MODULESTAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Modules
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
echo "Getting Modules end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-modules/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Modules"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip Modules
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Modules end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Configs
|
||||
# $1 path
|
||||
function getConfigs() {
|
||||
echo "Getting Configs begin"
|
||||
local DEST_PATH="${1:-configs}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/configs.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${CONFIGSTAG}" ]; then
|
||||
TAG="${CONFIGSTAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Configs
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Configs end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-configs/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Configs"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip Configs
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Configs end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Patches
|
||||
# $1 path
|
||||
function getPatches() {
|
||||
echo "Getting Patches begin"
|
||||
local DEST_PATH="${1:-patches}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/patches.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${PATCHESTAG}" ]; then
|
||||
TAG="${PATCHESTAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Patches
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Patches end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-patches/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Patches"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip Patches
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Patches end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Custom
|
||||
# $1 path
|
||||
function getCustom() {
|
||||
echo "Getting Custom begin"
|
||||
local DEST_PATH="${1:-custom}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/custom.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${CUSTOMTAG}" ]; then
|
||||
TAG="${CUSTOMTAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-custom/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-custom/releases/download/${TAG}/custom-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Custom
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Custom end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-custom/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Custom"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-custom/releases/download/${TAG}/custom.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip Custom
|
||||
rm -rf "${DEST_PATH}"
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Custom end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Theme
|
||||
# $1 path
|
||||
function getTheme() {
|
||||
echo "Getting Theme begin"
|
||||
local DEST_PATH="${1:-theme}"
|
||||
local DEST_PATH="${1}"
|
||||
local CACHE_FILE="/tmp/theme.zip"
|
||||
rm -f "${CACHE_FILE}"
|
||||
if [ -n "${THEMETAG}" ]; then
|
||||
TAG="${THEMETAG}"
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-theme/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-theme/releases/download/${TAG}/arc-theme-${TAG}.zip" -o "${CACHE_FILE}"; then
|
||||
# Unzip Theme
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip -o "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Theme end - ${TAG}"
|
||||
else
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-theme/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
echo "Failed to get Theme"
|
||||
exit 1
|
||||
fi
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-theme/releases/download/${TAG}/arc-theme.zip" -o "${CACHE_FILE}")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
# Unzip Theme
|
||||
mkdir -p "${DEST_PATH}"
|
||||
unzip "${CACHE_FILE}" -d "${DEST_PATH}"
|
||||
rm -f "${CACHE_FILE}"
|
||||
echo "Getting Theme end - ${TAG}"
|
||||
}
|
||||
|
||||
# Get latest Buildroot-X
|
||||
# $1 TAG
|
||||
# $2 path
|
||||
# $1 path
|
||||
function getBuildrootx() {
|
||||
echo "Getting Buildroot-X begin"
|
||||
TAG="${1:-latest}"
|
||||
local DEST_PATH="${2:-brx}"
|
||||
local DEST_PATH="${1}"
|
||||
|
||||
if [ "${TAG}" = "latest" ]; then
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
fi
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
|
||||
echo "Getting Kernel"
|
||||
rm -f "${DEST_PATH}/bzImage-arc"
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc"; then
|
||||
echo "Kernel: ${TAG}"
|
||||
else
|
||||
echo "Failed to get Kernel"
|
||||
exit 1
|
||||
fi
|
||||
echo "Getting Ramdisk"
|
||||
rm -f "${DEST_PATH}/initrd-arc"
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
echo "Getting Buildroot-X end - ${TAG}"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-buildroot-x/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc"; then
|
||||
echo "Ramdisk: ${TAG}"
|
||||
else
|
||||
echo "Failed to get Ramdisk"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Get latest Buildroot-S
|
||||
# $1 TAG
|
||||
# $2 path
|
||||
# Get latest Buildroot-X
|
||||
# $1 path
|
||||
function getBuildroots() {
|
||||
echo "Getting Buildroot-S begin"
|
||||
TAG="${1:-latest}"
|
||||
local DEST_PATH="${2:-brs}"
|
||||
local DEST_PATH="${1}"
|
||||
|
||||
if [ "${TAG}" = "latest" ]; then
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
fi
|
||||
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
|
||||
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
|
||||
echo "Getting Kernel"
|
||||
rm -f "${DEST_PATH}/bzImage-arc"
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc"; then
|
||||
echo "Kernel: ${TAG}"
|
||||
else
|
||||
echo "Failed to get Kernel"
|
||||
exit 1
|
||||
fi
|
||||
echo "Getting Ramdisk"
|
||||
rm -f "${DEST_PATH}/initrd-arc"
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
|
||||
echo "TAG=${TAG}; Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
echo "Getting Buildroot-S end - ${TAG}"
|
||||
if curl -skL "https://github.com/AuxXxilium/arc-buildroot-s/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc"; then
|
||||
echo "Ramdisk: ${TAG}"
|
||||
else
|
||||
echo "Failed to get Ramdisk"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Get latest Offline
|
||||
# $1 path
|
||||
function getOffline() {
|
||||
echo "Getting Offline begin"
|
||||
local DEST_PATH="${1:-configs}"
|
||||
local DEST_PATH="${1}"
|
||||
|
||||
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
|
||||
rm -f "${DEST_PATH}/offline.json"
|
||||
STATUS=$(curl -w "%{http_code}" -L "https://autoupdate.synology.com/os/v2" -o "${DEST_PATH}/offline.json")
|
||||
echo "Status=${STATUS}"
|
||||
[ ${STATUS} -ne 200 ] && exit 1
|
||||
|
||||
echo "Getting Offline end"
|
||||
if curl -skL "https://autoupdate.synology.com/os/v2" -o "${DEST_PATH}/offline.json"; then
|
||||
echo "Getting Offline end"
|
||||
else
|
||||
echo "Failed to get Offline"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# repack initrd
|
||||
@ -387,7 +354,7 @@ function convertova() {
|
||||
|
||||
# Create VM configuration
|
||||
cat <<_EOF_ >"OVA_${VMNAME}/${VMNAME}.vmx"
|
||||
.encoding = "GBK"
|
||||
.encoding = "UTF-8"
|
||||
config.version = "8"
|
||||
virtualHW.version = "21"
|
||||
displayName = "${VMNAME}"
|
||||
|
Loading…
Reference in New Issue
Block a user