2005-07-24 Yoshinori K. Okuji <okuji@enbug.org>

* DISTLIST: Added util/i386/pc/grub-install.in.

	* util/i386/pc/grub-install.in: New file.

	* conf/i386-pc.rmk (sbin_SCRIPTS): New variable.
	(grub_install_SOURCES): Likewise.

	* genmk.rb: Added support for scripts.
	(Script): New class.
	(scripts): New variable.

	* Makefile.in (install-local): Install sbin_SCRIPTS by
	INSTALL_SCRIPT.
	(uninstall): Remove sbin_SCRIPTS.

	* util/i386/pc/grub-setup.c (main): If the argument is not a GRUB
	device, try to get a GRUB device by
	grub_util_biosdisk_get_grub_dev.
	Free DEST_DEV.

	* util/i386/pc/grub-mkdevicemap.c (usage): Remove a duplicated
	description for --device-map.
This commit is contained in:
okuji 2005-07-24 18:16:26 +00:00
parent 5f968e1e61
commit 075a165076
8 changed files with 300 additions and 16 deletions

View file

@ -605,19 +605,26 @@ main (int argc, char *argv[])
usage (1);
}
dest_dev = get_device_name (argv[optind]);
if (! dest_dev)
{
fprintf (stderr, "Invalid device `%s'.\n", argv[optind]);
usage (1);
}
prefix = grub_get_prefix (dir ? : DEFAULT_DIRECTORY);
/* Initialize the emulated biosdisk driver. */
grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP);
dest_dev = get_device_name (argv[optind]);
if (! dest_dev)
{
/* Possibly, the user specified an OS device file. */
dest_dev = grub_util_biosdisk_get_grub_dev (argv[optind]);
if (! dest_dev)
{
fprintf (stderr, "Invalid device `%s'.\n", argv[optind]);
usage (1);
}
}
else
/* For simplicity. */
dest_dev = xstrdup (dest_dev);
prefix = grub_get_prefix (dir ? : DEFAULT_DIRECTORY);
/* Initialize filesystems. */
grub_fat_init ();
grub_ext2_init ();
@ -664,6 +671,7 @@ main (int argc, char *argv[])
free (dev_map);
free (root_dev);
free (prefix);
free (dest_dev);
return 0;
}