modified: .github/workflows/mikrotik_patch.yml

This commit is contained in:
zyb 2024-06-24 03:23:03 +08:00
parent ecb38359db
commit fda08d6a68

View File

@ -158,23 +158,23 @@ jobs:
run: |
sudo modprobe nbd
sudo apt install -y qemu-utils extlinux > /dev/null
sudo truncate --size 128M chr-$LATEST_VERSION.img
sudo sgdisk --clear --set-alignment=2 \
truncate --size 128M chr-$LATEST_VERSION.img
sgdisk --clear --set-alignment=2 \
--new=1::+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2::-0 --typecode=2:8300 --change-name=2:"RouterOS" \
chr-$LATEST_VERSION.img
sudo dd if=chr-$LATEST_VERSION.img of=pt.bin bs=1 count=66 skip=446
echo -e "\x80" | sudo dd of=dbt.bin bs=1 count=1 conv=notrunc
sudo sgdisk --mbrtogpt --clear --set-alignment=2 \
dd if=chr-$LATEST_VERSION.img of=pt.bin bs=1 count=66 skip=446
echo -e "\x80" | dd of=pt.bin bs=1 count=1 conv=notrunc
sgdisk --mbrtogpt --clear --set-alignment=2 \
--new=1::+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set:2 \
--new=2::-0 --typecode=2:8300 --change-name=2:"RouterOS" \
chr-$LATEST_VERSION.img
sudo dd if=mbr.bin of=chr-$LATEST_VERSION.img bs=1 count=446 conv=notrunc
sudo dd if=pt.bin of=chr-$LATEST_VERSION.img bs=1 count=66 seek=446 conv=notrunc
dd if=mbr.bin of=chr-$LATEST_VERSION.img bs=1 count=446 conv=notrunc
dd if=pt.bin of=chr-$LATEST_VERSION.img bs=1 count=66 seek=446 conv=notrunc
sudo qemu-nbd -c /dev/nbd0 -f raw chr-$LATEST_VERSION.img
sudo mkfs.vfat -n "Boot" /dev/nbd0p1
sudo mkfs.ext4 -F -L "RouterOS" -m 0 -i 16384 -I 128 /dev/nbd0p2
sudo mkfs.ext4 -F -L "RouterOS" -m 0 /dev/nbd0p2
sudo mkdir -p ./img/{boot,routeros}
sudo mount /dev/nbd0p1 ./img/boot/
sudo mkdir -p ./img/boot/{BOOT,EFI/BOOT}