Comment 4 for bug 658140

Revision history for this message
eexo (electric-exo) wrote :

Same problem here.
It seems to be caused by linux-boot-prober:
# linux-boot-prober /dev/sdb1
/dev/sdb1:/dev/sdb1:Linux Mint 14 MATE 32-bit, 3.4.34-030434-i7 (/dev/sda3):/boot/vmlinuz-3.4.34-030434-i7:/boot/initrd.img-3.4.34-030434-i7:root=UUID=ce078971-fdfb-4b0f-aaa8-728dc9b2f83b ro crashkernel=384M-2G:64M,2G-:128M quiet splash $vt_handoff

while blkid shows:
# blkid
/dev/sda3: UUID="ce078971-fdfb-4b0f-aaa8-728dc9b2f83b" TYPE="ext4"
/dev/sdb1: UUID="a1849561-5dae-4680-b989-8651e05fe1eb" TYPE="ext4"

i.e it puts wrong "root=".

The code below works it around, insert at approriate place in /etc/grub.d/30_os_prober:

    linux)
      LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      prepare_boot_cache=
      boot_device_id=
      is_first_entry=true
      title_correction_code=
      OS="${LONGNAME}"

      for LINUX in ${LINUXPROBED} ; do
        LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
        LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
        LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
        LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
        LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
        LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' ' | sed -e 's/root=[^ ]*//;'`"

        if [ -z "${LLABEL}" ] ; then
          LLABEL="${LONGNAME}"
        fi

        if [ "${LROOT}" != "${LBOOT}" ]; then
          LKERNEL="${LKERNEL#/boot}"
          LINITRD="${LINITRD#/boot}"
        fi

        if [ -z "${prepare_boot_cache}" ]; then
          prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
          [ "${prepare_boot_cache}" ] || continue
        fi

        found_other_os=1
        onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
        if [ -z "$boot_device_id" ]; then
            boot_device_id="$(grub_get_device_id "${DEVICE}")"
        fi
        LPARAMS="root=$boot_device_id ${LPARAMS}"