#include "../../kernel/config.h"
#include "../../kernel/type.h"
-
+#define VERBOSE 0 /* enable/ disable messages */
#define NR_DEVS 1 /* number of rescue devices */
#define RESCUE_KBYTES 128 /* default size in kilobytes */
panic("RESCUE","Couldn't store rescue disk details at DS.",s);
}
+#if VERBOSE
printf("RESCUE disk %d (size %u/base %u) initialized\n",
i, rescue_size, rescue_base);
+#endif
}
}
}
for (rep= &re_table[0]; rep < re_table+RE_PORT_NR; rep++)
rl_init_buf(rep);
- /* Try to notify inet that we are present (again). */
+ /* Try to notify INET that we are present (again). If INET cannot
+ * be found, assume this is the first time we started and INET is
+ * not yet alive.
+ */
(progname=strrchr(argv[0],'/')) ? progname++ : (progname=argv[0]);
r = findproc("inet", &inet_proc_nr);
- if (r == OK)
- notify(inet_proc_nr);
- else
- printf("rtl8139: cannot find proc number for inet: %d\n", r);
+ if (r == OK) notify(inet_proc_nr);
while (TRUE)
#define RS_UP (RS_RQ_BASE + 0) /* start system service */
#define RS_DOWN (RS_RQ_BASE + 1) /* stop system service */
#define RS_REFRESH (RS_RQ_BASE + 2) /* restart system service */
-#define RS_SHUTDOWN (RS_RQ_BASE + 3) /* alert about shutdown */
+#define RS_RESCUE (RS_RQ_BASE + 3) /* set rescue directory */
+#define RS_SHUTDOWN (RS_RQ_BASE + 4) /* alert about shutdown */
# define RS_CMD_ADDR m1_p1 /* command string */
# define RS_CMD_LEN m1_i1 /* length of command */
register struct proc **xpp; /* iterate over caller queue */
int i;
int sys_id;
- char rts_flags;
+ char saved_rts_flags;
/* Don't clear if already cleared. */
if(isemptyp(rc)) return;
* this point. All important fields are reinitialized when the
* slots are assigned to another, new process.
*/
- rts_flags = rc->p_rts_flags;
+ saved_rts_flags = rc->p_rts_flags;
rc->p_rts_flags = SLOT_FREE;
if (priv(rc)->s_flags & SYS_PROC) priv(rc)->s_proc_nr = NONE;
* message (e.g., the process was killed by a signal, rather than it doing
* a normal exit), then it must be removed from the message queues.
*/
- if (rts_flags & SENDING) {
+ if (saved_rts_flags & SENDING) {
xpp = &proc[rc->p_sendto].p_caller_q; /* destination's queue */
while (*xpp != NIL_PROC) { /* check entire queue */
if (*xpp == rc) { /* process is on the queue */
*/
execve(rp->r_argv[0], rp->r_argv, NULL); /* POSIX execute */
file_only = strrchr(rp->r_argv[0], '/') + 1;
- printf("Absolute exec failed (%d), trying file only: %s\n",
- errno, file_only);
execve(file_only, rp->r_argv, NULL); /* POSIX execute */
printf("RS: exec failed for %s: %d\n", rp->r_argv[0], errno);
exit(EXEC_FAILED); /* terminate child */
exit(EINVAL);
}
req_path = argv[ARG_PATH];
+ if (req_path[0] != '/') {
+ print_usage(argv[ARG_NAME], "rescue dir should be absolute path");
+ exit(EINVAL);
+ }
if (stat(argv[ARG_PATH], &stat_buf) == -1) {
print_usage(argv[ARG_NAME], "couldn't get status of directory");
exit(errno);
exec su root mkboot $@
@sync
-install: services hdboot
+install: includes services hdboot
# clean up compile results
clean: