[xenial][initramfs-tools] support uppercase and lowercase uuids
Bug #1548120 reported by
Manoj Iyer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
Fix Released
|
High
|
Manoj Iyer |
Bug Description
Initramfs tools does not support uppercase UUIDs. Initramfs-tools script/functions uses blkid to determine the device name from UUID/PARTUUID but if either of those are in uppercase blkid fails to return the name.
Changed in initramfs-tools (Ubuntu): | |
status: | Fix Released → In Progress |
tags: | added: block-proposed |
Changed in initramfs-tools (Ubuntu): | |
status: | Fix Committed → New |
tags: | removed: block-proposed |
tags: | added: block-proposed |
tags: | removed: block-proposed |
To post a comment you must log in.
This patch fixes this issue. I tested the functionality of this function by creating a script invoking this function as standalone.
$ sudo ./test.sh 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d -o device 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 275F782B- 3C55-4B3F- ACB2-C17DB0EAEE 8D 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d 275f782b- 3c55-4b3f- acb2-c17db0eaee 8d -o device
+ resolve_device PARTUUID=
+ DEV=PARTUUID=
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=
++ tr '[:upper:]' '[:lower:]'
++ cut -f 2 -d =
+ local value=275f782b-
+ DEV=PARTUUID=
+ command -v blkid
++ blkid -l -t PARTUUID=
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2
+ resolve_device PARTUUID=
+ DEV=PARTUUID=
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=
++ cut -f 2 -d =
++ tr '[:upper:]' '[:lower:]'
+ local value=275f782b-
+ DEV=PARTUUID=
+ command -v blkid
++ blkid -l -t PARTUUID=
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2