| # |
| # Copyright 2023 Google LLC |
| # |
| # This program is free software; you can redistribute it and/or |
| # modify it under the terms of the GNU General Public License |
| # version 2 as published by the Free Software Foundation. |
| # |
| # This program is distributed in the hope that it will be useful, |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| # GNU General Public License for more details. |
| # |
| |
| EAPI=7 |
| |
| inherit systemd toolchain-funcs |
| |
| DESCRIPTION="Service to preload large binaries to speed up boot" |
| |
| LICENSE="Apache-2.0" |
| SLOT="0" |
| KEYWORDS="*" |
| IUSE="" |
| |
| DEPEND="" |
| RDEPEND="${DEPEND} |
| sys-apps/systemd |
| " |
| |
| S=${WORKDIR} |
| |
| src_unpack() { |
| mkdir "${S}" |
| cp "${FILESDIR}/warm-up-elf.c" "${S}/" |
| } |
| |
| src_compile() { |
| $(tc-getCC) ${CFLAGS} ${CPPFLAGS} -o warm-up-elf warm-up-elf.c -lsystemd || |
| die "Unable to compile warm-up-elf tool." |
| } |
| |
| src_install() { |
| exeinto /usr/bin/ |
| doexe warm-up-elf |
| systemd_dounit "${FILESDIR}"/warm-up.service |
| systemd_enable_service sysinit.target warm-up.service |
| } |