print only a partition type in print_fsys_type, don't call HDIO_GETGEO for a floppy in check_device.
This commit is contained in:
parent
a936d03921
commit
b9ff0c2f81
3 changed files with 18 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2000-02-24 OKUJI Yoshinori <okuji@gnu.org>
|
||||
|
||||
* stage2/disk_io.c [!STAGE1_5] (print_fsys_type): Mask
|
||||
CURRENT_SLICE with 0xFF when printing the partition type.
|
||||
|
||||
* grub/asmstub.c [__linux__]: Include <linux/major.h> for the
|
||||
definition FLOPPY_MAJOR.
|
||||
(check_device) [__linux__]: Skip the HDIO_GETGEO ioctl if the
|
||||
major number of ST.ST_RDEV is FLOPPY_MAJOR.
|
||||
|
||||
2000-02-21 OKUJI Yoshinori <okuji@gnu.org>
|
||||
|
||||
* stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: Use the term
|
||||
|
|
|
@ -43,6 +43,7 @@ int grub_stage2 (void);
|
|||
#ifdef __linux__
|
||||
# include <sys/ioctl.h> /* ioctl */
|
||||
# include <linux/hdreg.h> /* HDIO_GETGEO */
|
||||
# include <linux/major.h> /* FLOPPY_MAJOR */
|
||||
# if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))
|
||||
/* Maybe libc doesn't have large file support. */
|
||||
# include <linux/unistd.h> /* _llseek */
|
||||
|
@ -526,8 +527,12 @@ check_device (const char *device)
|
|||
|
||||
if (fstat (fileno (fp), &st))
|
||||
return 0;
|
||||
|
||||
if (S_ISBLK (st.st_mode) && ioctl (fileno (fp), HDIO_GETGEO, &hdg))
|
||||
|
||||
/* If it is a block device and isn't a floppy, check if HDIO_GETGEO
|
||||
succeeds. */
|
||||
if (S_ISBLK (st.st_mode)
|
||||
&& MAJOR (st.st_rdev) != FLOPPY_MAJOR
|
||||
&& ioctl (fileno (fp), HDIO_GETGEO, &hdg))
|
||||
return 0;
|
||||
}
|
||||
#endif /* __linux__ */
|
||||
|
|
|
@ -1002,7 +1002,7 @@ print_fsys_type (void)
|
|||
if (current_partition == 0xFFFFFF)
|
||||
printf ("using whole disk\n");
|
||||
else
|
||||
printf ("partition type 0x%x\n", current_slice);
|
||||
printf ("partition type 0x%x\n", current_slice & 0xFF);
|
||||
}
|
||||
}
|
||||
#endif /* STAGE1_5 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue