graphics() raspian detection fix
This commit is contained in:
parent
fa7e7c5d12
commit
951806b400
@ -401,11 +401,11 @@ function graphics(callback) {
|
||||
let cmd = 'fbset -s | grep \'mode "\'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;';
|
||||
exec(cmd, function (error, stdout) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
if (lines.length > 3 && lines[0].indexOf('mode "' >= -1)) {
|
||||
if (lines.length > 3 && lines[0].indexOf('mode "' >= -1) && lines[2].indexOf('0x12000a') > -1) {
|
||||
const parts = lines[0].replace('mode', '').replace(/"/g, '').trim().split('x');
|
||||
if (parts.length === 2) {
|
||||
push({
|
||||
model: getValue(lines, 'device_name', '='),
|
||||
result.displays.push({
|
||||
model: util.getValue(lines, 'device_name', '='),
|
||||
main: true,
|
||||
builtin: false,
|
||||
connection: 'HDMI',
|
||||
@ -417,8 +417,8 @@ function graphics(callback) {
|
||||
})
|
||||
}
|
||||
}
|
||||
if (lines.length > 1 && lines[1].indexOf('gpu=' >= -1) {
|
||||
push({
|
||||
if (lines.length > 1 && lines[1].indexOf('gpu=' >= -1)) {
|
||||
result.controllers.push({
|
||||
vendor: 'Broadcom',
|
||||
model: 'VideoCore IV',
|
||||
bus: '',
|
||||
@ -426,6 +426,10 @@ function graphics(callback) {
|
||||
vramDynamic: true
|
||||
})
|
||||
}
|
||||
if (callback) {
|
||||
callback(result);
|
||||
}
|
||||
resolve(result);
|
||||
});
|
||||
} else {
|
||||
let cmd = 'lspci -vvv 2>/dev/null';
|
||||
|
||||
@ -300,7 +300,7 @@ function isRaspbian() {
|
||||
} catch (e) {
|
||||
return false;
|
||||
};
|
||||
const id = getValue(cpuinfo, 'id');
|
||||
const id = getValue(osrelease, 'id');
|
||||
return (id.indexOf('raspbian') >= -1)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user