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:
okuji 2000-02-23 18:53:27 +00:00
parent a936d03921
commit b9ff0c2f81
3 changed files with 18 additions and 3 deletions

View file

@ -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> 2000-02-21 OKUJI Yoshinori <okuji@gnu.org>
* stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: Use the term * stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: Use the term

View file

@ -43,6 +43,7 @@ int grub_stage2 (void);
#ifdef __linux__ #ifdef __linux__
# include <sys/ioctl.h> /* ioctl */ # include <sys/ioctl.h> /* ioctl */
# include <linux/hdreg.h> /* HDIO_GETGEO */ # include <linux/hdreg.h> /* HDIO_GETGEO */
# include <linux/major.h> /* FLOPPY_MAJOR */
# if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)) # if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))
/* Maybe libc doesn't have large file support. */ /* Maybe libc doesn't have large file support. */
# include <linux/unistd.h> /* _llseek */ # include <linux/unistd.h> /* _llseek */
@ -527,7 +528,11 @@ check_device (const char *device)
if (fstat (fileno (fp), &st)) if (fstat (fileno (fp), &st))
return 0; 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; return 0;
} }
#endif /* __linux__ */ #endif /* __linux__ */

View file

@ -1002,7 +1002,7 @@ print_fsys_type (void)
if (current_partition == 0xFFFFFF) if (current_partition == 0xFFFFFF)
printf ("using whole disk\n"); printf ("using whole disk\n");
else else
printf ("partition type 0x%x\n", current_slice); printf ("partition type 0x%x\n", current_slice & 0xFF);
} }
} }
#endif /* STAGE1_5 */ #endif /* STAGE1_5 */