1 /* grub-setup.c - make GRUB usable */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
21 #include <grub/types.h>
22 #include <grub/util/misc.h>
23 #include <grub/device.h>
24 #include <grub/disk.h>
25 #include <grub/file.h>
27 #include <grub/partition.h>
28 #include <grub/msdos_partition.h>
29 #include <grub/gpt_partition.h>
31 #include <grub/emu/hostdisk.h>
32 #include <grub/machine/boot.h>
33 #include <grub/machine/kernel.h>
34 #include <grub/term.h>
35 #include <grub/i18n.h>
36 #include <grub/util/raid.h>
37 #include <grub/util/lvm.h>
38 #include <grub/emu/getroot.h>
40 static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot
= GRUB_GPT_PARTITION_TYPE_BIOS_BOOT
;
42 #include <grub_setup_init.h>
48 #include <sys/types.h>
57 #define DEFAULT_BOOT_FILE "boot.img"
58 #define DEFAULT_CORE_FILE "core.img"
60 #define grub_target_to_host16(x) grub_le_to_cpu16(x)
61 #define grub_target_to_host32(x) grub_le_to_cpu32(x)
62 #define grub_target_to_host64(x) grub_le_to_cpu64(x)
63 #define grub_host_to_target16(x) grub_cpu_to_le16(x)
64 #define grub_host_to_target32(x) grub_cpu_to_le32(x)
65 #define grub_host_to_target64(x) grub_cpu_to_le64(x)
79 struct grub_handler_class grub_term_input_class
;
80 struct grub_handler_class grub_term_output_class
;
89 setup (const char *dir
,
90 const char *boot_file
, const char *core_file
,
91 const char *root
, const char *dest
, int must_embed
, int force
, int fs_probe
)
93 char *boot_path
, *core_path
, *core_path_dev
, *core_path_dev_full
;
94 char *boot_img
, *core_img
;
95 size_t boot_size
, core_size
;
96 grub_uint16_t core_sectors
;
97 grub_device_t root_dev
, dest_dev
;
98 const char *dest_partmap
;
99 grub_uint8_t
*boot_drive
;
100 grub_disk_addr_t
*kernel_sector
;
101 grub_uint16_t
*boot_drive_check
;
102 struct grub_boot_blocklist
*first_block
, *block
;
103 grub_int32_t
*install_dos_part
, *install_bsd_part
;
104 grub_int32_t dos_part
, bsd_part
;
107 grub_disk_addr_t first_sector
;
108 grub_uint16_t current_segment
109 = GRUB_BOOT_MACHINE_KERNEL_SEG
+ (GRUB_DISK_SECTOR_SIZE
>> 4);
110 grub_uint16_t last_length
= GRUB_DISK_SECTOR_SIZE
;
113 struct { grub_uint64_t start
; grub_uint64_t end
; } embed_region
;
114 embed_region
.start
= embed_region
.end
= ~0UL;
116 auto void NESTED_FUNC_ATTR
save_first_sector (grub_disk_addr_t sector
, unsigned offset
,
118 auto void NESTED_FUNC_ATTR
save_blocklists (grub_disk_addr_t sector
, unsigned offset
,
121 auto int NESTED_FUNC_ATTR
find_usable_region_msdos (grub_disk_t disk
,
122 const grub_partition_t p
);
123 int NESTED_FUNC_ATTR
find_usable_region_msdos (grub_disk_t disk
__attribute__ ((unused
)),
124 const grub_partition_t p
)
126 /* There's always an embed region, and it starts right after the MBR. */
127 embed_region
.start
= 1;
129 if (embed_region
.end
> p
->start
)
130 embed_region
.end
= p
->start
;
135 auto int NESTED_FUNC_ATTR
find_usable_region_gpt (grub_disk_t disk
,
136 const grub_partition_t p
);
137 int NESTED_FUNC_ATTR
find_usable_region_gpt (grub_disk_t disk
__attribute__ ((unused
)),
138 const grub_partition_t p
)
140 struct grub_gpt_partentry gptdata
;
142 disk
->partition
= p
->parent
;
143 if (grub_disk_read (disk
, p
->offset
, p
->index
,
144 sizeof (gptdata
), &gptdata
))
147 /* If there's an embed region, it is in a dedicated partition. */
148 if (! memcmp (&gptdata
.type
, &grub_gpt_partition_type_bios_boot
, 16))
150 embed_region
.start
= p
->start
;
151 embed_region
.end
= p
->start
+ p
->len
;
158 void NESTED_FUNC_ATTR
save_first_sector (grub_disk_addr_t sector
, unsigned offset
,
161 grub_util_info ("the first sector is <%llu,%u,%u>",
162 sector
, offset
, length
);
164 if (offset
!= 0 || length
!= GRUB_DISK_SECTOR_SIZE
)
165 grub_util_error (_("the first sector of the core file is not sector-aligned"));
167 first_sector
= sector
;
170 void NESTED_FUNC_ATTR
save_blocklists (grub_disk_addr_t sector
, unsigned offset
,
173 struct grub_boot_blocklist
*prev
= block
+ 1;
175 grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x",
176 sector
, offset
, length
, (unsigned) current_segment
);
178 if (offset
!= 0 || last_length
!= GRUB_DISK_SECTOR_SIZE
)
179 grub_util_error (_("non-sector-aligned data is found in the core file"));
181 if (block
!= first_block
182 && (grub_le_to_cpu64 (prev
->start
)
183 + grub_le_to_cpu16 (prev
->len
)) == sector
)
184 prev
->len
= grub_cpu_to_le16 (grub_le_to_cpu16 (prev
->len
) + 1);
187 block
->start
= grub_cpu_to_le64 (sector
);
188 block
->len
= grub_cpu_to_le16 (1);
189 block
->segment
= grub_cpu_to_le16 (current_segment
);
193 grub_util_error (_("the sectors of the core file are too fragmented"));
196 last_length
= length
;
197 current_segment
+= GRUB_DISK_SECTOR_SIZE
>> 4;
200 /* Read the boot image by the OS service. */
201 boot_path
= grub_util_get_path (dir
, boot_file
);
202 boot_size
= grub_util_get_image_size (boot_path
);
203 if (boot_size
!= GRUB_DISK_SECTOR_SIZE
)
204 grub_util_error (_("the size of `%s' is not %u"),
205 boot_path
, GRUB_DISK_SECTOR_SIZE
);
206 boot_img
= grub_util_read_image (boot_path
);
209 /* Set the addresses of variables in the boot image. */
210 boot_drive
= (grub_uint8_t
*) (boot_img
+ GRUB_BOOT_MACHINE_BOOT_DRIVE
);
211 kernel_sector
= (grub_disk_addr_t
*) (boot_img
212 + GRUB_BOOT_MACHINE_KERNEL_SECTOR
);
213 boot_drive_check
= (grub_uint16_t
*) (boot_img
214 + GRUB_BOOT_MACHINE_DRIVE_CHECK
);
216 core_path
= grub_util_get_path (dir
, core_file
);
217 core_size
= grub_util_get_image_size (core_path
);
218 core_sectors
= ((core_size
+ GRUB_DISK_SECTOR_SIZE
- 1)
219 >> GRUB_DISK_SECTOR_BITS
);
220 if (core_size
< GRUB_DISK_SECTOR_SIZE
)
221 grub_util_error (_("the size of `%s' is too small"), core_path
);
222 else if (core_size
> 0xFFFF * GRUB_DISK_SECTOR_SIZE
)
223 grub_util_error (_("the size of `%s' is too large"), core_path
);
225 core_img
= grub_util_read_image (core_path
);
227 /* Have FIRST_BLOCK to point to the first blocklist. */
228 first_block
= (struct grub_boot_blocklist
*) (core_img
229 + GRUB_DISK_SECTOR_SIZE
232 install_dos_part
= (grub_int32_t
*) (core_img
+ GRUB_DISK_SECTOR_SIZE
233 + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART
);
234 install_bsd_part
= (grub_int32_t
*) (core_img
+ GRUB_DISK_SECTOR_SIZE
235 + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART
);
237 /* Open the root device and the destination device. */
238 root_dev
= grub_device_open (root
);
240 grub_util_error ("%s", grub_errmsg
);
242 dest_dev
= grub_device_open (dest
);
244 grub_util_error ("%s", grub_errmsg
);
246 grub_util_info ("setting the root device to `%s'", root
);
247 if (grub_env_set ("root", root
) != GRUB_ERR_NONE
)
248 grub_util_error ("%s", grub_errmsg
);
250 /* Read the original sector from the disk. */
251 tmp_img
= xmalloc (GRUB_DISK_SECTOR_SIZE
);
252 if (grub_disk_read (dest_dev
->disk
, 0, 0, GRUB_DISK_SECTOR_SIZE
, tmp_img
))
253 grub_util_error ("%s", grub_errmsg
);
255 if (dest_dev
->disk
->partition
&& fs_probe
)
258 fs
= grub_fs_probe (dest_dev
);
260 grub_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"),
261 dest_dev
->disk
->name
);
263 if (! fs
->reserved_first_sector
)
264 grub_util_error (_("%s appears to contain a %s filesystem which isn't known to "
265 "reserve space for DOS-style boot. Installing GRUB there could "
266 "result in FILESYSTEM DESTRUCTION if valuable data is overwritten "
267 "by grub-setup (--skip-fs-probe disables this "
268 "check, use at your own risk)"), dest_dev
->disk
->name
, fs
->name
);
271 /* Copy the possible DOS BPB. */
272 memcpy (boot_img
+ GRUB_BOOT_MACHINE_BPB_START
,
273 tmp_img
+ GRUB_BOOT_MACHINE_BPB_START
,
274 GRUB_BOOT_MACHINE_BPB_END
- GRUB_BOOT_MACHINE_BPB_START
);
276 /* Copy the possible partition table. */
277 if (dest_dev
->disk
->has_partitions
)
278 memcpy (boot_img
+ GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
,
279 tmp_img
+ GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
,
280 GRUB_BOOT_MACHINE_PART_END
- GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
);
284 /* If DEST_DRIVE is a hard disk, enable the workaround, which is
285 for buggy BIOSes which don't pass boot drive correctly. Instead,
286 they pass 0x00 or 0x01 even when booted from 0x80. */
287 if (dest_dev
->disk
->id
& 0x80)
288 /* Replace the jmp (2 bytes) with double nop's. */
289 *boot_drive_check
= 0x9090;
291 /* If we hardcoded drive as part of prefix, we don't want to
292 override the current setting. */
293 if (*install_dos_part
!= -2)
295 /* Embed information about the installed location. */
296 if (root_dev
->disk
->partition
)
298 if (root_dev
->disk
->partition
->parent
)
300 if (root_dev
->disk
->partition
->parent
->parent
)
301 grub_util_error ("Installing on doubly nested partitions is "
303 dos_part
= root_dev
->disk
->partition
->parent
->number
;
304 bsd_part
= root_dev
->disk
->partition
->number
;
308 dos_part
= root_dev
->disk
->partition
->number
;
313 dos_part
= bsd_part
= -1;
317 dos_part
= grub_le_to_cpu32 (*install_dos_part
);
318 bsd_part
= grub_le_to_cpu32 (*install_bsd_part
);
321 grub_util_info ("dos partition is %d, bsd partition is %d",
324 if (! dest_dev
->disk
->has_partitions
)
326 grub_util_warn (_("Attempting to install GRUB to a partitionless disk. This is a BAD idea."));
327 goto unable_to_embed
;
330 if (dest_dev
->disk
->partition
)
332 grub_util_warn (_("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."));
333 goto unable_to_embed
;
336 /* Unlike root_dev, with dest_dev we're interested in the partition map even
337 if dest_dev itself is a whole disk. */
338 auto int NESTED_FUNC_ATTR
identify_partmap (grub_disk_t disk
,
339 const grub_partition_t p
);
340 int NESTED_FUNC_ATTR
identify_partmap (grub_disk_t disk
__attribute__ ((unused
)),
341 const grub_partition_t p
)
345 dest_partmap
= p
->partmap
->name
;
349 grub_partition_iterate (dest_dev
->disk
, identify_partmap
);
353 grub_util_warn (_("Attempting to install GRUB to a partitionless disk. This is a BAD idea."));
354 goto unable_to_embed
;
357 if (strcmp (dest_partmap
, "msdos") == 0)
358 grub_partition_iterate (dest_dev
->disk
, find_usable_region_msdos
);
359 else if (strcmp (dest_partmap
, "gpt") == 0)
360 grub_partition_iterate (dest_dev
->disk
, find_usable_region_gpt
);
362 grub_util_error (_("No DOS-style partitions found"));
364 if (embed_region
.end
== embed_region
.start
)
366 if (! strcmp (dest_partmap
, "msdos"))
367 grub_util_warn (_("This msdos-style partition label has no post-MBR gap; embedding won't be possible!"));
369 grub_util_warn (_("This GPT partition label has no BIOS Boot Partition; embedding won't be possible!"));
370 goto unable_to_embed
;
373 if ((unsigned long) core_sectors
> embed_region
.end
- embed_region
.start
)
375 if (core_sectors
> 62)
376 grub_util_warn (_("Your core.img is unusually large. It won't fit in the embedding area."));
377 else /* embed_region.end - embed_region.start < 62 */
378 grub_util_warn (_("Your embedding area is unusually small. core.img won't fit in it."));
379 goto unable_to_embed
;
383 grub_util_info ("the core image will be embedded at sector 0x%llx", embed_region
.start
);
385 *install_dos_part
= grub_cpu_to_le32 (dos_part
);
386 *install_bsd_part
= grub_cpu_to_le32 (bsd_part
);
388 /* The first blocklist contains the whole sectors. */
389 first_block
->start
= grub_cpu_to_le64 (embed_region
.start
+ 1);
391 /* These are filled elsewhere. Verify them just in case. */
392 assert (first_block
->len
== grub_host_to_target16 (core_sectors
- 1));
393 assert (first_block
->segment
== grub_host_to_target16 (GRUB_BOOT_MACHINE_KERNEL_SEG
394 + (GRUB_DISK_SECTOR_SIZE
>> 4)));
396 /* Make sure that the second blocklist is a terminator. */
397 block
= first_block
- 1;
402 /* Write the core image onto the disk. */
403 if (grub_disk_write (dest_dev
->disk
, embed_region
.start
, 0, core_size
, core_img
))
404 grub_util_error ("%s", grub_errmsg
);
406 /* FIXME: can this be skipped? */
409 *kernel_sector
= grub_cpu_to_le64 (embed_region
.start
);
411 /* Write the boot image onto the disk. */
412 if (grub_disk_write (dest_dev
->disk
, 0, 0, GRUB_DISK_SECTOR_SIZE
,
414 grub_util_error ("%s", grub_errmsg
);
421 grub_util_error (_("embedding is not possible, but this is required when "
422 "the root device is on a RAID array or LVM volume"));
424 grub_util_warn (_("Embedding is not possible. GRUB can only be installed in this "
425 "setup by using blocklists. However, blocklists are UNRELIABLE and "
426 "their use is discouraged."));
428 grub_util_error (_("if you really want blocklists, use --force"));
430 /* Make sure that GRUB reads the identical image as the OS. */
431 tmp_img
= xmalloc (core_size
);
432 core_path_dev_full
= grub_util_get_path (dir
, core_file
);
433 core_path_dev
= grub_make_system_path_relative_to_its_root (core_path_dev_full
);
434 free (core_path_dev_full
);
436 /* It is a Good Thing to sync two times. */
442 for (i
= 0; i
< MAX_TRIES
; i
++)
444 grub_util_info ((i
== 0) ? _("attempting to read the core image `%s' from GRUB")
445 : _("attempting to read the core image `%s' from GRUB again"),
448 grub_disk_cache_invalidate_all ();
450 file
= grub_file_open (core_path_dev
);
453 if (grub_file_size (file
) != core_size
)
454 grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)",
455 (int) grub_file_size (file
), (int) core_size
);
456 else if (grub_file_read (file
, tmp_img
, core_size
)
457 != (grub_ssize_t
) core_size
)
458 grub_util_info ("succeeded in opening the core image but cannot read %d bytes",
460 else if (memcmp (core_img
, tmp_img
, core_size
) != 0)
466 dump
= fopen ("dump.img", "wb");
469 fwrite (tmp_img
, 1, core_size
, dump
);
473 dump2
= fopen ("dump2.img", "wb");
476 fwrite (core_img
, 1, core_size
, dump2
);
481 grub_util_info ("succeeded in opening the core image but the data is different");
485 grub_file_close (file
);
489 grub_file_close (file
);
492 grub_util_info ("couldn't open the core image");
495 grub_util_info ("error message = %s", grub_errmsg
);
497 grub_errno
= GRUB_ERR_NONE
;
503 grub_util_error (_("cannot read `%s' correctly"), core_path_dev
);
505 /* Clean out the blocklists. */
515 if ((char *) block
<= core_img
)
516 grub_util_error (_("no terminator in the core image"));
519 /* Now read the core image to determine where the sectors are. */
520 file
= grub_file_open (core_path_dev
);
522 grub_util_error ("%s", grub_errmsg
);
524 file
->read_hook
= save_first_sector
;
525 if (grub_file_read (file
, tmp_img
, GRUB_DISK_SECTOR_SIZE
)
526 != GRUB_DISK_SECTOR_SIZE
)
527 grub_util_error (_("failed to read the first sector of the core image"));
530 file
->read_hook
= save_blocklists
;
531 if (grub_file_read (file
, tmp_img
, core_size
- GRUB_DISK_SECTOR_SIZE
)
532 != (grub_ssize_t
) core_size
- GRUB_DISK_SECTOR_SIZE
)
533 grub_util_error (_("failed to read the rest sectors of the core image"));
535 grub_file_close (file
);
537 free (core_path_dev
);
540 *kernel_sector
= grub_cpu_to_le64 (first_sector
);
542 /* FIXME: can this be skipped? */
545 *install_dos_part
= grub_cpu_to_le32 (dos_part
);
546 *install_bsd_part
= grub_cpu_to_le32 (bsd_part
);
548 /* Write the first two sectors of the core image onto the disk. */
549 grub_util_info ("opening the core image `%s'", core_path
);
550 fp
= fopen (core_path
, "r+b");
552 grub_util_error (_("cannot open `%s'"), core_path
);
554 grub_util_write_image (core_img
, GRUB_DISK_SECTOR_SIZE
* 2, fp
);
557 /* Write the boot image onto the disk. */
558 if (grub_disk_write (dest_dev
->disk
, 0, 0, GRUB_DISK_SECTOR_SIZE
, boot_img
))
559 grub_util_error ("%s", grub_errmsg
);
563 /* Sync is a Good Thing. */
569 grub_device_close (dest_dev
);
570 grub_device_close (root_dev
);
573 static struct option options
[] =
575 {"boot-image", required_argument
, 0, 'b'},
576 {"core-image", required_argument
, 0, 'c'},
577 {"directory", required_argument
, 0, 'd'},
578 {"device-map", required_argument
, 0, 'm'},
579 {"root-device", required_argument
, 0, 'r'},
580 {"force", no_argument
, 0, 'f'},
581 {"skip-fs-probe", no_argument
, 0, 's'},
582 {"help", no_argument
, 0, 'h'},
583 {"version", no_argument
, 0, 'V'},
584 {"verbose", no_argument
, 0, 'v'},
592 fprintf (stderr
, _("Try `%s --help' for more information.\n"), program_name
);
595 Usage: %s [OPTION]... DEVICE\n\
597 Set up images to boot from DEVICE.\n\
598 DEVICE must be a GRUB device (e.g. `(hd0,1)').\n\
600 -b, --boot-image=FILE use FILE as the boot image [default=%s]\n\
601 -c, --core-image=FILE use FILE as the core image [default=%s]\n\
602 -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n\
603 -m, --device-map=FILE use FILE as the device map [default=%s]\n\
604 -r, --root-device=DEV use DEV as the root device [default=guessed]\n\
605 -f, --force install even if problems are detected\n\
606 -s, --skip-fs-probe do not probe for filesystems in DEVICE\n\
607 -h, --help display this message and exit\n\
608 -V, --version print version information and exit\n\
609 -v, --verbose print verbose messages\n\
611 Report bugs to <%s>.\n\
614 DEFAULT_BOOT_FILE
, DEFAULT_CORE_FILE
, DEFAULT_DIRECTORY
,
615 DEFAULT_DEVICE_MAP
, PACKAGE_BUGREPORT
);
621 get_device_name (char *dev
)
623 size_t len
= strlen (dev
);
625 if (dev
[0] != '(' || dev
[len
- 1] != ')')
633 main (int argc
, char *argv
[])
641 int must_embed
= 0, force
= 0, fs_probe
= 1;
643 set_program_name (argv
[0]);
645 grub_util_init_nls ();
647 /* Check for options. */
650 int c
= getopt_long (argc
, argv
, "b:c:d:m:r:hVvf", options
, 0);
661 boot_file
= xstrdup (optarg
);
668 core_file
= xstrdup (optarg
);
675 dir
= xstrdup (optarg
);
682 dev_map
= xstrdup (optarg
);
689 root_dev
= xstrdup (optarg
);
705 printf ("grub-setup (%s) %s\n", PACKAGE_NAME
, PACKAGE_VERSION
);
719 grub_env_set ("debug", "all");
721 /* Obtain DEST_DEV. */
724 fprintf (stderr
, _("No device is specified.\n"));
728 if (optind
+ 1 != argc
)
730 fprintf (stderr
, _("Unknown extra argument `%s'.\n"), argv
[optind
+ 1]);
734 /* Initialize the emulated biosdisk driver. */
735 grub_util_biosdisk_init (dev_map
? : DEFAULT_DEVICE_MAP
);
737 /* Initialize all modules. */
740 dest_dev
= get_device_name (argv
[optind
]);
743 /* Possibly, the user specified an OS device file. */
744 dest_dev
= grub_util_get_grub_dev (argv
[optind
]);
747 fprintf (stderr
, _("Invalid device `%s'.\n"), argv
[optind
]);
752 /* For simplicity. */
753 dest_dev
= xstrdup (dest_dev
);
757 char *tmp
= get_device_name (root_dev
);
760 grub_util_error (_("invalid root device `%s'"), root_dev
);
768 root_dev
= grub_util_get_grub_dev (grub_guess_root_device (dir
? : DEFAULT_DIRECTORY
));
771 grub_util_info ("guessing the root device failed, because of `%s'",
773 grub_util_error (_("cannot guess the root device. Specify the option `--root-device'"));
778 if (grub_util_lvm_isvolume (root_dev
))
781 if (root_dev
[0] == 'm' && root_dev
[1] == 'd'
782 && root_dev
[2] >= '0' && root_dev
[2] <= '9')
784 /* FIXME: we can avoid this on RAID1. */
788 if (dest_dev
[0] == 'm' && dest_dev
[1] == 'd'
789 && dest_dev
[2] >= '0' && dest_dev
[2] <= '9')
794 devicelist
= grub_util_raid_getmembers (dest_dev
);
796 for (i
= 0; devicelist
[i
]; i
++)
798 setup (dir
? : DEFAULT_DIRECTORY
,
799 boot_file
? : DEFAULT_BOOT_FILE
,
800 core_file
? : DEFAULT_CORE_FILE
,
801 root_dev
, grub_util_get_grub_dev (devicelist
[i
]), 1, force
, fs_probe
);
806 /* Do the real work. */
807 setup (dir
? : DEFAULT_DIRECTORY
,
808 boot_file
? : DEFAULT_BOOT_FILE
,
809 core_file
? : DEFAULT_CORE_FILE
,
810 root_dev
, dest_dev
, must_embed
, force
, fs_probe
);
812 /* Free resources. */
814 grub_util_biosdisk_fini ();