aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-12-19 04:05:55 +0000
committerWarner Losh <imp@FreeBSD.org>2017-12-19 04:05:55 +0000
commit6bc860372dd7b2be0227ca213af631bdc51c2339 (patch)
treec57718327f9882f9c2bbceb2c271426e8c304920 /stand
parent0ff3f28b2d3886b23c9c228add0fb2d540c3fbe4 (diff)
downloadsrc-6bc860372dd7b2be0227ca213af631bdc51c2339.tar.gz
src-6bc860372dd7b2be0227ca213af631bdc51c2339.zip
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
Notes
Notes: svn path=/head/; revision=326961
Diffstat (limited to 'stand')
-rw-r--r--stand/common/bootstrap.h4
-rw-r--r--stand/common/interp.c11
-rw-r--r--stand/common/interp_forth.c13
-rw-r--r--stand/efi/loader/main.c2
-rw-r--r--stand/i386/loader/main.c2
-rw-r--r--stand/mips/beri/loader/main.c2
-rw-r--r--stand/ofw/common/main.c2
-rw-r--r--stand/powerpc/kboot/main.c2
-rw-r--r--stand/powerpc/ps3/main.c2
-rw-r--r--stand/sparc64/loader/main.c2
-rw-r--r--stand/uboot/common/main.c2
-rw-r--r--stand/userboot/userboot/main.c2
12 files changed, 19 insertions, 27 deletions
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
index 5d6a63db2b11..a570720b4250 100644
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -45,7 +45,7 @@ extern char command_errbuf[COMMAND_ERRBUFSZ];
#define CMD_FATAL 4
/* interp.c */
-void interact(const char *rc);
+void interact(void);
int include(const char *filename);
/* interp_backslash.c */
@@ -55,7 +55,7 @@ char *backslash(const char *str);
int parse(int *argc, char ***argv, const char *str);
/* interp_forth.c */
-void bf_init(const char *rc);
+void bf_init(void);
int bf_run(char *line);
/* boot.c */
diff --git a/stand/common/interp.c b/stand/common/interp.c
index 5cf4124660db..6b1b8bbf0db8 100644
--- a/stand/common/interp.c
+++ b/stand/common/interp.c
@@ -84,7 +84,7 @@ perform(int argc, char *argv[])
* Interactive mode
*/
void
-interact(const char *rc)
+interact(void)
{
static char input[256]; /* big enough? */
#ifndef BOOT_FORTH
@@ -93,14 +93,11 @@ interact(const char *rc)
#endif
#ifdef BOOT_FORTH
- bf_init((rc) ? "" : NULL);
+ bf_init();
#endif
- if (rc == NULL) {
- /* Read our default configuration. */
- include("/boot/loader.rc");
- } else if (*rc != '\0')
- include(rc);
+ /* Read our default configuration. */
+ include("/boot/loader.rc");
printf("\n");
diff --git a/stand/common/interp_forth.c b/stand/common/interp_forth.c
index a3b77769d38a..d617ce85842e 100644
--- a/stand/common/interp_forth.c
+++ b/stand/common/interp_forth.c
@@ -250,7 +250,7 @@ bf_command(FICL_VM *vm)
* Initialise the Forth interpreter, create all our commands as words.
*/
void
-bf_init(const char *rc)
+bf_init(void)
{
struct bootblk_command **cmdp;
char create_buf[41]; /* 31 characters-long builtins */
@@ -280,14 +280,9 @@ bf_init(const char *rc)
ficlSetEnv(bf_sys, "loader_version", bootprog_rev);
/* try to load and run init file if present */
- if (rc == NULL)
- rc = "/boot/boot.4th";
- if (*rc != '\0') {
- fd = open(rc, O_RDONLY);
- if (fd != -1) {
- (void)ficlExecFD(bf_vm, fd);
- close(fd);
- }
+ if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
+ (void)ficlExecFD(bf_vm, fd);
+ close(fd);
}
}
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index f367f292d387..516c47e37705 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -501,7 +501,7 @@ main(int argc, CHAR16 *argv[])
#endif
}
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
return (EFI_SUCCESS); /* keep compiler happy */
}
diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c
index 81bc2ff55dd0..543dae1af71a 100644
--- a/stand/i386/loader/main.c
+++ b/stand/i386/loader/main.c
@@ -232,7 +232,7 @@ main(void)
bios_getsmap();
- interact(NULL);
+ interact();
/* if we ever get here, it is an error */
return (1);
diff --git a/stand/mips/beri/loader/main.c b/stand/mips/beri/loader/main.c
index 2d201d8011ee..71b69b781572 100644
--- a/stand/mips/beri/loader/main.c
+++ b/stand/mips/beri/loader/main.c
@@ -149,7 +149,7 @@ main(int argc, char *argv[], char *envv[], struct bootinfo *bootinfop)
printf("bootpath=\"%s\"\n", bootpath);
#endif
- interact(NULL);
+ interact();
return (0);
}
diff --git a/stand/ofw/common/main.c b/stand/ofw/common/main.c
index 3c0bbdf97a26..128542c922f3 100644
--- a/stand/ofw/common/main.c
+++ b/stand/ofw/common/main.c
@@ -157,7 +157,7 @@ main(int (*openfirm)(void *))
archsw.arch_readin = ofw_readin;
archsw.arch_autoload = ofw_autoload;
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
OF_exit();
diff --git a/stand/powerpc/kboot/main.c b/stand/powerpc/kboot/main.c
index 7a24c163d5c4..e72a7482046c 100644
--- a/stand/powerpc/kboot/main.c
+++ b/stand/powerpc/kboot/main.c
@@ -122,7 +122,7 @@ main(int argc, const char **argv)
setenv("loaddev", bootdev, 1);
setenv("LINES", "24", 1);
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
return (0);
}
diff --git a/stand/powerpc/ps3/main.c b/stand/powerpc/ps3/main.c
index be8708aadefa..db9ea50959fa 100644
--- a/stand/powerpc/ps3/main.c
+++ b/stand/powerpc/ps3/main.c
@@ -140,7 +140,7 @@ main(void)
setenv("LINES", "24", 1);
setenv("hw.platform", "ps3", 1);
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
return (0);
}
diff --git a/stand/sparc64/loader/main.c b/stand/sparc64/loader/main.c
index d3c17c5ea6cc..140885d50e8e 100644
--- a/stand/sparc64/loader/main.c
+++ b/stand/sparc64/loader/main.c
@@ -902,7 +902,7 @@ main(int (*openfirm)(void *))
printf("bootpath=\"%s\"\n", bootpath);
/* Give control to the machine independent loader code. */
- interact(NULL);
+ interact();
return (1);
}
diff --git a/stand/uboot/common/main.c b/stand/uboot/common/main.c
index c4efb1f69bd9..5540059797cc 100644
--- a/stand/uboot/common/main.c
+++ b/stand/uboot/common/main.c
@@ -500,7 +500,7 @@ main(int argc, char **argv)
archsw.arch_readin = uboot_readin;
archsw.arch_autoload = uboot_autoload;
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
return (0);
}
diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
index 7f59eb7c3bdd..95bff1745a0f 100644
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -142,7 +142,7 @@ loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
if (setjmp(jb))
return;
- interact(NULL); /* doesn't return */
+ interact(); /* doesn't return */
exit(0);
}