lib: drop old boot_logo code; keep png/gif as they're used for plymouth

- origins of what's being dropped: https://github.com/armbian/build/pull/2065
This commit is contained in:
Ricardo Pardini 2024-03-06 03:40:47 +01:00 committed by Igor
parent f2dd9d5078
commit 5b978dc96d
9 changed files with 1 additions and 226 deletions

View File

@ -258,7 +258,7 @@ function adaptative_prepare_host_dependencies() {
dwarves # dwarves has been replaced by "pahole" and is now a transitional package
flex
gawk gnupg gpg
imagemagick # required for boot_logo, plymouth: converting images / spinners
imagemagick # required for plymouth: converting images / spinners
jq # required for parsing JSON, specially rootfs-caching related.
kmod # this causes initramfs rebuild, but is usually pre-installed, so no harm done unless it's an upgrade
libbison-dev libelf-dev libfdt-dev libfile-fcntllock-perl libmpc-dev libfl-dev liblz4-tool

View File

@ -1,136 +0,0 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#--------------------------------------------------------------------------------------------------------------------------------
# Create kernel boot logo from packages/blobs/splash/logo.png and packages/blobs/splash/spinner.gif (animated)
# and place to the file /lib/firmware/bootsplash
#--------------------------------------------------------------------------------------------------------------------------------
function boot_logo() {
# this requires `imagemagick`
display_alert "Building kernel splash logo" "$RELEASE" "info"
declare LOGO LOGO_WIDTH LOGO_HEIGHT THROBBER THROBBER_HEIGHT THROBBER_WIDTH
LOGO=${SRC}/packages/blobs/splash/logo.png
LOGO_WIDTH=$(identify $LOGO | cut -d " " -f 3 | cut -d x -f 1)
LOGO_HEIGHT=$(identify $LOGO | cut -d " " -f 3 | cut -d x -f 2)
THROBBER=${SRC}/packages/blobs/splash/spinner.gif
THROBBER_WIDTH=$(identify $THROBBER | head -1 | cut -d " " -f 3 | cut -d x -f 1)
THROBBER_HEIGHT=$(identify $THROBBER | head -1 | cut -d " " -f 3 | cut -d x -f 2)
run_host_command_logged convert -alpha remove -background "'#000000'" "$LOGO" "${SDCARD}"/tmp/logo.rgb
run_host_command_logged convert -alpha remove -background "'#000000'" "$THROBBER" "${SDCARD}"/tmp/throbber%02d.rgb
raw_command="[...shortened...] bootsplash-packer" \
run_host_x86_binary_logged "${SRC}/packages/blobs/splash/bootsplash-packer" \
--bg_red 0x00 \
--bg_green 0x00 \
--bg_blue 0x00 \
--frame_ms 48 \
--picture \
--pic_width $LOGO_WIDTH \
--pic_height $LOGO_HEIGHT \
--pic_position 0 \
--blob "${SDCARD}"/tmp/logo.rgb \
--picture \
--pic_width $THROBBER_WIDTH \
--pic_height $THROBBER_HEIGHT \
--pic_position 0x05 \
--pic_position_offset 200 \
--pic_anim_type 1 \
--pic_anim_loop 0 \
--blob "${SDCARD}"/tmp/throbber00.rgb \
--blob "${SDCARD}"/tmp/throbber01.rgb \
--blob "${SDCARD}"/tmp/throbber02.rgb \
--blob "${SDCARD}"/tmp/throbber03.rgb \
--blob "${SDCARD}"/tmp/throbber04.rgb \
--blob "${SDCARD}"/tmp/throbber05.rgb \
--blob "${SDCARD}"/tmp/throbber06.rgb \
--blob "${SDCARD}"/tmp/throbber07.rgb \
--blob "${SDCARD}"/tmp/throbber08.rgb \
--blob "${SDCARD}"/tmp/throbber09.rgb \
--blob "${SDCARD}"/tmp/throbber10.rgb \
--blob "${SDCARD}"/tmp/throbber11.rgb \
--blob "${SDCARD}"/tmp/throbber12.rgb \
--blob "${SDCARD}"/tmp/throbber13.rgb \
--blob "${SDCARD}"/tmp/throbber14.rgb \
--blob "${SDCARD}"/tmp/throbber15.rgb \
--blob "${SDCARD}"/tmp/throbber16.rgb \
--blob "${SDCARD}"/tmp/throbber17.rgb \
--blob "${SDCARD}"/tmp/throbber18.rgb \
--blob "${SDCARD}"/tmp/throbber19.rgb \
--blob "${SDCARD}"/tmp/throbber20.rgb \
--blob "${SDCARD}"/tmp/throbber21.rgb \
--blob "${SDCARD}"/tmp/throbber22.rgb \
--blob "${SDCARD}"/tmp/throbber23.rgb \
--blob "${SDCARD}"/tmp/throbber24.rgb \
--blob "${SDCARD}"/tmp/throbber25.rgb \
--blob "${SDCARD}"/tmp/throbber26.rgb \
--blob "${SDCARD}"/tmp/throbber27.rgb \
--blob "${SDCARD}"/tmp/throbber28.rgb \
--blob "${SDCARD}"/tmp/throbber29.rgb \
--blob "${SDCARD}"/tmp/throbber30.rgb \
--blob "${SDCARD}"/tmp/throbber31.rgb \
--blob "${SDCARD}"/tmp/throbber32.rgb \
--blob "${SDCARD}"/tmp/throbber33.rgb \
--blob "${SDCARD}"/tmp/throbber34.rgb \
--blob "${SDCARD}"/tmp/throbber35.rgb \
--blob "${SDCARD}"/tmp/throbber36.rgb \
--blob "${SDCARD}"/tmp/throbber37.rgb \
--blob "${SDCARD}"/tmp/throbber38.rgb \
--blob "${SDCARD}"/tmp/throbber39.rgb \
--blob "${SDCARD}"/tmp/throbber40.rgb \
--blob "${SDCARD}"/tmp/throbber41.rgb \
--blob "${SDCARD}"/tmp/throbber42.rgb \
--blob "${SDCARD}"/tmp/throbber43.rgb \
--blob "${SDCARD}"/tmp/throbber44.rgb \
--blob "${SDCARD}"/tmp/throbber45.rgb \
--blob "${SDCARD}"/tmp/throbber46.rgb \
--blob "${SDCARD}"/tmp/throbber47.rgb \
--blob "${SDCARD}"/tmp/throbber48.rgb \
--blob "${SDCARD}"/tmp/throbber49.rgb \
--blob "${SDCARD}"/tmp/throbber50.rgb \
--blob "${SDCARD}"/tmp/throbber51.rgb \
--blob "${SDCARD}"/tmp/throbber52.rgb \
--blob "${SDCARD}"/tmp/throbber53.rgb \
--blob "${SDCARD}"/tmp/throbber54.rgb \
--blob "${SDCARD}"/tmp/throbber55.rgb \
--blob "${SDCARD}"/tmp/throbber56.rgb \
--blob "${SDCARD}"/tmp/throbber57.rgb \
--blob "${SDCARD}"/tmp/throbber58.rgb \
--blob "${SDCARD}"/tmp/throbber59.rgb \
--blob "${SDCARD}"/tmp/throbber60.rgb \
--blob "${SDCARD}"/tmp/throbber61.rgb \
--blob "${SDCARD}"/tmp/throbber62.rgb \
--blob "${SDCARD}"/tmp/throbber63.rgb \
--blob "${SDCARD}"/tmp/throbber64.rgb \
--blob "${SDCARD}"/tmp/throbber65.rgb \
--blob "${SDCARD}"/tmp/throbber66.rgb \
--blob "${SDCARD}"/tmp/throbber67.rgb \
--blob "${SDCARD}"/tmp/throbber68.rgb \
--blob "${SDCARD}"/tmp/throbber69.rgb \
--blob "${SDCARD}"/tmp/throbber70.rgb \
--blob "${SDCARD}"/tmp/throbber71.rgb \
--blob "${SDCARD}"/tmp/throbber72.rgb \
--blob "${SDCARD}"/tmp/throbber73.rgb \
--blob "${SDCARD}"/tmp/throbber74.rgb \
"${SDCARD}"/lib/firmware/bootsplash.armbian \
"| { grep --line-buffered -v -e 'File header' -e 'Picture header' -e 'Blob header' -e 'length:' -e 'type:' -e 'picture_id:' -e 'bg_' -e 'num_' -e '^$' || true; }"
if [[ $BOOT_LOGO == yes || $BOOT_LOGO == desktop && $BUILD_DESKTOP == yes ]]; then
[[ -f "${SDCARD}"/boot/armbianEnv.txt ]] && grep -q '^bootlogo' "${SDCARD}"/boot/armbianEnv.txt &&
sed -i 's/^bootlogo.*/bootlogo=true/' "${SDCARD}"/boot/armbianEnv.txt || echo 'bootlogo=true' >> "${SDCARD}"/boot/armbianEnv.txt
[[ -f "${SDCARD}"/boot/boot.ini ]] && sed -i 's/^setenv bootlogo.*/setenv bootlogo "true"/' "${SDCARD}"/boot/boot.ini
# enable additional services. @TODO: rpardini: really wonder where do these come from?
chroot_sdcard "systemctl --no-reload enable bootsplash-ask-password-console.path || true"
chroot_sdcard "systemctl --no-reload enable bootsplash-hide-when-booted.service || true"
chroot_sdcard "systemctl --no-reload enable bootsplash-show-on-shutdown.service || true"
fi
return 0
}

View File

@ -548,9 +548,6 @@ function install_distribution_agnostic() {
# nsswitch settings for sane DNS behavior: remove resolve, assure libnss-myhostname support
sed "s/hosts\:.*/hosts: files mymachines dns myhostname/g" -i "${SDCARD}"/etc/nsswitch.conf
# build logo in any case
boot_logo
# Show logo
if [[ $PLYMOUTH == yes ]]; then
if [[ $BOOT_LOGO == yes || $BOOT_LOGO == desktop && $BUILD_DESKTOP == yes ]]; then

View File

@ -1090,15 +1090,6 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
# shellcheck source=lib/functions/rootfs/apt-sources.sh
source "${SRC}"/lib/functions/rootfs/apt-sources.sh
# no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled
set -o errtrace # trace ERR through - enabled
set -o errexit ## set -e : exit the script if any statement returns a non-true return value - enabled
### lib/functions/rootfs/boot_logo.sh
# shellcheck source=lib/functions/rootfs/boot_logo.sh
source "${SRC}"/lib/functions/rootfs/boot_logo.sh
# no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled

View File

@ -1,11 +0,0 @@
#!/bin/sh
# Copy splash file to initrd
#
mkdir -p "${DESTDIR}"/lib/firmware
splashfile=/lib/firmware/bootsplash.armbian
if [ -f "${splashfile}" ]; then
cp "${splashfile}" "${DESTDIR}"/lib/firmware
fi
exit 0

View File

@ -1,17 +0,0 @@
[Unit]
Description=Dispatch Password Requests to Console Directory Watch when bootsplash is active
DefaultDependencies=no
Conflicts=shutdown.target
Conflicts=systemd-ask-password-console.path
Conflicts=systemd-ask-password-console.service
After=plymouth-start.service
Before=paths.target shutdown.target cryptsetup.target
ConditionPathExists=!/run/plymouth/pid
ConditionPathExists=/sys/devices/platform/bootsplash.0/enabled
[Path]
DirectoryNotEmpty=/run/systemd/ask-password
MakeDirectory=yes
[Install]
WantedBy=sysinit.target

View File

@ -1,16 +0,0 @@
[Unit]
Description=Dispatch Password Requests to Console when bootsplash is active
DefaultDependencies=no
Conflicts=shutdown.target
Conflicts=systemd-ask-password-console.path
Conflicts=systemd-ask-password-console.service
After=plymouth-start.service systemd-vconsole-setup.service
Before=shutdown.target
ConditionPathExists=!/run/plymouth/pid
ConditionPathExists=/sys/devices/platform/bootsplash.0/enabled
[Service]
ExecStartPre=-/bin/sh -c '/bin/cat /sys/devices/platform/bootsplash.0/enabled > /run/systemd/ask-password/bootsplash-state ; exec /bin/echo off > /sys/devices/platform/bootsplash.0/enabled'
ExecStart=/usr/bin/systemd-tty-ask-password-agent --query --console
ExecStartPost=-/bin/sh -c 'exec /bin/cat /run/systemd/ask-password/bootsplash-state > /sys/devices/platform/bootsplash.0/enabled ; /bin/rm /run/systemd/ask-password/bootsplash-state'
Type=oneshot

View File

@ -1,14 +0,0 @@
[Unit]
Description=Hide bootsplash after starting the system
After=graphical.target
DefaultDependencies=no
ConditionPathExists=/sys/devices/platform/bootsplash.0/enabled
[Service]
ExecStartPre=/bin/sh -c 'exec /bin/sleep 15'
ExecStart=/bin/sh -c 'exec /bin/echo off > /sys/devices/platform/bootsplash.0/enabled'
Restart=no
Type=oneshot
[Install]
WantedBy=graphical.target

View File

@ -1,19 +0,0 @@
[Unit]
Description=Show bootsplash on system halt, power off, reboot, or kexec
Before=systemd-halt.service
Before=systemd-kexec.service
Before=systemd-poweroff.service
Before=systemd-reboot.service
DefaultDependencies=no
ConditionPathExists=/sys/devices/platform/bootsplash.0/enabled
[Service]
ExecStart=/bin/sh -c 'exec /bin/echo on > /sys/devices/platform/bootsplash.0/enabled'
Restart=no
Type=oneshot
[Install]
WantedBy=halt.target
WantedBy=kexec.target
WantedBy=poweroff.target
WantedBy=reboot.target