~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to include/grub/msdos_partition.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Robert Millan, Updated translations
  • Date: 2010-11-22 12:24:56 UTC
  • mfrom: (1.26.4 upstream) (17.3.36 sid)
  • mto: (17.3.43 sid)
  • mto: This revision was merged to the branch mainline in revision 89.
  • Revision ID: james.westby@ubuntu.com-20101122122456-y82z3sfb7k4zfdcc
Tags: 1.99~20101122-1
[ Colin Watson ]
* New Bazaar snapshot.  Too many changes to list in full, but some of the
  more user-visible ones are as follows:
  - GRUB script:
    + Function parameters, "break", "continue", "shift", "setparams",
      "return", and "!".
    + "export" command supports multiple variable names.
    + Multi-line quoted strings support.
    + Wildcard expansion.
  - sendkey support.
  - USB hotunplugging and USB serial support.
  - Rename CD-ROM to cd on BIOS.
  - Add new --boot-directory option to grub-install, grub-reboot, and
    grub-set-default; the old --root-directory option is still accepted
    but was often confusing.
  - Basic btrfs detection/UUID support (but no file reading yet).
  - bash-completion for utilities.
  - If a device is listed in device.map, always assume that it is
    BIOS-visible rather than using extra layers such as LVM or RAID.
  - Add grub-mknetdir script (closes: #550658).
  - Remove deprecated "root" command.
  - Handle RAID devices containing virtio components.
  - GRUB Legacy configuration file support (via grub-menulst2cfg).
  - Keyboard layout support (via grub-mklayout and grub-kbdcomp).
  - Check generated grub.cfg for syntax errors before saving.
  - Pause execution for at most ten seconds if any errors are displayed,
    so that the user has a chance to see them.
  - Support submenus.
  - Write embedding zone using Reed-Solomon, so that it's robust against
    being partially overwritten (closes: #550702, #591416, #593347).
  - GRUB_DISABLE_LINUX_RECOVERY and GRUB_DISABLE_NETBSD_RECOVERY merged
    into a single GRUB_DISABLE_RECOVERY variable.
  - Fix loader memory allocation failure (closes: #551627).
  - Don't call savedefault on recovery entries (closes: #589325).
  - Support triple-indirect blocks on ext2 (closes: #543924).
  - Recognise DDF1 fake RAID (closes: #603354).

[ Robert Millan ]
* Use dpkg architecture wildcards.

[ Updated translations ]
* Slovenian (Vanja Cvelbar).  Closes: #604003
* Dzongkha (dawa pemo via Tenzin Dendup).  Closes: #604102

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <grub/symbol.h>
23
23
#include <grub/types.h>
24
24
#include <grub/err.h>
 
25
#include <grub/disk.h>
 
26
#include <grub/partition.h>
25
27
 
26
28
/* The signature.  */
27
29
#define GRUB_PC_PARTITION_SIGNATURE             0xaa55
53
55
#define GRUB_PC_PARTITION_TYPE_GPT_DISK         0xee
54
56
#define GRUB_PC_PARTITION_TYPE_LINUX_RAID       0xfd
55
57
 
56
 
/* Constants for BSD disk label.  */
57
 
#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR      1
58
 
#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC       0x82564557
59
 
#define GRUB_PC_PARTITION_BSD_MAX_ENTRIES       8
60
 
 
61
 
/* BSD partition types.  */
62
 
#define GRUB_PC_PARTITION_BSD_TYPE_UNUSED       0
63
 
#define GRUB_PC_PARTITION_BSD_TYPE_SWAP         1
64
 
#define GRUB_PC_PARTITION_BSD_TYPE_V6           2
65
 
#define GRUB_PC_PARTITION_BSD_TYPE_V7           3
66
 
#define GRUB_PC_PARTITION_BSD_TYPE_SYSV         4
67
 
#define GRUB_PC_PARTITION_BSD_TYPE_V71K         5
68
 
#define GRUB_PC_PARTITION_BSD_TYPE_V8           6
69
 
#define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS       7
70
 
#define GRUB_PC_PARTITION_BSD_TYPE_MSDOS        8
71
 
#define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS       9
72
 
#define GRUB_PC_PARTITION_BSD_TYPE_OTHER        10
73
 
#define GRUB_PC_PARTITION_BSD_TYPE_HPFS         11
74
 
#define GRUB_PC_PARTITION_BSD_TYPE_ISO9660      12
75
 
#define GRUB_PC_PARTITION_BSD_TYPE_BOOT         13
76
 
 
77
 
/* FreeBSD-specific types.  */
78
 
#define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM    14
79
 
#define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID     15
80
 
#define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2     21
81
 
 
82
 
/* NetBSD-specific types.  */
83
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_ADOS      14
84
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_HFS       15
85
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE  16
86
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS    17
87
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_NTFS      18
88
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_RAID      19
89
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_CCD       20
90
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_JFS2      21
91
 
#define GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS  22
92
 
 
93
 
/* OpenBSD-specific types.  */
94
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS     14
95
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_HFS      15
96
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
97
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS   17
98
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS     18
99
 
#define GRUB_PC_PARTITION_OPENBSD_TYPE_RAID     19
100
 
 
101
 
/* The BSD partition entry.  */
102
 
struct grub_msdos_partition_bsd_entry
103
 
{
104
 
  grub_uint32_t size;
105
 
  grub_uint32_t offset;
106
 
  grub_uint32_t fragment_size;
107
 
  grub_uint8_t fs_type;
108
 
  grub_uint8_t fs_fragments;
109
 
  grub_uint16_t fs_cylinders;
110
 
} __attribute__ ((packed));
111
 
 
112
 
/* The BSD disk label. Only define members useful for GRUB.  */
113
 
struct grub_msdos_partition_disk_label
114
 
{
115
 
  grub_uint32_t magic;
116
 
  grub_uint8_t padding[128];
117
 
  grub_uint32_t magic2;
118
 
  grub_uint16_t checksum;
119
 
  grub_uint16_t num_partitions;
120
 
  grub_uint32_t boot_size;
121
 
  grub_uint32_t superblock_size;
122
 
  struct grub_msdos_partition_bsd_entry entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES];
123
 
} __attribute__ ((packed));
124
 
 
125
58
/* The partition entry.  */
126
59
struct grub_msdos_partition_entry
127
60
{
168
101
} __attribute__ ((packed));
169
102
 
170
103
 
171
 
struct grub_msdos_partition
172
 
{
173
 
    /* The DOS partition number.  */
174
 
  int dos_part;
175
 
 
176
 
  /* The BSD partition number (a == 0).  */
177
 
  int bsd_part;
178
 
 
179
 
  /* The DOS partition type.  */
180
 
  int dos_type;
181
 
 
182
 
  /* The BSD partition type.  */
183
 
  int bsd_type;
184
 
 
185
 
  /* The offset of the extended partition.  */
186
 
  unsigned long ext_offset;
187
 
};
188
104
 
189
105
static inline int
190
106
grub_msdos_partition_is_empty (int type)
200
116
          || type == GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED);
201
117
}
202
118
 
203
 
static inline int
204
 
grub_msdos_partition_is_bsd (int type)
205
 
{
206
 
  return (type == GRUB_PC_PARTITION_TYPE_FREEBSD
207
 
          || type == GRUB_PC_PARTITION_TYPE_OPENBSD
208
 
          || type == GRUB_PC_PARTITION_TYPE_NETBSD);
209
 
}
 
119
grub_err_t
 
120
grub_partition_msdos_iterate (grub_disk_t disk,
 
121
                              int (*hook) (grub_disk_t disk,
 
122
                                           const grub_partition_t partition));
210
123
 
211
124
#endif /* ! GRUB_PC_PARTITION_HEADER */