mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-24 01:19:54 +07:00
custom: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
374282b7b5
commit
34c78ce3c3
51
.github/workflows/custom.yml
vendored
51
.github/workflows/custom.yml
vendored
@ -69,13 +69,6 @@ jobs:
|
||||
echo "Version: ${VERSION}"
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
|
||||
if [ -n "${VERSION}" ]; then
|
||||
# Modify Source File
|
||||
echo "${VERSION}" >VERSION
|
||||
echo "${VERSION}" >files/p1/ARC-VERSION
|
||||
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
|
||||
fi
|
||||
|
||||
- name: Update Comment Building
|
||||
id: comment
|
||||
uses: actions-cool/issues-helper@v3
|
||||
@ -89,25 +82,13 @@ jobs:
|
||||
> ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
----
|
||||
|
||||
# Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
|
||||
# Install dependencies
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
|
||||
sudo snap install yq
|
||||
|
||||
. scripts/func.sh
|
||||
|
||||
getLKMs "files/p3/lkms"
|
||||
getAddons "files/p3/addons"
|
||||
getModules "files/p3/modules"
|
||||
getConfigs "files/p3/configs"
|
||||
getPatches "files/p3/patches"
|
||||
getTheme "files/p1/boot/grub"
|
||||
getOffline "files/p3/configs"
|
||||
|
||||
echo "OK"
|
||||
|
||||
# Build incremental
|
||||
- name: Build image
|
||||
run: |
|
||||
@ -117,9 +98,12 @@ jobs:
|
||||
[ "${2}" = "{}" ] && sudo yq eval '.'${1}' = {}' --inplace "${3}" 2>/dev/null || sudo yq eval '.'${1}' = "'"${2}"'"' --inplace "${3}" 2>/dev/null
|
||||
}
|
||||
|
||||
echo "Create Arc Image"
|
||||
IMAGE_FILE="arc.img"
|
||||
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
|
||||
TAG="$(curl -m 5 -kL https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')"
|
||||
curl -kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "/tmp/arc.img.zip"
|
||||
unzip -o "/tmp/arc.img.zip" -d "/tmp"
|
||||
|
||||
echo "Modify Arc Image"
|
||||
IMAGE_FILE="/tmp/arc.img"
|
||||
fdisk -l "${IMAGE_FILE}"
|
||||
|
||||
LOOPX=$(sudo losetup -f)
|
||||
@ -131,17 +115,9 @@ jobs:
|
||||
sudo mount ${LOOPX}p1 "/tmp/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/p3"
|
||||
|
||||
echo "Get Buildroot"
|
||||
getBuildroot "2023.08.x" "br"
|
||||
[ ! -f "br/bzImage-arc" ] || [ ! -f "br/initrd-arc" ] && return 1
|
||||
|
||||
echo "Repack initrd"
|
||||
cp -f "br/bzImage-arc" "files/p3/bzImage-arc"
|
||||
repackInitrd "br/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
||||
|
||||
echo "Set Custom Config"
|
||||
PRESET_CONFIG_FILE="files/p1/user-config.yml"
|
||||
touch "${PRESET_CONFIG_FILE}"
|
||||
PRESET_CONFIG_FILE="/tmp/p1/user-config.yml"
|
||||
sudo touch "${PRESET_CONFIG_FILE}"
|
||||
writeConfigKey "model" "${{ env.MODEL }}" "${PRESET_CONFIG_FILE}"
|
||||
writeConfigKey "productver" "${{ env.PRODUCTVER }}" "${PRESET_CONFIG_FILE}"
|
||||
writeConfigKey "arc" "{}" "${PRESET_CONFIG_FILE}"
|
||||
@ -159,10 +135,9 @@ jobs:
|
||||
done
|
||||
fi
|
||||
echo "$(cat "${PRESET_CONFIG_FILE}")"
|
||||
echo "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}" >"files/p3/automated"
|
||||
echo "arc-${{ env.MODEL }}-${{ env.PRODUCTVER }}-${{ env.VERSION }}" >"/tmp/automated"
|
||||
sudo cp -f "/tmp/automated" "/tmp/p3/automated"
|
||||
echo "Copying files"
|
||||
sudo cp -Rf "files/p1/"* "/tmp/p1"
|
||||
sudo cp -Rf "files/p3/"* "/tmp/p3"
|
||||
sync
|
||||
|
||||
echo "Unmount image file"
|
||||
@ -173,6 +148,8 @@ jobs:
|
||||
|
||||
sudo losetup --detach ${LOOPX}
|
||||
|
||||
cp -f "${IMAGE_FILE}" "arc.img"
|
||||
|
||||
if [ "${{ env.FORMAT }}" = "dyn" ]; then
|
||||
echo "Image Converter -> dyn"
|
||||
qemu-img convert -O vmdk arc.img arc-dyn.vmdk
|
||||
|
Loading…
Reference in New Issue
Block a user