Lines Matching refs:line
261 * Simply allocate a new line and copy in cmd + sep + arg
269 BAM_DPRINTF(("%s: line before update: %s\n", fcn, linep->line));
270 free(linep->line);
272 linep->line = s_calloc(1, size);
273 (void) snprintf(linep->line, size, "%s%s%s", linep->cmd, linep->sep,
275 BAM_DPRINTF(("%s: line after update: %s\n", fcn, linep->line));
323 * The parse_kernel_line function examines a menu.lst kernel line. For
363 cvt_kernel_line(line_t *line, const char *osroot, entry_t *entry)
375 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, line->line, osroot));
402 "Not updating line %d\n"), line->lineNum);
414 free(line->cmd);
415 line->cmd = s_strdup(menu_cmds[KERNEL_DOLLAR_CMD]);
416 BAM_DPRINTF(("%s: converted kernel cmd to %s\n", fcn, line->cmd));
418 assert(sizeof (linebuf) > strlen(line->arg) + 32);
419 (void) strlcpy(linebuf, line->arg, sizeof (linebuf));
502 free(line->arg);
503 line->arg = s_strdup(new_arg);
504 update_line(line);
505 BAM_DPRINTF(("%s: converted line is: %s\n", fcn, line->line));
510 * Similar to above, except this time we're looking at a module line,
513 * Under multiboot, the archive line is:
517 * Under directboot, the archive line is:
540 cvt_module_line(line_t *line, entry_t *entry)
544 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, line->line));
555 if (strcmp(line->arg, FAILSAFE_ARCHIVE) == 0) {
556 BAM_DPRINTF(("%s: failsafe module line needs no "
557 "conversion: %s\n", fcn, line->arg));
561 } else if (strcmp(line->arg, MULTIBOOT_ARCHIVE) != 0) {
562 bam_error(_("module command on line %d not recognized.\n"),
563 line->lineNum);
568 free(line->cmd);
569 free(line->arg);
570 line->cmd = s_strdup(menu_cmds[MODULE_DOLLAR_CMD]);
572 line->arg = s_strdup(entry->flags & BAM_ENTRY_FAILSAFE ?
575 update_line(line);
576 BAM_DPRINTF(("%s: converted module line is: %s\n", fcn, line->line));
638 line_t *line;
659 for (line = entry->start; line; line = line->next) {
660 if (line->cmd == NULL || line->arg == NULL) {
661 if (line == entry->end) {
667 "NULL line\n", fcn));
671 if (strcmp(line->cmd, menu_cmds[ROOT_CMD])
672 == 0 && strcmp(line->arg, grubroot) == 0) {
674 "line: %s,%s\n", fcn,
675 line->line, grubsign));
678 if (line == entry->end) {
685 for (line = entry->start; line; line = line->next) {
686 if (line->cmd == NULL || line->arg == NULL) {
687 if (line == entry->end) {
693 "NULL line\n", fcn));
697 if (strcmp(line->cmd, menu_cmds[FINDROOT_CMD])
698 == 0 && strcmp(line->arg, grubsign) == 0) {
700 "findroot line: %s,%s\n", fcn,
701 line->line, grubsign));
704 if (line == entry->end) {
741 line_t *line;
761 for (line = entry->start; line; line = line->next) {
762 if (line->cmd == NULL || line->arg == NULL) {
763 if (line == entry->end) {
768 BAM_DPRINTF(("%s: skipping NULL line\n",
773 if (strcmp(line->cmd, menu_cmds[TITLE_CMD]) == 0) {
781 newlp->line = s_strdup(linebuf);
782 bam_add_line(mp, entry, line, newlp);
786 BAM_DPRINTF(("%s: added findroot line: %s\n",
787 fcn, newlp->line));
788 line = newlp;
790 if (strcmp(line->cmd, menu_cmds[ROOT_CMD]) == 0) {
791 BAM_DPRINTF(("%s: freeing root line: %s\n",
792 fcn, line->line));
793 unlink_line(mp, line);
794 line_free(line);
796 if (line == entry->end) {
855 line_t *line;
863 for (line = entry->start; line; line = line->next) {
864 if (line->cmd == NULL || line->arg == NULL) {
865 if (line == entry->end) {
870 BAM_DPRINTF(("%s: skipping NULL line\n",
882 if (strcmp(line->cmd, menu_cmds[KERNEL_CMD]) == 0) {
883 ret = cvt_kernel_line(line, osroot, entry);
898 if (strcmp(line->cmd, menu_cmds[MODULE_CMD]) == 0) {
899 ret = cvt_module_line(line, entry);
915 if (line == entry->end) {