pmaports/main/devicepkg-dev/devicepkg_package.sh
Minecrell e3d07c832c
main/{devicepkg-dev,postmarketos-mkinitfs}: statically generate splash screens (!899)
We need to generate the splash screens separately for each device,
because they are specific to the device's display resolution.

At the moment we do this dynamically during the installation process.
This has the advantage that there is no need to re-build all device
packages when one of the splash screen is changed (or a new one is added).

In reality, however, the splash screens do not change very frequently.
On the other hand, generating the splash screens dynamically has signficant
disk usage overhead for a minimal ("none" UI) rootfs:

The Python interpreter together with the necessary libraries requires
about ~60 MB of disk space on aarch64.
The splash screens itself require about ~100 KB for 720x1280.

This is not necessary if we move the splash screen generation into
devicepkg-dev, which is used to build the device package for all devices.
Another advantage is that we no longer need the (rather complicated)
caching mechanism for splash screens - so we actually end up with less
lines than before.

rootfs size for samsung-a5ulte ("none" UI):
  Before: 450M
  After:  388M (-62M)

After this change, every(!) device package needs to be rebuilt once.
No changes are necessary in device packages.
2020-01-28 15:33:40 +01:00

33 lines
887 B
Bash

#!/bin/sh
startdir=$1
pkgname=$2
if [ -z "$startdir" ] || [ -z "$pkgname" ]; then
echo "ERROR: missing argument!"
echo "Please call $0 with \$startdir \$pkgname as arguments."
exit 1
fi
srcdir="$startdir/src"
pkgdir="$startdir/pkg/$pkgname"
if [ ! -f "$srcdir/deviceinfo" ]; then
echo "NOTE: $0 is intended to be used inside of the package() function"
echo "of a device package's APKBUILD only."
echo "ERROR: deviceinfo file missing!"
exit 1
fi
install -Dm644 "$srcdir/deviceinfo" \
"$pkgdir/etc/deviceinfo"
install -Dm644 -t "$pkgdir/usr/share/postmarketos-splashes" "$srcdir"/*.ppm.gz
if [ -f "$srcdir/90-$pkgname.rules" ]; then
install -Dm644 "$srcdir/90-$pkgname.rules" \
"$pkgdir/etc/udev/rules.d/90-$pkgname.rules"
fi
if [ -f "$srcdir/initfs-hook.sh" ]; then
install -Dm644 "$srcdir/initfs-hook.sh" \
"$pkgdir/etc/postmarketos-mkinitfs/hooks/00-$pkgname.sh"
fi