diff --git a/README.md b/README.md index 3fdbf85..77d5548 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,8 @@ For Developers: cd .. 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 ...) + Upload content of ./for_ftp_upload/pub/* to target RouterOS device via FTP(to /pub or /flash or /disk1 or ...) + * /disk1 is a USB flash drive with ext3 fs Put ./bins/kernel-new.elf to your tftp and Netboot from it telnet x.x.x.x 22111 diff --git a/cpio-fs-arm/init b/cpio-fs-arm/init index 681b921..fdb4622 100755 Binary files a/cpio-fs-arm/init and b/cpio-fs-arm/init differ diff --git a/cpio-fs-arm/oldinit b/cpio-fs-arm/oldinit index 7380362..a5b65b8 100755 Binary files a/cpio-fs-arm/oldinit and b/cpio-fs-arm/oldinit differ diff --git a/cpio-fs-arm/readme.txt b/cpio-fs-arm/readme.txt index 4808da1..cb8a655 100644 --- a/cpio-fs-arm/readme.txt +++ b/cpio-fs-arm/readme.txt @@ -1 +1 @@ -binary files from routeros arm 7.2rc1! \ No newline at end of file +binary files from routeros arm 7.2.3! \ No newline at end of file diff --git a/init/init.c b/init/init.c index 65afe09..1288622 100644 --- a/init/init.c +++ b/init/init.c @@ -32,12 +32,21 @@ static void do_chmod(const char *fname, int perm) perm, fname); return; } - printf("Making %s executable\n", fname); + printf("chmod %d %s\n", perm, fname); fchmod(fd, perm); close(fd); } -static char *work_dirs[ ] = { "/flash/rw/disk/pub", "/flash/rw/disk/flash/rw/disk/pub", NULL }; + +static char srd_dir[ ] = "/system/ram/disks"; +static char rd_dir[ ] = "/ram/disks"; +static char *work_dirs[ ] = { + "/ram/disks/disk1", + "/ram/disks/disk2", + "/flash/rw/disk/pub", + "/flash/rw/disk/flash/rw/disk/pub", + NULL +}; void daemonized_OWL(void) { int a = 0; @@ -47,6 +56,16 @@ void daemonized_OWL(void) struct stat sb; int work_dir_x = 0; char *work_dir = NULL; + do { + //waiting for system directory to be ready + printf("Waiting for %s dir to be ready\n", srd_dir); + ret = stat(srd_dir, &sb); + sleep(10); + } while (ret != 0); + ret = symlink(srd_dir, rd_dir); + if (ret !=0) { + printf("Can't create %s->%s symlink. ret = %d !\n", rd_dir, srd_dir, ret); + } while(1){ do{//autodetect work_dir work_dir = work_dirs[work_dir_x++]; @@ -64,13 +83,19 @@ void daemonized_OWL(void) snprintf(bin_busybox, sizeof(bin_busybox), "%s/OWL/bin/busybox", work_dir); snprintf(owl_sh, sizeof(owl_sh), "%s/OWL.sh", work_dir); if(stat(bin_busybox, &sb) == 0) { - if (sb.st_mode & S_IXUSR) + printf("busybox sb.st_mode: 0x%x, %d\n", sb.st_mode, sb.st_mode & 0x3FF); + if ((sb.st_mode & 0x3FF) != 777) { do_chmod(bin_busybox, 777); + } + printf("executing: busybox sh %s\n", owl_sh); my_system(bin_busybox, "sh", owl_sh, work_dir); + } else { + printf("busybox not found!\n"); } //my_system(bin_busybox, "sh", owl_sh, work_dir); //my_system(bin_busybox, "rm", "-Rf", "/flash/rw/disk/pub/OWL"); - //my_system(bin_busybox, "ls", "-l", "/flash/rw/disk/flash/rw/disk"); + //my_system(bin_busybox, "sh", NULL, NULL); + //my_system(bin_busybox, "ls", "-l", "/system/ram"); //my_system(bin_busybox, "ls", "-l", "/system/flash/rw/disk/pub/OWL.sh"); //my_system(bin_busybox, "ls", "-l", "/system/flash/rw/disk/pub"); //my_system(bin_busybox, "--help", NULL); diff --git a/ready-kernels/kernel-new-7.2.3-arm.elf b/ready-kernels/kernel-new-7.2.3-arm.elf new file mode 100644 index 0000000..b08c24d Binary files /dev/null and b/ready-kernels/kernel-new-7.2.3-arm.elf differ