Commit 78b606fc authored by Tomi Leppänen's avatar Tomi Leppänen

[qtbase] Skip rootfs in QStorageInfo. Contributes to JB#50211

Skips rootfs device since there is another device for /. It may exist
because / has been pivot from rootfs to ext4 on boot but it's typically
not useful. This allows another device mounted to the same mount point
to overwrite rootfs device.
Signed-off-by: Tomi Leppänen's avatarTomi Leppänen <tomi.leppanen@jolla.com>
parent d63a8c6c
......@@ -459,7 +459,10 @@ void QStorageInfoPrivate::initRootPath()
const QString mountDir = it.rootPath();
const QByteArray fsName = it.fileSystemType();
// we try to find most suitable entry
if (isParentOf(mountDir, oldRootPath) && maxLength < mountDir.length()) {
if (isParentOf(mountDir, oldRootPath)
&& (maxLength < mountDir.length()
// Alternative device that's not rootfs, overwrites pivoted root
|| (rootPath == mountDir && device == "rootfs"))) {
maxLength = mountDir.length();
rootPath = mountDir;
device = it.device();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment