Comment 18 for bug 563618

Revision history for this message
Dave Martin (dave-martin-arm) wrote : RE: [Bug 563618] Re: Ignoring a broken clock results in infinite reboots;not ignoring results in fsck failure; no solution to this problem

How about:

for x in $(cat /proc/cmdline); do
 case ${x} in
 root=*)
  case ${x} in
   UUID=*)
ROOTDEVPATH=$ROOTDEVPATH/disk/by-uuid/${x#UUID=} ;;
   *) ROOTDEVPATH=$ROOTDEVPATH/$x ;;
  esac
  ;;

...

done

ROOTDEVPATH=$(readlink -f "/dev/$ROOTDEVPATH")

[...]

This supports the root=<device node> case. Hackers will thank you (I know I
will)
Extending it to support LABEL= would be easy too.

(Extra case statement used to avoid sed (slow) and ${//} (bash-specific))