[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#696877: installation-reports: Wheezy DI-b4-amd64-netboot-mini.iso from an usb stick fails trying to install grub



[quoting from #698707]
On 24/01/13 12:42, Andrea Borghi wrote:
> 2. set the default drive for grub installation to the drive that contains the root
> partition selected during disk partitioning.

That's a good thing to ask, it seems like a more obvious place to start.

Currently (hd0) is preferred unless we're able to detect that it is
install media.  That's the problem currently.

*Only* if we'd detected it as install media, we would fall back to:

>  575 bootfs=$(findfs /boot)
>  576 [ "$bootfs" ] || bootfs="$(findfs /)"

(That does a grub probe of /boot or / in the target, or otherwise
whatever seems mounted on /target/boot or /target)


But wouldn't that be a better default_bootdev, for any
grub-legacy/pc/sparc/ieee1275 install?  Could we try to determine
default_bootdev that way to begin with?

It would just require a shuffle round of the code that is already there.
 I'm picturing something like:

>  case $ARCH:$grub_package in
>      *:grub|*:grub-pc|sparc:grub-ieee1275)
>          # For GRUB installs this should be a better starting point
>          bootfs=$(findfs /boot)
>          [ "$bootfs" ] || bootfs="$(findfs /)"
>          default_bootdev=$(device_to_disk "$bootfs")
>          ;;
>      *)
>          # This was the original default
>          default_bootdev_os="$($chroot $ROOT grub-mkdevicemap --no-floppy -m - | head -n1 | cut -f2)"
>          if [ "$default_bootdev_os" ]; then
>              default_bootdev="$($chroot $ROOT readlink -f "$default_bootdev_os")"
>          else
>              default_bootdev="(hd0)"
>          fi
>          ;;
>  esac

<then the usual sanity checks as before;  prompt if unsure>

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org


Reply to: