From 0a12361705965296fe6b8b66d9c8f577e81ac102 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 6 Apr 2021 14:50:16 +0200 Subject: [distro-logo] own module for distro logo --- core/modules/distro-logo/module.build | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core/modules/distro-logo/module.build (limited to 'core/modules/distro-logo/module.build') diff --git a/core/modules/distro-logo/module.build b/core/modules/distro-logo/module.build new file mode 100644 index 00000000..4e30667f --- /dev/null +++ b/core/modules/distro-logo/module.build @@ -0,0 +1,25 @@ +#!/bin/bash +fetch_source() { + : +} + +build() { + : +} + +post_copy() { + # Try to fetch distro logo + if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then + local DIST=$(lsb_release -si) + if [ -n "$DIST" ]; then + [ -z "$CFG_DISTLOGO_URL" ] && CFG_DISTLOGO_URL='http://mltk-services.ruf.uni-freiburg.de/distro_logo.php?distro=' + wget -t 3 -T 3 -O "$TARGET_BUILD_DIR/etc/distro.png" "${CFG_DISTLOGO_URL}${DIST}" + if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then + rm -f "$TARGET_BUILD_DIR/etc/distro.png" + pwarning "Could not download distro-logo" + fi + else + pwarning "Could not determine distribution" + fi + fi +} -- cgit v1.2.3-55-g7522