[U-Boot] [PATCH] Remove deprecated 'autoscr' command

The more standard 'source' command provides identical functionality to the autoscr command.
Environment variable names/values on the MVBC_P, MVBML7, kmeter1, mgcoge, and km8xx boards were updated to no longer refernce 'autoscr'.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- There was a fair amount of grey area as far as environment variable naming for those variables that used to refernce autoscr.
I tended to lean toward using "script" in the variable name as I thought that was a lot more descriptive than "source", which could mean lots of different things. eg I migrated autoscr_addr to script_addr instead of source_addr.
I also figured the "autoscript" and "autoscript_uname" variables were more descriptive than "autosource" and "autosource_uname", so they were left alone.
If others (especially board maintainers affected) have a strong opinion about environment variable naming let me know.
board/LEOX/elpt860/README.LEOX | 2 +- board/matrix_vision/mvbc_p/mvbc_p_autoscript | 4 ++-- board/matrix_vision/mvblm7/mvblm7_autoscript | 4 ++-- board/musenki/README | 2 +- common/cmd_source.c | 18 ------------------ doc/README.IPHASE4539 | 2 +- doc/README.m52277evb | 2 +- doc/README.m5373evb | 2 +- doc/README.m54455evb | 2 +- doc/README.m5475evb | 2 +- doc/feature-removal-schedule.txt | 19 ------------------- include/configs/MVBC_P.h | 14 +++++++------- include/configs/MVBLM7.h | 14 +++++++------- include/configs/keymile-common.h | 6 +++--- 14 files changed, 28 insertions(+), 65 deletions(-)
diff --git a/board/LEOX/elpt860/README.LEOX b/board/LEOX/elpt860/README.LEOX index 25524af..e8ab867 100644 --- a/board/LEOX/elpt860/README.LEOX +++ b/board/LEOX/elpt860/README.LEOX @@ -68,7 +68,6 @@ Type "run nfsboot" to mount root filesystem over NFS Hit any key to stop autoboot: 0 LEOX_elpt860: help askenv - get environment variables from stdin -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure bootm - boot application image from memory @@ -100,6 +99,7 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory tftpboot- boot image via network using TFTP protocol and env variables ipaddr and serverip version - print monitor version diff --git a/board/matrix_vision/mvbc_p/mvbc_p_autoscript b/board/matrix_vision/mvbc_p/mvbc_p_autoscript index 5cee6c5..ab8184f 100644 --- a/board/matrix_vision/mvbc_p/mvbc_p_autoscript +++ b/board/matrix_vision/mvbc_p/mvbc_p_autoscript @@ -22,7 +22,7 @@ setenv set_static_nm setenv netmask ${static_netmask} setenv set_static_gw setenv gatewayip ${static_gateway} setenv set_ip setenv ip ${ipaddr}::${gatewayip}:${netmask} setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs -if test ${autoscr_boot} != no; +if test ${autoscript_boot} != no; then if test ${netboot} = yes; then @@ -40,5 +40,5 @@ then echo "=== bootfromflash ===" run cpdtb rundtb bootfromflash else - echo "=== boot stopped with autoscr_boot no ===" + echo "=== boot stopped with autoscript_boot no ===" fi diff --git a/board/matrix_vision/mvblm7/mvblm7_autoscript b/board/matrix_vision/mvblm7/mvblm7_autoscript index 6f9357f..dc385fd 100644 --- a/board/matrix_vision/mvblm7/mvblm7_autoscript +++ b/board/matrix_vision/mvblm7/mvblm7_autoscript @@ -21,7 +21,7 @@ setenv set_static_nm setenv netmask ${static_netmask} setenv set_static_gw setenv gatewayip ${static_gateway} setenv set_ip setenv ip ${ipaddr}::${gatewayip}:${netmask} setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs -if test ${autoscr_boot} != no; +if test ${autoscript_boot} != no; then if test ${netboot} = yes; then @@ -39,5 +39,5 @@ then echo "=== bootfromflash ===" run cpdtb rundtb bootfromflash else - echo "=== boot stopped with autoscr_boot no ===" + echo "=== boot stopped with autoscript_boot no ===" fi diff --git a/board/musenki/README b/board/musenki/README index 135a01a..084ab54 100644 --- a/board/musenki/README +++ b/board/musenki/README @@ -34,7 +34,6 @@ Out: serial Err: serial Hit any key to stop autoboot: 0 => help -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure bootm - boot application image from memory @@ -67,6 +66,7 @@ reset - Perform RESET of the CPU run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables +source - run script from memory tftpboot- boot image via network using TFTP protocol and env variables ipaddr and serverip version - print monitor version diff --git a/common/cmd_source.c b/common/cmd_source.c index 965b8b1..1424d30 100644 --- a/common/cmd_source.c +++ b/common/cmd_source.c @@ -236,22 +236,4 @@ U_BOOT_CMD( "unit name in the form of addr:<subimg_uname>" #endif ); - -/* - * Keep for now for backward compatibility; - * remove later when support for "autoscr" goes away. - */ -static int -do_autoscr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) -{ - printf ("\n### WARNING ### " - ""autoscr" is deprecated, use "source" instead ###\n\n"); - return do_source (cmdtp, flag, argc, argv); -} - -U_BOOT_CMD( - autoscr, 2, 0, do_autoscr, - "DEPRECATED - use "source" command instead", - "" -); #endif diff --git a/doc/README.IPHASE4539 b/doc/README.IPHASE4539 index defad30..b804e06 100644 --- a/doc/README.IPHASE4539 +++ b/doc/README.IPHASE4539 @@ -54,7 +54,6 @@ connector as follows:
------------------------------------------------------------------------------ => help -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure bootm - boot application image from memory @@ -88,6 +87,7 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory tftpboot- boot image via network using TFTP protocol and env variables ipaddr and serverip version - print monitor version diff --git a/doc/README.m52277evb b/doc/README.m52277evb index bec77b4..40f9028 100644 --- a/doc/README.m52277evb +++ b/doc/README.m52277evb @@ -184,7 +184,6 @@ baudrate = 115200 bps -> -> help ? - alias for 'help' -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' @@ -227,5 +226,6 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory version - print monitor version -> diff --git a/doc/README.m5373evb b/doc/README.m5373evb index 0bd1101..5591748 100644 --- a/doc/README.m5373evb +++ b/doc/README.m5373evb @@ -195,7 +195,6 @@ baudrate = 115200 bps -> -> help ? - alias for 'help' -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' @@ -243,6 +242,7 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory tftpboot- boot image via network using TFTP protocol version - print monitor version -> tftp 0x40800000 uImage diff --git a/doc/README.m54455evb b/doc/README.m54455evb index b769ff9..1888e16 100644 --- a/doc/README.m54455evb +++ b/doc/README.m54455evb @@ -276,7 +276,6 @@ baudrate = 115200 bps -> -> help ? - alias for 'help' -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' @@ -332,6 +331,7 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory tftpboot- boot image via network using TFTP protocol version - print monitor version ->bootm 4000000 diff --git a/doc/README.m5475evb b/doc/README.m5475evb index 936c018..f3a1d7b 100644 --- a/doc/README.m5475evb +++ b/doc/README.m5475evb @@ -215,7 +215,6 @@ ip_addr = 192.162.1.2 baudrate = 115200 bps -> ? ? - alias for 'help' -autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' @@ -260,6 +259,7 @@ run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time +source - run script from memory tftpboot- boot image via network using TFTP protocol usb - USB sub-system usbboot - boot from USB device diff --git a/doc/feature-removal-schedule.txt b/doc/feature-removal-schedule.txt index 0238d97..5fe21e8 100644 --- a/doc/feature-removal-schedule.txt +++ b/doc/feature-removal-schedule.txt @@ -26,25 +26,6 @@ Who: Ben Warren biggerbadderben@gmail.com
---------------------------
-What: "autoscr" command -When: Release 2009-09 - -Why: "autosrc" is an ugly and completely non-standard name. - The "autoscr" command is deprecated and will be replaced by - - the "source" command as used by other shells such as bash. - - Starting with March 2009, both commands will be supported for - a transition period of 6 months after which "autoscr" will be - removed. During the transition period existing scripts and - environment variable names remain untouched for maximum - compatibiltiy; thse will be changed when support for the - "autoscr" command get's finally dropped. - -Who: Peter Tyser ptyser@xes-inc.com - ---------------------------- - What: GPL cleanup When: August 2009 Why: Over time, a couple of files have sneaked in into the U-Boot diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h index 867e8e0..21a3c75 100644 --- a/include/configs/MVBC_P.h +++ b/include/configs/MVBC_P.h @@ -73,8 +73,8 @@ #define MV_INITRD_LENGTH 0x00400000 #define MV_SCRATCH_ADDR 0x00000000 #define MV_SCRATCH_LENGTH MV_INITRD_LENGTH -#define MV_SOURCE_ADDR 0xff840000 -#define MV_SOURCE_ADDR2 0xff850000 +#define MV_SCRIPT_ADDR 0xff840000 +#define MV_SCRIPT_ADDR2 0xff850000 #define MV_DTB_ADDR 0xfffc0000
#define CONFIG_SHOW_BOOT_PROGRESS 1 @@ -130,9 +130,9 @@ #define CONFIG_ZERO_BOOTDELAY_CHECK #define CONFIG_RESET_TO_RETRY 1000
-#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \ - then source ${autoscr_addr}; \ - else source ${autoscr_addr2}; \ +#define CONFIG_BOOTCOMMAND "if imi ${script_addr}; \ + then source ${script_addr}; \ + else source ${script_addr2}; \ fi;"
#define CONFIG_BOOTARGS "root=/dev/ram ro rootfstype=squashfs" @@ -150,8 +150,8 @@ "fpga=0\0" \ "fpgadata=" MK_STR(MV_FPGA_DATA) "\0" \ "fpgadatasize=" MK_STR(MV_FPGA_SIZE) "\0" \ - "autoscr_addr=" MK_STR(MV_SOURCE_ADDR) "\0" \ - "autoscr_addr2=" MK_STR(MV_SOURCE_ADDR2) "\0" \ + "script_addr=" MK_STR(MV_SCRIPT_ADDR) "\0" \ + "script_addr2=" MK_STR(MV_SCRIPT_ADDR2) "\0" \ "mv_kernel_addr=" MK_STR(MV_KERNEL_ADDR) "\0" \ "mv_kernel_addr_ram=" MK_STR(MV_KERNEL_ADDR_RAM) "\0" \ "mv_initrd_addr=" MK_STR(MV_INITRD_ADDR) "\0" \ diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h index aa91805..e21fe80 100644 --- a/include/configs/MVBLM7.h +++ b/include/configs/MVBLM7.h @@ -408,8 +408,8 @@ #define MV_FPGA_SIZE 0x00076ca2 #define MV_KERNEL_ADDR 0xff810000 #define MV_INITRD_ADDR 0xffb00000 -#define MV_SOURCE_ADDR 0xff804000 -#define MV_SOURCE_ADDR2 0xff806000 +#define MV_SCRIPT_ADDR 0xff804000 +#define MV_SCRIPT_ADDR2 0xff806000 #define MV_DTB_ADDR 0xff808000 #define MV_INITRD_LENGTH 0x00400000
@@ -419,9 +419,9 @@ #define MV_DTB_ADDR_RAM 0x00600000 #define MV_INITRD_ADDR_RAM 0x01000000
-#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \ - then source ${autoscr_addr}; \ - else source ${autoscr_addr2}; \ +#define CONFIG_BOOTCOMMAND "if imi ${script_addr}; \ + then source ${script_addr}; \ + else source ${script_addr2}; \ fi;" #define CONFIG_BOOTARGS "root=/dev/ram ro rootfstype=squashfs"
@@ -434,8 +434,8 @@ "fpga=0\0" \ "fpgadata=" MK_STR(MV_FPGA_DATA) "\0" \ "fpgadatasize=" MK_STR(MV_FPGA_SIZE) "\0" \ - "autoscr_addr=" MK_STR(MV_SOURCE_ADDR) "\0" \ - "autoscr_addr2=" MK_STR(MV_SOURCE_ADDR2) "\0" \ + "script_addr=" MK_STR(MV_SCRIPT_ADDR) "\0" \ + "script_addr2=" MK_STR(MV_SCRIPT_ADDR2) "\0" \ "mv_kernel_addr=" MK_STR(MV_KERNEL_ADDR) "\0" \ "mv_kernel_addr_ram=" MK_STR(MV_KERNEL_ADDR_RAM) "\0" \ "mv_initrd_addr=" MK_STR(MV_INITRD_ADDR) "\0" \ diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h index 0cc1b3b..95f16cb 100644 --- a/include/configs/keymile-common.h +++ b/include/configs/keymile-common.h @@ -171,7 +171,7 @@ "kernel_addr_r=200000\0" \ "fdt_addr_r=600000\0" \ "ram_ws=800000 \0" \ - "autoscr_ws=780000 \0" \ + "script_ws=780000 \0" \ "fdt_file=" xstr(CONFIG_HOSTNAME) "/" \ xstr(CONFIG_HOSTNAME) ".dtb\0" \ "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin \0" \ @@ -253,8 +253,8 @@ "set_new_esw_script=setenv new_esw_script " \ "new_esw_0x${IVM_BoardId}_0x${IVM_HWKey}.scr \0" \ "new_esw=run set_new_esw_script; " \ - "tftp ${autoscr_ws} ${new_esw_script}; " \ - "iminfo ${autoscr_ws}; source ${autoscr_ws} \0" \ + "tftp ${script_ws} ${new_esw_script}; " \ + "iminfo ${script_ws}; source ${script_ws} \0" \ "bootlimit=0 \0" \ CONFIG_KM_DEF_ENV_IOMUX \ CONFIG_KM_DEF_ENV_PRIVATE \

Dear Peter Tyser,
In message 1251001885-19289-1-git-send-email-ptyser@xes-inc.com you wrote:
The more standard 'source' command provides identical functionality to the autoscr command.
Thanks.
There was a fair amount of grey area as far as environment variable naming for those variables that used to refernce autoscr.
Why actually?
I tended to lean toward using "script" in the variable name as I thought that was a lot more descriptive than "source", which could mean lots of different things. eg I migrated autoscr_addr to script_addr instead of source_addr.
I also figured the "autoscript" and "autoscript_uname" variables were more descriptive than "autosource" and "autosource_uname", so they were left alone.
I disagree here. "autoscript" has not much (if any) meaning when it comes to executing shell scripts (and this is what we are talking about there). I am not aware of a single man page in any of the many Unix flavours using this term. [OTOH, it is the name of an existing company and as such eventually a protected trade mark, at least in some parts of the world.]
If others (especially board maintainers affected) have a strong opinion about environment variable naming let me know.
I do. I want to get rid of references to "autoscr" / "autoscript".
Using "script_addr" (and it's variabts) is OK with me.
Best regards,
Wolfgang Denk

Hi Wolfgang,
There was a fair amount of grey area as far as environment variable naming for those variables that used to refernce autoscr.
Why actually?
I guess because we don't see eye-to-eye:)
I tended to lean toward using "script" in the variable name as I thought that was a lot more descriptive than "source", which could mean lots of different things. eg I migrated autoscr_addr to script_addr instead of source_addr.
I also figured the "autoscript" and "autoscript_uname" variables were more descriptive than "autosource" and "autosource_uname", so they were left alone.
I disagree here. "autoscript" has not much (if any) meaning when it comes to executing shell scripts (and this is what we are talking about there). I am not aware of a single man page in any of the many Unix flavours using this term. [OTOH, it is the name of an existing company and as such eventually a protected trade mark, at least in some parts of the world.]
I agree the term "autoscript" is non-standard, but what would be a better name for relating to a scipt that is automatically executed? The description of the current autoscript variable is:
autoscript - if set to "yes" commands like "loadb", "loady", "bootp", "tftpb", "rarpboot" and "nfs" will attempt to automatically run script images (by internally calling "source").
so if "autoscript" is set, a script is automatically ran. This name makes some sense to me and I couldn't think of a better one. Its name is also inline with the "autoload" and "autostart" variables. I think "autosource" is going to confuse a lot of people and is less descriptive than the current "autoscript".
If others (especially board maintainers affected) have a strong opinion about environment variable naming let me know.
I do. I want to get rid of references to "autoscr" / "autoscript".
Would you prefer to keep the functionality of the "autoscript" variable but with a different name, or remove that functionality altogether? Or are you referring to the references of "autoscript" in the board/matrix_vision/mvbc_p/mvbc_p_autoscript and board/matrix_vision/mvblm7/mvblm7_autoscript files?
A little off topic, but I'd personally love to get rid of the autoscript/autoscript_uname/autostart/autoload variables and have people explicitly use the commands they need. For example, the dhcp command would only set some environment variable values, then tftp/nfs would have to be called, followed by the appropriate boot command. Right now, the dhcp command behave in a number of different ways depending on the values of the auto* variables mentioned above. Same with tftp, loadb, etc.
Best, Peter

Dear Peter Tyser,
In message 1251059663.9041.21.camel@ptyser-laptop you wrote:
There was a fair amount of grey area as far as environment variable naming for those variables that used to refernce autoscr.
Why actually?
I guess because we don't see eye-to-eye:)
Indeed. We really should have a U-Boot developers meeting ...
I disagree here. "autoscript" has not much (if any) meaning when it comes to executing shell scripts (and this is what we are talking about there). I am not aware of a single man page in any of the many Unix flavours using this term. [OTOH, it is the name of an existing company and as such eventually a protected trade mark, at least in some parts of the world.]
I agree the term "autoscript" is non-standard, but what would be a better name for relating to a scipt that is automatically executed? The description of the current autoscript variable is:
It does not get _automatically_ executed. It get's executed when you run a special command, which reads and executes shell commands from a script rather than from stdin. The usual shells call this "sourcing a script file".
autoscript - if set to "yes" commands like "loadb", "loady", "bootp", "tftpb", "rarpboot" and "nfs" will attempt to automatically run script images (by internally calling "source").
This should be killed in this process, as it does nothing but duplicate the function of the "autostart" variable, just for another image type. It does not make sense to invent new names for the same function for all current and furture image types.
so if "autoscript" is set, a script is automatically ran. This name makes some sense to me and I couldn't think of a better one. Its name is also inline with the "autoload" and "autostart" variables. I think "autosource" is going to confuse a lot of people and is less descriptive than the current "autoscript".
"autoload" does something different. IMO, for automatic execution/ running/booting all image types should use "autostart".
Would you prefer to keep the functionality of the "autoscript" variable but with a different name, or remove that functionality altogether? Or are you referring to the references of "autoscript" in the board/matrix_vision/mvbc_p/mvbc_p_autoscript and board/matrix_vision/mvblm7/mvblm7_autoscript files?
We should merge this into "autostart".
A little off topic, but I'd personally love to get rid of the autoscript/autoscript_uname/autostart/autoload variables and have people explicitly use the commands they need. For example, the dhcp command would only set some environment variable values, then tftp/nfs would have to be called, followed by the appropriate boot command. Right now, the dhcp command behave in a number of different ways depending on the values of the auto* variables mentioned above. Same with tftp, loadb, etc.
I see, and I tend to agree. But then, we should also rename the commands, i. e. "dhcpboot" -> "dhcp", "tftpboot" -> "tftp", etc. Maybe this should be done in a two-step procedure, too: first introduce the new commands (which already changes default behaviour if you just type for example "tftp"), then deprecate and (after a sufficient transition period) remove the old commands.
Best regards,
Wolfgang Denk

Hi Wolfgang,
There was a fair amount of grey area as far as environment variable naming for those variables that used to refernce autoscr.
Why actually?
I guess because we don't see eye-to-eye:)
Indeed. We really should have a U-Boot developers meeting ...
I'm always up for U-Boot and beer;)
<snip>
autoscript - if set to "yes" commands like "loadb", "loady", "bootp", "tftpb", "rarpboot" and "nfs" will attempt to automatically run script images (by internally calling "source").
This should be killed in this process, as it does nothing but duplicate the function of the "autostart" variable, just for another image type. It does not make sense to invent new names for the same function for all current and furture image types.
I can generate a patch that replaces the functionality of the "autoscript" environment variable with "autostart", but we'd still have to take care of the "autoscript_uname" variable:
autoscript_uname - if script image is in a format (FIT) this variable is used to get script subimage unit name.
So I'd vote to either: 1. Remove support for the "autoscript" and "autoscript_uname" variables altogether now. There's been a warning in feature-removal-schedule.txt, I can't imagine that many people use them, and it seems like a waste of effort to migrate "autoscript/autoscript_uname" to "autostart" if its a feature that we're going to remove anyway.
2. Add a deprecated warning message when the autoscript* variables are used and then remove them 2 releases from now.
<snip>
Would you prefer to keep the functionality of the "autoscript" variable but with a different name, or remove that functionality altogether? Or are you referring to the references of "autoscript" in the board/matrix_vision/mvbc_p/mvbc_p_autoscript and board/matrix_vision/mvblm7/mvblm7_autoscript files?
We should merge this into "autostart".
How do we deal with "autoscript_uname"? I'd vote for #1 above and remove them both. People can work around the change in functionality by explicitly calling "source" after they download a script image.
A little off topic, but I'd personally love to get rid of the autoscript/autoscript_uname/autostart/autoload variables and have people explicitly use the commands they need. For example, the dhcp command would only set some environment variable values, then tftp/nfs would have to be called, followed by the appropriate boot command. Right now, the dhcp command behave in a number of different ways depending on the values of the auto* variables mentioned above. Same with tftp, loadb, etc.
I see, and I tend to agree. But then, we should also rename the commands, i. e. "dhcpboot" -> "dhcp", "tftpboot" -> "tftp", etc. Maybe this should be done in a two-step procedure, too: first introduce the new commands (which already changes default behaviour if you just type for example "tftp"), then deprecate and (after a sufficient transition period) remove the old commands.
Sounds good, I'll send some patches to do this and see what people think.
Best, Peter
participants (2)
-
Peter Tyser
-
Wolfgang Denk