2009-04-25 Vladimir Serbinenko <phcoder@gmail.com>

Parttool autoloading and improvements

	* Makefile.in (pkglib_DATA): add parttool.lst 
	(parttool.lst): new target
	* genmk.rb: generate parttool-*
	(CLEANFILES): add #{parttool}
	(PARTTOOLFILES): new variable
	* genparttoollist.sh: new file
	* parttool/pcpart.c (grub_pcpart_boot): more feedback 
	(grub_pcpart_type): likewise
	* commands/parttool.c (helpmsg): new variable
	(grub_cmd_parttool): output help if not enough arguments are supplied
	autoload modules
	(GRUB_MOD_INIT(parttool)): use helpmsg
This commit is contained in:
phcoder 2009-04-25 12:18:25 +00:00
parent 91b72b4f42
commit e434359358
6 changed files with 185 additions and 57 deletions

View file

@ -63,9 +63,13 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev,
for (i = 0; i < 4; i++)
mbr.entries[i].flag = 0x0;
mbr.entries[index].flag = 0x80;
grub_printf ("Partition %d is active now. \n", index);
}
else
mbr.entries[index].flag = 0x0;
{
mbr.entries[index].flag = 0x0;
grub_printf ("Cleared active flag on %d. \n", index);
}
/* Write the MBR. */
grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr);
@ -123,6 +127,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
}
mbr.entries[index].type = type;
grub_printf ("Setting partition type to 0x%x\n", type);
/* Write the parttable. */
grub_disk_write (dev->disk, part->offset, 0,