Lines Matching defs:fbarg
97 barg2bootargs(const grub_barg_t *barg, grub_boot_args_t *fbarg)
104 assert(fbarg);
105 bzero(fbarg, sizeof (*fbarg));
106 fbarg->gba_kernel_fd = -1;
113 bcopy(fsd, &fbarg->gba_fsd, sizeof (fbarg->gba_fsd));
114 bcopy(barg->gb_kernel, fbarg->gba_kernel, sizeof (fbarg->gba_kernel));
115 bcopy(barg->gb_module, fbarg->gba_module, sizeof (fbarg->gba_module));
117 if (fbarg->gba_fsd.gfs_mountp[0] == 0 &&
118 (rc = grub_fsd_mount_tmp(&fbarg->gba_fsd,
122 if (snprintf(path, sizeof (path), "%s%s", fbarg->gba_fsd.gfs_mountp,
123 fbarg->gba_kernel) >= sizeof (path)) {
140 rc = get_kernel_fd(rpath, &fbarg->gba_kernel_fd);
144 if (rc == 0 && snprintf(fbarg->gba_bootargs,
145 sizeof (fbarg->gba_bootargs), "%s %s", fbarg->gba_fsd.gfs_mountp,
146 fbarg->gba_kernel) >= sizeof (fbarg->gba_bootargs))
151 grub_cleanup_boot_args(fbarg);
161 grub_entry_get_boot_args(grub_entry_t *ent, grub_boot_args_t *fbarg)
166 return (barg2bootargs(&ent->ge_barg, fbarg));
178 grub_boot_args_t *fbarg)
183 assert(fbarg);
188 return (grub_entry_get_boot_args(ent, fbarg));
193 * Caller must allocate space for fbarg, and call grub_cleanup_boot_args()
194 * when it's done with fbarg to clean up.
199 grub_get_boot_args(grub_boot_args_t *fbarg, const char *menupath, int num)
204 assert(fbarg);
206 rc = grub_menu_get_boot_args(mp, num, fbarg);
213 * Clean up when done with fbarg: close file handle, unmount file
218 grub_cleanup_boot_args(grub_boot_args_t *fbarg)
220 if (fbarg == NULL)
223 (void) close(fbarg->gba_kernel_fd);
224 grub_fsd_umount_tmp(&fbarg->gba_fsd);