mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 05:25:00 +03:00
modified: .github/workflows/mikrotik_patch.yml
modified: patch.py
This commit is contained in:
parent
a8911399f6
commit
4f9f7b8150
1
.github/workflows/mikrotik_patch.yml
vendored
1
.github/workflows/mikrotik_patch.yml
vendored
@ -167,7 +167,6 @@ jobs:
|
||||
sudo qemu-img convert -f raw -O qcow2 chr-$LATEST_VERSION.img chr-$LATEST_VERSION.qcow2
|
||||
sudo rm chr-$LATEST_VERSION.img
|
||||
sudo qemu-nbd -c /dev/nbd0 chr-$LATEST_VERSION.qcow2
|
||||
sudo ls /dev/nbd*
|
||||
sudo -E python3 patch.py boot /dev/nbd0p1
|
||||
sudo mkdir ./routeros
|
||||
sudo mount /dev/nbd0p2 ./routeros
|
||||
|
5
patch.py
5
patch.py
@ -80,13 +80,8 @@ def patch_bootloader(key_dict,boot_dev):
|
||||
f.write(new_bzImage[index*BLOCK_SIZE:(index+1)*BLOCK_SIZE])
|
||||
f.flush()
|
||||
print(']')
|
||||
|
||||
stdout,stderr = run_shell_command(f"lsblk -no pkname {boot_dev}")
|
||||
print(f'{stdout.decode().strip()}')
|
||||
print(f'/dev/{stdout.decode().strip()}')
|
||||
with open(f'/dev/{stdout.decode().strip()}','wb') as f:
|
||||
f.seek(0x100)
|
||||
f.write(bytes.fromhex('00000000000000000000BDE800000000'))
|
||||
f.seek(0x150)
|
||||
f.write(b'\x00')
|
||||
f.flush()
|
||||
|
Loading…
Reference in New Issue
Block a user