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

Bug#712907: grub-installer: No longer installs automatically on a normal machine with one hard drive



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: