* [ECOS] Default boot scripts in RedBoot @ 2003-12-10 14:40 Savin Zlobec 2003-12-10 14:56 ` Gary Thomas 0 siblings, 1 reply; 5+ messages in thread From: Savin Zlobec @ 2003-12-10 14:40 UTC (permalink / raw) To: ecos-discuss Hello, I am using RedBoot configured with default boot script and it doesn't work just like I expect it to. It looks to me that default boot script timeout (CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT) is used only when CYGSEM_REDBOOT_FLASH_CONFIG is not set. I use flash config support in my configuration and when boot script is not set, than the default boot script is used, but the timeout remains 0 which aborts the script. Also from the cdl option description one could expect that the default value of boot_script_timeout would be CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT, but it is 0. Is this a feature or a bug ? savin -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Default boot scripts in RedBoot 2003-12-10 14:40 [ECOS] Default boot scripts in RedBoot Savin Zlobec @ 2003-12-10 14:56 ` Gary Thomas 2003-12-10 15:28 ` Savin Zlobec 0 siblings, 1 reply; 5+ messages in thread From: Gary Thomas @ 2003-12-10 14:56 UTC (permalink / raw) To: Savin Zlobec; +Cc: ecos-discuss [-- Attachment #1: Type: text/plain, Size: 992 bytes --] On Wed, 2003-12-10 at 07:47, Savin Zlobec wrote: > Hello, > > I am using RedBoot configured with default boot script and it doesn't > work just like I expect it to. It looks to me that default boot script > timeout > (CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT) is used > only when CYGSEM_REDBOOT_FLASH_CONFIG is not set. I use > flash config support in my configuration and when boot script is not set, > than the default boot script is used, but the timeout remains 0 which > aborts the script. > > Also from the cdl option description one could expect that the default > value of > boot_script_timeout would be CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT, > but it is 0. > > Is this a feature or a bug ? Perhaps the default timeout should always be set. In any case, if you have 'fconfig' enabled, then the value stored in your config database should be what gets used. Try this patch and see if it behaves more like you'd like. -- Gary Thomas <gary@mlbassoc.com> MLB Associates [-- Attachment #2: diffs --] [-- Type: text/x-patch, Size: 1283 bytes --] Index: redboot/current/src/main.c =================================================================== RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/main.c,v retrieving revision 1.50 diff -u -5 -p -r1.50 main.c --- redboot/current/src/main.c 24 Nov 2003 21:12:07 -0000 1.50 +++ redboot/current/src/main.c 10 Dec 2003 14:53:55 -0000 @@ -297,10 +297,14 @@ cyg_start(void) #ifdef CYGOPT_REDBOOT_FIS_ZLIB_COMMON_BUFFER fis_zlib_common_buffer = workspace_end -= CYGNUM_REDBOOT_FIS_ZLIB_COMMON_BUFFER_SIZE; #endif +#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT + script_timeout = CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT; +#endif + for (init_entry = __RedBoot_INIT_TAB__; init_entry != &__RedBoot_INIT_TAB_END__; init_entry++) { (*init_entry->fun)(); } mem_segments[0].start = workspace_start; @@ -318,13 +322,10 @@ cyg_start(void) #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT # ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT if (!script) { script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT; -# ifndef CYGSEM_REDBOOT_FLASH_CONFIG - script_timeout = CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT; -# endif } # endif if (script) { // Give the guy a chance to abort any boot script unsigned char *hold_script = script; [-- Attachment #3: Type: text/plain, Size: 146 bytes --] -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Default boot scripts in RedBoot 2003-12-10 14:56 ` Gary Thomas @ 2003-12-10 15:28 ` Savin Zlobec 2003-12-10 15:31 ` Gary Thomas 0 siblings, 1 reply; 5+ messages in thread From: Savin Zlobec @ 2003-12-10 15:28 UTC (permalink / raw) To: Gary Thomas; +Cc: ecos-discuss Gary Thomas wrote: >On Wed, 2003-12-10 at 07:47, Savin Zlobec wrote: > > >>Hello, >> >>I am using RedBoot configured with default boot script and it doesn't >>work just like I expect it to. It looks to me that default boot script >>timeout >>(CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT) is used >>only when CYGSEM_REDBOOT_FLASH_CONFIG is not set. I use >>flash config support in my configuration and when boot script is not set, >>than the default boot script is used, but the timeout remains 0 which >>aborts the script. >> >>Also from the cdl option description one could expect that the default >>value of >>boot_script_timeout would be CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT, >>but it is 0. >> >>Is this a feature or a bug ? >> >> > >Perhaps the default timeout should always be set. In any case, if >you have 'fconfig' enabled, then the value stored in your config >database should be what gets used. > >Try this patch and see if it behaves more like you'd like. > It looks fine, but the option I fancy is to set boot_script_timeout default value to CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_VALUE and to set script_timeout to boot_script_timeout value regardless of boot_script value - so the default boot script can be aborted by setting boot_script_timeout to 0. Also to make this work boot_script_timeout option has to be always enabled if default boot script is set. savin -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Default boot scripts in RedBoot 2003-12-10 15:28 ` Savin Zlobec @ 2003-12-10 15:31 ` Gary Thomas 2003-12-11 9:10 ` Savin Zlobec 0 siblings, 1 reply; 5+ messages in thread From: Gary Thomas @ 2003-12-10 15:31 UTC (permalink / raw) To: Savin Zlobec; +Cc: ecos-discuss On Wed, 2003-12-10 at 08:35, Savin Zlobec wrote: > Gary Thomas wrote: > > >On Wed, 2003-12-10 at 07:47, Savin Zlobec wrote: > > > > > >>Hello, > >> > >>I am using RedBoot configured with default boot script and it doesn't > >>work just like I expect it to. It looks to me that default boot script > >>timeout > >>(CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT) is used > >>only when CYGSEM_REDBOOT_FLASH_CONFIG is not set. I use > >>flash config support in my configuration and when boot script is not set, > >>than the default boot script is used, but the timeout remains 0 which > >>aborts the script. > >> > >>Also from the cdl option description one could expect that the default > >>value of > >>boot_script_timeout would be CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT, > >>but it is 0. > >> > >>Is this a feature or a bug ? > >> > >> > > > >Perhaps the default timeout should always be set. In any case, if > >you have 'fconfig' enabled, then the value stored in your config > >database should be what gets used. > > > >Try this patch and see if it behaves more like you'd like. > > > It looks fine, but the option I fancy is to set boot_script_timeout default > value to CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_VALUE > and to set script_timeout to boot_script_timeout value regardless of > boot_script > value - so the default boot script can be aborted by setting > boot_script_timeout to 0. > Also to make this work boot_script_timeout option has to be always > enabled if > default boot script is set. Sorry, but I'm not following what you are trying to accomplish. Please reword it, describing how you want it to behave (without referring to any of the variable/CDL names should help me understand). -- Gary Thomas <gary@mlbassoc.com> MLB Associates -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Default boot scripts in RedBoot 2003-12-10 15:31 ` Gary Thomas @ 2003-12-11 9:10 ` Savin Zlobec 0 siblings, 0 replies; 5+ messages in thread From: Savin Zlobec @ 2003-12-11 9:10 UTC (permalink / raw) To: Gary Thomas; +Cc: ecos-discuss [-- Attachment #1: Type: text/plain, Size: 2316 bytes --] Gary Thomas wrote: >On Wed, 2003-12-10 at 08:35, Savin Zlobec wrote: > > >>Gary Thomas wrote: >> >> >> >>>On Wed, 2003-12-10 at 07:47, Savin Zlobec wrote: >>> >>> >>> >>> >>>>Hello, >>>> >>>>I am using RedBoot configured with default boot script and it doesn't >>>>work just like I expect it to. It looks to me that default boot script >>>>timeout >>>>(CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT) is used >>>>only when CYGSEM_REDBOOT_FLASH_CONFIG is not set. I use >>>>flash config support in my configuration and when boot script is not set, >>>>than the default boot script is used, but the timeout remains 0 which >>>>aborts the script. >>>> >>>>Also from the cdl option description one could expect that the default >>>>value of >>>>boot_script_timeout would be CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT, >>>>but it is 0. >>>> >>>>Is this a feature or a bug ? >>>> >>>> >>>> >>>> >>>Perhaps the default timeout should always be set. In any case, if >>>you have 'fconfig' enabled, then the value stored in your config >>>database should be what gets used. >>> >>>Try this patch and see if it behaves more like you'd like. >>> >>> >>> >>It looks fine, but the option I fancy is to set boot_script_timeout default >>value to CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_VALUE >>and to set script_timeout to boot_script_timeout value regardless of >>boot_script >>value - so the default boot script can be aborted by setting >>boot_script_timeout to 0. >>Also to make this work boot_script_timeout option has to be always >>enabled if >>default boot script is set. >> >> > >Sorry, but I'm not following what you are trying to accomplish. > >Please reword it, describing how you want it to behave (without >referring to any of the variable/CDL names should help me understand). > What I need is a first time initialization script. I used redboot default script option for that, but I found that the script timeout was not set when flash config was enabled. Also I needed some way to disable this script after the first time - the obvious way was to set the script timeout to 0 from the initialization script, but I found out that the script timeout value stored in flash is used only when custom boot script option is enabled. Here is what I did to make it work from me. [-- Attachment #2: diff --] [-- Type: text/plain, Size: 2273 bytes --] Index: fconfig.c =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/src/fconfig.c,v retrieving revision 1.7 diff -u -r1.7 fconfig.c --- fconfig.c 25 Nov 2003 11:54:41 -0000 1.7 +++ fconfig.c 11 Dec 2003 08:47:13 -0000 @@ -136,9 +136,13 @@ CYGNUM_REDBOOT_BOOT_SCRIPT_TIMEOUT_RESOLUTION, "ms resolution)"), boot_script_timeout, +#ifndef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT "boot_script", true, +#else + ALWAYS_ENABLED, true, +#endif CONFIG_INT, - 0 + CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT ); #undef __cat #undef _cat @@ -1011,9 +1015,9 @@ } config_ok = true; flash_get_config("boot_script", &use_boot_script, CONFIG_BOOL); + flash_get_config("boot_script_timeout", &script_timeout, CONFIG_INT); if (use_boot_script) { flash_get_config("boot_script_data", &script, CONFIG_SCRIPT); - flash_get_config("boot_script_timeout", &script_timeout, CONFIG_INT); } #ifdef CYGSEM_REDBOOT_VARIABLE_BAUD_RATE if (flash_get_config("console_baud_rate", &console_baud_rate, CONFIG_INT)) { Index: main.c =================================================================== RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v retrieving revision 1.50 diff -u -r1.50 main.c --- main.c 24 Nov 2003 21:12:07 -0000 1.50 +++ main.c 11 Dec 2003 08:47:14 -0000 @@ -299,6 +299,10 @@ workspace_end -= CYGNUM_REDBOOT_FIS_ZLIB_COMMON_BUFFER_SIZE; #endif +#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT + script_timeout = CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT; +#endif + for (init_entry = __RedBoot_INIT_TAB__; init_entry != &__RedBoot_INIT_TAB_END__; init_entry++) { (*init_entry->fun)(); } @@ -320,9 +324,6 @@ # ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT if (!script) { script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT; -# ifndef CYGSEM_REDBOOT_FLASH_CONFIG - script_timeout = CYGNUM_REDBOOT_BOOT_SCRIPT_DEFAULT_TIMEOUT; -# endif } # endif if (script) { [-- Attachment #3: Type: text/plain, Size: 146 bytes --] -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-12-11 9:10 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-12-10 14:40 [ECOS] Default boot scripts in RedBoot Savin Zlobec 2003-12-10 14:56 ` Gary Thomas 2003-12-10 15:28 ` Savin Zlobec 2003-12-10 15:31 ` Gary Thomas 2003-12-11 9:10 ` Savin Zlobec
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).