add jffs2root from whiterussian/

SVN-Revision: 2255
This commit is contained in:
Felix Fietkau 2005-10-22 19:51:51 +00:00
parent b965972dd3
commit fb8995c621
2 changed files with 73 additions and 63 deletions

View File

@ -3,7 +3,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME := base-files-arch
PKG_RELEASE := 1
PKG_RELEASE := 2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(TOPDIR)/package/rules.mk

View File

@ -76,6 +76,7 @@ int main(int argc, char **argv)
struct mtd_info_user mtdInfo;
unsigned long len;
struct trx_header *ptr;
char *buf;
if (((fd = open(FILENAME, O_RDWR)) < 0)
|| ((len = lseek(fd, 0, SEEK_END)) < 0)
@ -106,6 +107,15 @@ int main(int argc, char **argv)
msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE);
printf("Partition moved; please reboot\n");
}
} else if (argc > 1 && !strcmp(argv[1], "--clean")) {
buf = (char *) ptr;
if (buf[ptr->offsets[1] - 1] == 0) {
init_crc32();
buf[ptr->offsets[1] - 1] = 1;
ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE);
printf("Partition marked as clean\n");
}
} else {
int x;
printf(" erase: 0x%08x\n",mtdInfo.erasesize);