Raspiblitz: Test Raspbian Buster Lite as base image to reduce bloat

Created on 16 May 2020  路  14Comments  路  Source: rootzoll/raspiblitz

Most sotftware included in the Raspbian Desktop in not used in the RaspiBlitz.

Will attempt to build the SDCard image with the minimal image and identify what is missing if anything.

For the Odroid build I am using a 149 MB minimal Buster image ( https://www.armbian.com/odroid-xu4/) vs Raspbian desktop 1136 MB and even the Lite is 434 MB (https://www.raspberrypi.org/downloads/raspbian/).

Most helpful comment

Installing LXDE seems to defeat the purpose of starting with the Lite image as it adds 464 packages

/o

BlitzTUI does not exactly require that LXDE is used... We could investigate other Window, Display and Logon Managers... Actually... No desktop environment is strictly required... If I recall correctly the only hard requirement is the XServer...

All 14 comments

If I recall correctly then the switch from Lite to Desktop happened when I added BlitzTUI as this uses the XServer, Display / Window manager and such things.

Getting it to work was a lot simpler by choosing the big image and selectively removing or disabling stuff.

Build_sd also already removes many unnecessary packages.

RaspiBlitz is running with the Desktop version from the beginning.

I think it is worth trying to identify the required extra, seems simpler to me then finding all the unnecessary packages.

Okay.. Then I mixed this up.. But I definitely started on creating a PyQT5 GUI from a reduced image and abandoned the approach.

I think it is worth trying to identify the required extra, seems simpler to me then finding all the unnecessary packages

Agreed.

Successfully built the SDcard manually on Raspbian Buster Lite.
It has half the installed packages compared to the desktop version (~500 vs ~1100) !
The LCD is working already so will continue with testing the individual services (especially the TUI).

Only needs some extra packages for the xserver and display drivers:

The following NEW packages will be installed:
  libdrm-amdgpu1 libdrm-common libdrm-nouveau2 libdrm-radeon1 libdrm2 libegl-mesa0 libegl1 libegl1-mesa libepoxy0 libevdev2 libfontenc1 libgbm1 libgl1 libgl1-mesa-dri libglapi-mesa
  libglvnd0 libglx-mesa0 libglx0 libice6 libllvm9 libmtdev1 libpciaccess0 libpixman-1-0 libsensors-config libsensors5 libsm6 libunwind8 libwayland-client0 libwayland-server0
  libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxcb-xfixes0 libxdamage1 libxfixes3 libxfont2 libxkbfile1 libxmu6 libxpm4 libxshmfence1
  libxt6 libxxf86vm1 x11-common x11-xkb-utils xfonts-base xfonts-encodings xfonts-utils xserver-common xserver-xorg-core xserver-xorg-input-evdev

As expected there are missing dependencies for the TUI during recovery:

Turn ON: LCD ROTATE
rm: cannot remove '/etc/X11/xorg.conf.d/40-libinput.conf': No such file or directory
OK - a restart is needed: sudo shutdown -r now
Provisioning Touchscreen - run config script
Turn ON: Touchscreen
making sure system dependencies are installed
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
installing BlitzTUI (including python dependencies)
/home/admin/config.scripts/blitz.touchscreen.sh: line 39: /home/admin/python3-env-lnd/bin/pip: No such file or directory
sed: can't read /etc/lightdm/lightdm.conf: No such file or directory
grep: /etc/lightdm/lightdm.conf: No such file or directory
tee: /etc/xdg/lxsession/LXDE-pi/autostart: No such file or directory
sed: can't read /etc/xdg/openbox/lxde-pi-rc.xml: No such file or directory
sed: can't read /etc/xdg/openbox/lxde-pi-rc.xml: No such file or directory
sed: can't read /usr/share/themes/PiXflat/openbox-3/themerc: No such file or directory
sed: can't read /usr/share/themes/PiXflat/openbox-3/themerc: No such file or directory
sed: can't read /etc/xdg/openbox/lxde-pi-rc.xml: No such file or directory
make sure pi is member of lndreadonly and lndinvoice
make sure symlink to central app-data directory exists
LCD is rotated into default - no touchscreen rotate
OK - a restart is needed: sudo shutdown -r now
Provisioning UPS - not active
Provisioning LNbits - run config script
making sure services are not running
*** INSTALL LNbits ***

@openoms what dependencies are still missing?

seems to be PIP issues
added:

# make sure /usr/bin/pip exists (and calls pip3 in Debian Buster)
sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

PR incoming, but building again first on Raspbian Lite

now installs without errors, but I guess still would need things like
LXDE and lightDM at least

Turn ON: Touchscreen
making sure system dependencies are installed
installing BlitzTUI (including python dependencies)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing ./raspiblitz/home.admin/BlitzTUI
Requirement already satisfied: googleapis-common-protos in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (1.51.0)
Requirement already satisfied: grpcio in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (1.29.0)
Requirement already satisfied: inotify in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (0.2.10)
Requirement already satisfied: psutil in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (5.7.0)
Requirement already satisfied: pyqtspinner in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (0.1.1)
Requirement already satisfied: qrcode in ./python3-env-lnd/lib/python3.7/site-packages (from BlitzTUI==0.46.1) (6.1)
Requirement already satisfied: protobuf>=3.6.0 in ./python3-env-lnd/lib/python3.7/site-packages (from googleapis-common-protos->BlitzTUI==0.46.1) (3.11.3)
Requirement already satisfied: six>=1.5.2 in /usr/lib/python3/dist-packages (from grpcio->BlitzTUI==0.46.1) (1.12.0)
Requirement already satisfied: nose in ./python3-env-lnd/lib/python3.7/site-packages (from inotify->BlitzTUI==0.46.1) (1.3.7)
Requirement already satisfied: setuptools in ./python3-env-lnd/lib/python3.7/site-packages (from protobuf>=3.6.0->googleapis-common-protos->BlitzTUI==0.46.1) (40.8.0)
Building wheels for collected packages: BlitzTUI
  Running setup.py bdist_wheel for BlitzTUI ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-6w74ou9h/wheels/f9/0b/dd/649ceef3de574283bea3013c5137570269cca956963db31bd6
Successfully built BlitzTUI
Installing collected packages: BlitzTUI
  Found existing installation: BlitzTUI 0.46.1
    Uninstalling BlitzTUI-0.46.1:
      Successfully uninstalled BlitzTUI-0.46.1
Successfully installed BlitzTUI-0.46.1

Adding lightDM was necessary, more packages:

$ sudo apt install lightdm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  busybox desktop-base fonts-quicksand gnome-accessibility-themes gnome-themes-extra gnome-themes-extra-data gtk2-engines-pixbuf initramfs-tools initramfs-tools-core klibc-utils libindicator3-7 libklibc
  liblightdm-gobject-1-0 libplymouth4 libxklavier16 lightdm-gtk-greeter linux-base pigz plymouth plymouth-label xserver-xorg xserver-xorg-legacy xserver-xorg-video-all xserver-xorg-video-amdgpu
  xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-nouveau xserver-xorg-video-radeon xserver-xorg-video-vesa
Suggested packages:
  gnome | kde-standard | xfce4 | wmaker accountsservice upower xserver-xephyr plymouth-themes firmware-amd-graphics xserver-xorg-video-r128 xserver-xorg-video-mach64
The following NEW packages will be installed:
  busybox desktop-base fonts-quicksand gnome-accessibility-themes gnome-themes-extra gnome-themes-extra-data gtk2-engines-pixbuf initramfs-tools initramfs-tools-core klibc-utils libindicator3-7 libklibc
  liblightdm-gobject-1-0 libplymouth4 libxklavier16 lightdm lightdm-gtk-greeter linux-base pigz plymouth plymouth-label xserver-xorg xserver-xorg-legacy xserver-xorg-video-all xserver-xorg-video-amdgpu
  xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-nouveau xserver-xorg-video-radeon xserver-xorg-video-vesa
0 upgraded, 30 newly installed, 0 to remove and 15 not upgraded.
Need to get 12.4 MB of archives.
After this operation, 29.1 MB of additional disk space will be used.

Installing LXDE seems to defeat the purpose of starting with the Lite image as it adds 464 packages including the desktop tools like libreoffice and media players https://pastebin.com/raw/sh5qtLGk

The experiment is still useful since Armbian has no desktop version and just got my Odroid C4 with a display so curious if I can make the TUI work on that.

Installing LXDE seems to defeat the purpose of starting with the Lite image as it adds 464 packages

/o

BlitzTUI does not exactly require that LXDE is used... We could investigate other Window, Display and Logon Managers... Actually... No desktop environment is strictly required... If I recall correctly the only hard requirement is the XServer...

@frennkie getting rid of LXDE could be a good research case for the future, but currently the BlitzTUI relies on it for autostart and login at least.

Good news that Armbian has the LXDE desktop as a built-in option as well.

@openoms and @frennkie is it realistic now to go with the minimal Raspbian already for v1.6 or are we pushing this a bit back?

@rootzoll this research has given me valuable insights, but currently I don't think it is any practical to base on the minimal image.
Would need to reinstall most packages which are present in the desktop image so not achieving much while significantly complicating the SDcard build.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tiero picture tiero  路  4Comments

syracusebitcoin picture syracusebitcoin  路  3Comments

ChuckNorrison picture ChuckNorrison  路  4Comments

rootzoll picture rootzoll  路  3Comments

shawnyeager picture shawnyeager  路  3Comments