From: Robert P. J. Day Date: Fri, 23 Aug 2013 08:57:26 -0400 (EDT) Subject: [U-Boot] can u-boot tools fw_{printenv, setenv} work with eMMC HW partition? In-Reply-To: <52175945.9020209@gmail.com> References: <52175945.9020209@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 23 Aug 2013, Andreas Bie?mann wrote: > Dear Robert P. J. Day, > > On 08/23/2013 02:25 PM, Robert P. J. Day wrote: > > > > > so it's clearly there, but i have no idea what i'd put in > > /etc/fw_env.config to refer to that partition. > > > > i tried adding the simple line: > > > > /dev/mmcblk1boot1 0x0 0x4000 > > > > to (allegedly) represent a block device, but i got the error: > > > > # fw_printenv > > Cannot access MTD device /dev/mmcblk1boot: No such file or directory > > # > > I think you stumble over this: > > ---8<--- > abiessmann at punisher % grep -C 4 'struct envdev_s' tools/env/fw_env.c > typeof(y) _min2 = (y); \ > (void) (&_min1 == &_min2); \ > _min1 < _min2 ? _min1 : _min2; }) > > struct envdev_s { > char devname[16]; /* Device name */ > ulong devoff; /* Device offset */ > ulong env_size; /* environment size */ > ulong erase_size; /* device erase size */ > ulong env_sectors; /* number of environment sectors */ > uint8_t mtd_type; /* type of the MTD device */ > }; > --->8--- > > An device name can only have 16 char by this declaration ;) good lord, you're right, that explains why the last character of the device file was getting mysteriously dropped. :-( so as a quick hack, i just did a "mknod" (i suspect a symlink would have worked just as well) to invent a shorter name, "/dev/mmcboot1", and got (predictably): # fw_printenv Cannot get MTD information: Invalid argument # which leads me into stefano's response which i just saw. rday -- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ========================================================================