Git user? Save 2.4 MB

Stuck a few MB short on my 16 MB install, I started looking at packages and what could be trimmed down. git is an important part of my workflow, but at 5 MB, also a huge part of my filesystem.

Looking into it, there are two copies each of these large binaries, that appear to be identical, one in /usr/bin and the other in /usr/lib/git-core

  • git
  • git-shell
  • git-upload-pack

I've opened a ticket on it, but until there is a formal approach, symlinks may save you enough space to do what you need without resorting to external storage.

That's pretty weird. I think I saw some duplicate file checks in the buildroot, right when it's packaging the images. Did you install these packages after flashing your firmware? Or did you include them in an image?

After flashing the firmware.

I'm still poking around in the Makefile, but it's equally strange to me that removing 2.4 MB of files only results in the "installed size" shrinking by 1.5 MB. DIdn't have a chance to try flashing it on a router last night though to see what the "real" installed size was.

I've taken to minimal builds now since it's a zero-sum game on firmware (Edit: Not the case, see below). If I need it to boot and to get connectivity for further management, it's in the image. Otherwise it's on the overlay; why have two copies around when you upgrade versions? (Yay, LEDE for updating packages regularly!)

Packages installed on the overlay are not compressed. You actually save space by including packages in your image; the image is compressed.

Of course if you have plenty flash, there's no problem with that; but then I'd imagine you were less bothered with this as well.

1 Like

:grinning: I owe you one @Borromini !

I'll still pursue the thinning of git, but...

... with block-mount, diffutils, findutils-find, git, gre, kmod-gre, less, luci-ssl-openssl, nano, python3-light, python3-logging, tcpdump-mini, wpad-mesh driving package selection over default (I probably missed one or two),

I go from 1464 kB free to 4564 kB free by including them in the firmware.

Happy to help! An added plus is you won't have duplicate packages (e.g. the files in the built-in wpad-mini wouldn't be replaced; they'd just be 'overruled' by the ones provided by wpad-mesh on the overlay).