File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -450,8 +450,27 @@ BBIO_err load_device_tree(const char *name)
450450#endif
451451
452452 char line [256 ];
453+ char buf [1035 ];
454+ const char * cmd = "grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline" ;
455+ FILE * fp ;
456+
457+ fprintf (stderr , "load_device_tree: cmd=%s\n" , cmd );
458+ fp = popen (cmd , "r" );
459+ if (fp == NULL ) {
460+ fprintf (stderr , "load_device_tree: failed to run command\n" );
461+ #ifndef NO_PYTHON
462+ PyErr_SetFromErrnoWithFilename (PyExc_IOError , cmd );
463+ #endif // !NO_PYTHON
464+ return BBIO_CAPE ;
465+ }
466+ while (fgets (buf , sizeof (buf )- 1 , fp ) != NULL ) {
467+ fprintf (stderr , "load_device_tree: %s\n" , buf );
468+ }
469+ pclose (fp );
470+
453471
454472 snprintf (slots , sizeof (slots ), "%s/slots" , ctrl_dir );
473+ fprintf (stderr , "load_device_tree: slots=%s\n" , slots );
455474
456475 file = fopen (slots , "r+" );
457476 if (!file ) {
@@ -462,6 +481,7 @@ BBIO_err load_device_tree(const char *name)
462481 }
463482
464483 while (fgets (line , sizeof (line ), file )) {
484+ fprintf (stderr , "load_device_tree: line=%s\n" , slots );
465485 //the device is already loaded, return 1
466486 if (strstr (line , name )) {
467487 fclose (file );
You can’t perform that action at this time.
0 commit comments