From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9100 invoked by alias); 29 Jul 2005 05:24:04 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 9034 invoked by uid 22791); 29 Jul 2005 05:23:50 -0000 Received: from serv0.rtunet.com (HELO serv0.rtunet.com) (67.107.78.234) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 29 Jul 2005 05:23:50 +0000 Received: from [192.168.1.71] ([203.57.166.22]) (authenticated bits=0) by serv0.rtunet.com (8.13.1/8.13.1) with ESMTP id j6T5N43p022385; Fri, 29 Jul 2005 00:23:46 -0500 From: Benny Chen To: Andrew Lunn Cc: ecos-discuss@sources.redhat.com In-Reply-To: <20050728070549.GA1057@lunn.ch> References: <1121140915.31422.42.camel@Vigor4> <20050712065537.GI29363@lunn.ch> <1121212035.31422.152.camel@Vigor4> <20050713064541.GM29363@lunn.ch> <42D5394D.8030300@mindspring.com> <20050713164717.GN29363@lunn.ch> <1122530343.31422.8159.camel@Vigor4> <20050728070549.GA1057@lunn.ch> Content-Type: text/plain Message-Id: <1122614637.18369.140.camel@Vigor4> Mime-Version: 1.0 Date: Fri, 29 Jul 2005 05:24:00 -0000 Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] Redboot JFFS2 Support X-SW-Source: 2005-07/txt/msg00315.txt.bz2 Hi Andrew, Right on, that was my problem. Now it is working consistently. However, every time I try to unlink() the config file from Redboot, I keep getting the infamous 'No space left on device' error as per below. My JFFS2 partition has heaps of space and my application has no problem reading, writing and unlinking the config files in there (refer to listing below). >From the sample test code, it seems quite straight forward. But it is not working for me. I have also included my simple getconfig function below. Hopefully, someone can help. Thanks guys. Regards, Benny # ----------- FIS LIST ----------------- RedBoot> fis list Name FLASH addr Mem addr Length Entry point RedBoot 0x60000000 0x60000000 0x00060000 0x00000000 jffs2 0x60060000 0x01200000 0x004E0000 0x01200000 ramdisk 0x60540000 0x00800000 0x00340000 0x00800000 zImage 0x60880000 0x00080000 0x000C0000 0x00080000 FIS directory 0x60FE0000 0x60FE0000 0x0001F000 0x00000000 RedBoot config 0x60FFF000 0x60FFF000 0x00001000 0x00000000 RedBoot> rtunet_config rtunet_config:Starting... unlink failed -1: No space left on device # ----------- JFFS2 Directory DF Listing -------------------- /mnt/jffs2_fs # df . Filesystem 1k-blocks Used Available Use% Mounted on /dev/mtdblock2 4992 644 4348 13% /mnt/jffs2_fs /mnt/jffs2_fs # # ----------- JFFS2 Directory Listing -------------------- /mnt/jffs2_fs # ls -l -rw-rw-rw- 1 root root 203 Jan 1 00:24 rbconfig -rw-r--r-- 1 root root 203 Jan 1 00:18 rbconfig.bak /mnt/jffs2_fs # # ----------- Redboot Unlink SRC CODE -------------------- static int get_config(unsigned char *rd_buf) { int err, i; err = mount(CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2"); if (err) { diag_printf("Mount failed %d\n", err); return err; } if (verbose) { diag_printf("Mount Successful\n"); } err = chdir( "/" ); if (err) { diag_printf("chdir failed %d\n", err); goto umnt; } if (verbose) { diag_printf("chdir Successful\n"); } checkcwd("/"); err = readfile("/rbconfig", rd_buf, 256); if (err == 0) { //Replace \n with ' ' for (i = 0; i < strlen(rd_buf);i++) { if (rd_buf[i] == '\n') { rd_buf[i] = ' '; } } } err = unlink("/rbconfig"); if (err) { diag_printf("unlink failed %d: %s\n",err, strerror(errno)); } umnt: err = umount("/"); if (err) { diag_printf("umount failed %d\n", err); } else { if (verbose) { diag_printf("umount Successful\n"); } } return err; } On Thu, 2005-07-28 at 17:05, Andrew Lunn wrote: > On Thu, Jul 28, 2005 at 03:59:04PM +1000, Benny Chen wrote: > > Hi there, > > Cirrus has not get back to me on my intention of releasing their patch > > on this list. Hence, I have ported their patch over to work on the > > latest ECOS tree from cvs. I have tested this out on my target and it > > seems to work fine. > > > > Back to my initial problem of getting JFFS2 support for Redboot. > > I have managed to mount the jffs2 directory and read my config file in > > RedBoot. But everytime after my application has updated the > > configuration file (after the system has booted up) and redboot do a > > read on the same file. I get the below error. > > > > What I saw on the list was that this issue has been fixed. I am using > > the latest Redboot from cvs. Could anyone help? > > Do you have CYGPKG_COMPRESS_ZLIB enabled? > > It looks like you have a compressed file in your filesystem and > without ZLIB jffs2 cannot decompress it. > > Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss