gershwin-desktop / gershwin-desktop/gershwin-components

Startup Disk: Do not show if not on UEFI system

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Objective-C
Stars
8
Forks
8
Avg merge
1d 15h
Merged PRs (30d)
1

Description

```
+ (BOOL)isEFISystemAvailable
{
// Check if this system supports EFI by querying the boot method via sysctl
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/sbin/sysctl"];
[task setArguments:[NSArray arrayWithObjects:@"-n", @"machdep.bootmethod", nil]];

NSPipe *outputPipe = [NSPipe pipe];
[task setStandardOutput:outputPipe];
[task setStandardError:[NSPipe pipe]];

BOOL isEFIAvailable = NO;

@try {
[task launch];
[task waitUntilExit];

int status = [task terminationStatus];

if (status == 0) {
NSData *outputData = [[outputPipe fileHandleForReading] readDataToEndOfFile];
NSString *bootMethod = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];

// Trim whitespace and newlines
bootMethod = [bootMethod stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

// Check if boot method is UEFI
isEFIAvailable = [bootMethod isEqualToString:@"UEFI"];

[bootMethod release];
}
}
@catch (NSException *exception) {
NSLog(@"StartupDiskPane: EFI availability check failed: %@", exception);
isEFIAvailable = NO;
}

[task release];

return isEFIAvailable;
}

```

But how to tell SystemPreferences.app NOT to show the prefPane in case the test fails?

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the StartupDiskPane EFI check shown in the issue and how SystemPreferences.app discovers or loads preference panes. Locate the existing entry point that controls pane availability, then verify behavior on UEFI and non-UEFI systems; done means the Startup Disk pane is absent when the check fails. No filename or test is provided, so begin by locating the pane class and its registration metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.