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 :-)

astorije
  • 183
  • 6

5 Answers5

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.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
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.

bobstro
  • 3,978
  • 15
  • 27
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.

joan
  • 71,852
  • 5
  • 76
  • 108
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.

WineSoaked
  • 350
  • 2
  • 10
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.

cjs
  • 823
  • 1
  • 6
  • 15