Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

PARTUUIDs #514

Closed
procount opened this issue Aug 16, 2018 · 8 comments
Closed

PARTUUIDs #514

procount opened this issue Aug 16, 2018 · 8 comments

Comments

@procount
Copy link
Contributor

I just booted PINN from USB and installed 6 OSes on the USB stick for testing.
The first 2 booted nicely (on partitions 6/7 & 8/9)
The next 3 failed with an unknown PARTUUID (10/11, 12/13, 14/15)
The next 1 booted (16/17), but it booted the rootfs on partition 11 !

Do you see a pattern here? Maybe if you convert those partition numbers to HEX, like the PARTTUUIDs are created, it will become clearer.

So my question is, should the partition number part of the PARTUUID be HEX (like it is created in NOOBS) or DECIMAL?
I haven't tested NOOBS, but I'm using the same code so I expect it will be the same problem. Or has something changed somewhere, because I don't remember this problem occurring before.

@XECDesign
Copy link
Contributor

Hex. Are they written as decimal somewhere?

@procount
Copy link
Contributor Author

Everything is HEX: in installed_os.json, cmdline.txt and /etc/fstab of each OS.

Here is what I think is happening:
PINN is initially loading the correct boot partition (10h) from installed_os.json and is reading cmdline.txt OK. But I think it is then interpreting the cmdline "root=PARTUUID=0005bedf-11" as decimal and loading rootfs from partition 11 / 0bh. That then correctly mounts the boot partition from /etc/fstab as PARTUUID=0005bedf-0a =partition 10.

@procount
Copy link
Contributor Author

procount commented Aug 16, 2018

Ah, the above is not quite right, but I found the bug.

PINN is actually booting partition 10 and is rejecting any hex partition numbers because of:
https://github.com/raspberrypi/noobs/blob/master/recovery/bootselectiondialog.cpp#L160 and https://github.com/raspberrypi/noobs/blob/master/recovery/bootselectiondialog.cpp#L166

It works ok for /dev/mmsblk0p10 because it's decimal, but no provision is made for the those last 2 digits being hexadecimal in the case of PARTUUID.

Edit: I can't believe no-one else has spotted this yet. Is no-one running more than 2 OSes on a USB drive?

@procount
Copy link
Contributor Author

Ah, Now I remember - it's my mistake, partly. See procount/pinn#150

When storing OSes on USB, NOOBS uses PARTUUIDs to avoid the device changing name. But it still stores the references in os_installed.json as /dev/sdaX. I changed this in PINN to PARTUUIDS for the cases where the USB device had changed device name. But I haven't changed the code in bootselectiondialog to accommodate this change.

So NOOBS won't have this problem, but it will have the original problem. So I guess it's down to me to fix it..... Once done, are you interested in a PR that will fix both issues in NOOBS?

@procount
Copy link
Contributor Author

That's better! Fixed now.

@XECDesign
Copy link
Contributor

Yeah, I think a PR for this would be much appreciated.

@procount
Copy link
Contributor Author

Ok, I'll backport it

@procount
Copy link
Contributor Author

I already created PR #497 for the original change a long time ago, so I've just pushed up the bugfix to it.
It built ok, but I'm not able to test at the moment. When I do I'll post the results, unless you have a chance before me 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants