Skip to content

make work on newer BBB images? #372

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,24 @@ int get_spi_bus_path_number(unsigned int spi)
If u-boot overlays are enabled, then device tree overlays should not
be loaded with the cape manager by writing to the slots file. There
is currently a kernel bug that causes the write to hang.

On even newer images, bone_capemgr is not a thing. Instead, maybe we look
for /proc/device-tree/chosen/overlays ?

*/
int uboot_overlay_enabled(void) {
const char *cmd = "/bin/grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline";
char uboot_overlay;
FILE *file = NULL;

file = fopen("/proc/device-tree/chosen/overlays","r");
if (file != NULL) {
fclose(file);
syslog(LOG_DEBUG, "Adafruit_BBIO: uboot_overlay_enabled() is true\n");
return 1;
}


file = popen(cmd, "r");
if (file == NULL) {
fprintf(stderr, "error: uboot_overlay_enabled() failed to run cmd=%s\n", cmd);
Expand Down