2004-01-18 Yoshinori K. Okuji <okuji@enbug.org>

From Thomas Schwinge <kischde@gmx.net>:
	* grub/Makefile.am (AM_CPPFLAGS): New variable.
	(AM_CFLAGS): Removed all cpp flags.

	* stage2/xfs.h (__int8_t): Renamed to ...
	(xfs_int8_t): ... this.
	(__uint8_t): Renamed to ...
	(xfs_uint8_t): ... this.
	(__int16_t): Renamed to ...
	(xfs_int16_t): ... this.
	(__uint16_t): Renamed to ...
	(xfs_uint16_t): ... this.
	(__int32_t): Renamed to ...
	(xfs_int32_t): ... this.
	(__uint32_t): Renamed to ...
	(xfs_uint32_t): ... this.
	(__int64_t): Renamed to ...
	(xfs_int64_t): ... this.
	(__uint64_t): Renamed to ...
	(xfs_uint64_t): ... this.
	All callers are changed.x

	From Egmont Koblinger <egmont@uhulinux.hu>:
	* util/grub-install.in: Support an install devices in GRUB's
	notation without parentheses.

	* docs/grub.texi (Installing GRUB using grub-install): Added an
	example of using grub-install without parentheses.
This commit is contained in:
okuji 2004-01-18 19:47:18 +00:00
parent 469abceb70
commit dcf4389bde
8 changed files with 171 additions and 129 deletions

View file

@ -1,3 +1,34 @@
2004-01-18 Yoshinori K. Okuji <okuji@enbug.org>
From Thomas Schwinge <kischde@gmx.net>:
* grub/Makefile.am (AM_CPPFLAGS): New variable.
(AM_CFLAGS): Removed all cpp flags.
* stage2/xfs.h (__int8_t): Renamed to ...
(xfs_int8_t): ... this.
(__uint8_t): Renamed to ...
(xfs_uint8_t): ... this.
(__int16_t): Renamed to ...
(xfs_int16_t): ... this.
(__uint16_t): Renamed to ...
(xfs_uint16_t): ... this.
(__int32_t): Renamed to ...
(xfs_int32_t): ... this.
(__uint32_t): Renamed to ...
(xfs_uint32_t): ... this.
(__int64_t): Renamed to ...
(xfs_int64_t): ... this.
(__uint64_t): Renamed to ...
(xfs_uint64_t): ... this.
All callers are changed.x
From Egmont Koblinger <egmont@uhulinux.hu>:
* util/grub-install.in: Support an install devices in GRUB's
notation without parentheses.
* docs/grub.texi (Installing GRUB using grub-install): Added an
example of using grub-install without parentheses.
2004-01-18 Yoshinori K. Okuji <okuji@enbug.org> 2004-01-18 Yoshinori K. Okuji <okuji@enbug.org>
* util/grub-install.in: Use the first word of GRUB_SHELL when * util/grub-install.in: Use the first word of GRUB_SHELL when

2
THANKS
View file

@ -32,6 +32,7 @@ Dennis Kitzman <dennis-kitzman@uiowa.edu>
Derrik Pates <dpates@dsdk12.net> Derrik Pates <dpates@dsdk12.net>
Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk> Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk>
Edward Killips <ekillips@triton.net> Edward Killips <ekillips@triton.net>
Egmont Koblinger <egmont@uhulinux.hu>
Eric Hanchrow <erich@microsoft.com> Eric Hanchrow <erich@microsoft.com>
Erik Schoenfelder <schoenfr@gaertner.de> Erik Schoenfelder <schoenfr@gaertner.de>
Eugene Doudine <dudin@np.nk.nornik.ru> Eugene Doudine <dudin@np.nk.nornik.ru>
@ -100,6 +101,7 @@ Taketo Kabe <kabe@sra-tohoku.co.jp>
Thierry DELHAISE <thierry.delhaise@delhaise.com> Thierry DELHAISE <thierry.delhaise@delhaise.com>
Thierry Laronde <thierry.laronde@polynum.com> Thierry Laronde <thierry.laronde@polynum.com>
Thomas Schweikle <tschweikle@fiducia.de> Thomas Schweikle <tschweikle@fiducia.de>
Thomas Schwinge <kischde@gmx.net>
Tilmann Bubeck <t.bubeck@reinform.de> Tilmann Bubeck <t.bubeck@reinform.de>
Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Torsten Duwe <duwe@caldera.de> Torsten Duwe <duwe@caldera.de>

View file

@ -620,6 +620,12 @@ If it is the first BIOS drive, this is the same as well:
# @kbd{grub-install '(hd0)'} # @kbd{grub-install '(hd0)'}
@end example @end example
Or you can omit the parentheses:
@example
# @kbd{grub-install hd0}
@end example
But all the above examples assume that GRUB should use images under But all the above examples assume that GRUB should use images under
the root directory. If you want GRUB to use images under a directory the root directory. If you want GRUB to use images under a directory
other than the root directory, you need to specify the option other than the root directory, you need to specify the option
@ -630,7 +636,7 @@ boot floppy with a filesystem. Here is an example:
@group @group
# @kbd{mke2fs /dev/fd0} # @kbd{mke2fs /dev/fd0}
# @kbd{mount -t ext2 /dev/fd0 /mnt} # @kbd{mount -t ext2 /dev/fd0 /mnt}
# @kbd{grub-install --root-directory=/mnt '(fd0)'} # @kbd{grub-install --root-directory=/mnt fd0}
# @kbd{umount /mnt} # @kbd{umount /mnt}
@end group @end group
@end example @end example
@ -3419,7 +3425,7 @@ you have a separate @dfn{boot} partition which is mounted on
@file{/boot}: @file{/boot}:
@example @example
@kbd{grub-install --root-directory=/boot '(hd0)'} @kbd{grub-install --root-directory=/boot hd0}
@end example @end example
@item --grub-shell=@var{file} @item --grub-shell=@var{file}

View file

@ -6,11 +6,12 @@ else
SERIAL_FLAGS = -DSUPPORT_SERIAL=1 SERIAL_FLAGS = -DSUPPORT_SERIAL=1
endif endif
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \ AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \ -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
$(SERIAL_FLAGS) \ $(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
-fwritable-strings -I$(top_srcdir)/stage2 \
-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib -I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
AM_CFLAGS = $(GRUB_CFLAGS) -fwritable-strings
grub_SOURCES = main.c asmstub.c grub_SOURCES = main.c asmstub.c
grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)

View file

@ -146,13 +146,14 @@ sbin_PROGRAMS = grub
@SERIAL_SPEED_SIMULATION_TRUE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 -DSIMULATE_SLOWNESS_OF_SERIAL=1 @SERIAL_SPEED_SIMULATION_TRUE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 -DSIMULATE_SLOWNESS_OF_SERIAL=1
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \ AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \ -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
$(SERIAL_FLAGS) \ $(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
-fwritable-strings -I$(top_srcdir)/stage2 \
-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib -I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
AM_CFLAGS = $(GRUB_CFLAGS) -fwritable-strings
grub_SOURCES = main.c asmstub.c grub_SOURCES = main.c asmstub.c
grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)
subdir = grub subdir = grub

View file

@ -1,7 +1,7 @@
/* fsys_xfs.c - an implementation for the SGI XFS file system */ /* fsys_xfs.c - an implementation for the SGI XFS file system */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2001,2002 Free Software Foundation, Inc. * Copyright (C) 2001,2002,2004 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -65,9 +65,9 @@ static struct xfs_info xfs;
#define inode ((xfs_dinode_t *)((char *)FSYS_BUF + 8192)) #define inode ((xfs_dinode_t *)((char *)FSYS_BUF + 8192))
#define icore (inode->di_core) #define icore (inode->di_core)
#define mask32lo(n) (((__uint32_t)1 << (n)) - 1) #define mask32lo(n) (((xfs_uint32_t)1 << (n)) - 1)
#define XFS_INO_MASK(k) ((__uint32_t)((1ULL << (k)) - 1)) #define XFS_INO_MASK(k) ((xfs_uint32_t)((1ULL << (k)) - 1))
#define XFS_INO_OFFSET_BITS xfs.inopblog #define XFS_INO_OFFSET_BITS xfs.inopblog
#define XFS_INO_AGBNO_BITS xfs.agblklog #define XFS_INO_AGBNO_BITS xfs.agblklog
#define XFS_INO_AGINO_BITS (xfs.agblklog + xfs.inopblog) #define XFS_INO_AGINO_BITS (xfs.agblklog + xfs.inopblog)
@ -97,8 +97,8 @@ ino2offset (xfs_ino_t ino)
return ino & XFS_INO_MASK(XFS_INO_OFFSET_BITS); return ino & XFS_INO_MASK(XFS_INO_OFFSET_BITS);
} }
static inline __const__ __uint16_t static inline __const__ xfs_uint16_t
le16 (__uint16_t x) le16 (xfs_uint16_t x)
{ {
__asm__("xchgb %b0,%h0" \ __asm__("xchgb %b0,%h0" \
: "=q" (x) \ : "=q" (x) \
@ -106,8 +106,8 @@ le16 (__uint16_t x)
return x; return x;
} }
static inline __const__ __uint32_t static inline __const__ xfs_uint32_t
le32 (__uint32_t x) le32 (xfs_uint32_t x)
{ {
#if 0 #if 0
/* 386 doesn't have bswap. */ /* 386 doesn't have bswap. */
@ -122,12 +122,12 @@ le32 (__uint32_t x)
return x; return x;
} }
static inline __const__ __uint64_t static inline __const__ xfs_uint64_t
le64 (__uint64_t x) le64 (xfs_uint64_t x)
{ {
__uint32_t h = x >> 32; xfs_uint32_t h = x >> 32;
__uint32_t l = x & ((1ULL<<32)-1); xfs_uint32_t l = x & ((1ULL<<32)-1);
return (((__uint64_t)le32(l)) << 32) | ((__uint64_t)(le32(h))); return (((xfs_uint64_t)le32(l)) << 32) | ((xfs_uint64_t)(le32(h)));
} }
@ -154,7 +154,7 @@ xt_len (xfs_bmbt_rec_32_t *r)
} }
static inline int static inline int
xfs_highbit32(__uint32_t v) xfs_highbit32(xfs_uint32_t v)
{ {
int i; int i;
@ -312,7 +312,7 @@ sf_ino (char *sfe, int namelen)
void *p = sfe + namelen + 3; void *p = sfe + namelen + 3;
return (xfs.i8param == 0) return (xfs.i8param == 0)
? le64(*(xfs_ino_t *)p) : le32(*(__uint32_t *)p); ? le64(*(xfs_ino_t *)p) : le32(*(xfs_uint32_t *)p);
} }
static inline xfs_ino_t static inline xfs_ino_t
@ -320,7 +320,7 @@ sf_parent_ino (void)
{ {
return (xfs.i8param == 0) return (xfs.i8param == 0)
? le64(*(xfs_ino_t *)(&inode->di_u.di_dir2sf.hdr.parent)) ? le64(*(xfs_ino_t *)(&inode->di_u.di_dir2sf.hdr.parent))
: le32(*(__uint32_t *)(&inode->di_u.di_dir2sf.hdr.parent)); : le32(*(xfs_uint32_t *)(&inode->di_u.di_dir2sf.hdr.parent));
} }
static inline int static inline int

View file

@ -2,7 +2,7 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (C) 2001 Free Software Foundation, Inc. * Copyright (C) 2001,2004 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as * under the terms of version 2 of the GNU General Public License as
@ -33,47 +33,45 @@
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/ */
#ifndef _BITS_TYPES_H typedef signed char xfs_int8_t;
typedef signed char __int8_t; typedef unsigned char xfs_uint8_t;
typedef unsigned char __uint8_t; typedef short xfs_int16_t;
typedef short __int16_t; typedef unsigned short xfs_uint16_t;
typedef unsigned short __uint16_t; typedef int xfs_int32_t;
typedef int __int32_t; typedef unsigned int xfs_uint32_t;
typedef unsigned int __uint32_t; typedef long long xfs_int64_t;
typedef long long __int64_t; typedef unsigned long long xfs_uint64_t;
typedef unsigned long long __uint64_t;
#endif
typedef __uint64_t xfs_ino_t; typedef xfs_uint64_t xfs_ino_t;
typedef __uint32_t xfs_agino_t; typedef xfs_uint32_t xfs_agino_t;
typedef __int64_t xfs_daddr_t; typedef xfs_int64_t xfs_daddr_t;
typedef __int64_t xfs_off_t; typedef xfs_int64_t xfs_off_t;
typedef __uint8_t uuid_t[16]; typedef xfs_uint8_t uuid_t[16];
/* those are from xfs_types.h */ /* those are from xfs_types.h */
typedef __uint32_t xfs_agblock_t; /* blockno in alloc. group */ typedef xfs_uint32_t xfs_agblock_t; /* blockno in alloc. group */
typedef __uint32_t xfs_extlen_t; /* extent length in blocks */ typedef xfs_uint32_t xfs_extlen_t; /* extent length in blocks */
typedef __uint32_t xfs_agnumber_t; /* allocation group number */ typedef xfs_uint32_t xfs_agnumber_t; /* allocation group number */
typedef __int32_t xfs_extnum_t; /* # of extents in a file */ typedef xfs_int32_t xfs_extnum_t; /* # of extents in a file */
typedef __int16_t xfs_aextnum_t; /* # extents in an attribute fork */ typedef xfs_int16_t xfs_aextnum_t; /* # extents in an attribute fork */
typedef __int64_t xfs_fsize_t; /* bytes in a file */ typedef xfs_int64_t xfs_fsize_t; /* bytes in a file */
typedef __uint32_t xfs_dablk_t; /* dir/attr block number (in file) */ typedef xfs_uint32_t xfs_dablk_t; /* dir/attr block number (in file) */
typedef __uint32_t xfs_dahash_t; /* dir/attr hash value */ typedef xfs_uint32_t xfs_dahash_t; /* dir/attr hash value */
/* /*
* Disk based types: * Disk based types:
*/ */
typedef __uint64_t xfs_dfsbno_t; /* blockno in filesystem (agno|agbno) */ typedef xfs_uint64_t xfs_dfsbno_t; /* blockno in filesystem (agno|agbno) */
typedef __uint64_t xfs_drfsbno_t; /* blockno in filesystem (raw) */ typedef xfs_uint64_t xfs_drfsbno_t; /* blockno in filesystem (raw) */
typedef __uint64_t xfs_drtbno_t; /* extent (block) in realtime area */ typedef xfs_uint64_t xfs_drtbno_t; /* extent (block) in realtime area */
typedef __uint64_t xfs_dfiloff_t; /* block number in a file */ typedef xfs_uint64_t xfs_dfiloff_t; /* block number in a file */
typedef __uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */ typedef xfs_uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */
typedef __uint64_t xfs_fileoff_t; /* block number in a file */ typedef xfs_uint64_t xfs_fileoff_t; /* block number in a file */
typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ typedef xfs_uint64_t xfs_filblks_t; /* number of blocks in a file */
/* those are from xfs_sb.h */ /* those are from xfs_sb.h */
@ -84,8 +82,8 @@ typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */
typedef struct xfs_sb typedef struct xfs_sb
{ {
__uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */ xfs_uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */
__uint32_t sb_blocksize; /* logical block size, bytes */ xfs_uint32_t sb_blocksize; /* logical block size, bytes */
xfs_drfsbno_t sb_dblocks; /* number of data blocks */ xfs_drfsbno_t sb_dblocks; /* number of data blocks */
xfs_drfsbno_t sb_rblocks; /* number of realtime blocks */ xfs_drfsbno_t sb_rblocks; /* number of realtime blocks */
xfs_drtbno_t sb_rextents; /* number of realtime extents */ xfs_drtbno_t sb_rextents; /* number of realtime extents */
@ -99,42 +97,42 @@ typedef struct xfs_sb
xfs_agnumber_t sb_agcount; /* number of allocation groups */ xfs_agnumber_t sb_agcount; /* number of allocation groups */
xfs_extlen_t sb_rbmblocks; /* number of rt bitmap blocks */ xfs_extlen_t sb_rbmblocks; /* number of rt bitmap blocks */
xfs_extlen_t sb_logblocks; /* number of log blocks */ xfs_extlen_t sb_logblocks; /* number of log blocks */
__uint16_t sb_versionnum; /* header version == XFS_SB_VERSION */ xfs_uint16_t sb_versionnum; /* header version == XFS_SB_VERSION */
__uint16_t sb_sectsize; /* volume sector size, bytes */ xfs_uint16_t sb_sectsize; /* volume sector size, bytes */
__uint16_t sb_inodesize; /* inode size, bytes */ xfs_uint16_t sb_inodesize; /* inode size, bytes */
__uint16_t sb_inopblock; /* inodes per block */ xfs_uint16_t sb_inopblock; /* inodes per block */
char sb_fname[12]; /* file system name */ char sb_fname[12]; /* file system name */
__uint8_t sb_blocklog; /* log2 of sb_blocksize */ xfs_uint8_t sb_blocklog; /* log2 of sb_blocksize */
__uint8_t sb_sectlog; /* log2 of sb_sectsize */ xfs_uint8_t sb_sectlog; /* log2 of sb_sectsize */
__uint8_t sb_inodelog; /* log2 of sb_inodesize */ xfs_uint8_t sb_inodelog; /* log2 of sb_inodesize */
__uint8_t sb_inopblog; /* log2 of sb_inopblock */ xfs_uint8_t sb_inopblog; /* log2 of sb_inopblock */
__uint8_t sb_agblklog; /* log2 of sb_agblocks (rounded up) */ xfs_uint8_t sb_agblklog; /* log2 of sb_agblocks (rounded up) */
__uint8_t sb_rextslog; /* log2 of sb_rextents */ xfs_uint8_t sb_rextslog; /* log2 of sb_rextents */
__uint8_t sb_inprogress; /* mkfs is in progress, don't mount */ xfs_uint8_t sb_inprogress; /* mkfs is in progress, don't mount */
__uint8_t sb_imax_pct; /* max % of fs for inode space */ xfs_uint8_t sb_imax_pct; /* max % of fs for inode space */
/* statistics */ /* statistics */
/* /*
* These fields must remain contiguous. If you really * These fields must remain contiguous. If you really
* want to change their layout, make sure you fix the * want to change their layout, make sure you fix the
* code in xfs_trans_apply_sb_deltas(). * code in xfs_trans_apply_sb_deltas().
*/ */
__uint64_t sb_icount; /* allocated inodes */ xfs_uint64_t sb_icount; /* allocated inodes */
__uint64_t sb_ifree; /* free inodes */ xfs_uint64_t sb_ifree; /* free inodes */
__uint64_t sb_fdblocks; /* free data blocks */ xfs_uint64_t sb_fdblocks; /* free data blocks */
__uint64_t sb_frextents; /* free realtime extents */ xfs_uint64_t sb_frextents; /* free realtime extents */
/* /*
* End contiguous fields. * End contiguous fields.
*/ */
xfs_ino_t sb_uquotino; /* user quota inode */ xfs_ino_t sb_uquotino; /* user quota inode */
xfs_ino_t sb_gquotino; /* group quota inode */ xfs_ino_t sb_gquotino; /* group quota inode */
__uint16_t sb_qflags; /* quota flags */ xfs_uint16_t sb_qflags; /* quota flags */
__uint8_t sb_flags; /* misc. flags */ xfs_uint8_t sb_flags; /* misc. flags */
__uint8_t sb_shared_vn; /* shared version number */ xfs_uint8_t sb_shared_vn; /* shared version number */
xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */ xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
__uint32_t sb_unit; /* stripe or raid unit */ xfs_uint32_t sb_unit; /* stripe or raid unit */
__uint32_t sb_width; /* stripe or raid width */ xfs_uint32_t sb_width; /* stripe or raid width */
__uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */ xfs_uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */
__uint8_t sb_dummy[7]; /* padding */ xfs_uint8_t sb_dummy[7]; /* padding */
} xfs_sb_t; } xfs_sb_t;
@ -145,9 +143,9 @@ typedef struct xfs_sb
*/ */
typedef struct xfs_btree_lblock typedef struct xfs_btree_lblock
{ {
__uint32_t bb_magic; /* magic number for block type */ xfs_uint32_t bb_magic; /* magic number for block type */
__uint16_t bb_level; /* 0 is a leaf */ xfs_uint16_t bb_level; /* 0 is a leaf */
__uint16_t bb_numrecs; /* current # of data records */ xfs_uint16_t bb_numrecs; /* current # of data records */
xfs_dfsbno_t bb_leftsib; /* left sibling block or NULLDFSBNO */ xfs_dfsbno_t bb_leftsib; /* left sibling block or NULLDFSBNO */
xfs_dfsbno_t bb_rightsib; /* right sibling block or NULLDFSBNO */ xfs_dfsbno_t bb_rightsib; /* right sibling block or NULLDFSBNO */
} xfs_btree_lblock_t; } xfs_btree_lblock_t;
@ -157,9 +155,9 @@ typedef struct xfs_btree_lblock
*/ */
typedef struct xfs_btree_hdr typedef struct xfs_btree_hdr
{ {
__uint32_t bb_magic; /* magic number for block type */ xfs_uint32_t bb_magic; /* magic number for block type */
__uint16_t bb_level; /* 0 is a leaf */ xfs_uint16_t bb_level; /* 0 is a leaf */
__uint16_t bb_numrecs; /* current # of data records */ xfs_uint16_t bb_numrecs; /* current # of data records */
} xfs_btree_hdr_t; } xfs_btree_hdr_t;
typedef struct xfs_btree_block typedef struct xfs_btree_block
@ -184,8 +182,8 @@ typedef struct xfs_btree_block
*/ */
typedef struct xfs_bmdr_block typedef struct xfs_bmdr_block
{ {
__uint16_t bb_level; /* 0 is a leaf */ xfs_uint16_t bb_level; /* 0 is a leaf */
__uint16_t bb_numrecs; /* current # of data records */ xfs_uint16_t bb_numrecs; /* current # of data records */
} xfs_bmdr_block_t; } xfs_bmdr_block_t;
/* /*
@ -206,18 +204,18 @@ typedef struct xfs_bmdr_block
typedef struct xfs_bmbt_rec_32 typedef struct xfs_bmbt_rec_32
{ {
__uint32_t l0, l1, l2, l3; xfs_uint32_t l0, l1, l2, l3;
} xfs_bmbt_rec_32_t; } xfs_bmbt_rec_32_t;
typedef struct xfs_bmbt_rec_64 typedef struct xfs_bmbt_rec_64
{ {
__uint64_t l0, l1; xfs_uint64_t l0, l1;
} xfs_bmbt_rec_64_t; } xfs_bmbt_rec_64_t;
#if BMBT_USE_64 #if BMBT_USE_64
typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */ typedef xfs_uint64_t xfs_bmbt_rec_base_t; /* use this for casts */
typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t; typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t;
#else /* !BMBT_USE_64 */ #else /* !BMBT_USE_64 */
typedef __uint32_t xfs_bmbt_rec_base_t; /* use this for casts */ typedef xfs_uint32_t xfs_bmbt_rec_base_t; /* use this for casts */
typedef xfs_bmbt_rec_32_t xfs_bmbt_rec_t, xfs_bmdr_rec_t; typedef xfs_bmbt_rec_32_t xfs_bmbt_rec_t, xfs_bmdr_rec_t;
#endif /* BMBT_USE_64 */ #endif /* BMBT_USE_64 */
@ -253,7 +251,7 @@ typedef struct xfs_btree_lblock xfs_bmbt_block_t;
/* /*
* Byte offset in data block and shortform entry. * Byte offset in data block and shortform entry.
*/ */
typedef __uint16_t xfs_dir2_data_off_t; typedef xfs_uint16_t xfs_dir2_data_off_t;
/* /*
* Byte offset in a directory. * Byte offset in a directory.
@ -277,8 +275,8 @@ typedef xfs_off_t xfs_dir2_off_t;
typedef struct xfs_da_blkinfo { typedef struct xfs_da_blkinfo {
xfs_dablk_t forw; /* previous block in list */ xfs_dablk_t forw; /* previous block in list */
xfs_dablk_t back; /* following block in list */ xfs_dablk_t back; /* following block in list */
__uint16_t magic; /* validity check on block */ xfs_uint16_t magic; /* validity check on block */
__uint16_t pad; /* unused */ xfs_uint16_t pad; /* unused */
} xfs_da_blkinfo_t; } xfs_da_blkinfo_t;
/* /*
@ -294,8 +292,8 @@ typedef struct xfs_da_blkinfo {
typedef struct xfs_da_intnode { typedef struct xfs_da_intnode {
struct xfs_da_node_hdr { /* constant-structure header block */ struct xfs_da_node_hdr { /* constant-structure header block */
xfs_da_blkinfo_t info; /* block type, links, etc. */ xfs_da_blkinfo_t info; /* block type, links, etc. */
__uint16_t count; /* count of active entries */ xfs_uint16_t count; /* count of active entries */
__uint16_t level; /* level above leaves (leaf == 0) */ xfs_uint16_t level; /* level above leaves (leaf == 0) */
} hdr; } hdr;
struct xfs_da_node_entry { struct xfs_da_node_entry {
xfs_dahash_t hashval; /* hash value for this descendant */ xfs_dahash_t hashval; /* hash value for this descendant */
@ -334,7 +332,7 @@ typedef struct xfs_dir2_data_free {
* The code knows that XFS_DIR2_DATA_FD_COUNT is 3. * The code knows that XFS_DIR2_DATA_FD_COUNT is 3.
*/ */
typedef struct xfs_dir2_data_hdr { typedef struct xfs_dir2_data_hdr {
__uint32_t magic; /* XFS_DIR2_DATA_MAGIC */ xfs_uint32_t magic; /* XFS_DIR2_DATA_MAGIC */
/* or XFS_DIR2_BLOCK_MAGIC */ /* or XFS_DIR2_BLOCK_MAGIC */
xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT]; xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT];
} xfs_dir2_data_hdr_t; } xfs_dir2_data_hdr_t;
@ -345,8 +343,8 @@ typedef struct xfs_dir2_data_hdr {
*/ */
typedef struct xfs_dir2_data_entry { typedef struct xfs_dir2_data_entry {
xfs_ino_t inumber; /* inode number */ xfs_ino_t inumber; /* inode number */
__uint8_t namelen; /* name length */ xfs_uint8_t namelen; /* name length */
__uint8_t name[1]; /* name bytes, no null */ xfs_uint8_t name[1]; /* name bytes, no null */
/* variable offset */ /* variable offset */
xfs_dir2_data_off_t tag; /* starting offset of us */ xfs_dir2_data_off_t tag; /* starting offset of us */
} xfs_dir2_data_entry_t; } xfs_dir2_data_entry_t;
@ -356,7 +354,7 @@ typedef struct xfs_dir2_data_entry {
* Tag appears as the last 2 bytes. * Tag appears as the last 2 bytes.
*/ */
typedef struct xfs_dir2_data_unused { typedef struct xfs_dir2_data_unused {
__uint16_t freetag; /* XFS_DIR2_DATA_FREE_TAG */ xfs_uint16_t freetag; /* XFS_DIR2_DATA_FREE_TAG */
xfs_dir2_data_off_t length; /* total free length */ xfs_dir2_data_off_t length; /* total free length */
/* variable offset */ /* variable offset */
xfs_dir2_data_off_t tag; /* starting offset of us */ xfs_dir2_data_off_t tag; /* starting offset of us */
@ -378,8 +376,8 @@ typedef union {
*/ */
typedef struct xfs_dir2_leaf_hdr { typedef struct xfs_dir2_leaf_hdr {
xfs_da_blkinfo_t info; /* header for da routines */ xfs_da_blkinfo_t info; /* header for da routines */
__uint16_t count; /* count of entries */ xfs_uint16_t count; /* count of entries */
__uint16_t stale; /* count of stale entries */ xfs_uint16_t stale; /* count of stale entries */
} xfs_dir2_leaf_hdr_t; } xfs_dir2_leaf_hdr_t;
@ -400,8 +398,8 @@ typedef struct xfs_dir2_leaf_hdr {
#define XFS_DIR2_BLOCK_MAGIC 0x58443242 /* XD2B: for one block dirs */ #define XFS_DIR2_BLOCK_MAGIC 0x58443242 /* XD2B: for one block dirs */
typedef struct xfs_dir2_block_tail { typedef struct xfs_dir2_block_tail {
__uint32_t count; /* count of leaf entries */ xfs_uint32_t count; /* count of leaf entries */
__uint32_t stale; /* count of stale lf entries */ xfs_uint32_t stale; /* count of stale lf entries */
} xfs_dir2_block_tail_t; } xfs_dir2_block_tail_t;
@ -417,14 +415,14 @@ typedef struct xfs_dir2_block_tail {
/* /*
* Inode number stored as 8 8-bit values. * Inode number stored as 8 8-bit values.
*/ */
typedef struct { __uint8_t i[8]; } xfs_dir2_ino8_t; typedef struct { xfs_uint8_t i[8]; } xfs_dir2_ino8_t;
/* /*
* Inode number stored as 4 8-bit values. * Inode number stored as 4 8-bit values.
* Works a lot of the time, when all the inode numbers in a directory * Works a lot of the time, when all the inode numbers in a directory
* fit in 32 bits. * fit in 32 bits.
*/ */
typedef struct { __uint8_t i[4]; } xfs_dir2_ino4_t; typedef struct { xfs_uint8_t i[4]; } xfs_dir2_ino4_t;
typedef union { typedef union {
xfs_dir2_ino8_t i8; xfs_dir2_ino8_t i8;
@ -435,7 +433,7 @@ typedef union {
* Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t. * Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t.
* Only need 16 bits, this is the byte offset into the single block form. * Only need 16 bits, this is the byte offset into the single block form.
*/ */
typedef struct { __uint8_t i[2]; } xfs_dir2_sf_off_t; typedef struct { xfs_uint8_t i[2]; } xfs_dir2_sf_off_t;
/* /*
* The parent directory has a dedicated field, and the self-pointer must * The parent directory has a dedicated field, and the self-pointer must
@ -446,15 +444,15 @@ typedef struct { __uint8_t i[2]; } xfs_dir2_sf_off_t;
* alignment for the inode number fields. * alignment for the inode number fields.
*/ */
typedef struct xfs_dir2_sf_hdr { typedef struct xfs_dir2_sf_hdr {
__uint8_t count; /* count of entries */ xfs_uint8_t count; /* count of entries */
__uint8_t i8count; /* count of 8-byte inode #s */ xfs_uint8_t i8count; /* count of 8-byte inode #s */
xfs_dir2_inou_t parent; /* parent dir inode number */ xfs_dir2_inou_t parent; /* parent dir inode number */
} xfs_dir2_sf_hdr_t; } xfs_dir2_sf_hdr_t;
typedef struct xfs_dir2_sf_entry { typedef struct xfs_dir2_sf_entry {
__uint8_t namelen; /* actual name length */ xfs_uint8_t namelen; /* actual name length */
xfs_dir2_sf_off_t offset; /* saved offset */ xfs_dir2_sf_off_t offset; /* saved offset */
__uint8_t name[1]; /* name, variable size */ xfs_uint8_t name[1]; /* name, variable size */
xfs_dir2_inou_t inumber; /* inode number, var. offset */ xfs_dir2_inou_t inumber; /* inode number, var. offset */
} xfs_dir2_sf_entry_t; } xfs_dir2_sf_entry_t;
@ -476,8 +474,8 @@ typedef struct xfs_dir2_sf {
* because we only need the core part in the in-core inode. * because we only need the core part in the in-core inode.
*/ */
typedef struct xfs_timestamp { typedef struct xfs_timestamp {
__int32_t t_sec; /* timestamp seconds */ xfs_int32_t t_sec; /* timestamp seconds */
__int32_t t_nsec; /* timestamp nanoseconds */ xfs_int32_t t_nsec; /* timestamp nanoseconds */
} xfs_timestamp_t; } xfs_timestamp_t;
/* /*
@ -486,16 +484,16 @@ typedef struct xfs_timestamp {
*/ */
typedef struct xfs_dinode_core typedef struct xfs_dinode_core
{ {
__uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ xfs_uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */
__uint16_t di_mode; /* mode and type of file */ xfs_uint16_t di_mode; /* mode and type of file */
__int8_t di_version; /* inode version */ xfs_int8_t di_version; /* inode version */
__int8_t di_format; /* format of di_c data */ xfs_int8_t di_format; /* format of di_c data */
__uint16_t di_onlink; /* old number of links to file */ xfs_uint16_t di_onlink; /* old number of links to file */
__uint32_t di_uid; /* owner's user id */ xfs_uint32_t di_uid; /* owner's user id */
__uint32_t di_gid; /* owner's group id */ xfs_uint32_t di_gid; /* owner's group id */
__uint32_t di_nlink; /* number of links to file */ xfs_uint32_t di_nlink; /* number of links to file */
__uint16_t di_projid; /* owner's project id */ xfs_uint16_t di_projid; /* owner's project id */
__uint8_t di_pad[10]; /* unused, zeroed space */ xfs_uint8_t di_pad[10]; /* unused, zeroed space */
xfs_timestamp_t di_atime; /* time last accessed */ xfs_timestamp_t di_atime; /* time last accessed */
xfs_timestamp_t di_mtime; /* time last modified */ xfs_timestamp_t di_mtime; /* time last modified */
xfs_timestamp_t di_ctime; /* time created/inode modified */ xfs_timestamp_t di_ctime; /* time created/inode modified */
@ -504,12 +502,12 @@ typedef struct xfs_dinode_core
xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
xfs_extnum_t di_nextents; /* number of extents in data fork */ xfs_extnum_t di_nextents; /* number of extents in data fork */
xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
__uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ xfs_uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
__int8_t di_aformat; /* format of attr fork's data */ xfs_int8_t di_aformat; /* format of attr fork's data */
__uint32_t di_dmevmask; /* DMIG event mask */ xfs_uint32_t di_dmevmask; /* DMIG event mask */
__uint16_t di_dmstate; /* DMIG state info */ xfs_uint16_t di_dmstate; /* DMIG state info */
__uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ xfs_uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
__uint32_t di_gen; /* generation number */ xfs_uint32_t di_gen; /* generation number */
} xfs_dinode_core_t; } xfs_dinode_core_t;
typedef struct xfs_dinode typedef struct xfs_dinode

View file

@ -360,6 +360,9 @@ case "$install_device" in
fi ;; fi ;;
\([hf]d[0-9]*\)) \([hf]d[0-9]*\))
install_drive="$install_device" ;; install_drive="$install_device" ;;
[hf]d[0-9]*)
# The GRUB format with no parenthesis.
install_drive="($install_device)" ;;
*) *)
echo "Format of install_device not recognized." 1>&2 echo "Format of install_device not recognized." 1>&2
usage usage