commit-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[2068] 2009-04-06 Vladimir Serbinenko <address@hidden>


From: Vladimir Serbinenko
Subject: [2068] 2009-04-06 Vladimir Serbinenko <address@hidden>
Date: Mon, 06 Apr 2009 09:51:01 +0000

Revision: 2068
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2068
Author:   phcoder
Date:     2009-04-06 09:51:01 +0000 (Mon, 06 Apr 2009)
Log Message:
-----------
2009-04-06  Vladimir Serbinenko  <address@hidden>
        
        Parttool

        * parttool/pcpart.c: new file
        * commands/parttool.c: likewise
        * conf/common.rmk (pkglib_MODULES): Added parttool.mod and pcpart.mod
        (parttool_mod_SOURCES): new variable
        (parttool_mod_CFLAGS): likewise
        (parttool_mod_LDFLAGS): likewise
        (pcpart_mod_SOURCES): likewise
        (pcpart_mod_CFLAGS): likewise
        (pcpart_mod_LDFLAGS): likewise
        * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c 
        and parttool/pcpart.c
        * conf/i386-efi.rmk: likewise
        * conf/i386-ieee1275.rmk: likewise
        * conf/i386-pc.rmk: likewise
        * conf/powerpc-ieee1275.rmk: likewise
        * conf/sparc64-ieee1275.rmk: likewise
        * conf/x86_64-ieee1275.rmk: likewise

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/DISTLIST
    trunk/grub2/conf/common.mk
    trunk/grub2/conf/common.rmk
    trunk/grub2/conf/i386-coreboot.mk
    trunk/grub2/conf/i386-coreboot.rmk
    trunk/grub2/conf/i386-efi.mk
    trunk/grub2/conf/i386-efi.rmk
    trunk/grub2/conf/i386-pc.mk
    trunk/grub2/conf/i386-pc.rmk
    trunk/grub2/conf/powerpc-ieee1275.mk
    trunk/grub2/conf/powerpc-ieee1275.rmk
    trunk/grub2/conf/sparc64-ieee1275.mk
    trunk/grub2/conf/sparc64-ieee1275.rmk
    trunk/grub2/conf/x86_64-efi.mk
    trunk/grub2/conf/x86_64-efi.rmk

Added Paths:
-----------
    trunk/grub2/commands/parttool.c
    trunk/grub2/include/grub/parttool.h
    trunk/grub2/parttool/
    trunk/grub2/parttool/pcpart.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/ChangeLog       2009-04-06 09:51:01 UTC (rev 2068)
@@ -1,3 +1,25 @@
+2009-04-06  Vladimir Serbinenko  <address@hidden>
+       
+       Parttool
+
+       * parttool/pcpart.c: new file
+       * commands/parttool.c: likewise
+       * conf/common.rmk (pkglib_MODULES): Added parttool.mod and pcpart.mod
+       (parttool_mod_SOURCES): new variable
+       (parttool_mod_CFLAGS): likewise
+       (parttool_mod_LDFLAGS): likewise
+       (pcpart_mod_SOURCES): likewise
+       (pcpart_mod_CFLAGS): likewise
+       (pcpart_mod_LDFLAGS): likewise
+       * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c 
+       and parttool/pcpart.c
+       * conf/i386-efi.rmk: likewise
+       * conf/i386-ieee1275.rmk: likewise
+       * conf/i386-pc.rmk: likewise
+       * conf/powerpc-ieee1275.rmk: likewise
+       * conf/sparc64-ieee1275.rmk: likewise
+       * conf/x86_64-ieee1275.rmk: likewise
+
 2009-04-05  Vladimir Serbinenko  <address@hidden>
 
        Support for mtime and further expandability of dir command

Modified: trunk/grub2/DISTLIST
===================================================================
--- trunk/grub2/DISTLIST        2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/DISTLIST        2009-04-06 09:51:01 UTC (rev 2068)
@@ -59,6 +59,7 @@
 commands/lsmmap.c
 commands/lspci.c
 commands/minicmd.c
+commands/parttool.c
 commands/read.c
 commands/reboot.c
 commands/search.c
@@ -181,6 +182,7 @@
 include/grub/ntfs.h
 include/grub/parser.h
 include/grub/partition.h
+include/grub/parttool.h
 include/grub/pc_partition.h
 include/grub/pci.h
 include/grub/raid.h

Added: trunk/grub2/commands/parttool.c
===================================================================
--- trunk/grub2/commands/parttool.c                             (rev 0)
+++ trunk/grub2/commands/parttool.c     2009-04-06 09:51:01 UTC (rev 2068)
@@ -0,0 +1,263 @@
+/* parttool.c - common dispatcher and parser for partition operations */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2009  Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <grub/types.h>
+#include <grub/misc.h>
+#include <grub/mm.h>
+#include <grub/err.h>
+#include <grub/dl.h>
+#include <grub/normal.h>
+#include <grub/device.h>
+#include <grub/disk.h>
+#include <grub/partition.h>
+#include <grub/parttool.h>
+#include <grub/command.h>
+
+static struct grub_parttool *parts = 0;
+static int curhandle = 0;
+static grub_dl_t mymod;
+
+int 
+grub_parttool_register(const char *part_name, 
+                      const grub_parttool_function_t func,
+                      const struct grub_parttool_argdesc *args)
+{
+  struct grub_parttool *cur;
+  int nargs = 0;
+
+#ifndef GRUB_UTIL
+  if (! parts)
+    grub_dl_ref (mymod);
+#endif
+
+  cur = (struct grub_parttool *) grub_malloc (sizeof (struct grub_parttool));
+  cur->next = parts;
+  cur->name = grub_strdup (part_name);
+  cur->handle = curhandle++;
+  for (nargs = 0; args[nargs].name != 0; nargs++);
+  cur->nargs = nargs;
+  cur->args = (struct grub_parttool_argdesc *) 
+    grub_malloc ((nargs + 1) * sizeof (struct grub_parttool_argdesc));
+  grub_memcpy (cur->args, args, 
+              (nargs + 1) * sizeof (struct grub_parttool_argdesc));
+  
+  cur->func = func;
+  parts = cur;
+  return cur->handle;
+}
+
+void
+grub_parttool_unregister (int handle)
+{
+  struct grub_parttool *prev = 0, *cur, *t;
+  for (cur = parts; cur; )
+    if (cur->handle == handle)
+      {
+       grub_free (cur->args);
+       grub_free (cur->name);
+       if (prev)
+         prev->next = cur->next;
+       else
+         parts = cur->next;
+       t = cur;
+       cur = cur->next;
+       grub_free (t);
+      }
+    else
+      {
+       prev = cur;
+       cur = cur->next;
+      }
+#ifndef GRUB_UTIL
+  if (! parts)
+    grub_dl_unref (mymod);
+#endif
+}
+
+static grub_err_t
+grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
+                  int argc, char **args)
+{
+  grub_device_t dev;
+  struct grub_parttool *cur, *ptool;
+  int *parsed;
+  int i, j;
+  grub_err_t err = GRUB_ERR_NONE;
+
+  if (argc < 2)
+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments");
+
+  if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')')
+    {
+      args[0][grub_strlen (args[0]) - 1] = 0;
+      dev = grub_device_open (args[0] + 1); 
+      args[0][grub_strlen (args[0]) - 1] = ')';
+    }
+  else
+    dev = grub_device_open (args[0]); 
+
+  if (! dev)
+    return grub_errno;
+
+  if (! dev->disk)
+    {
+      grub_device_close (dev);
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk");
+    }
+
+  if (! dev->disk->partition)
+    {
+      grub_device_close (dev);
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a partition");
+    }
+
+  parsed = (int *) grub_malloc (argc * sizeof (int));
+  grub_memset (parsed, 0, argc * sizeof (int));
+
+  for (i = 1; i < argc; i++)
+    if (!grub_strcmp (args[i], "help"))
+      {
+       int found = 0;
+       for (cur = parts; cur; cur = cur->next)
+         if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name))
+           {
+             struct grub_parttool_argdesc *curarg;
+             found = 1;
+             for (curarg = cur->args; curarg->name; curarg++)
+               {
+                 int spacing = 20;
+               
+                 spacing -= grub_strlen (curarg->name);
+                 grub_printf ("%s", curarg->name);
+
+                 switch (curarg->type)
+                   {
+                   case GRUB_PARTTOOL_ARG_BOOL:
+                     grub_printf ("+/-");
+                     spacing -= 3;
+                     break;
+
+                   case GRUB_PARTTOOL_ARG_VAL:               
+                     grub_printf ("=VAL");
+                     spacing -= 4;
+                     break;
+
+                   case GRUB_PARTTOOL_ARG_END:
+                     break;
+                   }
+                 while (spacing-- > 0)
+                   grub_printf (" ");
+                 grub_printf ("%s\n", curarg->desc);
+               }
+           }
+       if (! found)
+         grub_printf ("Sorry no parttool is available for %s\n", 
+                      dev->disk->partition->partmap->name);
+       return GRUB_ERR_NONE;
+      }
+
+  for (i = 1; i < argc; i++)
+    if (! parsed[i])
+      {
+       struct grub_parttool_argdesc *curarg;
+       struct grub_parttool_args *pargs;
+       for (cur = parts; cur; cur = cur->next)
+         if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name))
+           {
+             for (curarg = cur->args; curarg->name; curarg++)
+               if (!grub_strncmp (curarg->name, args[i], 
+                                  grub_strlen (curarg->name))
+                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL 
+                        && (args[i][grub_strlen (curarg->name)] == '+' 
+                            || args[i][grub_strlen (curarg->name)] == '-'))
+                       || (curarg->type == GRUB_PARTTOOL_ARG_VAL
+                           && args[i][grub_strlen (curarg->name)] == '=')))
+                   
+                 break;
+             if (curarg->name)
+               break;
+           }
+       if (! cur)
+         return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised argument %s",
+                            args[i]);
+       ptool = cur;
+       pargs = (struct grub_parttool_args *) 
+         grub_malloc (ptool->nargs * sizeof (struct grub_parttool_args));
+       grub_memset (pargs, 0, 
+                    ptool->nargs * sizeof (struct grub_parttool_args));
+       for (j = i; j < argc; j++)
+         if (!parsed[j])
+           {
+             for (curarg = ptool->args; curarg->name; curarg++)
+               if (!grub_strncmp (curarg->name, args[i], 
+                                  grub_strlen (curarg->name))
+                   && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL 
+                        && (args[j][grub_strlen (curarg->name)] == '+' 
+                            || args[j][grub_strlen (curarg->name)] == '-'))
+                       || (curarg->type == GRUB_PARTTOOL_ARG_VAL
+                           && args[j][grub_strlen (curarg->name)] == '=')))
+                 {
+                   parsed[j] = 1;
+                   pargs[curarg - ptool->args].set = 1;
+                   switch (curarg->type)
+                     {
+                     case GRUB_PARTTOOL_ARG_BOOL:
+                       pargs[curarg - ptool->args].bool 
+                         = (args[j][grub_strlen (curarg->name)] != '-');
+                       break;
+
+                     case GRUB_PARTTOOL_ARG_VAL:
+                       pargs[curarg - ptool->args].str 
+                         = (args[j] + grub_strlen (curarg->name) + 1);
+                       break;
+                       
+                     case GRUB_PARTTOOL_ARG_END:
+                       break;
+                     }
+                 }
+           }
+
+       err = ptool->func (dev, pargs);
+       grub_free (pargs);
+       if (err)
+         break;
+      }
+
+  grub_device_close (dev);
+  return err;
+}
+
+static grub_command_t cmd;
+
+GRUB_MOD_INIT(parttool)
+{
+  (void)mod;                   /* To stop warning. */
+  mymod = mod;
+  cmd = grub_register_command ("parttool", grub_cmd_parttool, 
+                              "parttool PARTITION COMMANDS", 
+                              "perform COMMANDS on partition."
+                              " use parttool PARTITION help for the list "
+                              " of available commands");
+}
+
+GRUB_MOD_FINI(parttool)
+{
+  grub_unregister_command (cmd);
+}

