Skip to content
Browse files

init: add support for PARTUUID=

The kernel supports this, but blkid doesn't really. A little bit of
refactoring, and everybody's happy.
  • Loading branch information...
1 parent 5ffbc06 commit e02ceaa169029cc1a84be1609b9a49388d72fbd6 @falconindy committed Jun 4, 2011
Showing with 9 additions and 6 deletions.
  1. +1 −0 README.pod
  2. +8 −6 init.c
View
1 README.pod
@@ -129,6 +129,7 @@ a number of different formats, such as:
root=/dev/sda2
root=LABEL=root
root=UUID=037b9d94-148e-4ee4-8d38-67bfe15bb535
+ root=PARTUUID=037b9d94-148e-4ee4-8d38-67bfe15bb535
root=MAJOR:MINOR
This parameter, for obvious reasons, must be specified.
View
14 init.c
@@ -699,19 +699,21 @@ static int wait_for_root(void) { /* {{{ */
static void try_create_root(void) { /* {{{ */
dev_t rootdev;
- char *root;
+ char *root, *tag = NULL;
root = getenv("root");
if (strncmp(root, "UUID=", 5) == 0 ||
strncmp(root, "LABEL=", 6) == 0) {
- /* resolve UUID= or LABEL= syntax */
- char *key, *val, *res;
+ tag = root;
+ } else if (strncmp(root, "PARTUUID=", 9) == 0) {
+ tag = &root[4];
+ }
- key = val = root;
- strsep(&val, "=");
+ if (tag) {
+ char *res;
- res = blkid_evaluate_tag(key, val, NULL);
+ res = blkid_evaluate_tag(tag, NULL, NULL);
if (!res) {
err("failed to resolve %s to a root device", root);
return;

0 comments on commit e02ceaa

Please sign in to comment.
Something went wrong with that request. Please try again.