Changeset 28df043 in freewrt for target/linux/package/base-files
- Timestamp:
- Jun 10, 2006, 3:22:48 PM (20 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- a5bb8b8
- Parents:
- e59ae5b
- File:
-
- 1 edited
-
target/linux/package/base-files/src/jffs2root.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
target/linux/package/base-files/src/jffs2root.c
re59ae5b r28df043 32 32 33 33 #include <sys/ioctl.h> 34 #include <sys/syscall.h> 34 35 #include <linux/mtd/mtd.h> 36 #include <linux/reboot.h> 35 37 36 38 #define FILENAME "/dev/mtdblock/1" … … 78 80 struct trx_header *ptr; 79 81 char *buf; 82 int reboot; 83 84 reboot = 0; 80 85 81 86 if (((fd = open(FILENAME, O_RDWR)) < 0) … … 106 111 ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version)); 107 112 msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE); 108 printf("Partition moved; please reboot\n"); 113 if (argc > 2 && !strcmp(argv[2],"--reboot")) { 114 reboot=1; 115 printf("Partition moved.\n"); 116 } else { 117 printf("Partition moved; please reboot\n"); 118 } 109 119 } 110 120 } else if (argc > 1 && !strcmp(argv[1], "--clean")) { … … 130 140 131 141 munmap((void *) ptr, len); 142 if (reboot) { 143 fflush(stdout); 144 syscall(SYS_reboot,LINUX_REBOOT_MAGIC1,LINUX_REBOOT_MAGIC2,LINUX_REBOOT_CMD_RESTART,NULL); 145 } 132 146 return 0; 133 147 }
Note:
See TracChangeset
for help on using the changeset viewer.
