Merge pull request #289 from bazoocaze/master

Workaround for Docker mounting rootfs on /var/lib/docker/plugins
This commit is contained in:
Tony George 2018-08-26 20:27:05 +05:30 committed by GitHub
commit 3a43d78b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -870,6 +870,8 @@ public class Device : GLib.Object{
for (int i = lines.length - 1; i >= 0; i--){
bool ignoreEntry = false;
string line = lines[i].strip();
if (line.length == 0) { continue; }
@ -882,12 +884,20 @@ public class Device : GLib.Object{
int k = 1;
foreach(string val in line.split(" ")){
if (val.strip().length == 0){ continue; }
if (ignoreEntry){ break; }
switch(k++){
case 1: //device
pi.device = val.strip();
break;
case 2: //mountpoint
mp.mount_point = val.strip().replace("""\040"""," "); // replace space. TODO: other chars?
// HACK: ignore Docker mounting(?) rootfs on /var/lib/docker
if (mp.mount_point.contains("/docker")){
ignoreEntry = true;
break;
}
if (!mount_list.contains(mp.mount_point)){
mount_list.add(mp.mount_point);
pi.mount_points.add(mp);
@ -905,6 +915,8 @@ public class Device : GLib.Object{
}
}
if (ignoreEntry) { continue; }
// resolve device names ----------------
pi.device = resolve_device_name(pi.device);