示例#1
0
void
command_multiboot(char *arg)
{
	char *filename;

	filename = arg;
	if (exec_multiboot(filename, gettrailer(arg)) < 0)
		printf("multiboot: %s: %s\n", filename,
		  strerror(errno));
	else
		printf("boot returned\n");
}
示例#2
0
文件: boot2.c 项目: ryo/netbsd-src
static void
docommand(const struct bootblk_command * const cmds, char *arg)
{
	char *options;
	int i;

	options = gettrailer(arg);

	for (i = 0; cmds[i].c_name != NULL; i++) {
		if (strcmp(arg, cmds[i].c_name) == 0) {
			(*cmds[i].c_fn)(options);
			return;
		}
	}

	printf("unknown command\n");
	bootcmd_help(NULL);
}
示例#3
0
文件: boot.c 项目: ryo/netbsd-src
void
docommand(char *arg)
{
	char *options;
	int i;

	options = gettrailer(arg);

	for (i = 0; bootcmds[i].c_name != NULL; i++) {
		if (strcmp(arg, bootcmds[i].c_name) == 0) {
			(*bootcmds[i].c_fn)(options);
			return;
		}
	}

	printf("unknown command\n");
	bootcmd_help(NULL);
}
示例#4
0
文件: boot2.c 项目: ryo/netbsd-src
static int
parseboot(char *arg, char **filename, int *howto)
{
	char *opts = NULL;

	*filename = 0;
	*howto = 0;

	/* if there were no arguments */
	if (*arg == NULL)
		return (1);

	/* format is... */
	/* [[xxNx:]filename] [-adqsv] */

	/* check for just args */
	if (arg[0] == '-') {
		opts = arg;
	} else {
		/* there's a file name */
		*filename = arg;

		opts = gettrailer(arg);
		if (*opts == NULL) {
			opts = NULL;
		} else if (*opts != '-') {
			printf("invalid arguments\n");
			bootcmd_help(NULL);
			return (0);
		}
	}

	/* at this point, we have dealt with filenames. */

	/* now, deal with options */
	if (opts) {
		if (parseopts(opts, howto) == 0) {
			return (0);
		}
	}
	return (1);
}
示例#5
0
void
copyin(register Archive_t* ap)
{
	register File_t*	f = &ap->file;

	deltabase(ap);
	while (getprologue(ap))
	{
		while (getheader(ap, f))
		{
			if (selectfile(ap, f))
				filein(ap, f);
			else
				fileskip(ap, f);
			if (ap->info)
				ap->info->checksum = ap->memsum;
			gettrailer(ap, f);
		}
		if (!getepilogue(ap))
			break;
	}
	deltaverify(ap);
}