From d2f9f703ade053678c6a7472d725412c7b084a83 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Mon, 22 Jan 2024 21:33:55 +0100 Subject: [PATCH] build: try something new Signed-off-by: AuxXxilium --- .github/workflows/autobuild.yml | 8 +++--- .github/workflows/build.yml | 7 +++--- img-gen.sh | 44 +++++++++++++++++---------------- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 2e593b8..42e1b6c 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -72,11 +72,13 @@ jobs: run: | . scripts/func.sh - gzip -dc "files/grub.img.gz" >"arc.img" - fdisk -l "arc.img" + echo "Create Arc Image" + IMAGE_FILE="arc.img" + gzip -dc "files/grub.img.gz" >"${IMAGE_FILE}" + fdisk -l "${IMAGE_FILE}" LOOPX=$(sudo losetup -f) - sudo losetup -P "${LOOPX}" "arc.img" + sudo losetup -P "${LOOPX}" "${IMAGE_FILE}" echo "Mounting image file" mkdir -p "/tmp/p1" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36874cc..1a10a1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,11 +149,12 @@ jobs: . scripts/func.sh echo "Create Arc Image" - gzip -dc "files/grub.img.gz" >"arc.img" - fdisk -l "arc.img" + IMAGE_FILE="arc.img" + gzip -dc "files/grub.img.gz" >"${IMAGE_FILE}" + fdisk -l "${IMAGE_FILE}" LOOPX=$(sudo losetup -f) - sudo losetup -P "${LOOPX}" "arc.img" + sudo losetup -P "${LOOPX}" "${IMAGE_FILE}" echo "Mounting Image File" mkdir -p "/tmp/p1" diff --git a/img-gen.sh b/img-gen.sh index 5f72a54..830c805 100755 --- a/img-gen.sh +++ b/img-gen.sh @@ -4,6 +4,14 @@ set -e . scripts/func.sh +# Get extractor, LKM, addons and Modules +getExtractor "files/p3/extractor" +getLKMs "files/p3/lkms" +getAddons "files/p3/addons" +getModules "files/p3/modules" +getConfigs "files/p3/configs" +getPatches "files/p3/patches" + IMAGE_FILE="arc.img" gzip -dc "files/grub.img.gz" >"${IMAGE_FILE}" fdisk -l "${IMAGE_FILE}" @@ -12,12 +20,12 @@ LOOPX=$(sudo losetup -f) sudo losetup -P "${LOOPX}" "${IMAGE_FILE}" echo "Mounting Image File" -sudo rm -rf "/tmp/files/p1" -sudo rm -rf "/tmp/files/p3" -sudo mkdir -p "/tmp/files/p1" -sudo mkdir -p "/tmp/files/p3" -sudo mount ${LOOPX}p1 "/tmp/files/p1" -sudo mount ${LOOPX}p3 "/tmp/files/p3" +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" echo "Get Buildroot" # read -rp 'Version (2023.02.x): ' br_version @@ -33,25 +41,19 @@ sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/incl # read -rp "Build: ${VERSION}? Press ENTER to continue" echo "Repack initrd" -sudo cp -f "br/bzImage-arc" "/tmp/files/p3/bzImage-arc" -repackInitrd "br/initrd-arc" "files/initrd" "/tmp/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/files/p1" -sudo cp -Rf "files/p3/"* "/tmp/files/p3" -# Get extractor, LKM, addons and Modules -getExtractor "/tmp/files/p3/extractor" -getLKMs "/tmp/files/p3/lkms" true -getAddons "/tmp/files/p3/addons" true -getModules "/tmp/files/p3/modules" true -getConfigs "/tmp/files/p3/configs" true -getPatches "/tmp/files/p3/patches" true - +sudo cp -Rf "files/p1/"* "/tmp/p1" +sudo cp -Rf "files/p3/"* "/tmp/p3" sync -echo "Unmount Image File" -sudo umount "/tmp/files/p1" -sudo umount "/tmp/files/p3" +echo "Unmount image file" +sudo umount "/tmp/p1" +sudo umount "/tmp/p3" +rmdir "/tmp/p1" +rmdir "/tmp/p3" sudo losetup --detach ${LOOPX}