The /usr/sbin/mkboot script provided by sys-apps/debianutils uses the following method to determine the root device: rootpart=$(rdev | cut -d ' ' -f 1) However, the rdev tool only seems to be provided when sys-apps/util-linux is built upon "intel" (i.e. ia32/x86) platforms. That particular issue was touched upon in bug 35902. I only became aware of this issue because I was privy to the matter as raised by an amd64 user. I think that the method used is poor and propose an alternative as follows: rootpart=$(grep -o "root=[^ ]*" /proc/cmdline | cut -d= -f2) I'm not sure whether that's the best way to go about it but it's certainly the more "agnostic" approach. I'll attach the proposed ebuild and patch.
Created attachment 58977 [details] sys-apps/debianutils-1.16.7-r5.ebuild
Created attachment 58978 [details, diff] debianutils-1.16.7-mkboot-nordev.patch This patch implements the alternate method of determining the root device as mentioned above.
debianutils-2.x has 'better' rdev handling ... your rootpart grep looks pretty good, could you please e-mail that to the debian bug site ? http://www.debian.org/Bugs/Reporting
Thanks SpanKY. I've done exactly that; I'll post back here if anything comes of it.
Here's the BTS link: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315303
Clint Adams accepted a fix for the package upstream (thanks Clint!). Not sure how it will propagate in terms of package versions/releases (should probably read up on their policy one of these days). I presume that the fix will somewhat resemble the suggestion I made: if [ $(mount | grep -o "^proc") ] && [ -e /proc/cmdline ]; then rootpart=$(grep -o "root=[^ ]*" /proc/cmdline | cut -d = -f 2) else which rdev >/dev/null && rootpart=$(rdev | cut -d ' ' -f 1) fi Thus, the existing behaviour is supported as a fallback in the case that it doesn't appear possible to establish the root device from the /proc filesystem.
we watch http://packages.debian.org/unstable/base/debianutils.html when that version gets updated, we update the ebuild
Sure thing, thanks. Damn, I just realised that it could have been made to work in a chroot also: [ $(mount | grep -Ec "^(none|proc) on /proc type proc") -gt 0 ] && [ -e /proc/cmdline ]
Bump. It's fixed in >=debianutils-2.14 (where 2.14.1 is currently available). So this should be closed once it's in portage.
2.14.1 now in portage, thanks