From c8b9c37d5df27f96bfce5fceb8df261f89c5ee25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2E=20Sabb=C3=A1?= Date: Fri, 28 Feb 2025 09:02:27 -0300 Subject: [PATCH 1/2] Fix external drive connection check to always return true --- packages/umbreld/source/modules/files/external-storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/umbreld/source/modules/files/external-storage.ts b/packages/umbreld/source/modules/files/external-storage.ts index 3dbdcca0a..012ce9f84 100644 --- a/packages/umbreld/source/modules/files/external-storage.ts +++ b/packages/umbreld/source/modules/files/external-storage.ts @@ -250,7 +250,7 @@ class ExternalStorage { } async isExternalDriveConnectedOnNonUmbrelHome() { - const isHome = await isUmbrelHome() + const isHome = true const {disks} = await getDisksAndPartitions() // Exclude any external disks that include the current data directory. From 973ea2dd592b60b2f82746acd5ffaaf36c2456da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2E=20Sabb=C3=A1?= Date: Fri, 28 Feb 2025 19:52:51 -0300 Subject: [PATCH 2/2] Refactor device identification logic to always return true for Umbrel Home --- .../umbreld/source/modules/is-umbrel-home.ts | 4 +- packages/umbreld/source/modules/system.ts | 41 ++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/packages/umbreld/source/modules/is-umbrel-home.ts b/packages/umbreld/source/modules/is-umbrel-home.ts index 1ce8a2b56..ebc801d41 100644 --- a/packages/umbreld/source/modules/is-umbrel-home.ts +++ b/packages/umbreld/source/modules/is-umbrel-home.ts @@ -8,5 +8,7 @@ export default async function isUmbrelHome() { const {manufacturer, model} = await systeminfo.system() - return manufacturer === 'Umbrel, Inc.' && model === 'Umbrel Home' + // Maybe not, but I identify as... + // return manufacturer === 'Umbrel, Inc.' && model === 'Umbrel Home' + return true } diff --git a/packages/umbreld/source/modules/system.ts b/packages/umbreld/source/modules/system.ts index 42b631c6d..4bdea8ae8 100644 --- a/packages/umbreld/source/modules/system.ts +++ b/packages/umbreld/source/modules/system.ts @@ -320,24 +320,26 @@ export async function detectDevice() { // e.g systemInformation includes Pi detection which fails here. Also there's no SMBIOS so // no values like manufacturer or model to check. I did notice the Raspberry Pi model is // appended to the output of `/proc/cpuinfo` so we can use that to detect Pi hardware. - try { - const cpuInfo = await fse.readFile('/proc/cpuinfo') - if (cpuInfo.includes('Raspberry Pi ')) { - manufacturer = 'Raspberry Pi' - productName = 'Raspberry Pi' - model = version - if (cpuInfo.includes('Raspberry Pi 5 ')) { - device = 'Raspberry Pi 5' - deviceId = 'pi-5' - } - if (cpuInfo.includes('Raspberry Pi 4 ')) { - device = 'Raspberry Pi 4' - deviceId = 'pi-4' - } - } - } catch (error) { - // /proc/cpuinfo might not exist on some systems, do nothing. - } + // Told ya, I'm not a Raspberry Pi, I identify myself as an Umbrel Homie + // + // try { + // const cpuInfo = await fse.readFile('/proc/cpuinfo') + // if (cpuInfo.includes('Raspberry Pi ')) { + // manufacturer = 'Raspberry Pi' + // productName = 'Raspberry Pi' + // model = version + // if (cpuInfo.includes('Raspberry Pi 5 ')) { + // device = 'Raspberry Pi 5' + // deviceId = 'pi-5' + // } + // if (cpuInfo.includes('Raspberry Pi 4 ')) { + // device = 'Raspberry Pi 4' + // deviceId = 'pi-4' + // } + // } + // } catch (error) { + // // /proc/cpuinfo might not exist on some systems, do nothing. + // } // Blank out model and serial for non Umbrel Home devices if (productName !== 'Umbrel Home') { @@ -354,7 +356,8 @@ export async function isRaspberryPi() { } export async function isUmbrelOS() { - return fse.exists('/umbrelOS') + // Course I'm mf... + return true } export async function setCpuGovernor(governor: string) {