All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add a --disk-module option to grub-install
@ 2009-06-04 18:57 Felix Zielcke
  2009-06-04 21:07 ` Felix Zielcke
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Zielcke @ 2009-06-04 18:57 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

Here's a patch which adds --disk-module to grub-install for i386-pc to
make it easier for users to try out ata mod instead of biosdisk.
-- 
Felix Zielcke

[-- Attachment #2: disk_module.patch --]
[-- Type: text/x-patch, Size: 2339 bytes --]

2009-06-04  Felix Zielcke  <fzielcke@z-51.de>

	* util/i386/pc/grub-install.in: Add a parameter --disk-module.

diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in
index 468a72e..7033477 100644
--- a/util/i386/pc/grub-install.in
+++ b/util/i386/pc/grub-install.in
@@ -49,6 +49,12 @@ force_lba=
 recheck=no
 debug=no
 
+if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
+    disk_module=biosdisk
+else
+    disk_module=ata
+fi
+
 # Usage: usage
 # Print the usage.
 usage () {
@@ -68,6 +74,13 @@ Install GRUB on your drive.
   --no-floppy             do not probe any floppy drive
   --recheck               probe a device map even if it already exists
   --force                 install even if problems are detected
+EOF
+if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
+    cat <<EOF
+  --disk-module=MODULE    disk module to use
+EOF
+fi
+    cat <<EOF
 
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
@@ -250,11 +263,7 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul
 devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}`
 
 # The order in this list is critical.  Be careful when modifying it.
-if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
-    modules="$modules biosdisk"
-else
-    modules="$modules ata"
-fi
+modules="$modules $disk_module"
 modules="$modules $fs_module $partmap_module $devabstraction_module"
 
 prefix_drive=
@@ -269,11 +278,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then
     # Strip partition number
     install_drive="`echo ${install_drive} | sed -e s/,[0-9]*[a-z]*//g`"
     grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*[a-z]*//g`"
-    if [ "${target_cpu}-${platform}" != "i386-pc" ] ; then
-        # generic method (used on coreboot)
+    if [ "$disk_module" = ata ] ; then
+        # generic method (used on coreboot and ata mod)
         uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
         if [ "x${uuid}" = "x" ] ; then
-          echo "UUID needed on this platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          echo "UUID needed on this platform and with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
           exit 1
         fi
         prefix_drive="(UUID=${uuid})"

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] add a --disk-module option to grub-install
  2009-06-04 18:57 [PATCH] add a --disk-module option to grub-install Felix Zielcke
@ 2009-06-04 21:07 ` Felix Zielcke
  2009-06-05 21:26   ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Zielcke @ 2009-06-04 21:07 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

Am Donnerstag, den 04.06.2009, 20:57 +0200 schrieb Felix Zielcke:
> Here's a patch which adds --disk-module to grub-install for i386-pc to
> make it easier for users to try out ata mod instead of biosdisk.

Args I forgot the actual parsing of the option.
-- 
Felix Zielcke

[-- Attachment #2: disk_module.patch.2 --]
[-- Type: text/x-patch, Size: 2564 bytes --]

diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in
index 468a72e..5f6e556 100644
--- a/util/i386/pc/grub-install.in
+++ b/util/i386/pc/grub-install.in
@@ -49,6 +49,12 @@ force_lba=
 recheck=no
 debug=no
 
+if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
+    disk_module=biosdisk
+else
+    disk_module=ata
+fi
+
 # Usage: usage
 # Print the usage.
 usage () {
@@ -68,6 +74,13 @@ Install GRUB on your drive.
   --no-floppy             do not probe any floppy drive
   --recheck               probe a device map even if it already exists
   --force                 install even if problems are detected
+EOF
+if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
+    cat <<EOF
+  --disk-module=MODULE    disk module to use
+EOF
+fi
+    cat <<EOF
 
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
@@ -104,6 +117,10 @@ for option in "$@"; do
 	no_floppy="--no-floppy" ;;
     --recheck)
 	recheck=yes ;;
+    --disk-module=*)
+	if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
+           disk_module=`echo "$option" | sed 's/--disk-module//'`
+        fi ;;
     # This is an undocumented feature...
     --debug)
 	debug=yes ;;
@@ -250,11 +267,7 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul
 devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}`
 
 # The order in this list is critical.  Be careful when modifying it.
-if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
-    modules="$modules biosdisk"
-else
-    modules="$modules ata"
-fi
+modules="$modules $disk_module"
 modules="$modules $fs_module $partmap_module $devabstraction_module"
 
 prefix_drive=
@@ -269,11 +282,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then
     # Strip partition number
     install_drive="`echo ${install_drive} | sed -e s/,[0-9]*[a-z]*//g`"
     grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*[a-z]*//g`"
-    if [ "${target_cpu}-${platform}" != "i386-pc" ] ; then
-        # generic method (used on coreboot)
+    if [ "$disk_module" = ata ] ; then
+        # generic method (used on coreboot and ata mod)
         uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
         if [ "x${uuid}" = "x" ] ; then
-          echo "UUID needed on this platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
+          echo "UUID needed on this platform and with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
           exit 1
         fi
         prefix_drive="(UUID=${uuid})"

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] add a --disk-module option to grub-install
  2009-06-04 21:07 ` Felix Zielcke
@ 2009-06-05 21:26   ` Vladimir 'phcoder' Serbinenko
  2009-06-08 20:50     ` Felix Zielcke
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-05 21:26 UTC (permalink / raw)
  To: The development of GRUB 2

-        # generic method (used on coreboot)
+    if [ "$disk_module" = ata ] ; then
+        # generic method (used on coreboot and ata mod)
         uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
         if [ "x${uuid}" = "x" ] ; then
-          echo "UUID needed on this platform, but the filesystem
containing ${grubdir} does not support UUIDs." 1>&2
+          echo "UUID needed on this platform and with ata mod, but
the filesystem containing ${grubdir} does not support UUIDs." 1>&2
IMO it would be better to remove "on this platform" part.
Otherwise patch looks ok, I will test it tomorrow
On Thu, Jun 4, 2009 at 11:07 PM, Felix Zielcke<fzielcke@z-51.de> wrote:
> Am Donnerstag, den 04.06.2009, 20:57 +0200 schrieb Felix Zielcke:
>> Here's a patch which adds --disk-module to grub-install for i386-pc to
>> make it easier for users to try out ata mod instead of biosdisk.
>
> Args I forgot the actual parsing of the option.
> --
> Felix Zielcke
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] add a --disk-module option to grub-install
  2009-06-05 21:26   ` Vladimir 'phcoder' Serbinenko
@ 2009-06-08 20:50     ` Felix Zielcke
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Zielcke @ 2009-06-08 20:50 UTC (permalink / raw)
  To: The development of GRUB 2

Am Freitag, den 05.06.2009, 23:26 +0200 schrieb Vladimir 'phcoder'
Serbinenko:
> -        # generic method (used on coreboot)
> +    if [ "$disk_module" = ata ] ; then
> +        # generic method (used on coreboot and ata mod)
>          uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
>          if [ "x${uuid}" = "x" ] ; then
> -          echo "UUID needed on this platform, but the filesystem
> containing ${grubdir} does not support UUIDs." 1>&2
> +          echo "UUID needed on this platform and with ata mod, but
> the filesystem containing ${grubdir} does not support UUIDs." 1>&2
> IMO it would be better to remove "on this platform" part.
> Otherwise patch looks ok, I will test it tomorrow

Commited with it removed.

> On Thu, Jun 4, 2009 at 11:07 PM, Felix Zielcke<fzielcke@z-51.de> wrote:
> > Am Donnerstag, den 04.06.2009, 20:57 +0200 schrieb Felix Zielcke:
> >> Here's a patch which adds --disk-module to grub-install for i386-pc to
> >> make it easier for users to try out ata mod instead of biosdisk.
> >
> > Args I forgot the actual parsing of the option.

-- 
Felix Zielcke




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-08 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 18:57 [PATCH] add a --disk-module option to grub-install Felix Zielcke
2009-06-04 21:07 ` Felix Zielcke
2009-06-05 21:26   ` Vladimir 'phcoder' Serbinenko
2009-06-08 20:50     ` Felix Zielcke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.