---- a/configure.in
-+++ b/configure.in
-@@ -813,7 +813,12 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -872,7 +872,12 @@
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
--- /dev/null
+--- a/ofgwrite.c
++++ b/ofgwrite.c
+@@ -41,7 +41,7 @@ enum FlashModeTypeEnum rootfs_flash_mode
+ int flash_kernel = 0;
+ int flash_rootfs = 0;
+ int no_write = 0;
+-int force_e2_stop = 0;
++int force_neutrino_stop = 0;
+ int quiet = 0;
+ int show_help = 0;
+ int newroot_mounted = 0;
+@@ -254,7 +254,7 @@ int read_args(int argc, char *argv[])
+ no_write = 1;
+ break;
+ case 'f':
+- force_e2_stop = 1;
++ force_neutrino_stop = 1;
+ break;
+ case 'q':
+ quiet = 1;
+@@ -653,14 +653,16 @@ int check_neutrino_stopped()
+ int max_time = 70;
+ int neutrino_found = 1;
+
++ if (!stop_neutrino_needed) // M
+ set_step_progress(0);
++
+ if (!quiet)
+ my_printf("Checking Neutrino is running...\n");
+ while (time < max_time && neutrino_found)
+ {
+-// neutrino_found = exec_ps();
++ // M neutrino_found = exec_ps(); //FIXME
+
+- system("init 4");
++ // M
+ system("killall start_neutrino 2>/dev/null");
+ system("killall rcS >/dev/null 2>&1");
+ int ret = system("pidof neutrino >/dev/null");
+@@ -681,6 +683,7 @@ int check_neutrino_stopped()
+ if (!quiet)
+ my_printf("Neutrino still running\n");
+ }
++ if (!stop_neutrino_needed) // M
+ set_step_progress(time * 100 / max_time);
+ }
+
+@@ -792,11 +795,11 @@ int umount_rootfs(int steps)
+ ret += mkdir("/newroot/run", 777);
+ ret += mkdir("/newroot/sbin", 777);
+ ret += mkdir("/newroot/sys", 777);
+- ret += mkdir("/newroot/usr", 777);
+- ret += mkdir("/newroot/usr/lib", 777);
+- ret += mkdir("/newroot/usr/lib/autofs", 777);
++// ret += mkdir("/newroot/usr", 777); // M
++// ret += mkdir("/newroot/usr/lib", 777); // M
++// ret += mkdir("/newroot/usr/lib/autofs", 777); // M
+ ret += mkdir("/newroot/var", 777);
+- ret += mkdir("/newroot/var/volatile", 777);
++// ret += mkdir("/newroot/var/volatile", 777); // M
+
+ /*
+ if (multilib)
+@@ -916,8 +919,9 @@ int umount_rootfs(int steps)
+ */
+
+ // Switch to user mode 1
+- my_printf("Switching to user mode 2\n");
+- ret = system("init 2");
++// my_printf("Switching to user mode 2\n"); //
++// ret = system("init 2"); // M
++
+ if (ret)
+ {
+ my_printf("Error switching runmode!\n");
+@@ -928,12 +932,15 @@ int umount_rootfs(int steps)
+
+ // it can take several seconds until Neutrino is shut down
+ // wait because otherwise remounting read only is not possible
++#if 0 // M
+ set_step("Wait until Neutrino is stopped");
+ if (!check_neutrino_stopped())
+ {
+ my_printf("Error Neutrino can't be stopped! Abort flashing.\n");
+ set_error_text("Error neutrino can't be stopped! Abort flashing.");
++/* // M
+ ret = system("init 3");
++*/
+ return 0;
+ }
+
+@@ -941,8 +948,10 @@ int umount_rootfs(int steps)
+ // reopen framebuffer to show the GUI
+ close_framebuffer();
+ init_framebuffer(steps);
++#endif // M
+ show_main_window(1, ofgwrite_version);
+ set_overall_text("Flashing image");
++ if (stop_neutrino_needed) // M
+ set_step_without_incr("Start flashing");
+ sleep(2);
+
+@@ -952,7 +961,9 @@ int umount_rootfs(int steps)
+ my_printf("Error executing pivot_root!\n");
+ set_error_text("Error pivot_root! Abort flashing.");
+ sleep(5);
++/* // M
+ ret = system("init 3");
++*/
+ return 0;
+ }
+
+@@ -962,9 +973,12 @@ int umount_rootfs(int steps)
+ ret += mount("/oldroot/proc/", "proc/", NULL, MS_MOVE, NULL);
+ ret += mount("/oldroot/sys/", "sys/", NULL, MS_MOVE, NULL);
+ ret += mount("/oldroot/mnt/", "mnt/", NULL, MS_MOVE, NULL);
++/* // M
+ ret += mount("/oldroot/var/volatile", "var/volatile/", NULL, MS_MOVE, NULL);
++
+ // create link for tmp
+ ret += symlink("/var/volatile/tmp", "/tmp");
++*/
+ if (ret != 0)
+ {
+ my_printf("Error move mounts to newroot\n");
+@@ -1004,6 +1018,8 @@ int umount_rootfs(int steps)
+ // create link for mount/umount for autofs
+ ret = symlink("/bin/busybox", "/bin/mount");
+ ret += symlink("/bin/busybox", "/bin/umount");
++ ret += symlink("/bin/busybox", "/bin/sh"); // M
++ ret += symlink("/bin/busybox", "/sbin/init"); // M
+
+ /*
+ // try to restart autofs
+@@ -1015,7 +1031,7 @@ int umount_rootfs(int steps)
+ */
+
+ // restart init process
+- ret = system("exec init u");
++// ret = system("exec init u"); // M
+ sleep(3);
+
+ // kill all remaining open processes which prevent umounting rootfs
+@@ -1309,7 +1325,7 @@ void find_kernel_rootfs_device()
+
+ if (((current_rootfs_sub_dir[0] == '\0' && strcmp(rootfs_device, current_rootfs_device) != 0 && rootfs_flash_mode != MTD) ||
+ ( current_rootfs_sub_dir[0] != '\0' && strcmp(current_rootfs_sub_dir, rootfs_sub_dir) != 0 )
+- ) && !force_e2_stop
++ ) && !force_neutrino_stop
+ )
+ {
+ stop_neutrino_needed = 0;
+@@ -1461,7 +1477,18 @@ int main(int argc, char *argv[])
+ return EXIT_FAILURE;
+
+ my_printf("\n");
+-
++// M
++ if (stop_neutrino_needed)
++ {
++ set_step("Wait until Neutrino is stopped");
++ if (!check_neutrino_stopped())
++ {
++ my_printf("Error Neutrino can't be stopped! Abort flashing.\n");
++ set_error_text("Error Neutrino can't be stopped! Abort flashing.");
++ return EXIT_FAILURE;
++ }
++ }
++// M
+ if (flash_kernel && !flash_rootfs) // flash only kernel
+ {
+ if (!quiet)
+@@ -1486,7 +1513,10 @@ int main(int argc, char *argv[])
+ {
+ my_printf("failed. System won't boot. Please flash backup!\n");
+ set_error_text1("Error flashing kernel. System won't boot!");
+- set_error_text2("Please flash backup! Go back to Neutrino in 60 sec");
++// M
++// set_error_text2("Please flash backup! Go back to Neutrino in 60 sec");
++ set_error_text2("Please flash backup! Go back to prompt in 60 sec");
++// M
+ sleep(60);
+ }
+ closelog();
+@@ -1545,6 +1575,7 @@ int main(int argc, char *argv[])
+ ret = system("/etc/init.d/samba stop");
+ // stop autofs
+ ret = system("/etc/init.d/autofs stop");
++ ret = system("/etc/init.d/rcK"); // M
+ // ignore return values, because the processes might not run
+ }
+
+@@ -1553,8 +1584,9 @@ int main(int argc, char *argv[])
+ set_step("Syncing filesystem");
+ sync();
+ sleep(1);
+-
++/* // M
+ set_step("init 2");
++*/
+ if (!no_write && stop_neutrino_needed)
+ {
+ if (!daemonize())
+@@ -1666,6 +1698,7 @@ int main(int argc, char *argv[])
+ sleep(3);
+ if (!no_write && stop_neutrino_needed)
+ {
++ set_step_progress(100); // M
+ my_printf("Rebooting in 3 seconds...\n");
+ set_step("Successfully flashed! Rebooting in 3 seconds...");
+ sleep(3);
+Gemeinsame Unterverzeichnisse: ofgwrite-max_orig.git/ubi-utils und ofgwrite-max.git/ubi-utils.
--- /dev/null
+--- a/flash_ext4.c
++++ b/flash_ext4.c
+@@ -172,7 +172,7 @@ int flash_unpack_rootfs(char* filename, int quiet, int no_write)
+ }
+
+ #define BUF_SIZE 1024
+-copy_file(char *from, char *to)
++int copy_file(char *from, char *to)
+ {
+ int inputFd, outputFd, openFlags;
+ mode_t filePerms;
+++ /dev/null
---- a/ofgwrite.c
-+++ b/ofgwrite.c
-@@ -41,7 +41,7 @@ enum FlashModeTypeEnum rootfs_flash_mode
- int flash_kernel = 0;
- int flash_rootfs = 0;
- int no_write = 0;
--int force_e2_stop = 0;
-+int force_neutrino_stop = 0;
- int quiet = 0;
- int show_help = 0;
- int newroot_mounted = 0;
-@@ -254,7 +254,7 @@ int read_args(int argc, char *argv[])
- no_write = 1;
- break;
- case 'f':
-- force_e2_stop = 1;
-+ force_neutrino_stop = 1;
- break;
- case 'q':
- quiet = 1;
-@@ -653,14 +653,16 @@ int check_neutrino_stopped()
- int max_time = 70;
- int neutrino_found = 1;
-
-+ if (!stop_neutrino_needed) // M
- set_step_progress(0);
-+
- if (!quiet)
- my_printf("Checking Neutrino is running...\n");
- while (time < max_time && neutrino_found)
- {
--// neutrino_found = exec_ps();
-+ // M neutrino_found = exec_ps(); //FIXME
-
-- system("init 4");
-+ // M
- system("killall start_neutrino 2>/dev/null");
- system("killall rcS >/dev/null 2>&1");
- int ret = system("pidof neutrino >/dev/null");
-@@ -681,6 +683,7 @@ int check_neutrino_stopped()
- if (!quiet)
- my_printf("Neutrino still running\n");
- }
-+ if (!stop_neutrino_needed) // M
- set_step_progress(time * 100 / max_time);
- }
-
-@@ -792,11 +795,11 @@ int umount_rootfs(int steps)
- ret += mkdir("/newroot/run", 777);
- ret += mkdir("/newroot/sbin", 777);
- ret += mkdir("/newroot/sys", 777);
-- ret += mkdir("/newroot/usr", 777);
-- ret += mkdir("/newroot/usr/lib", 777);
-- ret += mkdir("/newroot/usr/lib/autofs", 777);
-+// ret += mkdir("/newroot/usr", 777); // M
-+// ret += mkdir("/newroot/usr/lib", 777); // M
-+// ret += mkdir("/newroot/usr/lib/autofs", 777); // M
- ret += mkdir("/newroot/var", 777);
-- ret += mkdir("/newroot/var/volatile", 777);
-+// ret += mkdir("/newroot/var/volatile", 777); // M
-
- /*
- if (multilib)
-@@ -916,8 +919,9 @@ int umount_rootfs(int steps)
- */
-
- // Switch to user mode 1
-- my_printf("Switching to user mode 2\n");
-- ret = system("init 2");
-+// my_printf("Switching to user mode 2\n"); //
-+// ret = system("init 2"); // M
-+
- if (ret)
- {
- my_printf("Error switching runmode!\n");
-@@ -928,12 +932,15 @@ int umount_rootfs(int steps)
-
- // it can take several seconds until Neutrino is shut down
- // wait because otherwise remounting read only is not possible
-+#if 0 // M
- set_step("Wait until Neutrino is stopped");
- if (!check_neutrino_stopped())
- {
- my_printf("Error Neutrino can't be stopped! Abort flashing.\n");
- set_error_text("Error neutrino can't be stopped! Abort flashing.");
-+/* // M
- ret = system("init 3");
-+*/
- return 0;
- }
-
-@@ -941,8 +948,10 @@ int umount_rootfs(int steps)
- // reopen framebuffer to show the GUI
- close_framebuffer();
- init_framebuffer(steps);
-+#endif // M
- show_main_window(1, ofgwrite_version);
- set_overall_text("Flashing image");
-+ if (stop_neutrino_needed) // M
- set_step_without_incr("Start flashing");
- sleep(2);
-
-@@ -952,7 +961,9 @@ int umount_rootfs(int steps)
- my_printf("Error executing pivot_root!\n");
- set_error_text("Error pivot_root! Abort flashing.");
- sleep(5);
-+/* // M
- ret = system("init 3");
-+*/
- return 0;
- }
-
-@@ -962,9 +973,12 @@ int umount_rootfs(int steps)
- ret += mount("/oldroot/proc/", "proc/", NULL, MS_MOVE, NULL);
- ret += mount("/oldroot/sys/", "sys/", NULL, MS_MOVE, NULL);
- ret += mount("/oldroot/mnt/", "mnt/", NULL, MS_MOVE, NULL);
-+/* // M
- ret += mount("/oldroot/var/volatile", "var/volatile/", NULL, MS_MOVE, NULL);
-+
- // create link for tmp
- ret += symlink("/var/volatile/tmp", "/tmp");
-+*/
- if (ret != 0)
- {
- my_printf("Error move mounts to newroot\n");
-@@ -1004,6 +1018,8 @@ int umount_rootfs(int steps)
- // create link for mount/umount for autofs
- ret = symlink("/bin/busybox", "/bin/mount");
- ret += symlink("/bin/busybox", "/bin/umount");
-+ ret += symlink("/bin/busybox", "/bin/sh"); // M
-+ ret += symlink("/bin/busybox", "/sbin/init"); // M
-
- /*
- // try to restart autofs
-@@ -1015,7 +1031,7 @@ int umount_rootfs(int steps)
- */
-
- // restart init process
-- ret = system("exec init u");
-+// ret = system("exec init u"); // M
- sleep(3);
-
- // kill all remaining open processes which prevent umounting rootfs
-@@ -1309,7 +1325,7 @@ void find_kernel_rootfs_device()
-
- if (((current_rootfs_sub_dir[0] == '\0' && strcmp(rootfs_device, current_rootfs_device) != 0 && rootfs_flash_mode != MTD) ||
- ( current_rootfs_sub_dir[0] != '\0' && strcmp(current_rootfs_sub_dir, rootfs_sub_dir) != 0 )
-- ) && !force_e2_stop
-+ ) && !force_neutrino_stop
- )
- {
- stop_neutrino_needed = 0;
-@@ -1461,7 +1477,18 @@ int main(int argc, char *argv[])
- return EXIT_FAILURE;
-
- my_printf("\n");
--
-+// M
-+ if (stop_neutrino_needed)
-+ {
-+ set_step("Wait until Neutrino is stopped");
-+ if (!check_neutrino_stopped())
-+ {
-+ my_printf("Error Neutrino can't be stopped! Abort flashing.\n");
-+ set_error_text("Error Neutrino can't be stopped! Abort flashing.");
-+ return EXIT_FAILURE;
-+ }
-+ }
-+// M
- if (flash_kernel && !flash_rootfs) // flash only kernel
- {
- if (!quiet)
-@@ -1486,7 +1513,10 @@ int main(int argc, char *argv[])
- {
- my_printf("failed. System won't boot. Please flash backup!\n");
- set_error_text1("Error flashing kernel. System won't boot!");
-- set_error_text2("Please flash backup! Go back to Neutrino in 60 sec");
-+// M
-+// set_error_text2("Please flash backup! Go back to Neutrino in 60 sec");
-+ set_error_text2("Please flash backup! Go back to prompt in 60 sec");
-+// M
- sleep(60);
- }
- closelog();
-@@ -1545,6 +1575,7 @@ int main(int argc, char *argv[])
- ret = system("/etc/init.d/samba stop");
- // stop autofs
- ret = system("/etc/init.d/autofs stop");
-+ ret = system("/etc/init.d/rcK"); // M
- // ignore return values, because the processes might not run
- }
-
-@@ -1553,8 +1584,9 @@ int main(int argc, char *argv[])
- set_step("Syncing filesystem");
- sync();
- sleep(1);
--
-+/* // M
- set_step("init 2");
-+*/
- if (!no_write && stop_neutrino_needed)
- {
- if (!daemonize())
-@@ -1666,6 +1698,7 @@ int main(int argc, char *argv[])
- sleep(3);
- if (!no_write && stop_neutrino_needed)
- {
-+ set_step_progress(100); // M
- my_printf("Rebooting in 3 seconds...\n");
- set_step("Successfully flashed! Rebooting in 3 seconds...");
- sleep(3);
-Gemeinsame Unterverzeichnisse: ofgwrite-max_orig.git/ubi-utils und ofgwrite-max.git/ubi-utils.
OFGWRITE_SOURCE = ofgwrite-max.$(OFGWRITE_VERSION)
OFGWRITE_SITE = https://github.com/MaxWiesel/$(OFGWRITE_SOURCE)
-OFGWRITE_PATCH = ofg-4.6.1-neutrino.patch
+OFGWRITE_PATCH = 0001-4.6.1-neutrino.patch
+OFGWRITE_PATCH += 0002-fix-implicit-int.patch
$(ARCHIVE)/$(OFGWRITE_SOURCE).tar.bz2:
get-git-archive.sh $(OFGWRITE_SITE) master $(notdir $@) $(ARCHIVE)
$(call apply_patches, $(addprefix ofgwrite/, $(OFGWRITE_PATCH))); \
export CC=$(TARGET)-gcc && \
export AR=$(TARGET)-ar && \
+ export CFLAGS="-Wno-implicit-function-declaration"; \
$(BUILDENV); \
$(MAKE)
$(TARGET)-strip $(BUILD_TMP)/$(OFGWRITE_SOURCE)/ofgwrite_bin