graphics() raspian detection fix

This commit is contained in:
Sebastian Hildebrandt 2019-01-13 14:48:56 +01:00
parent fa7e7c5d12
commit 951806b400
2 changed files with 10 additions and 6 deletions

View File

@ -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';

View File

@ -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)
}