commit-grub
[Top][All Lists]
Advanced

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

[2513] 2009-08-23 Robert Millan <address@hidden>


From: Robert Millan
Subject: [2513] 2009-08-23 Robert Millan <address@hidden>
Date: Sun, 23 Aug 2009 12:00:58 +0000

Revision: 2513
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2513
Author:   robertmh
Date:     2009-08-23 12:00:57 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
2009-08-23  Robert Millan  <address@hidden>

        * partmap/pc.c: Rename to ...
        * partmap/msdos.c: ... this.  Update all users.
        (grub_pc_partition_map): Rename to ...
        (grub_msdos_partition_map): ... this.  Update all users.

        * parttool/pcpart.c: Rename to ...
        * parttool/msdospart.c: ... this.  Update all users.

        * include/grub/pc_partition.h: Rename to ...
        * include/grub/msdos_partition.h: ... this.  Update all users.
        (grub_pc_partition_bsd_entry): Rename to ...
        (grub_msdos_partition_bsd_entry): ... this.  Update all users.
        (grub_pc_partition_disk_label): Rename to ...
        (grub_msdos_partition_disk_label): ... this.  Update all users.
        (grub_pc_partition_entry): Rename to ...
        (grub_msdos_partition_entry): ... this.  Update all users.
        (grub_pc_partition_mbr): Rename to ...
        (grub_msdos_partition_mbr): ... this.  Update all users.
        (grub_pc_partition): Rename to ...
        (grub_msdos_partition): ... this.  Update all users.
        (grub_pc_partition_is_empty): Rename to ...
        (grub_msdos_partition_is_empty): ... this.  Update all users.
        (grub_pc_partition_is_extended): Rename to ...
        (grub_msdos_partition_is_extended): ... this.  Update all users.
        (grub_pc_partition_is_bsd): Rename to ...
        (grub_msdos_partition_is_bsd): ... this.  Update all users.

        * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS)
        (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS)
        (apple_mod_LDFLAGS, msdos_mod_SOURCES, msdos_mod_CFLAGS)
        (msdos_mod_LDFLAGS, sun_mod_SOURCES, sun_mod_CFLAGS)
        (sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS)
        (acorn_mod_LDFLAGS, gpt_mod_SOURCES, gpt_mod_CFLAGS)
        (gpt_mod_LDFLAGS): Rename to ...
        (part_amiga_mod_SOURCES, part_amiga_mod_CFLAGS, part_amiga_mod_LDFLAGS)
        (part_apple_mod_SOURCES, part_apple_mod_CFLAGS, part_apple_mod_LDFLAGS)
        (part_msdos_mod_SOURCES, part_msdos_mod_CFLAGS, part_msdos_mod_LDFLAGS)
        (part_sun_mod_SOURCES, part_sun_mod_CFLAGS, part_sun_mod_LDFLAGS)
        (part_acorn_mod_SOURCES, part_acorn_mod_CFLAGS, part_acorn_mod_LDFLAGS)
        (part_gpt_mod_SOURCES, part_gpt_mod_CFLAGS)
        (part_gpt_mod_LDFLAGS): ... this.
        (pkglib_MODULES): Prefix partition modules with `part_'.  Rename
        `pcpart.mod' to `msdospart.mod'.
        (pcpart_mod_SOURCES, pcpart_mod_CFLAGS, pcpart_mod_LDFLAGS): Rename
        to ...
        (msdospart_mod_SOURCES, msdospart_mod_CFLAGS)
        (msdospart_mod_LDFLAGS): ... this.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/gptsync.c
    trunk/grub2/conf/common.rmk
    trunk/grub2/conf/i386-coreboot.rmk
    trunk/grub2/conf/i386-efi.rmk
    trunk/grub2/conf/i386-ieee1275.rmk
    trunk/grub2/conf/i386-pc.rmk
    trunk/grub2/conf/powerpc-ieee1275.rmk
    trunk/grub2/conf/sparc64-ieee1275.rmk
    trunk/grub2/conf/x86_64-efi.rmk
    trunk/grub2/include/grub/partition.h
    trunk/grub2/partmap/gpt.c
    trunk/grub2/util/grub-probe.c
    trunk/grub2/util/hostdisk.c
    trunk/grub2/util/i386/pc/grub-setup.c
    trunk/grub2/util/sparc64/ieee1275/grub-setup.c

Added Paths:
-----------
    trunk/grub2/include/grub/msdos_partition.h
    trunk/grub2/partmap/msdos.c
    trunk/grub2/parttool/msdospart.c

Removed Paths:
-------------
    trunk/grub2/include/grub/pc_partition.h
    trunk/grub2/partmap/pc.c
    trunk/grub2/parttool/pcpart.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/ChangeLog       2009-08-23 12:00:57 UTC (rev 2513)
@@ -1,3 +1,53 @@
+2009-08-23  Robert Millan  <address@hidden>
+
+       * partmap/pc.c: Rename to ...
+       * partmap/msdos.c: ... this.  Update all users.
+       (grub_pc_partition_map): Rename to ...
+       (grub_msdos_partition_map): ... this.  Update all users.
+
+       * parttool/pcpart.c: Rename to ...
+       * parttool/msdospart.c: ... this.  Update all users.
+
+       * include/grub/pc_partition.h: Rename to ...
+       * include/grub/msdos_partition.h: ... this.  Update all users.
+       (grub_pc_partition_bsd_entry): Rename to ...
+       (grub_msdos_partition_bsd_entry): ... this.  Update all users.
+       (grub_pc_partition_disk_label): Rename to ...
+       (grub_msdos_partition_disk_label): ... this.  Update all users.
+       (grub_pc_partition_entry): Rename to ...
+       (grub_msdos_partition_entry): ... this.  Update all users.
+       (grub_pc_partition_mbr): Rename to ...
+       (grub_msdos_partition_mbr): ... this.  Update all users.
+       (grub_pc_partition): Rename to ...
+       (grub_msdos_partition): ... this.  Update all users.
+       (grub_pc_partition_is_empty): Rename to ...
+       (grub_msdos_partition_is_empty): ... this.  Update all users.
+       (grub_pc_partition_is_extended): Rename to ...
+       (grub_msdos_partition_is_extended): ... this.  Update all users.
+       (grub_pc_partition_is_bsd): Rename to ...
+       (grub_msdos_partition_is_bsd): ... this.  Update all users.
+
+       * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS)
+       (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS)
+       (apple_mod_LDFLAGS, msdos_mod_SOURCES, msdos_mod_CFLAGS)
+       (msdos_mod_LDFLAGS, sun_mod_SOURCES, sun_mod_CFLAGS)
+       (sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS)
+       (acorn_mod_LDFLAGS, gpt_mod_SOURCES, gpt_mod_CFLAGS)
+       (gpt_mod_LDFLAGS): Rename to ...
+       (part_amiga_mod_SOURCES, part_amiga_mod_CFLAGS, part_amiga_mod_LDFLAGS)
+       (part_apple_mod_SOURCES, part_apple_mod_CFLAGS, part_apple_mod_LDFLAGS)
+       (part_msdos_mod_SOURCES, part_msdos_mod_CFLAGS, part_msdos_mod_LDFLAGS)
+       (part_sun_mod_SOURCES, part_sun_mod_CFLAGS, part_sun_mod_LDFLAGS)
+       (part_acorn_mod_SOURCES, part_acorn_mod_CFLAGS, part_acorn_mod_LDFLAGS)
+       (part_gpt_mod_SOURCES, part_gpt_mod_CFLAGS)
+       (part_gpt_mod_LDFLAGS): ... this.
+       (pkglib_MODULES): Prefix partition modules with `part_'.  Rename
+       `pcpart.mod' to `msdospart.mod'.
+       (pcpart_mod_SOURCES, pcpart_mod_CFLAGS, pcpart_mod_LDFLAGS): Rename
+       to ...
+       (msdospart_mod_SOURCES, msdospart_mod_CFLAGS)
+       (msdospart_mod_LDFLAGS): ... this.
+
 2009-08-23  Vladimir Serbinenko  <address@hidden>
 
        * loader/i386/bsd.c (freebsd_opts): Rewritten to use extcmd.

Modified: trunk/grub2/commands/gptsync.c
===================================================================
--- trunk/grub2/commands/gptsync.c      2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/commands/gptsync.c      2009-08-23 12:00:57 UTC (rev 2513)
@@ -22,7 +22,7 @@
 #include <grub/dl.h>
 #include <grub/device.h>
 #include <grub/disk.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/partition.h>
 #include <grub/misc.h>
 #include <grub/mm.h>
@@ -60,7 +60,7 @@
                  int argc, char **args)
 {
   grub_device_t dev;
-  struct grub_pc_partition_mbr mbr;
+  struct grub_msdos_partition_mbr mbr;
   struct grub_partition *partition;
   grub_disk_addr_t first_sector;
   int numactive = 0;

Modified: trunk/grub2/conf/common.rmk
===================================================================
--- trunk/grub2/conf/common.rmk 2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/common.rmk 2009-08-23 12:00:57 UTC (rev 2513)
@@ -19,7 +19,7 @@
        fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
        fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c         \
        \
-       partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\
+       partmap/msdos.c partmap/apple.c partmap/sun.c partmap/gpt.c\
        kern/fs.c kern/env.c fs/fshelp.c                        \
        disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c
 
@@ -40,7 +40,7 @@
        fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c                  \
        fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c                 
\
        \
-       kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c     \
+       kern/partition.c partmap/msdos.c partmap/apple.c partmap/sun.c  \
        partmap/gpt.c                                                   \
        kern/fs.c kern/env.c fs/fshelp.c disk/raid.c                    \
        disk/raid5_recover.c disk/raid6_recover.c                       \
@@ -285,37 +285,36 @@
 befs_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Partition maps.
-pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod
 
-# For amiga.mod
-amiga_mod_SOURCES = partmap/amiga.c
-amiga_mod_CFLAGS = $(COMMON_CFLAGS)
-amiga_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_amiga.mod
+part_amiga_mod_SOURCES = partmap/amiga.c
+part_amiga_mod_CFLAGS = $(COMMON_CFLAGS)
+part_amiga_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For apple.mod
-apple_mod_SOURCES = partmap/apple.c
-apple_mod_CFLAGS = $(COMMON_CFLAGS)
-apple_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_apple.mod
+part_apple_mod_SOURCES = partmap/apple.c
+part_apple_mod_CFLAGS = $(COMMON_CFLAGS)
+part_apple_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For pc.mod
-pc_mod_SOURCES = partmap/pc.c
-pc_mod_CFLAGS = $(COMMON_CFLAGS)
-pc_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_msdos.mod
+part_msdos_mod_SOURCES = partmap/msdos.c
+part_msdos_mod_CFLAGS = $(COMMON_CFLAGS)
+part_msdos_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For sun.mod
-sun_mod_SOURCES = partmap/sun.c
-sun_mod_CFLAGS = $(COMMON_CFLAGS)
-sun_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_sun.mod
+part_sun_mod_SOURCES = partmap/sun.c
+part_sun_mod_CFLAGS = $(COMMON_CFLAGS)
+part_sun_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For acorn.mod
-acorn_mod_SOURCES = partmap/acorn.c
-acorn_mod_CFLAGS = $(COMMON_CFLAGS)
-acorn_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_acorn.mod
+part_acorn_mod_SOURCES = partmap/acorn.c
+part_acorn_mod_CFLAGS = $(COMMON_CFLAGS)
+part_acorn_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For gpt.mod
-gpt_mod_SOURCES = partmap/gpt.c
-gpt_mod_CFLAGS = $(COMMON_CFLAGS)
-gpt_mod_LDFLAGS = $(COMMON_LDFLAGS)
+pkglib_MODULES += part_gpt.mod
+part_gpt_mod_SOURCES = partmap/gpt.c
+part_gpt_mod_CFLAGS = $(COMMON_CFLAGS)
+part_gpt_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Special disk structures and generic drivers
 
@@ -363,7 +362,7 @@
        fs_file.mod fs_uuid.mod configfile.mod echo.mod         \
        terminfo.mod test.mod blocklist.mod hexdump.mod         \
        read.mod sleep.mod loadenv.mod crc.mod parttool.mod     \
-       pcpart.mod memrw.mod normal.mod sh.mod lua.mod  \
+       msdospart.mod memrw.mod normal.mod sh.mod lua.mod       \
        gptsync.mod true.mod probe.mod
 
 # For gptsync.mod.
@@ -391,10 +390,10 @@
 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 msdospart.mod.
+msdospart_mod_SOURCES = parttool/msdospart.c
+msdospart_mod_CFLAGS = $(COMMON_CFLAGS)
+msdospart_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For handler.mod.
 handler_mod_SOURCES = commands/handler.c

Modified: trunk/grub2/conf/i386-coreboot.rmk
===================================================================
--- trunk/grub2/conf/i386-coreboot.rmk  2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/i386-coreboot.rmk  2009-08-23 12:00:57 UTC (rev 2513)
@@ -32,7 +32,7 @@
        symlist.c
 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        machine/boot.h machine/console.h machine/init.h \
        machine/memory.h machine/loader.h list.h handler.h command.h
 kernel_img_CFLAGS = $(COMMON_CFLAGS)
@@ -75,7 +75,7 @@
        symlist.c
 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        machine/boot.h machine/console.h machine/init.h \
        machine/memory.h machine/loader.h list.h handler.h command.h
 kernel_img_CFLAGS = $(COMMON_CFLAGS) 
-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
@@ -134,14 +134,14 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c grub_script.tab.c          \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c partmap/gpt.c                                   \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \
        \
        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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/i386-efi.rmk
===================================================================
--- trunk/grub2/conf/i386-efi.rmk       2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/i386-efi.rmk       2009-08-23 12:00:57 UTC (rev 2513)
@@ -23,7 +23,7 @@
 #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c        \
 #      util/misc.c util/getroot.c kern/device.c kern/disk.c    \
 #      kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c    \
-#      fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c            \
+#      fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c         \
 #      fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c 
kern/file.c        \
 #      kern/fs.c kern/env.c fs/fshelp.c
 
@@ -61,14 +61,14 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c grub_script.tab.c          \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c partmap/gpt.c                                   \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \
        \
        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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)
@@ -100,7 +100,7 @@
        kern/generic/millisleep.c
 kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h
 kernel_mod_CFLAGS = $(COMMON_CFLAGS)
 kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)

Modified: trunk/grub2/conf/i386-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/i386-ieee1275.rmk  2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/i386-ieee1275.rmk  2009-08-23 12:00:57 UTC (rev 2513)
@@ -31,7 +31,7 @@
        symlist.c
 kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \
        list.h handler.h command.h
 kernel_img_CFLAGS = $(COMMON_CFLAGS)
@@ -88,7 +88,7 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c grub_script.tab.c          \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c partmap/gpt.c                                   \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \

Modified: trunk/grub2/conf/i386-pc.rmk
===================================================================
--- trunk/grub2/conf/i386-pc.rmk        2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/i386-pc.rmk        2009-08-23 12:00:57 UTC (rev 2513)
@@ -61,7 +61,7 @@
        symlist.c
 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
        machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \
        machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h
@@ -104,7 +104,7 @@
        fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
        fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c                 
\
        \
