system: also get rota information

This commit is contained in:
Girish Ramakrishnan
2024-09-30 14:09:02 +02:00
parent 40e7ee91d7
commit ea2479beda

View File

@@ -314,7 +314,7 @@ async function getLogs(unit, options) {
}
async function getBlockDevices() {
const result = await shell.exec('getBlockDevices', 'lsblk --paths --json --list --fs', {});
const result = await shell.exec('getBlockDevices', 'lsblk --paths --json --list --fs --output +rota', {});
const info = safe.JSON.parse(result);
if (!info) throw new BoxError(BoxError.INTERNAL_ERROR, `failed to parse lsblk: ${safe.error.message}`);
@@ -328,6 +328,7 @@ async function getBlockDevices() {
size: d.fsavail || 0,
type: d.fstype,
uuid: d.uuid,
rota: d.rota, // false (ssd) true (hdd)
mountpoint: d.mountpoints ? d.mountpoints.pop() : d.mountpoint // we only support one mountpoint here old lsblk only exposed one via .mountpoint
};
});