Hi,

As you might know, experimental grub2 support has been added to d-i when using
the expert mode, but it is only yet available on i386/amd64.

I made this patch to enable grub2 for powerpc as well, but unfortunately I can't
test it (no ppc hardware here).  Would anyone like to try it?

-- 
Robert Millan

My spam trap is [EMAIL PROTECTED]  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.
Remember to force local grub-installer in netboot:

        echo grub-installer > installer/build/pkg-lists/local

Index: packages/arch/i386/grub-installer/debian/control
===================================================================
--- packages/arch/i386/grub-installer/debian/control    (revision 40466)
+++ packages/arch/i386/grub-installer/debian/control    (working copy)
@@ -7,7 +7,7 @@
 Standards-Version: 3.6.1
 
 Package: grub-installer
-Architecture: i386 hurd-i386 amd64 kfreebsd-i386 kfreebsd-amd64
+Architecture: any-i386 any-amd64 any-powerpc
 Provides: bootable-system
 Depends: cdebconf-udeb, kernel-installer, created-fstab, di-utils (>= 1.15), 
di-utils-mapdevfs, os-prober, ${dmidecode}
 XB-Installer-Menu-Item: 73
Index: packages/arch/i386/grub-installer/debian/isinstallable
===================================================================
--- packages/arch/i386/grub-installer/debian/isinstallable      (revision 40466)
+++ packages/arch/i386/grub-installer/debian/isinstallable      (working copy)
@@ -13,10 +13,13 @@
        mount | grep "on /target${1%/} " | cut -d' ' -f5
 }
 
+bootfstype=$(findfstype /boot)
+[ -n "$bootfstype" ] || bootfstype="$(findfstype /)"
+
 ARCH="$(archdetect)"
 
 case $ARCH in
-    i386/*)
+    i386/*|amd64/*)
        MANUFACTURER="$(dmidecode -s system-manufacturer)"
        case $MANUFACTURER in
            Apple*)
@@ -27,6 +30,12 @@
            ;;
        esac
     ;;
+    *)
+       if [ "$bootfstype" = "reiserfs" ]; then
+               log "grub legacy doesn't support $ARCH, and grub2 doesn't (yet) 
support reiserfs"
+               exit 1
+       fi
+    ;;
 esac
 
 bootfs=$(findfs /boot)
@@ -44,9 +53,6 @@
        exit 1
 fi
 
-bootfstype=$(findfstype /boot)
-[ -n "$bootfstype" ] || bootfstype="$(findfstype /)"
-
 if [ "$bootfstype" = "xfs" ]; then
        log "/boot on xfs, unsafe to install grub"
        # Check this first to allow for preseeding forcing grub to xfs.
Index: packages/arch/i386/grub-installer/debian/grub-installer.templates
===================================================================
--- packages/arch/i386/grub-installer/debian/grub-installer.templates   
(revision 40466)
+++ packages/arch/i386/grub-installer/debian/grub-installer.templates   
(working copy)
@@ -100,6 +100,17 @@
  becomes unbootable. You're advised not to try this in production
  environments.
 
+Template: grub-installer/grub2_only
+Type: boolean
+Default: false
+# This is suitable for testing grub2 only. Do not translate it!
+Description: Install GRUB 2 as your bootloader?
+ GRUB 2 is the next generation of GNU GRUB. It has interesting new features but
+ is still experimental software. If you choose to install it, you should be
+ prepared for breakage, and have an idea on how to recover your system if it
+ becomes unbootable. You're advised not to try this in production
+ environments.
+
 Template: grub-installer/progress/title
 Type: text
 _Description: Installing GRUB boot loader
Index: packages/arch/i386/grub-installer/grub-installer
===================================================================
--- packages/arch/i386/grub-installer/grub-installer    (revision 40466)
+++ packages/arch/i386/grub-installer/grub-installer    (working copy)
@@ -189,21 +189,41 @@
 bootfstype=$(findfstype /boot)
 [ -n "$bootfstype" ] || bootfstype="$(findfstype /)"
 
-# GRUB Legacy defaults
-grub_version="grub"
-menu_file="menu.lst"
+ARCH="$(archdetect)"
 
-# reiserfs is the only filesystem that d-i supports and grub2 doesn't yet
-if [ "$bootfstype" != "reiserfs" ]; then
-  db_input low grub-installer/grub2_instead_of_grub_legacy || [ $? -eq 30 ]
-  db_go || true
-  db_get grub-installer/grub2_instead_of_grub_legacy
-  if [ "$RET" = true ]; then
-    grub_version="grub2"
-    menu_file="grub.cfg"
-  fi
-fi
+case $ARCH in
+    i386/*|amd64/*)
+       # GRUB Legacy defaults
+       grub_version="grub"
+       menu_file="menu.lst"
 
+       # reiserfs is the only filesystem that d-i supports and grub2 doesn't 
yet
+       if [ "$bootfstype" != "reiserfs" ]; then
+         db_input low grub-installer/grub2_instead_of_grub_legacy || [ $? -eq 
30 ]
+         db_go || true
+         db_get grub-installer/grub2_instead_of_grub_legacy
+         if [ "$RET" = true ]; then
+           grub_version="grub2"
+           menu_file="grub.cfg"
+         fi
+       fi
+    ;;
+    *)
+       # we don't need to check supported filesystems here, because 
isinstallable had
+       # enough information to do this before
+
+       db_input low grub-installer/grub2_only || [ $? -eq 30 ]
+       db_go || true
+       db_get grub-installer/grub2_only
+       if [ "$RET" = true ]; then
+         grub_version="grub2"
+         menu_file="grub.cfg"
+       else
+         exit 10
+       fi
+    ;;
+esac
+
 if [ "$bootfstype" = "xfs" ]; then
        # warn user that grub on xfs is not safe and let them back out to
        # main menu.

Reply via email to