Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving files between flash and ramdisk #17

Closed
sbourdeauducq opened this issue May 25, 2011 · 6 comments
Closed

Moving files between flash and ramdisk #17

sbourdeauducq opened this issue May 25, 2011 · 6 comments

Comments

@sbourdeauducq
Copy link
Member

Moving files between flash and ramdisk does not work. It copies empty files instead.

@xiangfu
Copy link

xiangfu commented May 26, 2011

[/ssd] # ls -l sysconfig.bin
-rw-rw-rw- 1 root root 612 Jan 1 1970 sysconfig.bin

[/ssd] # cp sysconfig.bin /ramdisk/
[/ssd] # ls -l /ramdisk/
total 0
-rw-r--r-- 1 root root 612 Jan 1 00:19 sysconfig.bin

[/ssd] # cp /ramdisk/sysconfig.bin ./test
[/ssd] # ls -l test
-rw-r--r-- 1 root root 612 Jan 2 1970 test

[/ssd] # mv test /ramdisk
[/ssd] # ls -l /ramdisk
total 0
-rw-r--r-- 1 root root 612 Jan 1 00:19 sysconfig.bin
-rw-r--r-- 1 root root 612 Jan 1 00:19 test

When move file from /ramdisk to /ssd there is error:
[/ssd] # mv /ramdisk/test ./test-2
No such file or directory
[/ssd] # ls -l /ramdisk
total 0
-rw-r--r-- 1 root root 612 Jan 1 00:19 sysconfig.bin
-rw-r--r-- 1 root root 612 Jan 1 00:19 test
[/ssd] # ls -l ./test-2
-rw-r--r-- 1 root root 0 Jan 2 1970 ./test-2

@xiangfu
Copy link

xiangfu commented May 26, 2011

just catch the problem, the ramdisk file st_blksize is 0, will try to give 'blen' a default value,
how about 512*1024?

more info, rtems-milkymist.git/cpukit/libmisc/shell/main_mv.c: line 346:

         if (!blen && !(bp = malloc(blen = sbp->st_blksize))) {                                                               
                warn("blksize: %d", sbp->st_blksize);                                                                        
                blen = 0;                                                                                                    
                (void)close(from_fd);                                                                                        
                (void)close(to_fd);                                                                                          
                return (1);                                                                                                  
        } 

@sbourdeauducq
Copy link
Member Author

IMO this should be fixed in the YAFFS2 port, not worked around in the mv command.

@sbourdeauducq
Copy link
Member Author

What's the value of obj->my_dev->data_bytes_per_chunk?
https://github.com/milkymist/rtems-yaffs2/blob/master/direct/rtems/rtems.c#L735

@sbourdeauducq
Copy link
Member Author

@xiangfu
Copy link

xiangfu commented Jun 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants