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

Jeremy Kerr jk at ozlabs.org
Tue Jul 13 21:55:08 AEST 2021


Hi Lulu,

> Forward user description:
> " Tester has found during the Virtual media Install when he mounted
> USB and VIrtual Media only 1 USB option is visible in the petitboot
> for install.

OK, so the test involved adding a USB device with some filesystem image,
plus a virtual media device providing the exact same filesystem
image then, is that correct?

Is there an expectation that both devices appear?
 
[For a bit of background: the UUID check prevents multiple devices
appearing in multipath setups; where it's actually the same physical
filesystem being added under separate Linux block devices. It's also
fairly important that the UUIDs are unique, as they're commonly
referenced in bootloader configurations, so we really should ignore the
second instance of a duplicated FS UUID]

> Could you give me some suggestions?

I'm OK with the message, but to look at the bigger picture here:

1) is the presence of only one device in the list actually a problem? Is
   it stopping the user from achieving a particular goal? and:

2) does the message help with that?

> If I make changes based on user requirements, this change will affect
> all platforms. I don't confirm the necessity of this feature, so I
> want to add a warning, at least to remind users when they mount the
> same file, instead of letting them misunderstand that the device is
> broken.

OK, makes sense.

> > When would this check ever fail? We'd have multiple block devices
> > with the same kernel name.
> 
> When a device using the UUID already exists, but the device name is
> different (e.g. Already exists device1: sda, New device2:sdc )

Yep, but my point is that the device name will always be different
- otherwise the kernel has created two block devices with identical
names. So, the conditional in the if statement will always evaluate to
true. Unless we have a bug elsewhere?

> This is my old warning: "[sdc] The list doesn’t support displaying
> the same mount file"
> I use this function to display warnings (
> https://github.com/open-power/petitboot/blob/f7f98227ae991497ffe361eec3b7a9d1b2d94db4/discover/device-handler.h#L124
>  ) 
> Besides creating sdc, could you suggest me a way to make this
> function display sdc?

Just include the device name in the string that you're generating.
There's nothing special about the _dev_info function over the plain
_info version, just that the former adds the device name prefix.

> > "%s: A duplicate filesystem has been detected (same as %s); only
> > listing the first"
>   name, ddev->device->id
> 
> > - would that work for your case?
> 
> Thank you for your suggestion, I will use this suggestion to modify
> the log message.

OK, great!

If you wanted to keep it really simple, you could just change the
pb_log() call there to a device_handler_status_info(); it's already
giving an indication of the duplicate UUID.

Regards,


Jeremy



More information about the Petitboot mailing list