mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 13:35:09 +03:00
modified: chr.sh
This commit is contained in:
parent
3586e46473
commit
ddc8a99b62
19
chr.sh
19
chr.sh
@ -1,29 +1,28 @@
|
|||||||
|
|
||||||
DEV=/dev/sda
|
|
||||||
sgdisk --clear --set-alignment=2 \
|
sgdisk --clear --set-alignment=2 \
|
||||||
--new=1::+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set: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" \
|
--new=2::-0 --typecode=2:8300 --change-name=2:"RouterOS" \
|
||||||
--gpttombr=1:2 \
|
--gpttombr=1:2 \
|
||||||
$DEV
|
/dev/sda
|
||||||
|
|
||||||
dd if=$DEV of=pt.bin bs=1 count=66 skip=446
|
dd if=/dev/sda of=pt.bin bs=1 count=66 skip=446
|
||||||
echo -e "\x80" | dd of=pt.bin bs=1 count=1 conv=notrunc
|
echo -e "\x80" | dd of=pt.bin bs=1 count=1 conv=notrunc
|
||||||
sgdisk --mbrtogpt --clear --set-alignment=2 \
|
sgdisk --mbrtogpt --clear --set-alignment=2 \
|
||||||
--new=1::+32M --typecode=1:8300 --change-name=1:"RouterOS Boot" --attributes=1:set: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" \
|
--new=2::-0 --typecode=2:8300 --change-name=2:"RouterOS" \
|
||||||
$DEV
|
/dev/sda
|
||||||
dd if=mbr.bin of=$DEV bs=1 count=446 conv=notrunc
|
dd if=mbr.bin of=/dev/sda bs=1 count=446 conv=notrunc
|
||||||
dd if=pt.bin of=$DEV bs=1 count=66 seek=446 conv=notrunc
|
dd if=pt.bin of=/dev/sda bs=1 count=66 seek=446 conv=notrunc
|
||||||
mkfs.vfat -n "Boot" $DEV1
|
mkfs.vfat -n "Boot" /dev/sda1
|
||||||
mkfs.ext4 -F -L "RouterOS" -m 0 $DEV2
|
mkfs.ext4 -F -L "RouterOS" -m 0 /dev/sda2
|
||||||
sudo mkdir -p /tmp/{boot,routeros}
|
sudo mkdir -p /tmp/{boot,routeros}
|
||||||
|
|
||||||
mount -o loop,rw $DEV1 /tmp/boot
|
mount -o loop,rw /dev/sda1 /tmp/boot
|
||||||
mkdir -p /tmp/boot/{BOOT,EFI/BOOT}
|
mkdir -p /tmp/boot/{BOOT,EFI/BOOT}
|
||||||
wget -O /tmp/boot/EFI/BOOT/BOOTX64.EFI https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/BOOTX64.EFI
|
wget -O /tmp/boot/EFI/BOOT/BOOTX64.EFI https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/BOOTX64.EFI
|
||||||
umount /tmp/boot
|
umount /tmp/boot
|
||||||
|
|
||||||
mount -o loop,rw $DEV2 /tmp/routeros
|
mount -o loop,rw /dev/sda2 /tmp/routeros
|
||||||
sudo mkdir -p /tmp/routeros/{var/pdb/{system,option},boot,rw}
|
sudo mkdir -p /tmp/routeros/{var/pdb/{system,option},boot,rw}
|
||||||
wget -O /tmp/routeros/var/pdb/option/image https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/option-7.15.2.npk
|
wget -O /tmp/routeros/var/pdb/option/image https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/option-7.15.2.npk
|
||||||
wget -O /tmp/routeros/var/pdb/system/image https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/routeros-7.15.2.npk
|
wget -O /tmp/routeros/var/pdb/system/image https://github.com/elseif/MikroTikPatch/releases/download/7.15.2/routeros-7.15.2.npk
|
||||||
|
Loading…
Reference in New Issue
Block a user