| # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI="7" |
| |
| CROS_WORKON_COMMIT="dbb1136242ba822d539eaf11493f3b68815adb7f" |
| CROS_WORKON_TREE=("527abd7a988a45572305a6c44b5324d0d9cf8be2" "60fa47aebd6ebfb702012849bd560717fceddcd4" "aec60c261c19c132b6dda00ed40f61717c823a15" "a65107acb3c4cbbae51687d8409856f07b5dda27" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb") |
| CROS_WORKON_PROJECT="chromiumos/platform2" |
| CROS_WORKON_LOCALNAME="platform2" |
| CROS_WORKON_INCREMENTAL_BUILD=1 |
| CROS_WORKON_OUTOFTREE_BUILD=1 |
| # TODO(crbug.com/809389): Avoid directly including headers from other packages. |
| CROS_WORKON_SUBTREE="chromeos-config common-mk installer verity .gn" |
| |
| PLATFORM_SUBDIR="installer" |
| |
| inherit cros-workon platform systemd |
| |
| DESCRIPTION="Chrome OS Installer" |
| HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/installer/" |
| SRC_URI="" |
| |
| LICENSE="BSD-Google" |
| SLOT="0" |
| KEYWORDS="*" |
| IUSE=" |
| cros_embedded |
| enable_slow_boot_notify |
| -mtd |
| pam |
| systemd |
| lvm_stateful_partition |
| postinstall_config_efi_and_legacy |
| manage_efi_boot_entries |
| " |
| |
| COMMON_DEPEND=" |
| chromeos-base/libbrillo:= |
| chromeos-base/vboot_reference |
| chromeos-base/verity |
| manage_efi_boot_entries? ( chromeos-base/chromeos-config sys-libs/efivar ) |
| " |
| |
| DEPEND="${COMMON_DEPEND} |
| dev-libs/openssl:0= |
| " |
| |
| RDEPEND="${COMMON_DEPEND} |
| pam? ( app-admin/sudo ) |
| chromeos-base/chromeos-common-script |
| !cros_embedded? ( chromeos-base/chromeos-storage-info ) |
| dev-libs/openssl:0= |
| dev-util/shflags |
| sys-apps/rootdev |
| sys-apps/util-linux |
| sys-apps/which |
| sys-fs/e2fsprogs" |
| |
| platform_pkg_test() { |
| platform_test "run" "${OUT}/cros_installer_test" |
| } |
| |
| src_prepare() { |
| # The workdir is platform2/nnapi - we need to pop up one level in the stack |
| # to apply our patches. |
| pushd .. || exit |
| eapply -p1 "${FILESDIR}/installer-support-new-dm-format.patch" |
| eapply -p1 "${FILESDIR}/0001-Add-dm-mod.create.patch" |
| popd || exit |
| |
| eapply_user |
| } |
| |
| src_install() { |
| platform_src_install |
| |
| dobin "${OUT}"/cros_installer |
| if use mtd ; then |
| dobin "${OUT}"/nand_partition |
| fi |
| dosbin chromeos-* encrypted_import "${OUT}"/evwaitkey |
| dosym usr/sbin/chromeos-postinst /postinst |
| |
| # Enable lvm stateful partition. |
| if use lvm_stateful_partition; then |
| # We are replacing expansions in a shell file, and shellcheck thinks we want |
| # to expand those in this context. Ignore it. |
| # shellcheck disable=SC2016 |
| sed -i '/DEFINE_boolean lvm_stateful "/s:\${FLAGS_FALSE}:\${FLAGS_TRUE}:' \ |
| "${D}/usr/sbin/chromeos-install" || |
| die "Failed to set 'lvm_stateful' in chromeos-install" |
| fi |
| |
| # Install init scripts. |
| if use systemd; then |
| systemd_dounit init/install-completed.service |
| systemd_enable_service boot-services.target install-completed.service |
| systemd_dounit init/crx-import.service |
| systemd_enable_service system-services.target crx-import.service |
| else |
| insinto /etc/init |
| doins init/*.conf |
| fi |
| exeinto /usr/share/cros/init |
| doexe init/crx-import.sh |
| } |