~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to debian/grub-extras/ntldr-img/utils.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-01-11 11:12:55 UTC
  • mfrom: (17.3.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100111111255-lr8ebkqw5x41gq6j
Tags: 1.98~20100101-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Conflict with grub (<< 0.97-54) as well as grub-legacy.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed. If it is, show the
    menu, otherwise boot immediately. If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt. Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - If the environment variable "quiet" is set to something other than 0,
    suppress progress messages as the kernel and initrd load. Set this for
    non-recovery kernel menu entries.
  - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
    utilities. Provides functionality essentially equivalent to GRUB
    Legacy's savedefault.
  - Keep the loopback file open so that subsequent changes to the "root"
    environment variable don't affect it.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Handle RAID devices containing virtio components.
* Update savedefault patch from current Bazaar branch, fixing grub-reboot
  to have distinct behaviour from grub-set-default (LP: #497326).
* Fix grub-mkisofs compilation error with FORTIFY_SOURCE.
* Convert recordfail boilerplate in each menu entry to use a function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  GRUB Utilities --  Utilities for GRUB Legacy, GRUB2 and GRUB for DOS
3
 
 *  Copyright (C) 2007 Bean (bean123@126.com)
4
 
 *
5
 
 *  This program is free software; you can redistribute it and/or modify
6
 
 *  it under the terms of the GNU General Public License as published by
7
 
 *  the Free Software Foundation; either version 2 of the License, or
8
 
 *  (at your option) any later version.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
 */
19
 
 
20
 
#ifndef __UTILS_H
21
 
#define __UTILS_H
22
 
 
23
 
#if defined(__cplusplus) || defined(c_plusplus)
24
 
extern "C" {
25
 
#endif
26
 
 
27
 
#define MAX_DISKS               10
28
 
#define MAX_PARTS               30
29
 
 
30
 
#define FST_OTHER               0
31
 
#define FST_MBR                 1
32
 
#define FST_FAT16               2
33
 
#define FST_FAT32               3
34
 
#define FST_NTFS                4
35
 
#define FST_EXT2                5
36
 
 
37
 
typedef struct {
38
 
  unsigned char cur;            // Current partition number
39
 
  unsigned char nxt;            // Next partition number
40
 
  unsigned char dfs;            // File system flag
41
 
  unsigned char pad;            // Padding
42
 
  unsigned long bse;            // Partition start address
43
 
  unsigned long len;            // Partition length
44
 
  unsigned long ebs;            // Base address for the extended partition
45
 
} xde_t;
46
 
 
47
 
#define valueat(buf,ofs,type)   *((type*)(((char*)&buf)+ofs))
48
 
 
49
 
extern int mbr_nhd, mbr_spt;
50
 
int go_sect(int,unsigned long);
51
 
int xd_enum(int,xde_t*);
52
 
int get_fstype(unsigned char*);
53
 
char* fst2str(int);
54
 
char* dfs2str(int);
55
 
 
56
 
#if defined(__cplusplus) || defined(c_plusplus)
57
 
}
58
 
#endif
59
 
#endif /* __UTILS_H */
 
1
/*
 
2
 *  GRUB Utilities --  Utilities for GRUB Legacy, GRUB2 and GRUB for DOS
 
3
 *  Copyright (C) 2007 Bean (bean123@126.com)
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 */
 
19
 
 
20
#ifndef __UTILS_H
 
21
#define __UTILS_H
 
22
 
 
23
#if defined(__cplusplus) || defined(c_plusplus)
 
24
extern "C" {
 
25
#endif
 
26
 
 
27
#define MAX_DISKS               10
 
28
#define MAX_PARTS               30
 
29
 
 
30
#define FST_OTHER               0
 
31
#define FST_MBR                 1
 
32
#define FST_FAT16               2
 
33
#define FST_FAT32               3
 
34
#define FST_NTFS                4
 
35
#define FST_EXT2                5
 
36
 
 
37
typedef struct {
 
38
  unsigned char cur;            // Current partition number
 
39
  unsigned char nxt;            // Next partition number
 
40
  unsigned char dfs;            // File system flag
 
41
  unsigned char pad;            // Padding
 
42
  unsigned long bse;            // Partition start address
 
43
  unsigned long len;            // Partition length
 
44
  unsigned long ebs;            // Base address for the extended partition
 
45
} xde_t;
 
46
 
 
47
#define valueat(buf,ofs,type)   *((type*)(((char*)&buf)+ofs))
 
48
 
 
49
extern int mbr_nhd, mbr_spt;
 
50
int go_sect(int,unsigned long);
 
51
int xd_enum(int,xde_t*);
 
52
int get_fstype(unsigned char*);
 
53
char* fst2str(int);
 
54
char* dfs2str(int);
 
55
 
 
56
#if defined(__cplusplus) || defined(c_plusplus)
 
57
}
 
58
#endif
 
59
#endif /* __UTILS_H */