Skip to content
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

sudo not actually needed for running rpiboot if debian package installed (which is how the instructions say to install) #3884

Open
AndySchroder opened this issue Oct 14, 2024 · 7 comments

Comments

@AndySchroder
Copy link

In

==== on Linux
To set up software on a Linux host device:
. Run the following command to install `rpiboot`:
+
[source,console]
----
$ sudo apt install rpiboot
----
. Connect the IO Board to power.
. Then, run `rpiboot`:
+
[source,console]
----
$ sudo rpiboot
----
. After a few seconds, the Compute Module should appear as a mass storage device. Check the `/dev/` directory, likely `/dev/sda` or `/dev/sdb`, for the device. Alternatively, run `lsblk` and search for a device with a storage capacity that matches the capacity of your Compute Module.
TIP: Alternatively, you can https://github.com/raspberrypi/usbboot[build `rpiboot` from source].
you suggest installing a debian package on linux and then later as part of that process suggest using sudo to run rpiboot

However, sudo is not needed using these instructions. The debian package installs a UDEV rule in /lib/udev/rules.d/70-rpiboot.rules which avoids the need for sudo.

See

https://github.com/raspberrypi/usbboot/blob/d0a2ed95ade02fbc042d325a22e4a7abcaf8fd34/debian/rpiboot.install#L12

https://github.com/raspberrypi/usbboot/blob/d0a2ed95ade02fbc042d325a22e4a7abcaf8fd34/debian/70-rpiboot.rules#L1

@nathan-contino
Copy link
Collaborator

Strange. I've always had to use sudo to run rpiboot. I wonder if this has changed recently? Or have I simply always used it unnecessarily?

@AndySchroder
Copy link
Author

If you compile from source, then sudo is needed. If you use the debian package, it seems you don't. Are you able to confirm?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@lurch
Copy link
Contributor

lurch commented Dec 16, 2024

Strange. I've always had to use sudo to run rpiboot. I wonder if this has changed recently? Or have I simply always used it unnecessarily?

Trawling back through the GitHub history, it looks like sudo hasn't been needed by rpiboot on Raspberry Pi OS since 2020! raspberrypi/usbboot#27

However I suspect there may be some confusion in the documentation between "on Linux" meaning "Linux (e.g. Ubuntu) on an x86 PC" and "on Linux" meaning "Raspberry Pi OS running on a Raspberry Pi"?

  • AFAIK if you're running Pi OS on a Raspberry Pi then you can do sudo apt install rpiboot and you can also run rpiboot without using sudo.
  • But I think that if you're running Linux on a generic PC, then you won't be able to sudo apt install rpiboot (because it's probably only packaged in the Raspberry Pi OS APT repos) and you'll therefore need to build rpiboot from source (just like on macOS) and then you will need to use sudo rpiboot ? 🤔

@AndySchroder
Copy link
Author

I'm running ubuntu, that uses the debian package. As mentioned in my original post, sudo is not needed.

@lurch
Copy link
Contributor

lurch commented Dec 16, 2024

I'm running ubuntu, that uses the debian package. As mentioned in my original post, sudo is not needed.

Hmmm, https://packages.debian.org/search?suite=all&searchon=names&keywords=rpiboot implies that rpiboot isn't packaged by Debian? 👀 Are you using Ubuntu on PC (i.e. x86 / x64) or Ubuntu on Raspberry Pi?

Ahhh, I've just found that it's packaged directly by Ubuntu themselves https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=rpiboot . I guess this means that you can sudo apt install rpiboot (and not need to use sudo) on "Raspberry Pi OS" or "Ubuntu" (and Ubunutu derivatives?) but not other Linux flavours. Although I see that even Ubuntu 24.10 still includes a version of rpiboot from 2022.

So I guess the instructions for rpiboot could be updated to say something like "If you're able to install rpiboot from apt then you don't need to run it with sudo; otherwise you'll need to build rpiboot from source and run it with sudo". But that's a bit of a mouthful and this is entirely @nathan-contino 's decision to make.

@AndySchroder
Copy link
Author

I'm on ubuntu 22.04, x86_64.

Agreed, the documentation at

==== on Linux
To set up software on a Linux host device:
. Run the following command to install `rpiboot`:
+
[source,console]
----
$ sudo apt install rpiboot
----
. Connect the IO Board to power.
. Then, run `rpiboot`:
+
[source,console]
----
$ sudo rpiboot
----
. After a few seconds, the Compute Module should appear as a mass storage device. Check the `/dev/` directory, likely `/dev/sda` or `/dev/sdb`, for the device. Alternatively, run `lsblk` and search for a device with a storage capacity that matches the capacity of your Compute Module.
TIP: Alternatively, you can https://github.com/raspberrypi/usbboot[build `rpiboot` from source].
is only for systems that use apt, that should be clarified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants