blob: 5a95e07e1b7a56caf7abda94de71ecad65146fd7 [file] [log] [blame]
# 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=7
inherit cos-linux-mod
DESCRIPTION="Kernel module to trigger loadpin on boot"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="*"
S="${WORKDIR}"
# modulename(libdir:srcdir:objdir)
MODULE_NAMES="loadpin_trigger(misc)"
src_prepare() {
cp "${FILESDIR}"/* .
cos-linux-mod_src_prepare
}
src_compile() {
cros_allow_gnu_build_tools
BUILD_PARAMS="KDIR=${KBUILD_OUTPUT}"
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
}