From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Date: Sun, 03 Aug 2014 18:38:39 +0200 Subject: [U-Boot] [PATCH 1/4] Add option -r to env import to allow import of text files with CRLF as line endings In-Reply-To: <53DD53A5.3010502@ahsoftware.de> References: <1405352998-7707-1-git-send-email-holler@ahsoftware.de> <1405352998-7707-2-git-send-email-holler@ahsoftware.de> <20140801120800.9BDE438336B@gemini.denx.de> <53DD53A5.3010502@ahsoftware.de> Message-ID: <53DE658F.5010703@ahsoftware.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 02.08.2014 23:09, schrieb Alexander Holler: > Am 01.08.2014 14:08, schrieb Wolfgang Denk: >> Should we not, for reasons of symmetry, then also extend "env export" >> by such a "-r" option? > > Sorry, but I don't follow the new features of u-boot that closely. > > Is it already possible to save an exported environment as (text-)file to > some storage? Such wasn't possible when I've implemented that -r for > "env import" and it doesn't make much sense if an exported environment > never reaches users. Just to clarify: I see uEnv.txt (which only was possible through your env import implementation) as a read-only configuration file for u-boot, mainly used to easily configure the kernel-command-line from userspace. Something like grub.cfg or any config for other bootloaders. The (simple) trick with uenvcmd to execute commands is just a handy addition. And I don't think all the necessary stuff to save a file in all the possible filesystems should end up in u-boot. Modifying filesystems is dangerous. So from a u-boot point of view uEnv.txt is a read-only mechanism and I'm happy with it as such. I just did the patch in the subject because it ended up with extremly hard to diagnose problems when someone created an uEnv.txt with CRLF using Windows. E.g. foo=bar in such an uEnv.txt was in fact foo=bar which was feeded to the kernel command line as foo=bar too, and the Linux kernel usually treads carriage returns as a normal character. So it treats bar as something different than bar, leading to various failures. And that underlying problem is almost impossible to see because everything (what a user pastes, kernel output, ...) looks good. Regards, Alexander Holler