-       partmap/pc.c partmap/gpt.c                              \
+       partmap/msdos.c partmap/gpt.c                           \
        \
        disk/raid.c disk/mdraid_linux.c disk/lvm.c              \
        util/raid.c util/lvm.c                                  \
@@ -140,7 +140,7 @@
        normal/menu_text.c                                              \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c grub_script.tab.c          \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c partmap/gpt.c                                   \
        \
        fs/affs.c fs/cpio.c  fs/fat.c fs/ext2.c fs/hfs.c                \
@@ -153,7 +153,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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/powerpc-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/powerpc-ieee1275.rmk       2009-08-23 11:46:25 UTC (rev 
2512)
+++ trunk/grub2/conf/powerpc-ieee1275.rmk       2009-08-23 12:00:57 UTC (rev 
2513)
@@ -16,7 +16,7 @@
 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
        symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
-       pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
+       msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h 
\
        command.h
 
 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h 
gensymlist.sh
@@ -69,14 +69,14 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c                            \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c                                                 \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \
        \
        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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_script.tab.c grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)

Modified: trunk/grub2/conf/sparc64-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/sparc64-ieee1275.rmk       2009-08-23 11:46:25 UTC (rev 
2512)
+++ trunk/grub2/conf/sparc64-ieee1275.rmk       2009-08-23 12:00:57 UTC (rev 
2513)
@@ -28,7 +28,7 @@
 
 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        list.h handler.h command.h \
        sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \
        sparc64/ieee1275/ieee1275.h
@@ -80,7 +80,7 @@
        fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
        fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c                 
\
        \
-       partmap/amiga.c partmap/apple.c partmap/pc.c            \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c         \
        partmap/sun.c partmap/acorn.c                           \
        \
        disk/raid.c disk/mdraid_linux.c disk/lvm.c              \
@@ -126,14 +126,14 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c                            \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c                                                 \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \
        \
        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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_script.tab.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-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/conf/x86_64-efi.rmk     2009-08-23 12:00:57 UTC (rev 2513)
@@ -22,7 +22,7 @@
 #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c        \
 #      util/misc.c util/getroot.c kern/device.c kern/disk.c    \
 #      kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c    \
-#      fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c            \
+#      fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c         \
 #      fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c 
kern/file.c        \
 #      kern/fs.c kern/env.c fs/fshelp.c
 
@@ -58,14 +58,14 @@
        normal/color.c                                                  \
        script/sh/main.c script/sh/execute.c script/sh/function.c       \
        script/sh/lexer.c script/sh/script.c grub_script.tab.c          \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
+       partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c   \
        partmap/acorn.c partmap/gpt.c                                   \
        util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
        util/hostdisk.c util/getroot.c                                  \
        \
        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                           \
+       commands/parttool.c parttool/msdospart.c                                
\
        grub_emu_init.c
 
 grub_emu_LDFLAGS = $(LIBCURSES)
@@ -97,7 +97,7 @@
        term/efi/console.c disk/efi/efidisk.c
 kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
-       partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
+       partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
        efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \
        handler.h command.h
 kernel_mod_CFLAGS = $(COMMON_CFLAGS)

Copied: trunk/grub2/include/grub/msdos_partition.h (from rev 2511, 
trunk/grub2/include/grub/pc_partition.h)
===================================================================
--- trunk/grub2/include/grub/msdos_partition.h                          (rev 0)
+++ trunk/grub2/include/grub/msdos_partition.h  2009-08-23 12:00:57 UTC (rev 
2513)
@@ -0,0 +1,211 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 1999,2000,2001,2002,2004,2007  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_PC_PARTITION_HEADER
+#define GRUB_PC_PARTITION_HEADER       1
+
+#include <grub/symbol.h>
+#include <grub/types.h>
+#include <grub/err.h>
+
+/* The signature.  */
+#define GRUB_PC_PARTITION_SIGNATURE            0xaa55
+
+/* This is not a flag actually, but used as if it were a flag.  */
+#define GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG     0x10
+
+/* DOS partition types.  */
+#define GRUB_PC_PARTITION_TYPE_NONE            0
+#define GRUB_PC_PARTITION_TYPE_FAT12           1
+#define GRUB_PC_PARTITION_TYPE_FAT16_LT32M     4
+#define GRUB_PC_PARTITION_TYPE_EXTENDED                5
+#define GRUB_PC_PARTITION_TYPE_FAT16_GT32M     6
+#define GRUB_PC_PARTITION_TYPE_NTFS            7
+#define GRUB_PC_PARTITION_TYPE_FAT32           0xb
+#define GRUB_PC_PARTITION_TYPE_FAT32_LBA       0xc
+#define GRUB_PC_PARTITION_TYPE_FAT16_LBA       0xe
+#define GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED  0xf
+#define GRUB_PC_PARTITION_TYPE_EZD             0x55
+#define GRUB_PC_PARTITION_TYPE_MINIX           0x80
+#define GRUB_PC_PARTITION_TYPE_LINUX_MINIX     0x81
+#define GRUB_PC_PARTITION_TYPE_EXT2FS          0x83
+#define GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED  0x85
+#define GRUB_PC_PARTITION_TYPE_VSTAFS          0x9e
+#define GRUB_PC_PARTITION_TYPE_FREEBSD         0xa5
+#define GRUB_PC_PARTITION_TYPE_OPENBSD         0xa6
+#define GRUB_PC_PARTITION_TYPE_NETBSD          0xa9
+#define GRUB_PC_PARTITION_TYPE_HFS             0xaf
+#define GRUB_PC_PARTITION_TYPE_GPT_DISK                0xee
+#define GRUB_PC_PARTITION_TYPE_LINUX_RAID      0xfd
+
+/* Constants for BSD disk label.  */
+#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR     1
+#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC      0x82564557
+#define GRUB_PC_PARTITION_BSD_MAX_ENTRIES      8
+
+/* BSD partition types.  */
+#define GRUB_PC_PARTITION_BSD_TYPE_UNUSED      0
+#define GRUB_PC_PARTITION_BSD_TYPE_SWAP                1
+#define GRUB_PC_PARTITION_BSD_TYPE_V6          2
+#define GRUB_PC_PARTITION_BSD_TYPE_V7          3
+#define GRUB_PC_PARTITION_BSD_TYPE_SYSV                4
+#define GRUB_PC_PARTITION_BSD_TYPE_V71K                5
+#define GRUB_PC_PARTITION_BSD_TYPE_V8          6
+#define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS      7
+#define GRUB_PC_PARTITION_BSD_TYPE_MSDOS       8
+#define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS      9
+#define GRUB_PC_PARTITION_BSD_TYPE_OTHER       10
+#define GRUB_PC_PARTITION_BSD_TYPE_HPFS                11
+#define GRUB_PC_PARTITION_BSD_TYPE_ISO9660     12
+#define GRUB_PC_PARTITION_BSD_TYPE_BOOT                13
+
+/* FreeBSD-specific types.  */
+#define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM   14
+#define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID    15
+#define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2    21
+
+/* NetBSD-specific types.  */
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_ADOS      14
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_HFS       15
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE  16
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS    17
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_NTFS      18
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_RAID      19
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_CCD       20
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_JFS2      21
+#define        GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS  22
+
+/* OpenBSD-specific types.  */
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS     14
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_HFS      15
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS   17
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS     18
+#define        GRUB_PC_PARTITION_OPENBSD_TYPE_RAID     19
+
+/* The BSD partition entry.  */
+struct grub_msdos_partition_bsd_entry
+{
+  grub_uint32_t size;
+  grub_uint32_t offset;
+  grub_uint32_t fragment_size;
+  grub_uint8_t fs_type;
+  grub_uint8_t fs_fragments;
+  grub_uint16_t fs_cylinders;
+} __attribute__ ((packed));
+
+/* The BSD disk label. Only define members useful for GRUB.  */
+struct grub_msdos_partition_disk_label
+{
+  grub_uint32_t magic;
+  grub_uint8_t padding[128];
+  grub_uint32_t magic2;
+  grub_uint16_t checksum;
+  grub_uint16_t num_partitions;
+  grub_uint32_t boot_size;
+  grub_uint32_t superblock_size;
+  struct grub_msdos_partition_bsd_entry 
entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES];
+} __attribute__ ((packed));
+
+/* The partition entry.  */
+struct grub_msdos_partition_entry
+{
+  /* If active, 0x80, otherwise, 0x00.  */
+  grub_uint8_t flag;
+
+  /* The head of the start.  */
+  grub_uint8_t start_head;
+
+  /* (S | ((C >> 2) & 0xC0)) where S is the sector of the start and C
+     is the cylinder of the start. Note that S is counted from one.  */
+  grub_uint8_t start_sector;
+
+  /* (C & 0xFF) where C is the cylinder of the start.  */
+  grub_uint8_t start_cylinder;
+
+  /* The partition type.  */
+  grub_uint8_t type;
+
+  /* The end versions of start_head, start_sector and start_cylinder,
+     respectively.  */
+  grub_uint8_t end_head;
+  grub_uint8_t end_sector;
+  grub_uint8_t end_cylinder;
+
+  /* The start sector. Note that this is counted from zero.  */
+  grub_uint32_t start;
+
+  /* The length in sector units.  */
+  grub_uint32_t length;
+} __attribute__ ((packed));
+
+/* The structure of MBR.  */
+struct grub_msdos_partition_mbr
+{
+  /* The code area (actually, including BPB).  */
+  grub_uint8_t code[446];
+
+  /* Four partition entries.  */
+  struct grub_msdos_partition_entry entries[4];
+
+  /* The signature 0xaa55.  */
+  grub_uint16_t signature;
+} __attribute__ ((packed));
+
+
+struct grub_msdos_partition
+{
+    /* The DOS partition number.  */
+  int dos_part;
+
+  /* The BSD partition number (a == 0).  */
+  int bsd_part;
+
+  /* The DOS partition type.  */
+  int dos_type;
+
+  /* The BSD partition type.  */
+  int bsd_type;
+
+  /* The offset of the extended partition.  */
+  unsigned long ext_offset;
+};
+
+static inline int
+grub_msdos_partition_is_empty (int type)
+{
+  return (type == GRUB_PC_PARTITION_TYPE_NONE);
+}
+
+static inline int
+grub_msdos_partition_is_extended (int type)
+{
+  return (type == GRUB_PC_PARTITION_TYPE_EXTENDED
+         || type == GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED
+         || type == GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED);
+}
+
+static inline int
+grub_msdos_partition_is_bsd (int type)
+{
+  return (type == GRUB_PC_PARTITION_TYPE_FREEBSD
+         || type == GRUB_PC_PARTITION_TYPE_OPENBSD
+         || type == GRUB_PC_PARTITION_TYPE_NETBSD);
+}
+
+#endif /* ! GRUB_PC_PARTITION_HEADER */


Property changes on: trunk/grub2/include/grub/msdos_partition.h
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.3
Added: svn:mime-type
   + text/x-chdr
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
Added: svn:eol-style
   + native

Modified: trunk/grub2/include/grub/partition.h
===================================================================
--- trunk/grub2/include/grub/partition.h        2009-08-23 11:46:25 UTC (rev 
2512)
+++ trunk/grub2/include/grub/partition.h        2009-08-23 12:00:57 UTC (rev 
2513)
@@ -84,8 +84,8 @@
 void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap);
 
 #ifdef GRUB_UTIL
-void grub_pc_partition_map_init (void);
-void grub_pc_partition_map_fini (void);
+void grub_msdos_partition_map_init (void);
+void grub_msdos_partition_map_fini (void);
 void grub_amiga_partition_map_init (void);
 void grub_amiga_partition_map_fini (void);
 void grub_apple_partition_map_init (void);

Deleted: trunk/grub2/include/grub/pc_partition.h
===================================================================
--- trunk/grub2/include/grub/pc_partition.h     2009-08-23 11:46:25 UTC (rev 
2512)
+++ trunk/grub2/include/grub/pc_partition.h     2009-08-23 12:00:57 UTC (rev 
2513)
@@ -1,211 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999,2000,2001,2002,2004,2007  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_PC_PARTITION_HEADER
-#define GRUB_PC_PARTITION_HEADER       1
-
-#include <grub/symbol.h>
-#include <grub/types.h>
-#include <grub/err.h>
-
-/* The signature.  */
-#define GRUB_PC_PARTITION_SIGNATURE            0xaa55
-
-/* This is not a flag actually, but used as if it were a flag.  */
-#define GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG     0x10
-
-/* DOS partition types.  */
-#define GRUB_PC_PARTITION_TYPE_NONE            0
-#define GRUB_PC_PARTITION_TYPE_FAT12           1
-#define GRUB_PC_PARTITION_TYPE_FAT16_LT32M     4
-#define GRUB_PC_PARTITION_TYPE_EXTENDED                5
-#define GRUB_PC_PARTITION_TYPE_FAT16_GT32M     6
-#define GRUB_PC_PARTITION_TYPE_NTFS            7
-#define GRUB_PC_PARTITION_TYPE_FAT32           0xb
-#define GRUB_PC_PARTITION_TYPE_FAT32_LBA       0xc
-#define GRUB_PC_PARTITION_TYPE_FAT16_LBA       0xe
-#define GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED  0xf
-#define GRUB_PC_PARTITION_TYPE_EZD             0x55
-#define GRUB_PC_PARTITION_TYPE_MINIX           0x80
-#define GRUB_PC_PARTITION_TYPE_LINUX_MINIX     0x81
-#define GRUB_PC_PARTITION_TYPE_EXT2FS          0x83
-#define GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED  0x85
-#define GRUB_PC_PARTITION_TYPE_VSTAFS          0x9e
-#define GRUB_PC_PARTITION_TYPE_FREEBSD         0xa5
-#define GRUB_PC_PARTITION_TYPE_OPENBSD         0xa6
-#define GRUB_PC_PARTITION_TYPE_NETBSD          0xa9
-#define GRUB_PC_PARTITION_TYPE_HFS             0xaf
-#define GRUB_PC_PARTITION_TYPE_GPT_DISK                0xee
-#define GRUB_PC_PARTITION_TYPE_LINUX_RAID      0xfd
-
-/* Constants for BSD disk label.  */
-#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR     1
-#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC      0x82564557
-#define GRUB_PC_PARTITION_BSD_MAX_ENTRIES      8
-
-/* BSD partition types.  */
-#define GRUB_PC_PARTITION_BSD_TYPE_UNUSED      0
-#define GRUB_PC_PARTITION_BSD_TYPE_SWAP                1
-#define GRUB_PC_PARTITION_BSD_TYPE_V6          2
-#define GRUB_PC_PARTITION_BSD_TYPE_V7          3
-#define GRUB_PC_PARTITION_BSD_TYPE_SYSV                4
-#define GRUB_PC_PARTITION_BSD_TYPE_V71K                5
-#define GRUB_PC_PARTITION_BSD_TYPE_V8          6
-#define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS      7
-#define GRUB_PC_PARTITION_BSD_TYPE_MSDOS       8
-#define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS      9
-#define GRUB_PC_PARTITION_BSD_TYPE_OTHER       10
-#define GRUB_PC_PARTITION_BSD_TYPE_HPFS                11
-#define GRUB_PC_PARTITION_BSD_TYPE_ISO9660     12
-#define GRUB_PC_PARTITION_BSD_TYPE_BOOT                13
-
-/* FreeBSD-specific types.  */
-#define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM   14
-#define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID    15
-#define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2    21
-
-/* NetBSD-specific types.  */
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_ADOS      14
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_HFS       15
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE  16
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS    17
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_NTFS      18
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_RAID      19
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_CCD       20
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_JFS2      21
-#define        GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS  22
-
-/* OpenBSD-specific types.  */
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS     14
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_HFS      15
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS   17
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS     18
-#define        GRUB_PC_PARTITION_OPENBSD_TYPE_RAID     19
-
-/* The BSD partition entry.  */
-struct grub_pc_partition_bsd_entry
-{
-  grub_uint32_t size;
-  grub_uint32_t offset;
-  grub_uint32_t fragment_size;
-  grub_uint8_t fs_type;
-  grub_uint8_t fs_fragments;
-  grub_uint16_t fs_cylinders;
-} __attribute__ ((packed));
-
-/* The BSD disk label. Only define members useful for GRUB.  */
-struct grub_pc_partition_disk_label
-{
-  grub_uint32_t magic;
-  grub_uint8_t padding[128];
-  grub_uint32_t magic2;
-  grub_uint16_t checksum;
-  grub_uint16_t num_partitions;
-  grub_uint32_t boot_size;
-  grub_uint32_t superblock_size;
-  struct grub_pc_partition_bsd_entry 
entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES];
-} __attribute__ ((packed));
-
-/* The partition entry.  */
-struct grub_pc_partition_entry
-{
-  /* If active, 0x80, otherwise, 0x00.  */
-  grub_uint8_t flag;
-
-  /* The head of the start.  */
-  grub_uint8_t start_head;
-
-  /* (S | ((C >> 2) & 0xC0)) where S is the sector of the start and C
-     is the cylinder of the start. Note that S is counted from one.  */
-  grub_uint8_t start_sector;
-
-  /* (C & 0xFF) where C is the cylinder of the start.  */
-  grub_uint8_t start_cylinder;
-
-  /* The partition type.  */
-  grub_uint8_t type;
-
-  /* The end versions of start_head, start_sector and start_cylinder,
-     respectively.  */
-  grub_uint8_t end_head;
-  grub_uint8_t end_sector;
-  grub_uint8_t end_cylinder;
-
-  /* The start sector. Note that this is counted from zero.  */
-  grub_uint32_t start;
-
-  /* The length in sector units.  */
-  grub_uint32_t length;
-} __attribute__ ((packed));
-
-/* The structure of MBR.  */
-struct grub_pc_partition_mbr
-{
-  /* The code area (actually, including BPB).  */
-  grub_uint8_t code[446];
-
-  /* Four partition entries.  */
-  struct grub_pc_partition_entry entries[4];
-
-  /* The signature 0xaa55.  */
-  grub_uint16_t signature;
-} __attribute__ ((packed));
-
-
-struct grub_pc_partition
-{
-    /* The DOS partition number.  */
-  int dos_part;
-
-  /* The BSD partition number (a == 0).  */
-  int bsd_part;
-
-  /* The DOS partition type.  */
-  int dos_type;
-
-  /* The BSD partition type.  */
-  int bsd_type;
-
-  /* The offset of the extended partition.  */
-  unsigned long ext_offset;
-};
-
-static inline int
-grub_pc_partition_is_empty (int type)
-{
-  return (type == GRUB_PC_PARTITION_TYPE_NONE);
-}
-
-static inline int
-grub_pc_partition_is_extended (int type)
-{
-  return (type == GRUB_PC_PARTITION_TYPE_EXTENDED
-         || type == GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED
-         || type == GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED);
-}
-
-static inline int
-grub_pc_partition_is_bsd (int type)
-{
-  return (type == GRUB_PC_PARTITION_TYPE_FREEBSD
-         || type == GRUB_PC_PARTITION_TYPE_OPENBSD
-         || type == GRUB_PC_PARTITION_TYPE_NETBSD);
-}
-
-#endif /* ! GRUB_PC_PARTITION_HEADER */

