[xenial][initramfs-tools] support uppercase and lowercase uuids
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| initramfs-tools (Ubuntu) |
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.
Manoj Iyer (manjo) wrote : | #1 |
Changed in initramfs-tools (Ubuntu): | |
assignee: | nobody → Manoj Iyer (manjo) |
importance: | Undecided → High |
The attachment "Patch to support uppercase and lowercase uuids" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]
tags: | added: patch |
dino99 (9d9) wrote : | #3 |
initramfs-tools (0.122ubuntu4) xenial; urgency=medium
[ Manoj Iyer ]
* Add support for uppercase and lowercase uuids. (LP: #1548120)
-- Andy Whitcroft <email address hidden> Sun, 21 Feb 2016 22:12:36 +0000
Changed in initramfs-tools (Ubuntu): | |
status: | New → Fix Released |
Manoj Iyer (manjo) wrote : | #4 |
tr trick does not work in the initramfs environement.
(initramfs) echo "81780AD9-
:upper:]' '[:lower:]'
81780AD9-
But awk works:
(initramfs) echo "81780ad9-
81780ad9-
I will resubmit the patch using awk instead.
Manoj Iyer (manjo) wrote : | #5 |
Sorry here is what does not work:
(initramfs) echo "81780AD9-
81780AD9-
Changed in initramfs-tools (Ubuntu): | |
status: | Fix Released → In Progress |
Manoj Iyer (manjo) wrote : | #6 |
With the attached patch I was able to boot with root=PARUUID=
$ cat /proc/cmdline
BOOT_IMAGE=
tags: | added: block-proposed |
Andy Whitcroft (apw) wrote : | #7 |
Hmm, that on the surface of things makes no sense as mini-tr exists in busybox and in theory at least supports those constructs. Blocking this in proposed while we get to the bottom of this.
Andy Whitcroft (apw) wrote : | #8 |
Ok, it seems that busybox tr does not actually support symbolic ranges. Rather than add a first user of awk it seems simpler to manually expand the character ranges. Specifically as the specification says the following:
"The hexadecimal values "a" through "f" are output as lower case characters and are case insensitive on input."
we can simply map A-F to a-f and cover all valid cases.
@manjo -- I have uploaded this fix to my ppa:apw/
Manoj Iyer (manjo) wrote : | #9 |
@apw can you pls fix these dependencies in your packge?
initramfs-tools : Depends: initramfs-
initramfs-
initramfs-tools-bin is already the newest version (0.122ubuntu4).
Manoj Iyer (manjo) wrote : | #10 |
I was able to boot with the package/patch in your PPA. root=PARTUUID=
$ cat /proc/cmdline
BOOT_IMAGE=
ubuntu@bandera:~$
Manoj Iyer (manjo) wrote : | #11 |
and lower case also works.
$ cat /proc/cmdline
BOOT_IMAGE=
Manoj Iyer (manjo) wrote : | #12 |
$ apt-cache policy initramfs-tools
initramfs-tools:
Installed: 0.122ubuntu5~rc2
Candidate: 0.122ubuntu5~rc2
Version table:
*** 0.122ubuntu5~rc2 500
500 http://
100 /var/lib/
0.122ubuntu3 500
500 http://
Andy Whitcroft (apw) wrote : | #13 |
Ok applied and uploaded. Sorting some dependancies on other packages right now.
Changed in initramfs-tools (Ubuntu): | |
status: | In Progress → Fix Committed |
hakuna_matata (hakuna-matata) wrote : | #14 |
The fix doesn't work for UUIDs of a Windows file system. blkid uses always UUIDs in upper case for these file systems. So it fails because the fix converts all UUIDs in lower case.
IMHO short UUIDs (length <= 16) should be always converted in upper case because short UUIDs are only UUIDs of a Windows file systems.
It can affect also systems without Windows because the EFI partition has a Windows file system (vfat).
In my case it fails booting into a loopback device(ext4) on a Windows file system (ntfs).
Please fix your patch. Thanks.
Changed in initramfs-tools (Ubuntu): | |
status: | Fix Committed → New |
Andy Whitcroft (apw) wrote : | #15 |
@hakuna_matata -- thanks for the report there, testing here confirms your findings that they are upper case on NTFS and only match with upper case. Properly the fix for this whole mess should be in util-linux in blkid as the individual formats have specific forms and only it knows what is appropriate to do to that UUID such that we do not lose information in the transformation. I am filing a new bug for that isssue so we track it clearly. See Bug #1553107.
tags: | removed: block-proposed |
tags: | added: block-proposed |
tags: | removed: block-proposed |
Launchpad Janitor (janitor) wrote : | #16 |
This bug was fixed in the package initramfs-tools - 0.122ubuntu6
---------------
initramfs-tools (0.122ubuntu6) xenial; urgency=medium
[ Andy Whitcroft ]
* uuids: only apply case mapping to RFC#4122 format uuids (LP: #1553107,
#1548120)
[ Timo Aaltonen ]
* hooks/framebuffer: Copy kernel/ubuntu/i915 backport driver too. (LP:
#1500751)
initramfs-tools (0.122ubuntu5) xenial; urgency=medium
[ Andy Whitcroft ]
* uuids: busybox tr does not support symbolic ranges expand manually
(LP: #1548120)
[ Martin Pitt ]
* wait-for-root.c: Drop check if device is queued in udev (LP: #1539195)
initramfs-tools (0.122ubuntu4) xenial; urgency=medium
[ Manoj Iyer ]
* Add support for uppercase and lowercase uuids. (LP: #1548120)
-- Andy Whitcroft <email address hidden> Fri, 04 Mar 2016 10:12:42 +0000
Changed in initramfs-tools (Ubuntu): | |
status: | New → Fix Released |
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