Package: debianutils
Version: 2.8.4

I recently discovered an apparent issue regarding the manner in which
the "/usr/bin/mkboot" script from this package attempts to determine
the root device. Here are lines 19-20 of the script:

  # root partition
  which rdev >/dev/null && rootpart=$(rdev | cut -d ' ' -f 1)

The problem is that rdev is only built for "intel" (ia32/x86)
platforms. A quick peek at the current "util-linux-2.12p-4" package
from the stable tree appears to confirm this. I became aware of this
as a result of a discussion I had with a Gentoo (AMD64) user who was,
at the time, using debianutils-1.16.7. As of the 2.x branch of
debianutils, I see that a `which` check has been added which
presumably prevents the script from crashing out on platforms where
the rdev binary is not available at least.

However, I would like to propose an alternate method which seems to me
to be "platform-agnostic" and reliable:

  # root partition
  rootpart=$(grep -o "root=[^ ]*" /proc/cmdline | cut -d= -f2)

The only issue I can see with this is that it depends on a functional
proc mount - which seems reasonable. One could elaborate upon this
slightly in order to perform a simple check to ensure that /proc is
actually mounted correctly. In any case, it seems to be a reliable
method of determinining the correct root device and I would therefore
like for it to be considered for inclusion.

For your reference, here is the original bug that I filed in Gentoo's
bugzilla (note that I was advised to bring this upstream):

  https://bugs.gentoo.org/show_bug.cgi?id=92748

Reply via email to