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

Lulu_Su at wistron.com Lulu_Su at wistron.com
Fri Jul 16 01:43:21 AEST 2021


Hi Jeremy,

> I see you've sorted this, but for anyone else following along: this is set in the platform configuration. On OpenPOWER machines, this is the 'petitboot,debug?' var, which you can set with:
> 
>    nvram --update-config petitboot,debug?=true

Thank you for your sharing.

> Back to the log:
> 
> It looks like you actually have *four* devices with a duplicate filesystem UUID: sda, sda1, sdc, and sdc1.
> 
> The duplication within the same devices appears to be due to the way the installer image is constructed - there's an is09660 filesystem on the sda adevice, and also a DOS partition table. That partition table contains a partition which then references the same iso9660 data as the underlying (non-partition) device.
>
> So, the outcome of this is that we definitely don't want to remove the duplicate supression; it will make the standard case (where only one installer image is present) appear as though you have two installers plugged-in!

No wonder! Thanks for the explanation.

> Let's proceed with the message approach then.

There is also an unusual thing, it will repeatedly detect sdc (device is virtual media).
This doesn't affect the increase of warning messages, but is this a common phenomenon?

In pb-discover.log:
[12:21:14] SKIP: sdc UUID [2020-04-04-04-38-27-00] already present (as sda)
[12:21:15] SKIP: sdc1 UUID [2020-04-04-04-38-27-00] already present (as sda)
[12:21:15] SKIP: sdc UUID [2020-04-04-04-38-27-00] already present (as sda)
[12:21:15] SKIP: sdc UUID [2020-04-04-04-38-27-00] already present (as sda)


Through your knowledge sharing and guidance, I re-modified the code:
+			if (strncmp(name, ddev->device->id, strlen(ddev->device->id)) && (strlen(name) > strlen(ddev->device->id))) {
+				char temp[] = "sdx";
+				strncpy(temp, name, strlen(ddev->device->id));
+				device_handler_status_info(udev->handler,
+				_("[%s] Duplicate filesystem has been detected (as %s); only listing the first"), 
+				temp, ddev->device->id);
+ 			}

Due to the repeated detection, the warning message will only be displayed when sd** is detected.
The judgment condition is: in the case of the same UUID, the device name is different from the existing device name, and the length of the device name is greater than the existing device name.

This is the message displayed in the system status log:
" [sdc] Duplicate filesystem has been detected (as sda); only listing the first "
Need to modify the description?
The number of strings is the limit displayed on one line.
Other logs are described by one line, tried to wrap, but it will cause the format to run away...

Thanks,
-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