disable network for lshw to fix vmware workstation bug on ubuntu 24

https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/2069649

Simon Smith committed Apr 19, 2025 at 10:44 UTC b7364d89881780d4e7b819162e5ba6d055b0305c
1 file changed +1 -1
agents/modules_meshcore/computer-identifiers.js
+1 -1
@@ -148,7 +148,7 @@ function linux_identifiers()
148 // Fetch Storage Info
149 child = require('child_process').execFile('/bin/sh', ['sh']);
150 child.stdout.str = ''; child.stdout.on('data', dataHandler);
151 - child.stdin.write("lshw -class disk | tr '\\n' '`' | awk '" + '{ len=split($0,lines,"*"); printf "["; for(i=2;i<=len;++i) { model=""; caption=""; size=""; clen=split(lines[i],item,"`"); for(j=2;j<clen;++j) { split(item[j],tokens,":"); split(tokens[1],key," "); if(key[1]=="description") { caption=substr(tokens[2],2); } if(key[1]=="product") { model=substr(tokens[2],2); } if(key[1]=="size") { size=substr(tokens[2],2); } } if(model=="") { model=caption; } if(caption!="" || model!="") { printf "%s{\\"Caption\\":\\"%s\\",\\"Model\\":\\"%s\\",\\"Size\\":\\"%s\\"}",(i==2?"":","),caption,model,size; } } printf "]"; }\'\nexit\n');
151 + child.stdin.write("lshw -class disk -disable network | tr '\\n' '`' | awk '" + '{ len=split($0,lines,"*"); printf "["; for(i=2;i<=len;++i) { model=""; caption=""; size=""; clen=split(lines[i],item,"`"); for(j=2;j<clen;++j) { split(item[j],tokens,":"); split(tokens[1],key," "); if(key[1]=="description") { caption=substr(tokens[2],2); } if(key[1]=="product") { model=substr(tokens[2],2); } if(key[1]=="size") { size=substr(tokens[2],2); } } if(model=="") { model=caption; } if(caption!="" || model!="") { printf "%s{\\"Caption\\":\\"%s\\",\\"Model\\":\\"%s\\",\\"Size\\":\\"%s\\"}",(i==2?"":","),caption,model,size; } } printf "]"; }\'\nexit\n');
152 child.waitExit();
153 try { identifiers['storage_devices'] = JSON.parse(child.stdout.str.trim()); } catch (xx) { }
154 child = null;