Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external drive connection check to always return true #1993

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/umbreld/source/modules/files/external-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion packages/umbreld/source/modules/is-umbrel-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
41 changes: 22 additions & 19 deletions packages/umbreld/source/modules/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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) {
Expand Down