2022-07-01 23:57:55 +07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2024-05-05 06:13:00 +07:00
|
|
|
# Clean cached Files
|
|
|
|
sudo git clean -fdx
|
|
|
|
|
2024-11-23 20:36:09 +07:00
|
|
|
. scripts/func.sh "${AUX_TOKEN}"
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
# Get extractor, LKM, addons and Modules
|
2024-10-25 00:08:56 +07:00
|
|
|
echo "Get Dependencies"
|
2024-05-05 06:13:00 +07:00
|
|
|
getAddons "files/p3/addons"
|
|
|
|
getModules "files/p3/modules"
|
|
|
|
getConfigs "files/p3/configs"
|
|
|
|
getPatches "files/p3/patches"
|
2024-08-02 23:28:15 +07:00
|
|
|
getCustom "files/p3/custom"
|
2024-10-25 00:08:56 +07:00
|
|
|
getLKMs "files/p3/lkms"
|
2024-05-05 06:13:00 +07:00
|
|
|
getTheme "files/p1/boot/grub"
|
2024-10-25 00:08:56 +07:00
|
|
|
getOffline "files/p3/configs"
|
2024-11-23 20:36:09 +07:00
|
|
|
[ -f "../brs/bzImage" ] && copyBuildroot "brs" || getBuildroots "brs"
|
2024-05-05 06:13:00 +07:00
|
|
|
|
2024-08-07 03:58:23 +07:00
|
|
|
# Sbase
|
2024-08-07 04:37:35 +07:00
|
|
|
IMAGE_FILE="arc.img"
|
2024-05-05 06:13:00 +07:00
|
|
|
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"
|
|
|
|
|
2024-11-14 05:43:24 +07:00
|
|
|
ARC_BUILD="`date +'%y%m%d'`"
|
2024-11-13 23:22:01 +07:00
|
|
|
ARC_VERSION="13.37.dev"
|
2024-11-08 02:24:20 +07:00
|
|
|
ARC_BRANCH="stable"
|
|
|
|
echo "${ARC_BUILD}" >files/p1/ARC-BUILD
|
|
|
|
echo "${ARC_VERSION}" >files/p1/ARC-VERSION
|
|
|
|
echo "${ARC_BRANCH}" >files/p1/ARC-BRANCH
|
2024-05-05 06:13:00 +07:00
|
|
|
|
|
|
|
echo "Repack initrd"
|
2024-08-07 03:58:23 +07:00
|
|
|
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
|
2024-11-23 20:36:09 +07:00
|
|
|
[[ ! -f "brs/bzImage-arc" || ! -f "brs/initrd-arc" ]] && exit 1
|
2024-08-07 03:58:23 +07:00
|
|
|
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
|
2024-05-05 06:13:00 +07:00
|
|
|
|
2022-07-01 23:57:55 +07:00
|
|
|
echo "Copying files"
|
2024-11-09 23:45:40 +07:00
|
|
|
sudo cp -rf "files/p1/"* "/tmp/p1"
|
|
|
|
sudo cp -rf "files/p3/"* "/tmp/p3"
|
2024-05-05 06:13:00 +07:00
|
|
|
sync
|
|
|
|
|
|
|
|
echo "Unmount image file"
|
|
|
|
sudo umount "/tmp/p1"
|
|
|
|
sudo umount "/tmp/p3"
|
|
|
|
rmdir "/tmp/p1"
|
|
|
|
rmdir "/tmp/p3"
|
|
|
|
|
|
|
|
sudo losetup --detach ${LOOPX}
|
|
|
|
|
2024-11-23 20:36:09 +07:00
|
|
|
qemu-img convert -p -f raw -o subformat=monolithicFlat -O vmdk ${IMAGE_FILE} arc.vmdk
|