Modified: trunk/grub2/partmap/gpt.c
===================================================================
--- trunk/grub2/partmap/gpt.c   2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/partmap/gpt.c   2009-08-23 12:00:57 UTC (rev 2513)
@@ -22,7 +22,7 @@
 #include <grub/mm.h>
 #include <grub/partition.h>
 #include <grub/dl.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/gpt_partition.h>
 
 static grub_uint8_t grub_gpt_magic[8] =
@@ -45,7 +45,7 @@
   struct grub_gpt_header gpt;
   struct grub_gpt_partentry entry;
   struct grub_disk raw;
-  struct grub_pc_partition_mbr mbr;
+  struct grub_msdos_partition_mbr mbr;
   grub_uint64_t entries;
   unsigned int i;
   int last_offset = 0;

Copied: trunk/grub2/partmap/msdos.c (from rev 2511, trunk/grub2/partmap/pc.c)
===================================================================
--- trunk/grub2/partmap/msdos.c                         (rev 0)
+++ trunk/grub2/partmap/msdos.c 2009-08-23 12:00:57 UTC (rev 2513)
@@ -0,0 +1,320 @@
+/* pc.c - Read PC style partition tables.  */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2002,2004,2005,2006,2007,2008,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/>.
+ */
+
+#include <grub/partition.h>
+#include <grub/msdos_partition.h>
+#include <grub/disk.h>
+#include <grub/mm.h>
+#include <grub/misc.h>
+#include <grub/dl.h>
+
+static struct grub_partition_map grub_msdos_partition_map;
+
+
+/* Parse the partition representation in STR and return a partition.  */
+static grub_partition_t
+grub_partition_parse (const char *str)
+{
+  grub_partition_t p;
+  struct grub_msdos_partition *pcdata;
+
+  char *s = (char *) str;
+
+  p = (grub_partition_t) grub_malloc (sizeof (*p));
+  if (! p)
+    return 0;
+
+  pcdata = (struct grub_msdos_partition *) grub_malloc (sizeof (*pcdata));
+  if (! pcdata)
+    goto fail;
+
+  p->data = pcdata;
+  p->partmap = &grub_msdos_partition_map;
+
+  /* Initialize some of the fields with invalid values.  */
+  pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1;
+
+  /* Get the DOS partition number. The number is counted from one for
+     the user interface, and from zero internally.  */
+  pcdata->dos_part = grub_strtoul (s, &s, 0) - 1;
+
+  if (grub_errno)
+    {
+      /* Not found. Maybe only a BSD label is specified.  */
+      pcdata->dos_part = -1;
+      grub_errno = GRUB_ERR_NONE;
+    }
+  else if (*s == ',')
+    s++;
+
+  if (*s)
+    {
+      if (*s >= 'a' && *s <= 'h')
+       {
+         pcdata->bsd_part = *s - 'a';
+         s++;
+       }
+
+      if (*s)
+       goto fail;
+    }
+
+  if (pcdata->dos_part == -1 && pcdata->bsd_part == -1)
+    goto fail;
+
+  return p;
+
+ fail:
+  grub_free (p);
+  grub_free (pcdata);
+  grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
+  return 0;
+}
+
+static grub_err_t
+pc_partition_map_iterate (grub_disk_t disk,
+                         int (*hook) (grub_disk_t disk,
+                                      const grub_partition_t partition))
+{
+  struct grub_partition p;
+  struct grub_msdos_partition pcdata;
+  struct grub_msdos_partition_mbr mbr;
+  struct grub_msdos_partition_disk_label label;
+  struct grub_disk raw;
+
+  /* Enforce raw disk access.  */
+  raw = *disk;
+  raw.partition = 0;
+
+  p.offset = 0;
+  pcdata.ext_offset = 0;
+  pcdata.dos_part = -1;
+  p.data = &pcdata;
+  p.partmap = &grub_msdos_partition_map;
+
+  while (1)
+    {
+      int i;
+      struct grub_msdos_partition_entry *e;
+
+      /* Read the MBR.  */
+      if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr))
+       goto finish;
+
+      /* Check if it is valid.  */
+      if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
+       return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
+
+      for (i = 0; i < 4; i++)
+       if (mbr.entries[i].flag & 0x7f)
+         return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");
+
+      /* Analyze DOS partitions.  */
+      for (p.index = 0; p.index < 4; p.index++)
+       {
+         e = mbr.entries + p.index;
+
+         p.start = p.offset + grub_le_to_cpu32 (e->start);
+         p.len = grub_le_to_cpu32 (e->length);
+         pcdata.bsd_part = -1;
+         pcdata.dos_type = e->type;
+         pcdata.bsd_type = -1;
+
+         grub_dprintf ("partition",
+                       "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 
0x%llx\n",
+                       p.index, e->flag, pcdata.dos_type,
+                       (unsigned long long) p.start,
+                       (unsigned long long) p.len);
+
+         /* If this is a GPT partition, this MBR is just a dummy.  */
+         if (e->type == GRUB_PC_PARTITION_TYPE_GPT_DISK && p.index == 0)
+           return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr");
+
+         /* If this partition is a normal one, call the hook.  */
+         if (! grub_msdos_partition_is_empty (e->type)
+             && ! grub_msdos_partition_is_extended (e->type))
+           {
+             pcdata.dos_part++;
+
+             if (hook (disk, &p))
+               return 1;
+
+             /* Check if this is a BSD partition.  */
+             if (grub_msdos_partition_is_bsd (e->type))
+               {
+                 /* Check if the BSD label is within the DOS partition.  */
+                 if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR)
+                   {
+                     grub_dprintf ("partition", "no space for disk label\n");
+                     continue;
+                   }
+                 /* Read the BSD label.  */
+                 if (grub_disk_read (&raw,
+                                     (p.start
+                                      + GRUB_PC_PARTITION_BSD_LABEL_SECTOR),
+                                     0,
+                                     sizeof (label),
+                                     &label))
+                   goto finish;
+
+                 /* Check if it is valid.  */
+                 if (label.magic
+                     != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC))
+                   {
+                     grub_dprintf ("partition",
+                                   "invalid disk label magic 0x%x on partition 
%d\n",
+                                   label.magic, p.index);
+                     continue;
+                   }
+                 for (pcdata.bsd_part = 0;
+                      pcdata.bsd_part < grub_cpu_to_le16 
(label.num_partitions);
+                      pcdata.bsd_part++)
+                   {
+                     struct grub_msdos_partition_bsd_entry *be
+                       = label.entries + pcdata.bsd_part;
+
+                     p.start = grub_le_to_cpu32 (be->offset);
+                     p.len = grub_le_to_cpu32 (be->size);
+                     pcdata.bsd_type = be->fs_type;
+
+                     if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED)
+                       if (hook (disk, &p))
+                         return 1;
+                   }
+               }
+           }
+         else if (pcdata.dos_part < 4)
+           /* If this partition is a logical one, shouldn't increase the
+              partition number.  */
+           pcdata.dos_part++;
+       }
+
+      /* Find an extended partition.  */
+      for (i = 0; i < 4; i++)
+       {
+         e = mbr.entries + i;
+
+         if (grub_msdos_partition_is_extended (e->type))
+           {
+             p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start);
+             if (! pcdata.ext_offset)
+               pcdata.ext_offset = p.offset;
+
+             break;
+           }
+       }
+
+      /* If no extended partition, the end.  */
+      if (i == 4)
+       break;
+    }
+
+ finish:
+  return grub_errno;
+}
+
+
+static grub_partition_t
+pc_partition_map_probe (grub_disk_t disk, const char *str)
+{
+  grub_partition_t p;
+  struct grub_msdos_partition *pcdata;
+
+  auto int find_func (grub_disk_t d, const grub_partition_t partition);
+
+  int find_func (grub_disk_t d __attribute__ ((unused)),
+                const grub_partition_t partition)
+    {
+      struct grub_msdos_partition *partdata = partition->data;
+
+      if ((pcdata->dos_part == partdata->dos_part || pcdata->dos_part == -1)
+         && pcdata->bsd_part == partdata->bsd_part)
+       {
+         grub_memcpy (p, partition, sizeof (*p));
+         p->data = pcdata;
+         grub_memcpy (pcdata, partdata, sizeof (*pcdata));
+         return 1;
+       }
+
+      return 0;
+    }
+
+  p = grub_partition_parse (str);
+  if (! p)
+    return 0;
+
+  pcdata = p->data;
+  pc_partition_map_iterate (disk, find_func);
+  if (grub_errno)
+    goto fail;
+
+  if (p->index < 0)
+    {
+      grub_error (GRUB_ERR_BAD_DEVICE, "no such partition");
+      goto fail;
+    }
+
+  return p;
+
+ fail:
+  grub_free (p);
+  grub_free (pcdata);
+  return 0;
+}
+
+
+static char *
+pc_partition_map_get_name (const grub_partition_t p)
+{
+  char *name;
+  struct grub_msdos_partition *pcdata = p->data;
+
+  name = grub_malloc (13);
+  if (! name)
+    return 0;
+
+  if (pcdata->bsd_part < 0)
+    grub_sprintf (name, "%d", pcdata->dos_part + 1);
+  else if (pcdata->dos_part < 0)
+    grub_sprintf (name, "%c", pcdata->bsd_part + 'a');
+  else
+    grub_sprintf (name, "%d,%c", pcdata->dos_part + 1, pcdata->bsd_part + 'a');
+
+  return name;
+}
+
+
+/* Partition map type.  */
+static struct grub_partition_map grub_msdos_partition_map =
+  {
+    .name = "msdos_partition_map",
+    .iterate = pc_partition_map_iterate,
+    .probe = pc_partition_map_probe,
+    .get_name = pc_partition_map_get_name
+  };
+
+GRUB_MOD_INIT(pc_partition_map)
+{
+  grub_partition_map_register (&grub_msdos_partition_map);
+}
+
+GRUB_MOD_FINI(pc_partition_map)
+{
+  grub_partition_map_unregister (&grub_msdos_partition_map);
+}


