This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Redboot JFFS2 Support


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]