From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5469 invoked by alias); 31 Jul 2005 22:27:24 -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 5458 invoked by uid 22791); 31 Jul 2005 22:27:15 -0000 Received: from serv0.rtunet.com (HELO serv0.rtunet.com) (67.107.78.234) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 31 Jul 2005 22:27:15 +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 j6VMQVUp010581 for ; Sun, 31 Jul 2005 17:27:12 -0500 From: Benny Chen To: ecos-discuss@sources.redhat.com In-Reply-To: <20050712065537.GI29363@lunn.ch> References: <1121140915.31422.42.camel@Vigor4> <20050712065537.GI29363@lunn.ch> Content-Type: text/plain Message-Id: <1122848847.18369.177.camel@Vigor4> Mime-Version: 1.0 Date: Sun, 31 Jul 2005 22:27:00 -0000 Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] Redboot JFFS2 Support X-SW-Source: 2005-07/txt/msg00327.txt.bz2 Hi there, I should be sending this to the list. 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. It may be a configuration issue. I have also included my savefile and simple getconfig function below. Hopefully, someone can help. Thanks guys. Regards, Benny # ----------- ecosmy.ecm ----------------- cdl_savefile_version 1; cdl_savefile_command cdl_savefile_version {}; cdl_savefile_command cdl_savefile_command {}; cdl_savefile_command cdl_configuration { description hardware template package }; cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; cdl_configuration eCos { description "" ; template redboot ; package -hardware CYGPKG_HAL_ARM current ; package -hardware CYGPKG_HAL_ARM_ARM9 current ; package -hardware CYGPKG_HAL_ARM_ARM9_EP93XX current ; package -hardware CYGPKG_DEVS_FLASH_STRATA current ; package -hardware CYGPKG_DEVS_ETH_ARM_EP93XX current ; package -template CYGPKG_HAL current ; package -template CYGPKG_INFRA current ; package -template CYGPKG_REDBOOT current ; package -template CYGPKG_ISOINFRA current ; package -template CYGPKG_LIBC_STRING current ; package CYGPKG_IO_FLASH current ; package CYGPKG_IO_ETH_DRIVERS current ; package CYGPKG_FS_JFFS2 current ; package CYGPKG_ERROR current ; package CYGPKG_IO_FILEIO current ; package CYGPKG_MEMALLOC current ; package CYGPKG_LINUX_COMPAT current ; package CYGPKG_IO current ; package CYGPKG_COMPRESS_ZLIB current ; }; cdl_option CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP { user_value 1 }; cdl_option CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP { user_value 1 }; cdl_option CYGBLD_BUILD_REDBOOT_WITH_EXEC { user_value 1 }; cdl_option CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS { user_value 0x00000100 }; cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE { user_value 6144 }; cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { user_value 0 }; cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { inferred_value 0 }; cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { inferred_value 1 }; cdl_option CYGSEM_HAL_ROM_MONITOR { inferred_value 1 }; cdl_option CYGSEM_HAL_USE_ROM_MONITOR { inferred_value 0 0 }; cdl_option CYGPKG_HAL_ARM_ARM9_ARM920T { inferred_value 1 }; cdl_component CYG_HAL_STARTUP { user_value ROMRAM }; cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE { user_value 0x60000 }; cdl_component CYGBLD_BUILD_REDBOOT { user_value 1 }; cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS { user_value 1 }; cdl_option CYGBLD_ISO_STRTOK_R_HEADER { inferred_value 1 }; cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER { inferred_value 1 }; cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER { inferred_value 1 }; cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER { inferred_value 1 }; cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1 { user_value 0 }; cdl_component CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1 { user_value "\"jffs2\"" }; # BLOCK Device Access cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_1 { user_value 1 }; cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 { user_value 0x00060000 }; cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_1 { user_value 0x00020000 }; cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 { user_value "\"/dev/flash1\"" }; cdl_component CYGBLD_BUILD_REDBOOT_WITH_ZLIB { user_value 1 }; cdl_option CYGNUM_REDBOOT_LOAD_ZLIB_BUFFER { user_value 64 }; cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB { user_value 1 }; cdl_option CYGOPT_FS_JFFS2_WRITE { user_value 1 }; # ----------- 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 Tue, 2005-07-12 at 16:55, Andrew Lunn wrote: > On Tue, Jul 12, 2005 at 02:01:55PM +1000, Benny Chen wrote: > > Hi there, > > Our system runs Cirrus Linux and uses Redboot as the bootloader. I > > would like to access my JFFS2 partition from redboot but could not find > > enough information to get this going. It seems from reading the list > > that this has been done countless of times but yet I am not able to work > > it out. > > > > Please bear with me as I have not gotten enough information about this > > topic hence, ask very random and basic questions. > > > > I am using redboot from ecosV2_0. > > Very old. There has been a lot of changes to the JFFS2 support since > then. So your millage may vary. > > > > > 1. I used ecosconfig add jffs2 and followed by ecosconfig check and > > there is no conflict. > > > > Target: edb9301 > > Template: redboot > > Added: > > CYGPKG_IO_FLASH > > CYGPKG_IO_ETH_DRIVERS > > CYGPKG_IO_FILEIO > > CYGPKG_COMPRESS_ZLIB > > CYGPKG_MEMALLOC > > CYGPKG_ERROR > > CYGPKG_LINUX_COMPAT > > CYGPKG_IO > > CYGPKG_FS_JFFS2 > > No conflicts > > > > 2. I have make clean and make the redboot.bin image and makes completes > > successfully. I manage to download the redboot.bin to target and it > > boots up the redboot> prompt ok. However, when I tried to type the > > 'mount' command it is not even found. I am missing something here. What > > I have in mind is that I would get a list of commands like 'mount', > > 'unmount', 'ls', that can be executed in the redboot cmd prompt. > > Support for this was added 2003/12/02 14:40:19. eCos 2.0 was released > sometime around 2003/02/14. So this is obviously not going to work. > Put your eCos sources in a museum and try again with something more > uptodate. > > 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