build: modify

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-02 21:05:34 +02:00
parent 5e10296de9
commit b0d370ee30
6 changed files with 106 additions and 136 deletions

View File

@ -73,8 +73,6 @@ jobs:
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getBuildroot "latest" "brx"
echo "BR_XVERSION=${TAG}" >> $GITHUB_ENV
getBuildroot "latest-s" "brs"
echo "BR_SVERSION=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
@ -137,64 +135,6 @@ jobs:
zip -9j update.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
sha256sum update.zip >checksum.sha256
# Build incremental
- name: Build Image S
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
VERSION="${VERSION}-s"
# 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
echo "Create Arc Image"
IMAGE_FILE="arc-s.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"
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-s-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-s.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-s.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc-s.ova"
# Zip update and generate checksum
zip -9j update-s.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
sha256sum update-s.zip >checksum-s.sha256
# Zip image and generate checksum
- name: Pack
run: |
@ -205,14 +145,7 @@ jobs:
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.VERSION }}.vhdx.zip" arc.vhdx
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
# SBase
zip -9 "arc-${{ env.VERSION }}-s.img.zip" arc-s.img
zip -9 "arc-${{ env.VERSION }}-s.vmdk-dyn.zip" arc-s-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}-s.vmdk-flat.zip" arc-s.vmdk arc-s-flat.vmdk
zip -9 "arc-${{ env.VERSION }}-s.vhdx.zip" arc-s.vhdx
zip -9 "arc-${{ env.VERSION }}-s.ova.zip" arc-s.ova
fi
echo "${{ inputs.update_version }}" >check.update
# Publish a release if is a tag
- name: Release
@ -241,11 +174,8 @@ jobs:
Custom: ${{ env.CUSTOMTAG }}
Theme: ${{ env.THEMETAG }}
LKM: ${{ env.LKMTAG }}
Buildroot: ${{ env.BR_XVERSION }} | Buildroot S: ${{ env.BR_SVERSION }}
Buildroot: ${{ env.BR_XVERSION }}
artifacts: |
arc-*.zip
update.zip
update-s.zip
checksum.sha256
checksum-s.sha256
check.update
checksum.sha256

View File

@ -99,9 +99,9 @@ jobs:
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
getTheme "files/p1/boot/grub"
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getBuildroot "latest" "brx"
getBuildrootx "latest" "brx"
echo "BR_XVERSION=${TAG}" >> $GITHUB_ENV
getBuildroot "latest-s" "brs"
getBuildroots "latest" "brs"
echo "BR_SVERSION=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV

View File

@ -8,6 +8,11 @@ tasks:
- git pull
- ./img-gen.sh
build-img-s:
cmds:
- git pull
- ./img-gen-s.sh
compile-kpatch:
dir: kpatch
cmds:

63
img-gen-s.sh Executable file
View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
set -e
# Clean cached Files
sudo git clean -fdx
. scripts/func.sh
# Get extractor, LKM, addons and Modules
getLKMs "files/p3/lkms"
getAddons "files/p3/addons"
getModules "files/p3/modules"
getConfigs "files/p3/configs"
getPatches "files/p3/patches"
getCustom "files/p3/custom"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
getBuildroots "latest-s" "brs"
# Sbase
IMAGE_FILE="arc-s.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"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%-m.dev')
echo "${VERSION}-s" >files/p1/ARC-VERSION
echo "${VERSION}-s" >VERSION
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}-s'"/' -i files/initrd/opt/arc/include/consts.sh
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"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-s-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-s.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-s.vhdx

View File

@ -16,8 +16,7 @@ getPatches "files/p3/patches"
getCustom "files/p3/custom"
getTheme "files/p1/boot/grub"
getOffline "files/p3/configs"
getBuildroot "latest" "brx"
getBuildroot "latest-s" "brs"
getBuildrootx "latest" "brx"
# Xbase
IMAGE_FILE="arc.img"
@ -61,48 +60,4 @@ sudo losetup --detach ${LOOPX}
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
# Sbase
IMAGE_FILE="arc-s.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"
sudo rm -rf "/tmp/p1"
sudo rm -rf "/tmp/p3"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && return 1
VERSION=$(date +'%y.%-m.dev')
echo "${VERSION}-s" >files/p1/ARC-VERSION
echo "${VERSION}-s" >VERSION
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}-s'"/' -i files/initrd/opt/arc/include/consts.sh
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"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-s-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-s.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-s.vhdx
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc.vhdx

View File

@ -221,37 +221,54 @@ function getTheme() {
echo "Getting Theme end - ${TAG}"
}
# Get latest Buildroot
# Get latest Buildroot-X
# $1 TAG
# $2 path
function getBuildroot() {
echo "Getting Buildroot begin"
function getBuildrootx() {
echo "Getting Buildroot-X begin"
TAG="${1:-latest}"
local DEST_PATH="${2:-brx}"
if [ "${TAG}" = "latest" ]; then
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-x/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
fi
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
rm -f "${DEST_PATH}/bzImage-arc"
if [ "${TAG}" = "latest-s" ]; then
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot/releases/download/${TAG}-s/bzImage" -o "${DEST_PATH}/bzImage-arc")
else
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot/releases/download/${TAG}/bzImage" -o "${DEST_PATH}/bzImage-arc")
fi
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
rm -f "${DEST_PATH}/initrd-arc"
if [ "${TAG}" = "latest-s" ]; then
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot/releases/download/${TAG}-s/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
else
STATUS=$(curl -w "%{http_code}" -L "https://github.com/AuxXxilium/arc-buildroot/releases/download/${TAG}/rootfs.cpio.xz" -o "${DEST_PATH}/initrd-arc")
fi
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 end - ${TAG}"
echo "Getting Buildroot-X end - ${TAG}"
}
# Get latest Buildroot-S
# $1 TAG
# $2 path
function getBuildroots() {
echo "Getting Buildroot-S begin"
TAG="${1:-latest}"
local DEST_PATH="${2:-brs}"
if [ "${TAG}" = "latest" ]; then
TAG="$(curl -s https://api.github.com/repos/AuxXxilium/arc-buildroot-s/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
fi
[ ! -d "${DEST_PATH}" ] && mkdir -p "${DEST_PATH}"
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
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}"
}
# Get latest Offline