mirror of
https://github.com/adron-s/mtik_initrd_hacks.git
synced 2025-12-10 07:44:40 +01:00
Fix support for routeros-arm-6.44 and RB3011
Signed-off-by: Sergey Sergeev <adron@yapic.net>
This commit is contained in:
parent
85ffaded3d
commit
21d602c331
8 changed files with 21 additions and 18 deletions
|
|
@ -1,12 +1,12 @@
|
|||
# Mikrotik netboot/initrd jailbreak
|
||||
|
||||
(C) Sergey Sergeev, 2019
|
||||
(C) Sergey Sergeev, 2019-2020
|
||||
|
||||
All that you do is at your own risk!
|
||||
The author has not liable for any of you actions and their consequences!
|
||||
This code is presented as is and is solely for educational purposes ONLY!
|
||||
|
||||
0) Use RouterOS 6.45.6 or 7.0b1!
|
||||
0) Use RouterOS 6.44 or 6.45.6 or 7.0b1!
|
||||
1) Upload(using FTP) content of ./for_ftp_upload/pub/* to /pub
|
||||
(or /flash or /flash/rw/disk/pub) folder on target RouterOS device
|
||||
2) Netboot(via bootp and tftp) with kernel-new.elf
|
||||
|
|
@ -27,7 +27,7 @@ For Developers:
|
|||
cd ./init
|
||||
./compile.sh
|
||||
cd ..
|
||||
Make the necessary changes to the ./cpio-fs-ARCH(compile add add busybox, etc...)
|
||||
Make the necessary changes to the ./cpio-fs-ARCH(copy oldinit && order from ./bins/initramfs.cpio, compile add add busybox, etc...)
|
||||
In the end, when everything is ready, to get ./bins/kernel-new.elf, run: ./pack-kernel.sh
|
||||
Upload content of ./for_ftp_upload/pub/* to target RouterOS device via FTP(to /pub or /flash or ...)
|
||||
Put ./bins/kernel-new.elf to your tftp and Netboot from it
|
||||
|
|
|
|||
BIN
cpio-fs-arm/init
BIN
cpio-fs-arm/init
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
cpio-fs-arm/readme.txt
Normal file
1
cpio-fs-arm/readme.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
binary files from routeros arm 6.44!
|
||||
Binary file not shown.
|
|
@ -3,8 +3,8 @@
|
|||
#(C) Sergey Sergeev aka adron, 2019
|
||||
#
|
||||
|
||||
#TARGET_ARCH="arm"
|
||||
TARGET_ARCH="mips"
|
||||
TARGET_ARCH="arm"
|
||||
#TARGET_ARCH="mips"
|
||||
|
||||
[ ${TARGET_ARCH} = "arm" ] && {
|
||||
OPENWRT_DIR=/home/prog/openwrt/lede-all/2019-openwrt-all/openwrt-ipq806x
|
||||
|
|
|
|||
28
init/init.c
28
init/init.c
|
|
@ -21,26 +21,28 @@ void my_system(char *cmd, char *arg1, char *arg2, char *arg3){
|
|||
waitpid(pid, NULL, 0);
|
||||
}
|
||||
|
||||
static char work_dir1[ ] = "/flash/rw/disk/pub";
|
||||
static char work_dir2[ ] = "/flash/rw/disk/flash/rw/disk/pub";
|
||||
static char *work_dir = work_dir1;
|
||||
static char *work_dirs[ ] = { "/flash/rw/disk/pub", "/flash/rw/disk/flash/rw/disk/pub", NULL };
|
||||
void daemonized_OWL(void){
|
||||
int a = 0;
|
||||
int ret = 0;
|
||||
static char bin_busybox[128];
|
||||
static char owl_sh[128];
|
||||
struct stat sb;
|
||||
int work_dir_x = 0;
|
||||
char *work_dir = NULL;
|
||||
while(1){
|
||||
/* if(a++ % 10 == 0){
|
||||
printf("OWL is here! %d\n", a);
|
||||
}*/
|
||||
do{ //autodetect work_dir
|
||||
if(work_dir == work_dir1)
|
||||
work_dir = work_dir2;
|
||||
else
|
||||
work_dir = work_dir1;
|
||||
do{//autodetect work_dir
|
||||
work_dir = work_dirs[work_dir_x++];
|
||||
if(!work_dir){
|
||||
work_dir_x = 0;
|
||||
continue;
|
||||
}
|
||||
printf("%d: Trying work_dir: '%s'\n", a++, work_dir);
|
||||
sleep(5);
|
||||
}while(stat(work_dir, &sb) != 0);
|
||||
memset(&sb, 0x0, sizeof(sb));
|
||||
sleep(5); //at first fast run it always return -1
|
||||
ret = stat(work_dir, &sb);
|
||||
printf("stat() ret := %d\n", ret);
|
||||
}while(ret != 0);
|
||||
printf("work_dir found at: '%s'\n", work_dir);
|
||||
snprintf(bin_busybox, sizeof(bin_busybox), "%s/OWL/bin/busybox", work_dir);
|
||||
snprintf(owl_sh, sizeof(owl_sh), "%s/OWL.sh", work_dir);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue