From b42b9b7e220fbe4ff3fadd016f277dd1c506e21e Mon Sep 17 00:00:00 2001 From: okuji Date: Fri, 12 Mar 2004 18:16:40 +0000 Subject: [PATCH] 2004-03-12 Yoshinori K. Okuji From Boji Tony Kannanthanam : * util/grub-install.in (convert): Add support for ATARAID device names. * lib/device.c (get_ataraid_disk_name) [__linux__]: New function. (init_device_map) [__linux__]: Probe ATARAID disks. * stage2/size_test (check): Don't use the local statement any longer. It was unneeded actually. Reported by Paul Jarc. --- ChangeLog | 12 ++++++++++++ NEWS | 1 + THANKS | 1 + docs/grub-install.8 | 2 +- lib/device.c | 29 ++++++++++++++++++++++++++++- stage2/size_test | 4 +--- util/grub-install.in | 2 ++ 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c062155f6..361fc94a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2004-03-12 Yoshinori K. Okuji + From Boji Tony Kannanthanam : + * util/grub-install.in (convert): Add support for ATARAID + device names. + * lib/device.c (get_ataraid_disk_name) [__linux__]: New + function. + (init_device_map) [__linux__]: Probe ATARAID disks. + + * stage2/size_test (check): Don't use the local statement any + longer. It was unneeded actually. Reported by Paul Jarc. + +2004-03-12 Yoshinori K. Okuji + From Sergey Matveychuk : * lib/device.c (get_drive_geometry): Do not open the same device more than once unnecessarily. diff --git a/NEWS b/NEWS index b1a6b0b3c..eff7a952c 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ NEWS - list of user-visible changes between releases of GRUB New: * Add support for ReiserFS 3. * Fix support for FreeBSD 5. +* Support ATARAID for Linux in the grub shell and grub-install. New in 0.94 - 2004-01-25: * Support building on x86-64 with gcc -m32. diff --git a/THANKS b/THANKS index 6838c2bd3..ce6a8adc0 100644 --- a/THANKS +++ b/THANKS @@ -17,6 +17,7 @@ Andrew Walrond Ben Liblit Bernhard Treutwein Bodo Rueskamp . +Boji Tony Kannanthanam Bradford Hovinen Brian Brunswick Bryan Ford diff --git a/docs/grub-install.8 b/docs/grub-install.8 index 555b7912c..a89affe98 100644 --- a/docs/grub-install.8 +++ b/docs/grub-install.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-INSTALL "8" "January 2004" "grub-install (GNU GRUB 0.94)" FSF +.TH GRUB-INSTALL "8" "March 2004" "grub-install (GNU GRUB 0.94)" FSF .SH NAME grub-install \- install GRUB on your drive .SH SYNOPSIS diff --git a/lib/device.c b/lib/device.c index 7f09d881d..afddee819 100644 --- a/lib/device.c +++ b/lib/device.c @@ -1,7 +1,7 @@ /* device.c - Some helper functions for OS devices and BIOS drives */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. * * 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 @@ -361,6 +361,12 @@ get_dac960_disk_name (char *name, int controller, int drive) { sprintf (name, "/dev/rd/c%dd%d", controller, drive); } + +static void +get_ataraid_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/ataraid/d%c", unit + '0'); +} #endif /* Check if DEVICE can be read. If an error occurs, return zero, @@ -682,6 +688,27 @@ init_device_map (char ***map, const char *map_file, int floppy_disks) } } +#ifdef __linux__ + /* ATARAID disks. */ + for (i = 0; i < 8; i++) + { + char name[20]; + + get_ataraid_disk_name (name, i); + if (check_device (name)) + { + (*map)[num_hd + 0x80] = strdup (name); + assert ((*map)[num_hd + 0x80]); + + /* If the device map file is opened, write the map. */ + if (fp) + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); + + num_hd++; + } + } +#endif /* __linux__ */ + /* The rest is SCSI disks. */ for (i = 0; i < 16; i++) { diff --git a/stage2/size_test b/stage2/size_test index 5cc917ddd..73269d06e 100644 --- a/stage2/size_test +++ b/stage2/size_test @@ -1,7 +1,7 @@ #!/bin/sh # Check the sizes of Stage 2 and Stage 1.5's. -# Copyright (C) 1999 Free Software Foundation, Inc. +# Copyright (C) 1999,2004 Free Software Foundation, Inc. # 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 @@ -25,8 +25,6 @@ # status 1, otherwise do nothing. check () { - local file size limit - file=$1 limit=$2 set dummy `ls -l $file` diff --git a/util/grub-install.in b/util/grub-install.in index b30c7fde5..4a547f947 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -92,10 +92,12 @@ convert () { case "$host_os" in linux*) tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ + -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ -e 's%\(fd[0-9]*\)$%\1%' \ -e 's%/part[0-9]*$%/disc%' \ -e 's%\(c[0-7]d[0-9]*\).*$%\1%'` tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ + -e 's%.*d[0-9]*p*%%' \ -e 's%.*/fd[0-9]*$%%' \ -e 's%.*/floppy/[0-9]*$%%' \ -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \