Infrastructure #1003
closedCleanup buildroot config
Added by Hammel over 1 year ago. Updated about 1 year ago.
100%
Description
There seems to be a lot of cruft in the config - packages I don't really need. It's made the rootfs (even without nodejs now) 1.7G.
Clean up the config to reduce the disk space used.
Related issues
Updated by Hammel about 1 year ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
This is going to be a little more work than just removing items.
While browsing the configuration I found that there are options I'd like to enable, such as the VC4 Mesa driver. But that can't be enabled by default because of the Target Options->Target Architecture Variant option set in the single Buildroot config. This field needs to be set based on the processor.
Hardware | Setting |
---|---|
RPi 1 | ARM1176JZF-S |
RPi 2 | Cortex-A7 |
RPi 3 | Cortex-A53 |
RPi 4 | Cortex-A72 |
RPi Zero | ARM1176JZF-S |
RPi Zero 2W | Cortex-A53 |
It's unclear if the Cortex-A53 builds will work with the Cortex-A7, but I think they will. Since Buildroot is NOT generating the kernel or toolchain, it just uses this option to identify what other Target Package options to enable for selection. So I should just be able to have the three configs: rpi1, rpi2 (which includes rpi3) and rpi4.
Updated by Hammel about 1 year ago
After browsing the entire configuration with menuconfig I find that there is not as much cruft as I thought. I suspect that the scripting languages, (perl, lua, python, possibly others) are what's taking up so much space.
Running
du -sm <target>
shows about 1.7G of data. The squashfs is 1.2G.
Taking this further
mjhammel(tty40)$ pwd /home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2023.02.2/output/target mjhammel(tty40)$ sudo du -sm * 1 THIS_IS_NOT_YOUR_ROOT_FILESYSTEM 2 bin 18 etc 1 home 125 lib 0 lib32 0 linuxrc 1 media 42 opt 1 proc 4 root 1 run 9 sbin 1 sys 1542 usr 1 var mjhammel(tty40)$ sudo du -sm usr/* 45 usr/bin 12 usr/include 244 usr/lib 0 usr/lib32 3 usr/libexec 9 usr/sbin 1231 usr/share mjhammel(tty40)$ sudo du -sm usr/share/* 6 usr/share/X11 1 usr/share/alsa 1 usr/share/applications 1 usr/share/aumix 1 usr/share/bash-completion 2 usr/share/consolefonts 1 usr/share/consoletrans 1 usr/share/ctdb 1 usr/share/dbus-1 1 usr/share/doc 1 usr/share/dvb 1 usr/share/enchant 1 usr/share/et 1 usr/share/feh 1 usr/share/ffmpeg 1 usr/share/fontconfig 11 usr/share/fonts 1 usr/share/gettext 1 usr/share/glib-2.0 1 usr/share/gnome 1 usr/share/gnome-session 1 usr/share/gtk-2.0 2 usr/share/hwdata 17 usr/share/i18n 1 usr/share/icons 1 usr/share/imlib2 2 usr/share/keymaps 1120 usr/share/legal-info 1 usr/share/libinput 41 usr/share/locale 1 usr/share/lua 1 usr/share/matchbox 1 usr/share/matchbox-keyboard 8 usr/share/misc 1 usr/share/opkg 1 usr/share/pixmaps 1 usr/share/screen 2 usr/share/sounds 1 usr/share/ss 1 usr/share/tabset 8 usr/share/terminfo 1 usr/share/themes 1 usr/share/udhcpc 1 usr/share/unimaps 14 usr/share/vim 1 usr/share/xcb 1 usr/share/xml 1 usr/share/xsessions 1 usr/share/xtables
So it appears the legal-info is taking up 1.1G of space! I can either extract it into it's own archive or compress the tree. Both of these should be tried to see what works best.
Updated by Hammel about 1 year ago
- Related to Feature #792: Try adding opengl to cairo in Launcher added
Updated by Hammel about 1 year ago
- % Done changed from 10 to 50
Duh. I'm a moron.
The postbuild.sh script is copying the legal-files from Buildroot's build tree to /usr/share/legal-info in the target. So, instead of doing that, I can just have the Buildroot targets generate an archive of the legal-info data as an extra distributable file, compressed of course. And remove the legal-info handling out of postbuild.sh
That will really save room on the SD card. And for devices like the PinePhone that have an eMMC that can be very useful to extend the life of the storage device.
For now, just clean up the legal-files. I'll return to the multiple-config files for the rootfs later when I'm working on adding OpenGL support for Cairo (RM #792).
Updated by Hammel about 1 year ago
- % Done changed from 50 to 70
rpi2 sandbox has the update and the updated build has been run. The squashfs is now down to 200M+.
This build needs to be tested on hardware. It seems unlikely to cause any problems but it still needs to be tested.
Updated by Hammel about 1 year ago
- Status changed from In Progress to Closed
- % Done changed from 70 to 100
Tested on RPi2. Works fine. SD card creation is a bit faster, of course.
Changes committed and pushed.
Closing issue.