Modified: trunk/grub2/conf/common.mk
===================================================================
--- trunk/grub2/conf/common.mk  2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/common.mk  2009-04-06 09:51:01 UTC (rev 2068)
@@ -2444,7 +2444,7 @@
         ls.mod cmp.mod cat.mod help.mod search.mod             \
        loopback.mod fs_uuid.mod configfile.mod echo.mod        \
        terminfo.mod test.mod blocklist.mod hexdump.mod         \
-       read.mod sleep.mod loadenv.mod crc.mod
+       read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod
 
 # For minicmd.mod.
 minicmd_mod_SOURCES = commands/minicmd.c
@@ -2636,6 +2636,120 @@
 hello_mod_CFLAGS = $(COMMON_CFLAGS)
 hello_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For parttool.mod.
+parttool_mod_SOURCES = commands/parttool.c
+CLEANFILES += parttool.mod mod-parttool.o mod-parttool.c pre-parttool.o 
parttool_mod-commands_parttool.o und-parttool.lst
+ifneq ($(parttool_mod_EXPORTS),no)
+CLEANFILES += def-parttool.lst
+DEFSYMFILES += def-parttool.lst
+endif
+MOSTLYCLEANFILES += parttool_mod-commands_parttool.d
+UNDSYMFILES += und-parttool.lst
+
+parttool.mod: pre-parttool.o mod-parttool.o $(TARGET_OBJ2ELF)
+       -rm -f $@
+       $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ 
pre-parttool.o mod-parttool.o
+       if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f 
$@; exit 1); fi
+       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K 
_grub_mod_init -K _grub_mod_fini -R .note -R .comment $@
+
+pre-parttool.o: $(parttool_mod_DEPENDENCIES) parttool_mod-commands_parttool.o
+       -rm -f $@
+       $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ 
parttool_mod-commands_parttool.o
+
+mod-parttool.o: mod-parttool.c
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) 
-c -o $@ $<
+
+mod-parttool.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh
+       sh $(srcdir)/genmodsrc.sh 'parttool' $< > $@ || (rm -f $@; exit 1)
+
+ifneq ($(parttool_mod_EXPORTS),no)
+def-parttool.lst: pre-parttool.o
+       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 parttool/' > 
$@
+endif
+
+und-parttool.lst: pre-parttool.o
+       echo 'parttool' > $@
+       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
+
+parttool_mod-commands_parttool.o: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES)
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS)  
$(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -MD -c -o $@ $<
+-include parttool_mod-commands_parttool.d
+
+CLEANFILES += cmd-parttool_mod-commands_parttool.lst 
fs-parttool_mod-commands_parttool.lst partmap-parttool_mod-commands_parttool.lst
+COMMANDFILES += cmd-parttool_mod-commands_parttool.lst
+FSFILES += fs-parttool_mod-commands_parttool.lst
+PARTMAPFILES += partmap-parttool_mod-commands_parttool.lst
+
+cmd-parttool_mod-commands_parttool.lst: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES) gencmdlist.sh
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $<          | sh 
$(srcdir)/gencmdlist.sh parttool > $@ || (rm -f $@; exit 1)
+
+fs-parttool_mod-commands_parttool.lst: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES) genfslist.sh
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $<          | sh 
$(srcdir)/genfslist.sh parttool > $@ || (rm -f $@; exit 1)
+
+partmap-parttool_mod-commands_parttool.lst: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES) genpartmaplist.sh
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $<          | sh 
$(srcdir)/genpartmaplist.sh parttool > $@ || (rm -f $@; exit 1)
+
+
+parttool_mod_CFLAGS = $(COMMON_CFLAGS)
+parttool_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For pcpart.mod.
+pcpart_mod_SOURCES = parttool/pcpart.c
+CLEANFILES += pcpart.mod mod-pcpart.o mod-pcpart.c pre-pcpart.o 
pcpart_mod-parttool_pcpart.o und-pcpart.lst
+ifneq ($(pcpart_mod_EXPORTS),no)
+CLEANFILES += def-pcpart.lst
+DEFSYMFILES += def-pcpart.lst
+endif
+MOSTLYCLEANFILES += pcpart_mod-parttool_pcpart.d
+UNDSYMFILES += und-pcpart.lst
+
+pcpart.mod: pre-pcpart.o mod-pcpart.o $(TARGET_OBJ2ELF)
+       -rm -f $@
+       $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ 
pre-pcpart.o mod-pcpart.o
+       if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f 
$@; exit 1); fi
+       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K 
_grub_mod_init -K _grub_mod_fini -R .note -R .comment $@
+
+pre-pcpart.o: $(pcpart_mod_DEPENDENCIES) pcpart_mod-parttool_pcpart.o
+       -rm -f $@
+       $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ 
pcpart_mod-parttool_pcpart.o
+
+mod-pcpart.o: mod-pcpart.c
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) 
-c -o $@ $<
+
+mod-pcpart.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh
+       sh $(srcdir)/genmodsrc.sh 'pcpart' $< > $@ || (rm -f $@; exit 1)
+
+ifneq ($(pcpart_mod_EXPORTS),no)
+def-pcpart.lst: pre-pcpart.o
+       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pcpart/' > $@
+endif
+
+und-pcpart.lst: pre-pcpart.o
+       echo 'pcpart' > $@
+       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
+
+pcpart_mod-parttool_pcpart.o: parttool/pcpart.c 
$(parttool/pcpart.c_DEPENDENCIES)
+       $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS)  
$(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -MD -c -o $@ $<
+-include pcpart_mod-parttool_pcpart.d
+
+CLEANFILES += cmd-pcpart_mod-parttool_pcpart.lst 
fs-pcpart_mod-parttool_pcpart.lst partmap-pcpart_mod-parttool_pcpart.lst
+COMMANDFILES += cmd-pcpart_mod-parttool_pcpart.lst
+FSFILES += fs-pcpart_mod-parttool_pcpart.lst
+PARTMAPFILES += partmap-pcpart_mod-parttool_pcpart.lst
+
+cmd-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c 
$(parttool/pcpart.c_DEPENDENCIES) gencmdlist.sh
+       set -e;           $(TARGET_CC) -Iparttool -I$(srcdir)/parttool 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $<    | sh 
$(srcdir)/gencmdlist.sh pcpart > $@ || (rm -f $@; exit 1)
+
+fs-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c 
$(parttool/pcpart.c_DEPENDENCIES) genfslist.sh
+       set -e;           $(TARGET_CC) -Iparttool -I$(srcdir)/parttool 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $<    | sh 
$(srcdir)/genfslist.sh pcpart > $@ || (rm -f $@; exit 1)
+
+partmap-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c 
$(parttool/pcpart.c_DEPENDENCIES) genpartmaplist.sh
+       set -e;           $(TARGET_CC) -Iparttool -I$(srcdir)/parttool 
$(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $<    | sh 
$(srcdir)/genpartmaplist.sh pcpart > $@ || (rm -f $@; exit 1)
+
+
+pcpart_mod_CFLAGS = $(COMMON_CFLAGS)
+pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For handler.mod.
 handler_mod_SOURCES = commands/handler.c
 CLEANFILES += handler.mod mod-handler.o mod-handler.c pre-handler.o 
handler_mod-commands_handler.o und-handler.lst

Modified: trunk/grub2/conf/common.rmk
===================================================================
--- trunk/grub2/conf/common.rmk 2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/common.rmk 2009-04-06 09:51:01 UTC (rev 2068)
@@ -335,7 +335,7 @@
         ls.mod cmp.mod cat.mod help.mod search.mod             \
        loopback.mod fs_uuid.mod configfile.mod echo.mod        \
        terminfo.mod test.mod blocklist.mod hexdump.mod         \
-       read.mod sleep.mod loadenv.mod crc.mod
+       read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod
 
 # For minicmd.mod.
 minicmd_mod_SOURCES = commands/minicmd.c
@@ -352,6 +352,16 @@
 hello_mod_CFLAGS = $(COMMON_CFLAGS)
 hello_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For parttool.mod.
+parttool_mod_SOURCES = commands/parttool.c
+parttool_mod_CFLAGS = $(COMMON_CFLAGS)
+parttool_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For pcpart.mod.
+pcpart_mod_SOURCES = parttool/pcpart.c
+pcpart_mod_CFLAGS = $(COMMON_CFLAGS)
+pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For handler.mod.
 handler_mod_SOURCES = commands/handler.c
 handler_mod_CFLAGS = $(COMMON_CFLAGS)

Modified: trunk/grub2/conf/i386-coreboot.mk
===================================================================
--- trunk/grub2/conf/i386-coreboot.mk   2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-coreboot.mk   2009-04-06 09:51:01 UTC (rev 2068)
@@ -238,12 +238,13 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
-CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_emu_init.o
-MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d 
grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d 
grub_emu-commands_test.d grub_emu-commands_search.d 
grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d 
grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d 
grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d 
grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d 
grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d 
grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d 
grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d 
grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d 
grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d 
grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d 
grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d 
grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d 
grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d 
grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d 
grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d 
grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d 
grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d 
grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d 
grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d 
grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d 
grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d 
grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d 
grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d 
grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d 
grub_emu-grub_emu_init.d
+CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o
+MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d 
grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d 
grub_emu-commands_test.d grub_emu-commands_search.d 
grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d 
grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d 
grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d 
grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d 
grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d 
grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d 
grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d 
grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d 
grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d 
grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d 
grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d 
grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d 
grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d 
grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d 
grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d 
grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d 
grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d 
grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d 
grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d 
grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d 
grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d 
grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d 
grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d 
grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d 
grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d
 
-grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_emu_init.o
-       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o 
grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o 
grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS)
+grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o
+       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o 
grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o 
grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o 
grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o 
grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o 
grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o 
grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o 
grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o 
grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o 
grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o 
grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o 
grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o 
grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o 
grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o 
grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS)
 
 grub_emu-commands_minicmd.o: commands/minicmd.c 
