Guide: use adb & fastboot on Fedora for installing custom Android OS

From Ask Fedora to Proposed Common Issues

Added howto

As discussed here, Common Issues are not meant as a place to publishing guides and howtos. Alternatives are discussed in the linked thread. Moving to Ask Fedora at this moment.

3 Likes

From Proposed Common Issues to Ask Fedora

Hi, I was just trying your method now on my Kinoite (Version: 40.20241026.0 (2024-10-26T00:48:56Z)), but it doesn’t seem to pick up the udev rules for some reason.
I did this:

  1. Install Chromium and android-tools by layering
  2. Symlink the rules from the package to the rules.d folder
  3. Create and add myself to the plugdev group
  4. Refreshed the rules with udevadm
  5. Open the web installer in Chromium
  6. Press “Unlock bootloader”
  7. Select the Pixel phone from USB connections

Here I get stuck because I get this error:

Error: Failed to execute 'open' on 'USBDevice': Access denied.

I checked it out in the terminal and ran fastboot devices to see if it is detected and I get this error:

no permissions (missing udev rules? user is in the plugdev group); see [http://developer.android.com/tools/device.html]      fastboot

Instead it is detected if I do sudo fastboot devices, so I’m wondering, has there been any change to how to activate the rules since your post?

2 Likes

Hm, for me the CLI method was also the only one working, but I think it was with sudo too.

This should be working.

Maybe try copying the rules instead.

Also maybe try restoring the SELinux contexts of these rules. Show them with ls -Z /etc/polkit-1/rules.d and fixe it with chcon

Hm, for me the CLI method was also the only one working

Oh, from the discussion I thought that the web installer had worked for some, so I assumed you did that too.

Maybe try copying the rules instead.

I tried copying too, yes, same result unfortunately.

Also maybe try restoring the SELinux contexts of these rules.

Sorry, I’m not familiar with it, could you tell me how to do that? This is the output of the command:

$ sudo ls -Z /etc/polkit-1/rules.d
system_u:object_r:etc_t:s0 49-polkit-pkla-compat.rules
1 Like

Oh sorry, udev not polkit.

You can display the SELinux of the regularly placed files and fix the context of all files withchcon. I guess restorecon works too for automatic labelling.

restorecon -R /etc/udev/rules.d

That likely doesnt fix the problem though

Yeah, fastboot still doesn’t list any devices, here’s the context I get now after running restorecon on the directory:

unconfined_u:object_r:udev_rules_t:s0 51-android.rules
1 Like

For this time I caved in (sorry, was too excited to finally get my first Graphene OS installation done and playing around with my phone) and installed it through the command line using sudo where necessary:

  • unlocking the bootloader
  • running the flash-all.sh script
  • re-locking the bootloader

I’m still curious why the udev rules didn’t work, I hope my post was at least useful to report on the problem.
Thanks everyone in the meantime :))

1 Like

Ooooh did you use the Google fastboot binaries?

I edited the install script back then

I know that, will install a couple of phones soon.

1 Like

Nope, I used the ones included in the Fedora repos, so the same I have layered before.
I also didn’t need to perform any editing, just followed the guide, aside from using the pre-installed unzip instead of bsdtar for decompressing the archive containing the OS files.
Would love to know if you get any different results in you future testing!

Yeah their strange bsdtar guides are weird Ubuntu quirks. I tried editing the guide for Fedora once but didnt finish it. Should do a next attempt.

Yeah their strange bsdtar guides are weird Ubuntu quirks

I see, lucky we have more humane tools XD

I tried editing the guide for Fedora once but didnt finish it

That would be neat! Do you mean the guide on CLI install guide | Install | GrapheneOS?

1 Like

Yes, Fedora is not officially supported so this is kind of an issue .

But Fedora fastboot now works? In the past I needed to use googles binaries as Fedora fastboot gave strange issues

It did, yes! I didn’t need to go through any other third-party route

1 Like

easiest way i use always is just download JetBrains Toolbox and then install android tools from there and done all working

That is very abstract XD and trust some 3rd parties

1 Like

What they said, also that’s just extra steps if you don’t use JetBrains already, guess it’s a tad more convenient for those who do though

Is all this still current as of May 2025? I am using Fedora 41 Workstation.

I want to use adb and fastboot to flash a custom rom on my phone.

1 Like