Re: [U-Boot] [PATCH v3 0/5] env: Add support for environment files
HI Wolfgang, On Sat, Oct 26, 2013 at 1:26 PM, Wolfgang Denk w...@denx.de wrote: Dear Simon, In message 1382763563-1483-1-git-send-email-...@chromium.org you wrote: (Note that Wolfgang is looking at a way of adjusting the environment within a U-Boot binary - this series could fit with that but aims to improve the creation of the initial default environment). At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. I think we need to be very clear hear about what these patches are actually doing. Many users might easily confise the default environment that gets statically built into the U-Boot binary (and that cannot be changed at runtime) with the working environment that gets saved to some persistent storage and is loaded when booting. This is especially important as there are boards where, depending on which state of the boot process you are in, one or the other mightbe in effect (there used to be boards, and probably still are, where full environment access was not possible in the SPL [or whatever it was named then], so you were using the default settings initially, and the real environment only later - which can be extremely confusing - just think of thigs like console baudrate settings etc. Yes agreed, I will have a think about a better title. This series adds a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/vendor/env directory called board.env (or common.env if you want the same environment for all boards for that vendor). I understand these patches are trying to improve the way how we initialize the CONFIG_EXTRA_ENV_SETTINGS setting in the _default_ environment _at build time_, right? I feel this should be made really clear in both the Subject: and in the commit message. Agreed. Hm... what was your reason for stopping half-way? Setting only CONFIG_EXTRA_ENV_SETTINGS this way seems inconsequent to me. Why do we not initialize the whole default environment like this? Well just this change has provide quite a bit of discussion - I'm quite pleased I didn't go further! The environment variables should be of the form var=value. Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example. I am afraid I dislike the current proposal - see comments to that patch. See my reply there. After discussion on the mailing list the .emv file was moved from include/configs to board/. See here: .emv? Guess this is a typo? Another discussion was compatibility with the environment commands 'env export -t' and 'env import -t'. This series permits these to be used and the environment is exported and imported as expected. I have dropped I can't see how this would work - the examples given in yout README patch definitely cannot be imported using env import -t, which is the reason why I dislike the proposed format. We should probably continue discussion on the other thread. I think I have addressed this now (with your suggestion to perhaps change the format of 'env import -t'). Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/5] env: Add support for environment files
Hello Simon, On Sat, Oct 26, 2013 at 2:59 AM, Simon Glass s...@chromium.org wrote: (Note that Wolfgang is looking at a way of adjusting the environment within a U-Boot binary - this series could fit with that but aims to improve the creation of the initial default environment). I really appreciate this patchset; I will merge it in my tree and try to convert some boards to see how it goes. I think it'll allow for much better environment reuse :-) At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. This series adds a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/vendor/env directory called board.env (or common.env if you want the same environment for all boards for that vendor). The environment variables should be of the form var=value. Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example. After discussion on the mailing list the .emv file was moved from include/configs to board/. See here: http://patchwork.ozlabs.org/patch/237120/ There was also talk of using the C preprocessor for these boards. I tried this out and found it to be extremely useful. In fact without it, the scripts probably cannot move from the config header file, since many scripts are put together based on information from CONFIG variables. Agreed; this is critical. Another discussion was compatibility with the environment commands 'env export -t' and 'env import -t'. This series permits these to be used and the environment is exported and imported as expected. I have dropped the ugly \0 approach in favour of a more flexible awk script for parsing the environment file. The environment commands use \ at the end of a line for continuation which works nicely with this feature. I have added a patch to 'run' so that it runs the entire script, not just the first line. A nice benefit is that there is no longer any need to put ';' at the end of every line - in other words U-Boot scripts become proper scripts with multiple lines instead of messy and fragile continuations. As an example, I have converted most of the tegra environment over to this new approach on an RFC basis. If the rest of this series is accepted then I will need to adjust this patch based on the mainline code. ... In my point of view, patch 3 and 4 could be squashed. So it would allow for a 'complete' feature add in the commit 3. Regards, -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/5] env: Add support for environment files
Dear Simon, In message 1382763563-1483-1-git-send-email-...@chromium.org you wrote: (Note that Wolfgang is looking at a way of adjusting the environment within a U-Boot binary - this series could fit with that but aims to improve the creation of the initial default environment). At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. I think we need to be very clear hear about what these patches are actually doing. Many users might easily confise the default environment that gets statically built into the U-Boot binary (and that cannot be changed at runtime) with the working environment that gets saved to some persistent storage and is loaded when booting. This is especially important as there are boards where, depending on which state of the boot process you are in, one or the other mightbe in effect (there used to be boards, and probably still are, where full environment access was not possible in the SPL [or whatever it was named then], so you were using the default settings initially, and the real environment only later - which can be extremely confusing - just think of thigs like console baudrate settings etc. This series adds a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/vendor/env directory called board.env (or common.env if you want the same environment for all boards for that vendor). I understand these patches are trying to improve the way how we initialize the CONFIG_EXTRA_ENV_SETTINGS setting in the _default_ environment _at build time_, right? I feel this should be made really clear in both the Subject: and in the commit message. Hm... what was your reason for stopping half-way? Setting only CONFIG_EXTRA_ENV_SETTINGS this way seems inconsequent to me. Why do we not initialize the whole default environment like this? The environment variables should be of the form var=value. Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example. I am afraid I dislike the current proposal - see comments to that patch. After discussion on the mailing list the .emv file was moved from include/configs to board/. See here: .emv? Guess this is a typo? Another discussion was compatibility with the environment commands 'env export -t' and 'env import -t'. This series permits these to be used and the environment is exported and imported as expected. I have dropped I can't see how this would work - the examples given in yout README patch definitely cannot be imported using env import -t, which is the reason why I dislike the proposed format. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de In Christianity neither morality nor religion come into contact with reality at any point. - Friedrich Nietzsche ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/5] env: Add support for environment files
(Note that Wolfgang is looking at a way of adjusting the environment within a U-Boot binary - this series could fit with that but aims to improve the creation of the initial default environment). At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. This series adds a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/vendor/env directory called board.env (or common.env if you want the same environment for all boards for that vendor). The environment variables should be of the form var=value. Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example. After discussion on the mailing list the .emv file was moved from include/configs to board/. See here: http://patchwork.ozlabs.org/patch/237120/ There was also talk of using the C preprocessor for these boards. I tried this out and found it to be extremely useful. In fact without it, the scripts probably cannot move from the config header file, since many scripts are put together based on information from CONFIG variables. Another discussion was compatibility with the environment commands 'env export -t' and 'env import -t'. This series permits these to be used and the environment is exported and imported as expected. I have dropped the ugly \0 approach in favour of a more flexible awk script for parsing the environment file. The environment commands use \ at the end of a line for continuation which works nicely with this feature. I have added a patch to 'run' so that it runs the entire script, not just the first line. A nice benefit is that there is no longer any need to put ';' at the end of every line - in other words U-Boot scripts become proper scripts with multiple lines instead of messy and fragile continuations. As an example, I have converted most of the tegra environment over to this new approach on an RFC basis. If the rest of this series is accepted then I will need to adjust this patch based on the mainline code. Changes in v3: - Add more detail in the README about the format of .env files - Adjust Makefile to generate the .inc and .h files in separate fules - Correctly terminate environment files with \n - Define __UBOOT_CONFIG__ when collecting environment files - Improve the comment about in the awk script Changes in v2: - Add dependency rule so that the environment is rebuilt when it changes - Add information and updated example script to README - Add new patch to adjust 'run' command to better support testing - Add new patch to get 'env import/export' working on sandbox - Add new patch to illustrate the impact on Tegra environment - Add separate patch to enable C preprocessor for environment files - Enable var+=value form to simplify composing variables in multiple steps - Move .env file from include/configs to board/ - Use awk script to process environment since it is much easier on the brain Simon Glass (5): sandbox: Support 'env import' and 'env export' Make 'run' use run_command_list() instead of run_command() Allow U-Boot scripts to be placed in a .env file env: Allow environment files to use the C preprocessor RFC: tegra: Convert to using environment files Makefile| 37 ++- README | 54 board/nvidia/env/common.env | 79 common/cmd_nvedit.c | 31 ++ common/env_embedded.c | 1 + common/main.c | 2 +- config.mk | 2 + include/configs/tegra-common-post.h | 120 +--- include/env_default.h | 2 + mkconfig| 7 +++ tools/scripts/env2string.awk| 54 11 files changed, 255 insertions(+), 134 deletions(-) create mode 100644 board/nvidia/env/common.env create mode 100644 tools/scripts/env2string.awk -- 1.8.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot