Title:                   LILO pass root as-is patch
Submitted by:            Michael Shell (www.michaelshell.org)
Date:                    2017-11-02
Description:             Except for the special case of root=current,
                         enables the passing of nonempty/nonspace values of
			 root= as-is to the kernel, thus enabling support
			 for PARTUUID as well as any other root device
			 specification format supported by the kernel
			 name_to_dev_t() function of init/do_mounts.c

diff -Naur lilo-24.2/src/bsect.c lilo-24.2_new/src/bsect.c
--- lilo-24.2/src/bsect.c	2011-06-22 03:09:44.000000000 -0400
+++ lilo-24.2_new/src/bsect.c	2017-11-04 08:36:24.750702727 -0400
@@ -1089,19 +1089,15 @@
 	    if (stat("/",&st) < 0) pdie("stat /");
 	    sprintf(strchr(options,0),"root=%x ",(unsigned int) st.st_dev);
 	}
-	else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) {
-	    sprintf(strchr(options,0),"root=%s ", root);
+	/* MDS: Except for the special case of root=current, just pass
+	   any nonempty/nonspace value of root as-is to the kernel.    */
+	else if (strlen(root) > 0) {
+	  if (!strncmp(root," ",1))
+	   die("Root value '%s' must not begin with a space.",root);
+	  else
+	   sprintf(strchr(options,0),"root=%s ",root);
 	}
-	else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) {
-	    sprintf(strchr(options,0),"root=%s ", root);
-	}
-	else if (strlen(root)>5 && !strncmp(root,"UUID=",5)) {
-	    sprintf(strchr(options,0),"root=%s ", root);
-        }
-	else {
-	    sprintf(strchr(options,0),"root=%x ",dev_number(root));
-	}
-      }	
+    }	
     if ((ram_disk = cfg_get_strg(cf_kernel,"ramdisk")) || (ram_disk =
       cfg_get_strg(cf_options,"ramdisk")))
 	sprintf(strchr(options,0),"ramdisk=%d ",to_number(ram_disk));
