Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Userspace framebuffer boot logo based on usplash" |
| 2 | DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information." |
| 3 | HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash" |
| 4 | SECTION = "base" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 5 | LICENSE = "GPL-2.0-or-later" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=8;md5=8f232c1e95929eacab37f00900580224" |
| 7 | DEPENDS = "gdk-pixbuf-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 9 | SRCREV = "44afb7506d43cca15582b4c5b90ba5580344d75d" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | PV = "0.1+git${SRCPV}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 12 | SRC_URI = "git://git.yoctoproject.org/${BPN};branch=master \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | file://psplash-init \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | file://psplash-start.service \ |
| 15 | file://psplash-systemd.service \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | ${SPLASH_IMAGES}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | UPSTREAM_CHECK_COMMITS = "1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
| 19 | SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default" |
| 20 | |
| 21 | python __anonymous() { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | oldpkgs = d.getVar("PACKAGES").split() |
| 23 | splashfiles = d.getVar('SPLASH_IMAGES').split() |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 24 | mlprefix = d.getVar('MLPREFIX') or '' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | pkgs = [] |
| 26 | localpaths = [] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | for uri in splashfiles: |
| 28 | fetcher = bb.fetch2.Fetch([uri], d) |
| 29 | flocal = os.path.basename(fetcher.localpath(uri)) |
| 30 | fbase = os.path.splitext(flocal)[0] |
| 31 | outsuffix = fetcher.ud[uri].parm.get("outsuffix") |
| 32 | if not outsuffix: |
| 33 | if fbase.startswith("psplash-"): |
| 34 | outsuffix = fbase[8:] |
| 35 | else: |
| 36 | outsuffix = fbase |
| 37 | if outsuffix.endswith('-img'): |
| 38 | outsuffix = outsuffix[:-4] |
| 39 | outname = "psplash-%s" % outsuffix |
| 40 | if outname == '' or outname in oldpkgs: |
| 41 | bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri)) |
| 42 | else: |
| 43 | pkgs.append(outname) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | localpaths.append(flocal) |
| 45 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | # Set these so that we have less work to do in do_compile and do_install:append |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | d.setVar("SPLASH_INSTALL", " ".join(pkgs)) |
| 48 | d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths)) |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 49 | for p in pkgs: |
| 50 | d.prependVar("PACKAGES", "%s%s " % (mlprefix, p)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 52 | pn = d.getVar('PN') or '' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | for p in pkgs: |
| 54 | ep = '%s%s' % (mlprefix, p) |
| 55 | epsplash = '%s%s' % (mlprefix, 'psplash') |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 56 | d.setVar("FILES:%s" % ep, "${bindir}/%s" % p) |
| 57 | d.setVar("ALTERNATIVE:%s" % ep, 'psplash') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p) |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | d.appendVar("RDEPENDS:%s" % ep, " %s" % pn) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | if p == "psplash-default": |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | d.appendVar("RRECOMMENDS:%s" % pn, " %s" % ep) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | S = "${WORKDIR}/git" |
| 65 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 66 | inherit autotools pkgconfig update-rc.d update-alternatives systemd |
| 67 | |
| 68 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
| 69 | |
| 70 | PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | |
| 72 | ALTERNATIVE_PRIORITY = "100" |
| 73 | ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash" |
| 74 | |
| 75 | python do_compile () { |
| 76 | import shutil |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 77 | import subprocess |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | |
| 79 | # Build a separate executable for each splash image |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 80 | workdir = d.getVar('WORKDIR') |
| 81 | convertscript = "%s/make-image-header.sh" % d.getVar('S') |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 82 | destfile = "%s/psplash-poky-img.h" % d.getVar('B') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 83 | localfiles = d.getVar('SPLASH_LOCALPATHS').split() |
| 84 | outputfiles = d.getVar('SPLASH_INSTALL').split() |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 85 | for localfile, outputfile in zip(localfiles, outputfiles): |
| 86 | if localfile.endswith(".png"): |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 87 | if subprocess.call([ convertscript, os.path.join(workdir, localfile), 'POKY' ], cwd=workdir): |
| 88 | bb.fatal("Error calling convert script '%s'" % (convertscript)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 89 | fbase = os.path.splitext(localfile)[0] |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 90 | shutil.copyfile(os.path.join(workdir, "%s-img.h" % fbase), destfile) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | else: |
| 92 | shutil.copyfile(os.path.join(workdir, localfile), destfile) |
| 93 | # For some reason just updating the header is not enough, we have to touch the .c |
| 94 | # file in order to get it to rebuild |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 95 | os.utime("%s/psplash.c" % d.getVar('S'), None) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 96 | bb.build.exec_func("oe_runmake", d) |
| 97 | shutil.copyfile("psplash", outputfile) |
| 98 | } |
| 99 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 100 | do_install:append() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 101 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 102 | install -d ${D}${sysconfdir}/init.d/ |
| 103 | install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 104 | |
| 105 | # make fifo for psplash |
| 106 | install -d ${D}/mnt |
| 107 | mkfifo ${D}/mnt/psplash_fifo |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 108 | fi |
| 109 | |
| 110 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 111 | install -d ${D}${systemd_system_unitdir} |
| 112 | install -m 644 ${WORKDIR}/psplash-start.service ${D}/${systemd_system_unitdir} |
| 113 | install -m 644 ${WORKDIR}/psplash-systemd.service ${D}/${systemd_system_unitdir} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 114 | fi |
| 115 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 116 | install -d ${D}${bindir} |
| 117 | for i in ${SPLASH_INSTALL} ; do |
| 118 | install -m 0755 $i ${D}${bindir}/$i |
| 119 | done |
| 120 | rm -f ${D}${bindir}/psplash |
| 121 | } |
| 122 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 123 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 124 | SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start.service psplash-systemd.service', '', d)}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 125 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | INITSCRIPT_NAME = "psplash.sh" |
| 127 | INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ." |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 128 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | FILES:${PN} += "/mnt" |