Interact is always called with NULL. Simplify code a little by
removing this argument, and expanding when rc is NULL. This effectively completes the back out of custom scripts for tftp booted loaders from r269153 that was started in r292344 with the new path tricks that obsoleted it. Submitted by: Netflix
This commit is contained in:
parent
0ff3f28b2d
commit
6bc860372d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326961
@ -45,7 +45,7 @@ extern char command_errbuf[COMMAND_ERRBUFSZ];
|
|||||||
#define CMD_FATAL 4
|
#define CMD_FATAL 4
|
||||||
|
|
||||||
/* interp.c */
|
/* interp.c */
|
||||||
void interact(const char *rc);
|
void interact(void);
|
||||||
int include(const char *filename);
|
int include(const char *filename);
|
||||||
|
|
||||||
/* interp_backslash.c */
|
/* interp_backslash.c */
|
||||||
@ -55,7 +55,7 @@ char *backslash(const char *str);
|
|||||||
int parse(int *argc, char ***argv, const char *str);
|
int parse(int *argc, char ***argv, const char *str);
|
||||||
|
|
||||||
/* interp_forth.c */
|
/* interp_forth.c */
|
||||||
void bf_init(const char *rc);
|
void bf_init(void);
|
||||||
int bf_run(char *line);
|
int bf_run(char *line);
|
||||||
|
|
||||||
/* boot.c */
|
/* boot.c */
|
||||||
|
@ -84,7 +84,7 @@ perform(int argc, char *argv[])
|
|||||||
* Interactive mode
|
* Interactive mode
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
interact(const char *rc)
|
interact(void)
|
||||||
{
|
{
|
||||||
static char input[256]; /* big enough? */
|
static char input[256]; /* big enough? */
|
||||||
#ifndef BOOT_FORTH
|
#ifndef BOOT_FORTH
|
||||||
@ -93,14 +93,11 @@ interact(const char *rc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOT_FORTH
|
#ifdef BOOT_FORTH
|
||||||
bf_init((rc) ? "" : NULL);
|
bf_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc == NULL) {
|
/* Read our default configuration. */
|
||||||
/* Read our default configuration. */
|
include("/boot/loader.rc");
|
||||||
include("/boot/loader.rc");
|
|
||||||
} else if (*rc != '\0')
|
|
||||||
include(rc);
|
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ bf_command(FICL_VM *vm)
|
|||||||
* Initialise the Forth interpreter, create all our commands as words.
|
* Initialise the Forth interpreter, create all our commands as words.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
bf_init(const char *rc)
|
bf_init(void)
|
||||||
{
|
{
|
||||||
struct bootblk_command **cmdp;
|
struct bootblk_command **cmdp;
|
||||||
char create_buf[41]; /* 31 characters-long builtins */
|
char create_buf[41]; /* 31 characters-long builtins */
|
||||||
@ -280,14 +280,9 @@ bf_init(const char *rc)
|
|||||||
ficlSetEnv(bf_sys, "loader_version", bootprog_rev);
|
ficlSetEnv(bf_sys, "loader_version", bootprog_rev);
|
||||||
|
|
||||||
/* try to load and run init file if present */
|
/* try to load and run init file if present */
|
||||||
if (rc == NULL)
|
if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
|
||||||
rc = "/boot/boot.4th";
|
(void)ficlExecFD(bf_vm, fd);
|
||||||
if (*rc != '\0') {
|
close(fd);
|
||||||
fd = open(rc, O_RDONLY);
|
|
||||||
if (fd != -1) {
|
|
||||||
(void)ficlExecFD(bf_vm, fd);
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ main(int argc, CHAR16 *argv[])
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
return (EFI_SUCCESS); /* keep compiler happy */
|
return (EFI_SUCCESS); /* keep compiler happy */
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ main(void)
|
|||||||
|
|
||||||
bios_getsmap();
|
bios_getsmap();
|
||||||
|
|
||||||
interact(NULL);
|
interact();
|
||||||
|
|
||||||
/* if we ever get here, it is an error */
|
/* if we ever get here, it is an error */
|
||||||
return (1);
|
return (1);
|
||||||
|
@ -149,7 +149,7 @@ main(int argc, char *argv[], char *envv[], struct bootinfo *bootinfop)
|
|||||||
printf("bootpath=\"%s\"\n", bootpath);
|
printf("bootpath=\"%s\"\n", bootpath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
interact(NULL);
|
interact();
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ main(int (*openfirm)(void *))
|
|||||||
archsw.arch_readin = ofw_readin;
|
archsw.arch_readin = ofw_readin;
|
||||||
archsw.arch_autoload = ofw_autoload;
|
archsw.arch_autoload = ofw_autoload;
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
OF_exit();
|
OF_exit();
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ main(int argc, const char **argv)
|
|||||||
setenv("loaddev", bootdev, 1);
|
setenv("loaddev", bootdev, 1);
|
||||||
setenv("LINES", "24", 1);
|
setenv("LINES", "24", 1);
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ main(void)
|
|||||||
setenv("LINES", "24", 1);
|
setenv("LINES", "24", 1);
|
||||||
setenv("hw.platform", "ps3", 1);
|
setenv("hw.platform", "ps3", 1);
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -902,7 +902,7 @@ main(int (*openfirm)(void *))
|
|||||||
printf("bootpath=\"%s\"\n", bootpath);
|
printf("bootpath=\"%s\"\n", bootpath);
|
||||||
|
|
||||||
/* Give control to the machine independent loader code. */
|
/* Give control to the machine independent loader code. */
|
||||||
interact(NULL);
|
interact();
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ main(int argc, char **argv)
|
|||||||
archsw.arch_readin = uboot_readin;
|
archsw.arch_readin = uboot_readin;
|
||||||
archsw.arch_autoload = uboot_autoload;
|
archsw.arch_autoload = uboot_autoload;
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
|
|||||||
if (setjmp(jb))
|
if (setjmp(jb))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
interact(NULL); /* doesn't return */
|
interact(); /* doesn't return */
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user