last minute bugfixes
authormbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 4 Mar 2005 07:59:08 +0000 (07:59 +0000)
committermbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 4 Mar 2005 07:59:08 +0000 (07:59 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@305 3c298f89-4303-0410-b956-a3cf2f4a3e73

openwrt/package/openwrt/jffs2root.c
openwrt/package/openwrt/mtd.c
openwrt/package/openwrt/openwrt.mk
openwrt/target/default/target_skeleton/etc/preinit
openwrt/target/jffs2/jffs2root.mk

index 2ff37fd..77519a4 100644 (file)
@@ -84,11 +84,13 @@ int main(int argc, char **argv)
     if (argc > 1 && !strcmp(argv[1],"--move")) {
       if (ptr->offsets[1] >= ptr->len) {
         printf("Partition already moved outside trx\n");
+#if 0
       } else if (ptr->offsets[1] & 0x0001ffff) {
         printf("Partition does not start on a block boundary\n");
+#endif
       } else {
        init_crc32();
-       bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len));
+       //bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len));
         ptr->len = ptr->offsets[1];
         ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
        msync(ptr,len,MS_SYNC|MS_INVALIDATE);
index ff104c6..296bf4b 100644 (file)
@@ -140,11 +140,7 @@ mtd_erase(const char *mtd)
                 mtdEraseInfo.start < mtdInfo.size;
                 mtdEraseInfo.start += mtdInfo.erasesize) {
                
-               if(ioctl(fd, MEMUNLOCK, &mtdEraseInfo)) {
-                       fprintf(stderr, "Could not unlock MTD device: %s\n", mtd);
-                       close(fd);
-                       exit(1);
-               }
+               ioctl(fd, MEMUNLOCK, &mtdEraseInfo);
                if(ioctl(fd, MEMERASE, &mtdEraseInfo)) {
                        fprintf(stderr, "Could not erase MTD device: %s\n", mtd);
                        close(fd);
index 765f511..bc6e97e 100644 (file)
@@ -112,7 +112,7 @@ openwrt-mtd-clean:
 OPENWRT_JFFS2ROOT_SOURCE=package/openwrt/jffs2root.c
 OPENWRT_JFFS2ROOT_TARGET_BINARY:=sbin/jffs2root
 
-$(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY): 
+$(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY): openwrt
                $(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY) $(OPENWRT_JFFS2ROOT_SOURCE)
 
 openwrt-jffs2root: $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
@@ -160,7 +160,7 @@ SSTRIP=$(OPENWRT_SSTRIP_TARGET)
 
 linksys:       linksys-shared linksys-nvram linksys-wlconf
 
-openwrt:       linksys openwrt-mtd openwrt-trx openwrt-addpattern openwrt-jffs2root openwrt-sstrip
+openwrt:       linksys openwrt-mtd openwrt-trx openwrt-addpattern openwrt-sstrip
 
 openwrt-dirclean: linksys-shared-dirclean linksys-nvram-dirclean linksys-wlconf-dirclean
 
index 01df205..6507d23 100755 (executable)
@@ -8,8 +8,15 @@ if [ $(cat /proc/sys/reset) = 1 ] ; then
   while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
 else
   mount | grep jffs2 >&-
-  if [ $? = 0 ] && [ $(cat /proc/mtd | wc -l) = 6 ] ; then
-    jffs2root --move && reboot 
+  if [ $? = 0 ] ; then 
+    mtd unlock rootfs
+    [ $(cat /proc/mtd | wc -l) = 6 ] && {
+      echo 5 > /proc/sys/diag
+      mtd unlock OpenWrt
+      mtd erase OpenWrt
+      jffs2root --move
+    }
+    mount -o remount,rw /dev/root /
   else
     mtd unlock mtd4
     mount -t jffs2 /dev/mtdblock/4 /jffs
index 5e93808..5a0259b 100644 (file)
@@ -44,11 +44,11 @@ jffs2root-dirclean:
        rm -rf $(MTD_DIR)
 
 ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2)),y)
-TARGETS+=openwrt-image
+TARGETS+=openwrt-jffs2root openwrt-image
 ROOTFS=jffs2
 JFFS2FLAGS=-a $(JFFS2_BLOCK_SIZE)
 
-openwrt-image: openwrt
+openwrt-image: openwrt
        @make jffs2root openwrt-code.bin TAG=W54G \
        EXTRAVERSION=$(EXTRAVERSION)-JFFS2-4M JFFS2_BLOCK_SIZE=0x10000
        @make jffs2root openwrt-code.bin TAG=W54S \
This page took 0.032073 seconds and 4 git commands to generate.