[PATCH] discover/udev.c: Added warning in system status log

Lulu_Su at wistron.com Lulu_Su at wistron.com
Mon Oct 4 17:46:05 AEDT 2021


Hi Jeremy,

> According to your requirements above, in this case it sounds like you want to the following to happen:
> 1) sda: shows a boot option
> 2) sda1: is a duplicate of sda, skipped, no message displayed
> 3) sdc: duplicate of sda, skipped, message is displayed
> 4) sdc1: duplicate of sda, skipped, no message displayed

Yes this is exactly what I want to achieve.

> - but we have no way of determining any difference between sdc and sdc1
>  here; since sdc was skipped, we are not comparing ID_PATH against sdc.
>   Can you come up with a policy for this case? Which of the sdc/sdc1
>   devices should generate the message? (and how would you apply that
>   logic?)

I want to use the sd*1 device to generate messages, but I found that some iso files do not have this device; and on my machine, the device sd* will be generated repeatedly 3 times, which is not suitable as a condition...
Since no correlation was found, it was decided not to set conditions for devices that cannot be mounted.

> If no policy is obvious, then you may even want to do something like warning *once* when we see a duplicate UUID as the first-discovered device, no matter how many duplicates you see. Would that suit your intended UX?

Yes this is exactly what i expected.

> If so, you could just add a 'dup_warn' boolean on struct discover_device, and only generate the warning if you haven't done so already.

I thought about it before, but I didn't find a condition to reset this boolean.
I will try again, thank you for your suggestion.

> I'd suggest a minor change to that wording - "the sda" sounds odd. Maybe something like:
>   Duplicate filesystem as sda detected on sdc.
> Or if we're just warning once:
>   Duplicate filesystem as sda detected; skipping duplicates.

Thank you so much for your suggestion.

> In pb-discover.log:
> [02:24:02] SKIP: sda1 UUID [2020-04-04-04-38-27-00] already present 
> (as sda) [02:28:45] SKIP: sdc UUID [2020-04-04-04-38-27-00] already 
> present (as sda) [02:28:45] SKIP: sdc1 UUID [2020-04-04-04-38-27-00] 
> already present (as sda) [02:28:45] SKIP: sdc UUID 
> [2020-04-04-04-38-27-00] already present (as sda) [02:28:45] SKIP: sdc 
> UUID [2020-04-04-04-38-27-00] already present (as sda)

> Somewhat unlreated, but can you see why you're getting three events for sdc? That's probably not helping with multiple log outputs in the UI.

When the petitboot list has mounted the USB device (the USB has been plugged into the machine), this will happen when using virtual media to mount the same iso file; but on the contrary, only sdc and sdc1 will be displayed.
I have seen this phenomenon on two platforms: Mihawk and Mowgli

> Maybe try debug mode again.

Ok, if there are other discoveries, i will share, thank you~

Cheers,
Lulu Su


---------------------------------------------------------------------------------------------------------------------------------------------------------------
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. 
Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited.
If you are not the intended recipient, you may reply to the sender and should delete this e-mail immediately.
---------------------------------------------------------------------------------------------------------------------------------------------------------------



More information about the Petitboot mailing list