$(commands/minicmd.c_DEPENDENCIES)
        $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
@@ -613,6 +614,14 @@
        $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-disk_lvm.d
 
+grub_emu-commands_parttool.o: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES)
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-commands_parttool.d
+
+grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES)
+       $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-parttool_pcpart.d
+
 grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES)
        $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-grub_emu_init.d

Modified: trunk/grub2/conf/i386-coreboot.rmk
===================================================================
--- trunk/grub2/conf/i386-coreboot.rmk  2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-coreboot.rmk  2009-04-06 09:51:01 UTC (rev 2068)
@@ -89,6 +89,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/i386-efi.mk
===================================================================
--- trunk/grub2/conf/i386-efi.mk        2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-efi.mk        2009-04-06 09:51:01 UTC (rev 2068)
@@ -100,6 +100,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/i386-efi.rmk
===================================================================
--- trunk/grub2/conf/i386-efi.rmk       2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-efi.rmk       2009-04-06 09:51:01 UTC (rev 2068)
@@ -67,6 +67,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/i386-pc.mk
===================================================================
--- trunk/grub2/conf/i386-pc.mk 2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-pc.mk 2009-04-06 09:51:01 UTC (rev 2068)
@@ -571,12 +571,13 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
-CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o
-MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d 
grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d 
grub_emu-commands_test.d grub_emu-commands_search.d 
grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d 
grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d 
grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d 
grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d 
grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d 
grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d 
grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d 
grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d 
grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d 
grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d 
grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d 
grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d 
grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d 
grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d 
grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d 
grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d 
grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d 
grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d 
grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d 
grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d 
grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d 
grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d 
grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d 
grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d 
grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d 
grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d
+CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o 
grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o
+MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d 
grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d 
grub_emu-commands_test.d grub_emu-commands_search.d 
grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d 
grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d 
grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d 
grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d 
grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d 
grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d 
grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d 
grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d 
grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d 
grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d 
grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d 
grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d 
grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d 
grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d 
grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d 
grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d 
grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d 
grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d 
grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d 
grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d 
grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d 
grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d 
grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d 
grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d 
grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d 
grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d 
grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d
 
-grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o
-       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o 
grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o 
grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o 
$(LDFLAGS) $(grub_emu_LDFLAGS)
+grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o 
grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o 
grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o
+       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o 
grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o 
grub_emu-commands_test.o grub_emu-commands_search.o 
grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o 
grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o 
grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o 
grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o 
grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o 
grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o 
grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o 
grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o 
grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o 
grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o 
grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o 
grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o 
grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o 
grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o 
grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o 
grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o 
grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o 
grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o 
grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o 
grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o 
grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o $(LDFLAGS) 
$(grub_emu_LDFLAGS)
 
 grub_emu-commands_minicmd.o: commands/minicmd.c 
$(commands/minicmd.c_DEPENDENCIES)
        $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
@@ -958,6 +959,14 @@
        $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-disk_lvm.d
 
+grub_emu-commands_parttool.o: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES)
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-commands_parttool.d
+
+grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES)
+       $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-parttool_pcpart.d
+
 grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES)
        $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-grub_emu_init.d

Modified: trunk/grub2/conf/i386-pc.rmk
===================================================================
--- trunk/grub2/conf/i386-pc.rmk        2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/i386-pc.rmk        2009-04-06 09:51:01 UTC (rev 2068)
@@ -148,6 +148,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES) 

Modified: trunk/grub2/conf/powerpc-ieee1275.mk
===================================================================
--- trunk/grub2/conf/powerpc-ieee1275.mk        2009-04-05 20:19:05 UTC (rev 
2067)
+++ trunk/grub2/conf/powerpc-ieee1275.mk        2009-04-06 09:51:01 UTC (rev 
2068)
@@ -87,12 +87,13 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_script.tab.c grub_emu_init.c
-CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o 
grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
-MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d 
grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d 
grub_emu-commands_ls.d grub_emu-commands_blocklist.d 
grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d 
grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d 
grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d 
grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d 
grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d 
grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d 
grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d 
grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d 
grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d 
grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d 
grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d 
grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d 
grub_emu-normal_command.d grub_emu-normal_datetime.d 
grub_emu-normal_completion.d grub_emu-normal_execute.d 
grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d 
grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d 
grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d 
grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d 
grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d 
grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d 
grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d 
grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d 
grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d 
grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d
+CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o 
grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
+MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d 
grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d 
grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d 
grub_emu-commands_ls.d grub_emu-commands_blocklist.d 
grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d 
grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d 
grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d 
grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d 
grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d 
grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d 
grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d 
grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d 
grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d 
grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d 
grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d 
grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d 
grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d 
grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d 
grub_emu-normal_command.d grub_emu-normal_datetime.d 
grub_emu-normal_completion.d grub_emu-normal_execute.d 
grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d 
grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d 
grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d 
grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d 
grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d 
grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d 
grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d 
grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d 
grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d 
grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d 
grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d 
grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d
 
-grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o 
grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
-       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o 
grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o 
grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) 
$(grub_emu_LDFLAGS)
+grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o 
grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o 
grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o 
grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
+       $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o 
grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o 
grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o 
grub_emu-commands_ls.o grub_emu-commands_blocklist.o 
grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o 
grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o 
grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o 
grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o 
grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o 
grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o 
grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o 
grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o 
grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o 
grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o 
grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o 
grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o 
grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o 
grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o 
grub_emu-normal_command.o grub_emu-normal_datetime.o 
grub_emu-normal_completion.o grub_emu-normal_execute.o 
grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o 
grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o 
grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o 
grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o 
grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o 
grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o 
grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o 
grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o 
grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o 
grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o 
grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o 
grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) 
$(grub_emu_LDFLAGS)
 
 grub_emu-commands_minicmd.o: commands/minicmd.c 
$(commands/minicmd.c_DEPENDENCIES)
        $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
@@ -450,6 +451,14 @@
        $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-disk_lvm.d
 
+grub_emu-commands_parttool.o: commands/parttool.c 
$(commands/parttool.c_DEPENDENCIES)
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-commands_parttool.d
+
+grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES)
+       $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) 
-DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $<
+-include grub_emu-parttool_pcpart.d
+
 grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES)
        $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 
$(grub_emu_CFLAGS) -MD -c -o $@ $<
 -include grub_emu-grub_script_tab.d

Modified: trunk/grub2/conf/powerpc-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/powerpc-ieee1275.rmk       2009-04-05 20:19:05 UTC (rev 
2067)
+++ trunk/grub2/conf/powerpc-ieee1275.rmk       2009-04-06 09:51:01 UTC (rev 
2068)
@@ -72,6 +72,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_script.tab.c grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/sparc64-ieee1275.mk
===================================================================
--- trunk/grub2/conf/sparc64-ieee1275.mk        2009-04-05 20:19:05 UTC (rev 
2067)
+++ trunk/grub2/conf/sparc64-ieee1275.mk        2009-04-06 09:51:01 UTC (rev 
2068)
@@ -67,6 +67,7 @@
 #      partmap/acorn.c                                                 \
 #      util/console.c util/grub-emu.c util/misc.c                      \
 #      util/hostdisk.c util/getroot.c                                  \
+#      commands/parttool.c parttool/pcpart.c                           \
 #      util/sparc64/ieee1275/misc.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/sparc64-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/sparc64-ieee1275.rmk       2009-04-05 20:19:05 UTC (rev 
2067)
+++ trunk/grub2/conf/sparc64-ieee1275.rmk       2009-04-06 09:51:01 UTC (rev 
2068)
@@ -66,6 +66,7 @@
 #      partmap/acorn.c                                                 \
 #      util/console.c util/grub-emu.c util/misc.c                      \
 #      util/hostdisk.c util/getroot.c                                  \
+#      commands/parttool.c parttool/pcpart.c                           \
 #      util/sparc64/ieee1275/misc.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/x86_64-efi.mk
===================================================================
--- trunk/grub2/conf/x86_64-efi.mk      2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/x86_64-efi.mk      2009-04-06 09:51:01 UTC (rev 2068)
@@ -88,6 +88,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/x86_64-efi.rmk
===================================================================
--- trunk/grub2/conf/x86_64-efi.rmk     2009-04-05 20:19:05 UTC (rev 2067)
+++ trunk/grub2/conf/x86_64-efi.rmk     2009-04-06 09:51:01 UTC (rev 2068)
@@ -69,6 +69,7 @@
        \
        disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
        disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
+       commands/parttool.c parttool/pcpart.c                           \
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Added: trunk/grub2/include/grub/parttool.h
===================================================================
--- trunk/grub2/include/grub/parttool.h                         (rev 0)
+++ trunk/grub2/include/grub/parttool.h 2009-04-06 09:51:01 UTC (rev 2068)
@@ -0,0 +1,58 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2009  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_PARTTOOL_HEADER
+#define GRUB_PARTTOOL_HEADER   1
+
+struct grub_parttool_argdesc
+{
+  char *name;
+  char *desc;
+  enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} 
+    type;
+};
+
+struct grub_parttool_args
+{
+  int set;
+  union
+  {
+    int bool;
+    char *str;
+  };
+};
+
+typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, 
+                                               const struct grub_parttool_args 
*args);
+
+struct grub_parttool
+{
+  struct grub_parttool *next;
+  char *name;
+  int handle;
+  int nargs;
+  struct grub_parttool_argdesc *args;
+  grub_parttool_function_t func;
+};
+
+int grub_parttool_register(const char *part_name, 
+                          const grub_parttool_function_t func,
+                          const struct grub_parttool_argdesc *args);
+void grub_parttool_unregister (int handle);
+
+#endif /* ! GRUB_PARTTOOL_HEADER*/

Added: trunk/grub2/parttool/pcpart.c
===================================================================
--- trunk/grub2/parttool/pcpart.c                               (rev 0)
+++ trunk/grub2/parttool/pcpart.c       2009-04-06 09:51:01 UTC (rev 2068)
@@ -0,0 +1,152 @@
+/* pcpart.c - manipulate fdisk partitions */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2009  Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <grub/types.h>
+#include <grub/misc.h>
+#include <grub/mm.h>
+#include <grub/err.h>
+#include <grub/pc_partition.h>
+#include <grub/device.h>
+#include <grub/disk.h>
+#include <grub/partition.h>
+#include <grub/parttool.h>
+
+static int activate_table_handle = -1;
+static int type_table_handle = -1;
+
+static struct grub_parttool_argdesc grub_pcpart_bootargs[] =
+{
+  {"boot", "Make partition active", GRUB_PARTTOOL_ARG_BOOL},
+  {0, 0, 0}
+};
+
+static grub_err_t grub_pcpart_boot (const grub_device_t dev, 
+                                   const struct grub_parttool_args *args)
+{
+  int i, index;
+  grub_partition_t part;
+  struct grub_pc_partition_mbr mbr;
+
+  if (dev->disk->partition->offset)
+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a primary partition");
+
+  index = dev->disk->partition->index;
+  part = dev->disk->partition;
+  dev->disk->partition = 0;
+
+  /* Read the MBR.  */
+  if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr))
+    {
+      dev->disk->partition = part;
+      return grub_errno;
+    }
+
+  if (args[0].set && args[0].bool)
+    {
+      for (i = 0; i < 4; i++)
+       mbr.entries[i].flag = 0x0;
+      mbr.entries[index].flag = 0x80;
+    }
+  else
+    mbr.entries[index].flag = 0x0;
+
+   /* Write the MBR.  */
+  grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr);
+
+  dev->disk->partition = part;
+
+  return GRUB_ERR_NONE;
+}
+
+static struct grub_parttool_argdesc grub_pcpart_typeargs[] =
+{
+  {"type", "Change partition type", GRUB_PARTTOOL_ARG_VAL},
+  {"hidden", "Make partition hidden", GRUB_PARTTOOL_ARG_BOOL},
+  {0, 0, 0}
+};
+
+static grub_err_t grub_pcpart_type (const grub_device_t dev, 
+                                   const struct grub_parttool_args *args)
+{
+  int index;
+  grub_uint8_t type;
+  grub_partition_t part;
+  struct grub_pc_partition_mbr mbr;
+
+  index = dev->disk->partition->index;
+  part = dev->disk->partition;
+  dev->disk->partition = 0;
+
+  /* Read the parttable.  */
+  if (grub_disk_read (dev->disk, part->offset, 0, 
+                     sizeof (mbr), (char *) &mbr))
+    {
+      dev->disk->partition = part;
+      return grub_errno;
+    }
+
+  if (args[0].set)
+    type = grub_strtoul (args[0].str, 0, 0);
+  else
+    type = mbr.entries[index].type;
+
+  if (args[1].set)
+    {
+      if (args[1].bool)
+       type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
+      else
+       type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
+    }
+
+  if (grub_pc_partition_is_empty (type) 
+      || grub_pc_partition_is_extended (type))
+    {
+      dev->disk->partition = part;
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid type");
+    }
+
+  mbr.entries[index].type = type;
+
+   /* Write the parttable.  */
+  grub_disk_write (dev->disk, part->offset, 0, 
+                  sizeof (mbr), (char *) &mbr);
+
+  dev->disk->partition = part;
+
+  return GRUB_ERR_NONE;
+}
+
+GRUB_MOD_INIT (pcpart)
+{
+  (void)mod;                   /* To stop warning. */
+
+  activate_table_handle = grub_parttool_register ("pc_partition_map", 
+                                                 grub_pcpart_boot,
+                                                 grub_pcpart_bootargs);
+  type_table_handle = grub_parttool_register ("pc_partition_map", 
+                                             grub_pcpart_type,
+                                             grub_pcpart_typeargs);
+ 
+}
+GRUB_MOD_FINI(pcpart)
+{
+  grub_parttool_unregister (activate_table_handle);
+  grub_parttool_unregister (type_table_handle);
+}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]