| # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2. |
| |
| # This package installs a kernel module loadpin-trigger.ko and configures |
| # OS to load the module on boot. The kernel module calls |
| # kernel_read_file_from_path to load a dummy file into kernel, which will |
| # trigger loadpin. We used to rely on loading kernel modules to pin to |
| # rootfs, but the recent kernel param loadpin.exclude=kernel-module we added |
| # makes loadpin ignore module loading. |
| |
| EAPI=6 |
| inherit cos-linux-mod |
| |
| DESCRIPTION="Kernel module to trigger loadpin on boot" |
| |
| LICENSE="GPL-2" |
| SLOT="0" |
| KEYWORDS="*" |
| |
| S="${WORKDIR}" |
| |
| # Prevent kernel module signature being striped. |
| STRIP_MASK+=" *.ko" |
| |
| MODULE_NAME="loadpin_trigger" |
| |
| src_prepare() { |
| cp "${FILESDIR}"/* . |
| cos-linux-mod_src_prepare |
| } |
| |
| src_compile() { |
| cos-linux-mod_src_compile |
| } |
| |
| src_install() { |
| cos-linux-mod_src_install |
| |
| # Install a dummy file to /etc. The file will be read by |
| # loadpin-trigger so that rootfs will be pinned. |
| insinto /etc |
| newins "${FILESDIR}"/loadpin_trigger_dummy loadpin_trigger |
| } |