Property changes on: trunk/grub2/partmap/msdos.c
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.10
Added: svn:mime-type
   + text/x-csrc
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
Added: svn:eol-style
   + native

Deleted: trunk/grub2/partmap/pc.c
===================================================================
--- trunk/grub2/partmap/pc.c    2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/partmap/pc.c    2009-08-23 12:00:57 UTC (rev 2513)
@@ -1,320 +0,0 @@
-/* pc.c - Read PC style partition tables.  */
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2004,2005,2006,2007,2008,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/>.
- */
-
-#include <grub/partition.h>
-#include <grub/pc_partition.h>
-#include <grub/disk.h>
-#include <grub/mm.h>
-#include <grub/misc.h>
-#include <grub/dl.h>
-
-static struct grub_partition_map grub_pc_partition_map;
-
-
-/* Parse the partition representation in STR and return a partition.  */
-static grub_partition_t
-grub_partition_parse (const char *str)
-{
-  grub_partition_t p;
-  struct grub_pc_partition *pcdata;
-
-  char *s = (char *) str;
-
-  p = (grub_partition_t) grub_malloc (sizeof (*p));
-  if (! p)
-    return 0;
-
-  pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata));
-  if (! pcdata)
-    goto fail;
-
-  p->data = pcdata;
-  p->partmap = &grub_pc_partition_map;
-
-  /* Initialize some of the fields with invalid values.  */
-  pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1;
-
-  /* Get the DOS partition number. The number is counted from one for
-     the user interface, and from zero internally.  */
-  pcdata->dos_part = grub_strtoul (s, &s, 0) - 1;
-
-  if (grub_errno)
-    {
-      /* Not found. Maybe only a BSD label is specified.  */
-      pcdata->dos_part = -1;
-      grub_errno = GRUB_ERR_NONE;
-    }
-  else if (*s == ',')
-    s++;
-
-  if (*s)
-    {
-      if (*s >= 'a' && *s <= 'h')
-       {
-         pcdata->bsd_part = *s - 'a';
-         s++;
-       }
-
-      if (*s)
-       goto fail;
-    }
-
-  if (pcdata->dos_part == -1 && pcdata->bsd_part == -1)
-    goto fail;
-
-  return p;
-
- fail:
-  grub_free (p);
-  grub_free (pcdata);
-  grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
-  return 0;
-}
-
-static grub_err_t
-pc_partition_map_iterate (grub_disk_t disk,
-                         int (*hook) (grub_disk_t disk,
-                                      const grub_partition_t partition))
-{
-  struct grub_partition p;
-  struct grub_pc_partition pcdata;
-  struct grub_pc_partition_mbr mbr;
-  struct grub_pc_partition_disk_label label;
-  struct grub_disk raw;
-
-  /* Enforce raw disk access.  */
-  raw = *disk;
-  raw.partition = 0;
-
-  p.offset = 0;
-  pcdata.ext_offset = 0;
-  pcdata.dos_part = -1;
-  p.data = &pcdata;
-  p.partmap = &grub_pc_partition_map;
-
-  while (1)
-    {
-      int i;
-      struct grub_pc_partition_entry *e;
-
-      /* Read the MBR.  */
-      if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr))
-       goto finish;
-
-      /* Check if it is valid.  */
-      if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
-       return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
-
-      for (i = 0; i < 4; i++)
-       if (mbr.entries[i].flag & 0x7f)
-         return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag");
-
-      /* Analyze DOS partitions.  */
-      for (p.index = 0; p.index < 4; p.index++)
-       {
-         e = mbr.entries + p.index;
-
-         p.start = p.offset + grub_le_to_cpu32 (e->start);
-         p.len = grub_le_to_cpu32 (e->length);
-         pcdata.bsd_part = -1;
-         pcdata.dos_type = e->type;
-         pcdata.bsd_type = -1;
-
-         grub_dprintf ("partition",
-                       "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 
0x%llx\n",
-                       p.index, e->flag, pcdata.dos_type,
-                       (unsigned long long) p.start,
-                       (unsigned long long) p.len);
-
-         /* If this is a GPT partition, this MBR is just a dummy.  */
-         if (e->type == GRUB_PC_PARTITION_TYPE_GPT_DISK && p.index == 0)
-           return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr");
-
-         /* If this partition is a normal one, call the hook.  */
-         if (! grub_pc_partition_is_empty (e->type)
-             && ! grub_pc_partition_is_extended (e->type))
-           {
-             pcdata.dos_part++;
-
-             if (hook (disk, &p))
-               return 1;
-
-             /* Check if this is a BSD partition.  */
-             if (grub_pc_partition_is_bsd (e->type))
-               {
-                 /* Check if the BSD label is within the DOS partition.  */
-                 if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR)
-                   {
-                     grub_dprintf ("partition", "no space for disk label\n");
-                     continue;
-                   }
-                 /* Read the BSD label.  */
-                 if (grub_disk_read (&raw,
-                                     (p.start
-                                      + GRUB_PC_PARTITION_BSD_LABEL_SECTOR),
-                                     0,
-                                     sizeof (label),
-                                     &label))
-                   goto finish;
-
-                 /* Check if it is valid.  */
-                 if (label.magic
-                     != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC))
-                   {
-                     grub_dprintf ("partition",
-                                   "invalid disk label magic 0x%x on partition 
%d\n",
-                                   label.magic, p.index);
-                     continue;
-                   }
-                 for (pcdata.bsd_part = 0;
-                      pcdata.bsd_part < grub_cpu_to_le16 
(label.num_partitions);
-                      pcdata.bsd_part++)
-                   {
-                     struct grub_pc_partition_bsd_entry *be
-                       = label.entries + pcdata.bsd_part;
-
-                     p.start = grub_le_to_cpu32 (be->offset);
-                     p.len = grub_le_to_cpu32 (be->size);
-                     pcdata.bsd_type = be->fs_type;
-
-                     if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED)
-                       if (hook (disk, &p))
-                         return 1;
-                   }
-               }
-           }
-         else if (pcdata.dos_part < 4)
-           /* If this partition is a logical one, shouldn't increase the
-              partition number.  */
-           pcdata.dos_part++;
-       }
-
-      /* Find an extended partition.  */
-      for (i = 0; i < 4; i++)
-       {
-         e = mbr.entries + i;
-
-         if (grub_pc_partition_is_extended (e->type))
-           {
-             p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start);
-             if (! pcdata.ext_offset)
-               pcdata.ext_offset = p.offset;
-
-             break;
-           }
-       }
-
-      /* If no extended partition, the end.  */
-      if (i == 4)
-       break;
-    }
-
- finish:
-  return grub_errno;
-}
-
-
-static grub_partition_t
-pc_partition_map_probe (grub_disk_t disk, const char *str)
-{
-  grub_partition_t p;
-  struct grub_pc_partition *pcdata;
-
-  auto int find_func (grub_disk_t d, const grub_partition_t partition);
-
-  int find_func (grub_disk_t d __attribute__ ((unused)),
-                const grub_partition_t partition)
-    {
-      struct grub_pc_partition *partdata = partition->data;
-
-      if ((pcdata->dos_part == partdata->dos_part || pcdata->dos_part == -1)
-         && pcdata->bsd_part == partdata->bsd_part)
-       {
-         grub_memcpy (p, partition, sizeof (*p));
-         p->data = pcdata;
-         grub_memcpy (pcdata, partdata, sizeof (*pcdata));
-         return 1;
-       }
-
-      return 0;
-    }
-
-  p = grub_partition_parse (str);
-  if (! p)
-    return 0;
-
-  pcdata = p->data;
-  pc_partition_map_iterate (disk, find_func);
-  if (grub_errno)
-    goto fail;
-
-  if (p->index < 0)
-    {
-      grub_error (GRUB_ERR_BAD_DEVICE, "no such partition");
-      goto fail;
-    }
-
-  return p;
-
- fail:
-  grub_free (p);
-  grub_free (pcdata);
-  return 0;
-}
-
-
-static char *
-pc_partition_map_get_name (const grub_partition_t p)
-{
-  char *name;
-  struct grub_pc_partition *pcdata = p->data;
-
-  name = grub_malloc (13);
-  if (! name)
-    return 0;
-
-  if (pcdata->bsd_part < 0)
-    grub_sprintf (name, "%d", pcdata->dos_part + 1);
-  else if (pcdata->dos_part < 0)
-    grub_sprintf (name, "%c", pcdata->bsd_part + 'a');
-  else
-    grub_sprintf (name, "%d,%c", pcdata->dos_part + 1, pcdata->bsd_part + 'a');
-
-  return name;
-}
-
-
-/* Partition map type.  */
-static struct grub_partition_map grub_pc_partition_map =
-  {
-    .name = "pc_partition_map",
-    .iterate = pc_partition_map_iterate,
-    .probe = pc_partition_map_probe,
-    .get_name = pc_partition_map_get_name
-  };
-
-GRUB_MOD_INIT(pc_partition_map)
-{
-  grub_partition_map_register (&grub_pc_partition_map);
-}
-
-GRUB_MOD_FINI(pc_partition_map)
-{
-  grub_partition_map_unregister (&grub_pc_partition_map);
-}

Copied: trunk/grub2/parttool/msdospart.c (from rev 2511, 
trunk/grub2/parttool/pcpart.c)
===================================================================
--- trunk/grub2/parttool/msdospart.c                            (rev 0)
+++ trunk/grub2/parttool/msdospart.c    2009-08-23 12:00:57 UTC (rev 2513)
@@ -0,0 +1,155 @@
+/* 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/msdos_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_msdos_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), &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;
+      grub_printf ("Partition %d is active now. \n", index);
+    }
+  else
+    {
+      mbr.entries[index].flag = 0x0;
+      grub_printf ("Cleared active flag on %d. \n", index);
+    }
+
+   /* Write the MBR.  */
+  grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &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_msdos_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), &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_msdos_partition_is_empty (type)
+      || grub_msdos_partition_is_extended (type))
+    {
+      dev->disk->partition = part;
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid type");
+    }
+
+  mbr.entries[index].type = type;
+  grub_printf ("Setting partition type to 0x%x\n", type);
+
+   /* Write the parttable.  */
+  grub_disk_write (dev->disk, part->offset, 0,
+                  sizeof (mbr), &mbr);
+
+  dev->disk->partition = part;
+
+  return GRUB_ERR_NONE;
+}
+
+GRUB_MOD_INIT (pcpart)
+{
+  activate_table_handle = grub_parttool_register ("msdos_partition_map",
+                                                 grub_pcpart_boot,
+                                                 grub_pcpart_bootargs);
+  type_table_handle = grub_parttool_register ("msdos_partition_map",
+                                             grub_pcpart_type,
+                                             grub_pcpart_typeargs);
+
+}
+GRUB_MOD_FINI(pcpart)
+{
+  grub_parttool_unregister (activate_table_handle);
+  grub_parttool_unregister (type_table_handle);
+}


Property changes on: trunk/grub2/parttool/msdospart.c
___________________________________________________________________
Added: svn:mergeinfo
   + 

Deleted: trunk/grub2/parttool/pcpart.c
===================================================================
--- trunk/grub2/parttool/pcpart.c       2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/parttool/pcpart.c       2009-08-23 12:00:57 UTC (rev 2513)
@@ -1,155 +0,0 @@
-/* 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), &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;
-      grub_printf ("Partition %d is active now. \n", index);
-    }
-  else
-    {
-      mbr.entries[index].flag = 0x0;
-      grub_printf ("Cleared active flag on %d. \n", index);
-    }
-
-   /* Write the MBR.  */
-  grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &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), &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;
-  grub_printf ("Setting partition type to 0x%x\n", type);
-
-   /* Write the parttable.  */
-  grub_disk_write (dev->disk, part->offset, 0,
-                  sizeof (mbr), &mbr);
-
-  dev->disk->partition = part;
-
-  return GRUB_ERR_NONE;
-}
-
-GRUB_MOD_INIT (pcpart)
-{
-  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);
-}

Modified: trunk/grub2/util/grub-probe.c
===================================================================
--- trunk/grub2/util/grub-probe.c       2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/util/grub-probe.c       2009-08-23 12:00:57 UTC (rev 2513)
@@ -25,7 +25,7 @@
 #include <grub/file.h>
 #include <grub/fs.h>
 #include <grub/partition.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/util/hostdisk.h>
 #include <grub/util/getroot.h>
 #include <grub/term.h>

Modified: trunk/grub2/util/hostdisk.c
===================================================================
--- trunk/grub2/util/hostdisk.c 2009-08-23 11:46:25 UTC (rev 2512)
+++ trunk/grub2/util/hostdisk.c 2009-08-23 12:00:57 UTC (rev 2513)
@@ -19,7 +19,7 @@
 
 #include <grub/disk.h>
 #include <grub/partition.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/types.h>
 #include <grub/err.h>
 #include <grub/util/misc.h>
@@ -947,9 +947,9 @@
     int find_partition (grub_disk_t disk __attribute__ ((unused)),
                        const grub_partition_t partition)
       {
-       struct grub_pc_partition *pcdata = NULL;
+       struct grub_msdos_partition *pcdata = NULL;
 
-       if (strcmp (partition->partmap->name, "pc_partition_map") == 0)
+       if (strcmp (partition->partmap->name, "msdos_partition_map") == 0)
          pcdata = partition->data;
 
        if (pcdata)

Modified: trunk/grub2/util/i386/pc/grub-setup.c
===================================================================
--- trunk/grub2/util/i386/pc/grub-setup.c       2009-08-23 11:46:25 UTC (rev 
2512)
+++ trunk/grub2/util/i386/pc/grub-setup.c       2009-08-23 12:00:57 UTC (rev 
2513)
@@ -25,7 +25,7 @@
 #include <grub/file.h>
 #include <grub/fs.h>
 #include <grub/partition.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/gpt_partition.h>
 #include <grub/env.h>
 #include <grub/util/hostdisk.h>
@@ -121,14 +121,14 @@
   int NESTED_FUNC_ATTR find_usable_region_msdos (grub_disk_t disk 
__attribute__ ((unused)),
                                                 const grub_partition_t p)
     {
-      struct grub_pc_partition *pcdata = p->data;
+      struct grub_msdos_partition *pcdata = p->data;
 
       /* There's always an embed region, and it starts right after the MBR.  */
       embed_region.start = 1;
 
       /* For its end offset, include as many dummy partitions as we can.  */
-      if (! grub_pc_partition_is_empty (pcdata->dos_type)
-         && ! grub_pc_partition_is_bsd (pcdata->dos_type)
+      if (! grub_msdos_partition_is_empty (pcdata->dos_type)
+         && ! grub_msdos_partition_is_bsd (pcdata->dos_type)
          && embed_region.end > p->start)
        embed_region.end = p->start;
 
@@ -279,9 +279,9 @@
       if (root_dev->disk->partition)
        {
          if (strcmp (root_dev->disk->partition->partmap->name,
-                     "pc_partition_map") == 0)
+                     "msdos_partition_map") == 0)
            {
-             struct grub_pc_partition *pcdata =
+             struct grub_msdos_partition *pcdata =
                root_dev->disk->partition->data;
              dos_part = pcdata->dos_part;
              bsd_part = pcdata->bsd_part;
@@ -338,12 +338,12 @@
       goto unable_to_embed;
     }
 
-  grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, 
"pc_partition_map") ?
+  grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, 
"msdos_partition_map") ?
                                           find_usable_region_gpt : 
find_usable_region_msdos));
 
   if (embed_region.end == embed_region.start)
     {
-      if (! strcmp (dest_partmap, "pc_partition_map"))
+      if (! strcmp (dest_partmap, "msdos_partition_map"))
        grub_util_warn ("This msdos-style partition label has no post-MBR gap; 
embedding won't be possible!");
       else
        grub_util_warn ("This GPT partition label has no BIOS Boot Partition; 
embedding won't be possible!");

Modified: trunk/grub2/util/sparc64/ieee1275/grub-setup.c
===================================================================
--- trunk/grub2/util/sparc64/ieee1275/grub-setup.c      2009-08-23 11:46:25 UTC 
(rev 2512)
+++ trunk/grub2/util/sparc64/ieee1275/grub-setup.c      2009-08-23 12:00:57 UTC 
(rev 2513)
@@ -25,7 +25,7 @@
 #include <grub/file.h>
 #include <grub/fs.h>
 #include <grub/partition.h>
-#include <grub/pc_partition.h>
+#include <grub/msdos_partition.h>
 #include <grub/gpt_partition.h>
 #include <grub/env.h>
 #include <grub/util/hostdisk.h>





reply via email to

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