I have been trying out GrapheneOS on my Pixel 9 for a while and have found access to some of its files by using 'adb shell'. I noticed several files in the source code (.rc files) that seem to reference files here, and I wanted to explore more of what is happening (yes, I am interested in getting involved in the code, perhaps related to this).
However, when I try taking a look at the files, some of the details are not accessible. For example:
tokay:/sys/devices/tracepoint/power $ ls -l
total 0
-????????? ? ? ? ? ? async
-????????? ? ? ? ? ? autosuspend_delay_ms
-????????? ? ? ? ? ? control
-????????? ? ? ? ? ? runtime_active_kids
-????????? ? ? ? ? ? runtime_active_time
-????????? ? ? ? ? ? runtime_enabled
-????????? ? ? ? ? ? runtime_status
-????????? ? ? ? ? ? runtime_suspended_time
-????????? ? ? ? ? ? runtime_usage
tokay:/sys/devices/tracepoint/power $ cat runtime_usage
cat: runtime_usage: Permission denied
I figured this may have been a sudo issue, so I exited the shell and tried 'adb root' to give myself the necessary permissions. But the output says 'adbd cannot run as root in production builds'.
So now I'm looking into the official build instructions to see if it mentions how to make a non-production build. But the best I could find is references about a "development build" and creating a faster build by "using the default build target rather than target-files-package". It seems to end the instructions with "Leave the bootloader unlocked and flashing the raw images that are signed with the default public test keys".
I have previously been building GrapheneOS and making "signed factory images"; I would unzip the factory zip and be able to flash the new image onto my Pixel 9. But when doing it in the same directory, but just adjusting the commands to try building for development build, it hasn't been working. I tried the following, but all still lead to my 'cannot run as root' issue:
- Ensured I did 'lunch tokay-cur-userdebug' instead of 'lunch tokay-cur-user'
- Tried running 'm' instead of 'm vendorbootimage vendorkernelbootimage target-files-package'
- Did 'rm -r out' and run 'm' again i.e., build from scratch
- Instead of making signed factory image, grab just the output images (vendor_boot.img and vendor-bootconfig.img from out/target/product/tokay/) and replace the old ones from a previous signed factory image, and run .\flash_all.bat from this previous signed factory image
In short, could I get some help making a non-production build, capable of having root access in the 'adb shell' please?