8

I am the lucky owner of a Raspberry Pi 2 on which I installed Raspbian:

$ cat /proc/version
Linux version 3.18.11-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015

In an attempt to make my very own RMS happy, I want to remove the non-free packages that ship with it by default (I already took care of sonic-pi which appears to be non-free...)

$ vrms
        Non-free packages installed on oufmalade....

firmware-atheros                    Binary firmware for Atheros wireless cards
firmware-brcm80211                  Binary firmware for Broadcom 802.11 wireless cards
firmware-libertas                   Binary firmware for Marvell Libertas 8xxx wireless car
firmware-ralink                     Binary firmware for Ralink wireless cards
firmware-realtek                    Binary firmware for Realtek wired and wireless network
oracle-java8-jdk                    Java™ Platform, Standard Edition 8 Development Kit
pistore                             Pi Store is the official store for Rasp. Pi apps and g
wolfram-engine                      Mathematica® and the Wolfram Language

  8 non-free packages, 0.9% of 886 installed packages.

I am wondering:

  1. Regarding all these firmware-* packages, knowing that I am on the wired network (through the on-board Ethernet port) with no Wi-Fi dongle (and this Pi will never get one), am I safe to remove them? Even the firmware-realtek one? I don't think the on-board Ethernet is by Realtek but I prefer to double-check otherwise I'll lose my one and only SSH access...

    For what it's worth, here is the only result of $ sudo lshw | grep firmware:

       configuration: autonegotiation=on broadcast=yes driver=smsc95xx driverversion=22-Aug-2005 duplex=full firmware=smsc95xx USB 2.0 Ethernet ip=... link=yes multicast=yes port=MII speed=100Mbit/s
    
  2. What would I lose exactly with removing pistore apart from very specific apps and games I won't be using? (FYI this Pi will never have a GUI, it's a server and will live his entire life as such)
  3. Is there anything vital that ships on the standard Raspbian that depends on oracle-java8-jdk? Or on wolfram-engine?

I'm pretty sure I can safely remove all of them but I'd like to make sure I am not doing something I'll regret beforehand (especially (1.)!).


EDIT: I do not have a physical access to the machine (well, I can, but very rarely and not for another few months) nor do I plan to change distribution or re-format anything. The server is running and its smooth functioning is more important than other minor improvements :-)

7

You can remove all of that to satisfy vrms, if that's all it complains about. However, the real RMS would, I am certain, inform you that there is no way to make the pi truly free, since it requires some proprietary firmware in order to boot. I mention this because it is always possible that in the future the virtual will become more real, in which case you will encounter some insurmountable obstacles. Right now vrms presumably does not check for such things (they could likely be easily concealed anyway since they are loaded before the kernel).

  1. Regarding all these firmware-* packages

Those having nothing to do with the firmware mentioned in the last paragraph. They're binary blobby things that can get included with the linux kernel due to the difference between Linux Torvald's and Richard Stallman's attitudes toward open source licencing, but I believe they aren't in the vanilla tree because they are not open source. They aren't used by any of the pi's own hardware. If you have peripherals that need them, you would either know, or easily recognize that you did once you remove them. You can put all this stuff back as easily as you removed it anyway.

The ethernet chip is not made by Realtek, or Broadcom, it's by SMSC (recently absorbed by Microchip Technology). Not all firmware is closed source; also, it may be installed by the manufacturer. I don't know which is the case here, but if I had to guess it's the latter. I.e., that firmware isn't from the kernel, and it isn't from a Raspbian package.

You can see what files were installed by a package with dpkg -L. Those all populate /lib/firmware, which is where a kernel build places stuff that's in-tree. Hence there's a lot more stuff than from those non-free packages, since the default Raspbian kernel includes it. But there's no SMSC firmware there.

I've completely removed /lib/firmware on a B running Raspbian jessie, and it boots up and connects to ethernet. Again, none of the /lib/firmware stuff has to do with the pi's own hardware.

  1. What would I lose exactly with removing pistore

I've never used pi store, but not because I have anything against it; I use google play on Android, etc. There are surprisingly few references to it here. Once again, certainly nothing crucial.

  1. Is there anything vital that ships on the standard Raspbian that depends on oracle-java8-jdk? Or on wolfram-engine?

Regular Debian doesn't include any java, but if you want a FOSS version one is available ("iced tea", aka. openjdk); I'm not sure that it's up to version 8. The system doesn't use java for anything anyway.

Wolfram-engine was added by default to Raspbian (it's not in normal Debian) for the Pi Foundation's own mysterious reasons. If you don't need it, you can remove it.

  • Thanks for this detailed answer, the closest to what I was looking for. Regarding question (1.) though, you said: "You can put all this stuff back as easily as you removed it anyway." This is unfortunately not true as I do not have physical access to the machine. Can you confirm that I can safely remove firmware-realtek without losing Ethernet connection and, therefore, SSH access? My guess after reading your answer is yes, but I want to make sure I didn't misunderstand your statement. – astorije Aug 15 '15 at 12:38
  • I can confirm that it is safe to remove; I've edited in a few paragraphs under (1.) explaining how I tested this. – goldilocks Aug 15 '15 at 13:04
  • Great, thanks a lot! I've removed them all and the world hasn't changed since then! – astorije Aug 15 '15 at 17:40
  • Do I need any of the firmware-* mentioned above for an Edimax WiFi dongle? – KeyWeeUsr Jan 3 '17 at 16:59
4

Debian seems to think not: "The Raspberry Pi boots from its GPU and only non-free software is currently available for the GPU, even starting the machine requires a large (2MB) blob of non-free, unsupportable software"

You can definitely dump java and wolfram. I get rid of those right away. As to the drivers, it might be easiest just to duplicate your card and try removing them on a test copy before you get yourself stuck.

If you just want to make vrms not complain, you might be able to remove some/most of the flagged packages, but getting it to "real" RMS standards -- actually not using any non-free software, not just getting rid of vrms flagged debian packages -- with raspbian might be impossible.

  • Thanks for the Debian link, it will be helpful to others. Regarding java and wolfram, I had little doubt but preferred to double check. As said in the original question, I only have an SSH access to the machine, not physical access, so I will not try anything that can lock myself out :-) – astorije Aug 15 '15 at 12:26
  • Oh and yeah, I figured that I will only be able to make vrms happy as the Raspberry Pi runs non-free hardware. On the other hand, although the very real RMS spends his days literally steps away from my machine, I don't think he will ever pay attention to it :-) – astorije Aug 15 '15 at 12:31
2

You can delete all the packages you mentioned with the noted possible exception of the Realtek wired and wireless firmware.

Personally I'd just delete the Realtek firmware and take the unlikely hit you have to put it back.

The other packages are not needed and some like Wolfram and Java take a significant amount of SD card space.

pistore is a failed experiment. I don't understand why it is still shipped as part of the image.

  • Thanks for the answer, I will do that. Except taking the risk of getting locked out as I do not have physical access to the machine, just SSH access. I'll keep investigate for that... – astorije Aug 15 '15 at 12:32
1

I keep thinking that using Minibian might be the answer to this. However, I am not clear if they include any of those non-free packages or not. I'm also a bit busy right now to check.

Either way, even if they did include them, you'd probably have fewer things to remove if you started with Minibian.

  • As I just mentioned in the edit of my question, I do not plan to format my SD card or change distribution so this is not a suitable solution. Thanks for your help though, but I'd like to find a direct answer to my question rather than going around it :-) – astorije Aug 15 '15 at 12:18
  • All I can say is ¯\_(ツ)_/¯ I would be extra extra careful about deleting packages, if you don't have physical access (or if it's not in close proximity). All of this package removing business should've been done before you installed the Pi wherever it is, to be honest. Good luck! – WineSoaked Aug 15 '15 at 19:07
  • I must disagree, it is becoming more rare to have a physical access to a server, when even possible. And not all virtual instances are easy to spin up a duplicate! Extra careful, yes, but we are talking about software edits here, nothing hardware really. Anyway, my problem got solved so no worries :) – astorije Aug 16 '15 at 20:33
  • Glad you got it worked out! All I was cautioning is that, when installing an embedded device (i.e. Raspberry Pi) at a remote location, you should already have your software/firmware sorted out prior to that installation. – WineSoaked Aug 16 '15 at 20:44
1

To clarify something in goldilocks' answer, not all of the code under /lib/firmware is "[loaded into] the Linux kernel"; some of it is loaded directly into devices attached via USB or other means. For example, on a Raspberry Pi Zero W you will see the following message in your logs:

btuart[416]: Flash firmware /lib/firmware/BCM43430A1.hcd

This is the bcm43xx driver uploading firmware to the device. (In fact, it's uploading a patch to the firmware to the device's RAM; this is why it needs to be reloaded on every reboot. I don't know how well the Bluetooth on the Pi Zero W would function without this patch.)

Whether you consider "nonfree" code loaded into devices to be ok really depends on your point of view. In situations like the above, the nonfree code must stay on your disk, but the CPU never runs it. In other situations you might be able to load the code into the device once and then remove the code from your disk, with the nonfree code remaining in flash memory or similar on the device. That seems pretty similar to having bought a device with nonfree code preloaded in its flash memory or in ROM, such as the GPU (and perhaps other parts) of the Pi. One might even consider the wiring of the transistors on the chips to be non-free if they're not available for you to copy and modify.

sudo journalctl | grep -i firmware will help you to determine what firmware you really need on your system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.