From: Benny Chen <bennyc@rtunet.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Redboot JFFS2 Support
Date: Fri, 29 Jul 2005 05:24:00 -0000 [thread overview]
Message-ID: <1122614637.18369.140.camel@Vigor4> (raw)
In-Reply-To: <20050728070549.GA1057@lunn.ch>
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
next prev parent reply other threads:[~2005-07-29 5:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 4:02 Benny Chen
2005-07-12 6:56 ` Andrew Lunn
2005-07-12 23:47 ` Benny Chen
2005-07-13 6:45 ` Andrew Lunn
2005-07-13 15:55 ` Frank Pagliughi
2005-07-13 16:47 ` Andrew Lunn
2005-07-13 23:43 ` Benny Chen
2005-07-28 5:59 ` Benny Chen
2005-07-28 7:06 ` Andrew Lunn
2005-07-29 5:24 ` Benny Chen [this message]
2005-07-13 23:49 ` Benny Chen
2005-07-31 22:27 ` Benny Chen
2005-08-01 9:47 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1122614637.18369.140.camel@Vigor4 \
--to=bennyc@rtunet.com \
--cc=andrew@lunn.ch \
--cc=ecos-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).