Bug#712907: grub-installer: No longer installs automatically on a normal machine with one hard drive
- To: Steven Chamberlain <steven@pyro.eu.org>, 712907@bugs.debian.org
- Subject: Bug#712907: grub-installer: No longer installs automatically on a normal machine with one hard drive
- From: Petter Reinholdtsen <pere@hungry.com>
- Date: Fri, 24 Oct 2014 13:55:16 +0200
- Message-id: <[🔎] 20141024115516.GB13078@ulrik.uio.no>
- Reply-to: Petter Reinholdtsen <pere@hungry.com>, 712907@bugs.debian.org
- In-reply-to: <5410C0D6.6090305@pyro.eu.org>
- References: <2flobb0zmvp.fsf@diskless.uio.no> <54022D4B.3050202@pyro.eu.org> <1409439256.27524.7.camel@decadent.org.uk> <20140831154450.GB14886@ulrik.uio.no> <20140910184537.GK22717@ulrik.uio.no> <54109F12.4020900@pyro.eu.org> <20140910193924.GD3220@mraw.org> <5410B675.6010707@pyro.eu.org> <20140910204709.GF3220@mraw.org> <5410C0D6.6090305@pyro.eu.org>
To make it easier for teachers and others without knowledge about disk
devices to install Debian Edu, I implemented this workaround for this
issue in debian-edu-config:
# Work around grub bug #712907 (see also bug #763580) by preseeding
# grub-installer/choose_device to the disk used by /target/boot
# This fix it for the most common case.
workaround_grub_issue() {
log "checking if grub workaround for bug #712907 should be activated."
bootdev=$(grep /target/boot /proc/mounts | cut -d" " -f1)
grubdev=$(echo $bootdev | sed -rn 's/(\/sd.).*$/\1/p')
# Only override if it is set to manual or do not have a value,
# otherwise we assume someone is preseeding it to the value they
# want.
db_get grub-installer/choose_bootdev || true
if [ "$RET" ] && [ "manual" != "$RET" ]; then
log "not overriding grub-installer/choose_bootdev to $grubdev, its value was '$RET'"
return
fi
case "$bootdev" in
/dev/sd*)
log "overriding grub-installer/choose_bootdev, setting it to $grubdev"
db_set grub-installer/choose_bootdev "$grubdev" || true
;;
esac
}
workaround_grub_issue
Mentioning it here in case the logic might be interesting to those
trying to find a solution for the grub-installer package.
--
Happy hacking
Petter Reinholdtsen
Reply to: