Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
default_stages: [pre-commit]

default_install_hook_types: [pre-commit, commit-msg]
exclude: .*\.(patch)|(diff)$|CHANGELOG.md|^(meta-zarhus-distro/classes-recipe/)|^(meta-zarhus-distro/recipes-devtools/rust/)
exclude: |
(?x)^(
.*\.patch|
.*\.diff|
.*\.ppm|
CHANGELOG.md|
meta-zarhus-distro/classes-recipe/.*|
meta-zarhus-distro/recipes-devtools/rust/.*
)$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SUMMARY = "Prepare U-Boot logo"
HOMEPAGE = "https://docs.zarhus.com"
# TODO: which license does logo have
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recipe only function is to prepare logo for u-boot (resize and convert to BMP).
Not sure which part does this license apply to as the only file we download is Zarhus Logo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this repo uses MIT license https://github.com/zarhus/docs/tree/main/docs/images

LICENSE = "CLOSED"

DEPENDS = "imagemagick-native"

SPLASH_FILE = "logo-${PV}"
SPLASH_SOURCE = "https://docs.zarhus.com/images/zarhus-logo.svg;downloadfilename=${SPLASH_FILE}"
SRC_URI = "${SPLASH_SOURCE}"
SRC_URI[sha256sum] = "2ba3358102e2bb27b5c2b21d06e47325aa8238fad629d67ac46b97d8c77ab470"

inherit allarch

python do_prepare_logo() {
workdir = d.getVar("WORKDIR")
logo_size = d.getVar("LOGO_SIZE")
resize = f"-resize {logo_size}" if logo_size else ""
splash = d.getVar("SPLASH_FILE")
cmd = f"magick.im7 {splash} -depth 8 -type truecolor {resize} logo.bmp"
bb.note(f"Converting image: {cmd}")
bb.process.run(cmd, cwd=workdir)
}

do_install() {
install -d "${D}/boot"
install -m 0644 "${WORKDIR}/logo.bmp" "${D}/boot/logo.bmp"
}

FILES:${PN} += "/boot/logo.bmp"

addtask prepare_logo before do_configure after do_prepare_recipe_sysroot
addtask install before do_build after do_prepare_logo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_VIDEO=y
CONFIG_SPLASH_SCREEN=y
CONFIG_SPLASH_SOURCE=y
CONFIG_CMD_BMP=y
CONFIG_VIDEO_BMP_GZIP=y
CONFIG_BMP_16BPP=y
CONFIG_BMP_24BPP=y
CONFIG_BMP_32BPP=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'splash', 'imagemagick-native', '', d)}"
SRC_URI += "\
${@bb.utils.contains('DISTRO_FEATURES', 'splash', 'file://enable-splash.cfg', '', d)} \
"

# U-Boot recipe doesn't have do_install tasks (and everything after)
# so it's easier to separate U-Boot logo task into another recipe.
# There is a problem that U-Boot doesn't respect RDEPENDS and doesn't build
# u-boot-logo recipe so I also added it to `base_files` RDEPENDS.
RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'splash', 'u-boot-logo', '', d)}"
Loading