From 1418a5f6e6a2aedfe700e0d248627278da3d1a87 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Fri, 23 Feb 2018 23:47:14 +0100 Subject: [PATCH] show system disk info in DIR --- apps/cs-bos_app.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/cs-bos_app.lua b/apps/cs-bos_app.lua index d9763b3..c18dc91 100644 --- a/apps/cs-bos_app.lua +++ b/apps/cs-bos_app.lua @@ -146,6 +146,7 @@ laptop.register_app("cs-bos_launcher", { receive_fields_func = function(cs_bos, mtos, sender, fields) local data = mtos.bdev:get_app_storage('ram', 'cs_bos') + local sysos = mtos.bdev:get_app_storage('ram', 'os') local sdata = mtos.bdev:get_app_storage('system', 'cs_bos') or {} -- handle temporary if no sysdata given initialize_data(data, sdata, mtos) @@ -199,10 +200,21 @@ laptop.register_app("cs-bos_launcher", { elseif exec_command == "DIR" then - local idata = mtos.bdev:get_removable_disk() - add_outline(data, 'VIEWING CONTENTS OF DISK 0: '..idata.label) - add_outline(data, "FORMAT: "..idata.os_format) - add_outline(data, '') + if sysos.booted_from == "removable" then + local idata = mtos.bdev:get_removable_disk() + if idata and idata.label then + add_outline(data, 'VIEWING CONTENTS OF DISK 0: '..idata.label) + add_outline(data, "FORMAT: "..idata.os_format) + add_outline(data, '') + else + add_outline(data, 'ERROR ACCESSING DISK 0: ') + add_outline(data, '') + end + else + add_outline(data, 'VIEWING CONTENTS OF HARD DISK 0: ') + add_outline(data, "FORMAT: bootable") + add_outline(data, '') + end for k, v in pairs(laptop.apps) do if is_executable_app(mtos, v) then add_outline(data, k:upper().."* " .. (v.app_info or ""))