Skip to content

Commit ad189bd

Browse files
author
jinqiang zhang
committed
fix chromiumos rpi4 /dev/tpm* create failed and crostini install failed
Signed-off-by: jinqiang zhang <[email protected]>
1 parent 25766da commit ad189bd

File tree

6 files changed

+146
-0
lines changed

6 files changed

+146
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2022 Fyde Innovations. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
EAPI=7
6+
7+
inherit cros-unibuild
8+
9+
DESCRIPTION="ChromeOS model configuration"
10+
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/chromeos-config/README.md"
11+
12+
LICENSE="BSD-Google"
13+
SLOT="0"
14+
KEYWORDS="*"
15+
16+
S="${WORKDIR}"
17+
18+
src_install() {
19+
install_model_files
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2022 Fyde Innovations. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
# This board only supports a single config, defined below, as it is a
6+
# migrated pre-unibuild device.
7+
device-config: &device_config
8+
name: rpi4
9+
10+
# Required dunder for chromeos-config to support a single device.
11+
chromeos:
12+
devices:
13+
- skus:
14+
- config: *device_config
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/simulator.cc b/simulator.cc
2+
index 19fb8f299d..a49a878170 100644
3+
--- a/simulator.cc
4+
+++ b/simulator.cc
5+
@@ -153,10 +153,6 @@ void SimulatorDaemon::OnTpmPathChange(const base::FilePath& path, bool error) {
6+
return;
7+
}
8+
if (!initialized_ && base::PathExists(path)) {
9+
- if (HANDLE_EINTR(selinux_restorecon(path.value().c_str(), 0)) < 0) {
10+
- PLOG(ERROR) << "restorecon(" << path.value() << ") failed";
11+
- }
12+
-
13+
LOG(INFO) << "vTPM initialized: " << path.value();
14+
tpm_watcher_.reset();
15+
initialized_ = true;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2014 The Chromium OS Authors. All rights reserved.
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=7
5+
6+
CROS_WORKON_COMMIT="b064f849311c4ac593a1917e826c6c1eafdd3822"
7+
CROS_WORKON_TREE=("2345346c6533c29d4e3ee84bc2bf53306247256c" "30dbe432f5e7874ebed1557763eb0d2f7e311249" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb")
8+
CROS_WORKON_INCREMENTAL_BUILD=1
9+
CROS_WORKON_LOCALNAME="platform2"
10+
CROS_WORKON_PROJECT="chromiumos/platform2"
11+
CROS_WORKON_OUTOFTREE_BUILD=1
12+
CROS_WORKON_SUBTREE="common-mk tpm2-simulator .gn"
13+
14+
PLATFORM_SUBDIR="tpm2-simulator"
15+
16+
inherit cros-workon platform user
17+
18+
DESCRIPTION="TPM 2.0 Simulator"
19+
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/tpm2-simulator/"
20+
21+
LICENSE="BSD-Google"
22+
SLOT="0/0"
23+
KEYWORDS="*"
24+
25+
IUSE="tpm tpm2"
26+
27+
COMMON_DEPEND="
28+
tpm? ( dev-libs/libtpms:= )
29+
tpm2? ( chromeos-base/tpm2:=[tpm2_simulator,tpm2_simulator_manufacturer] )
30+
chromeos-base/minijail:=
31+
chromeos-base/pinweaver:=
32+
chromeos-base/vboot_reference:=[tpm2_simulator]
33+
dev-libs/openssl:0=
34+
sys-libs/libselinux:=
35+
"
36+
37+
RDEPEND="${COMMON_DEPEND}"
38+
DEPEND="${COMMON_DEPEND}"
39+
40+
PATCHES=(
41+
"${FILESDIR}"/skip-selinux_restorecon.patch
42+
)
43+
44+
src_install() {
45+
platform_install
46+
}
47+
48+
pkg_preinst() {
49+
enewuser tpm2-simulator
50+
enewgroup tpm2-simulator
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2014 The Chromium OS Authors. All rights reserved.
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=7
5+
6+
CROS_WORKON_INCREMENTAL_BUILD=1
7+
CROS_WORKON_LOCALNAME="platform2"
8+
CROS_WORKON_PROJECT="chromiumos/platform2"
9+
CROS_WORKON_OUTOFTREE_BUILD=1
10+
CROS_WORKON_SUBTREE="common-mk tpm2-simulator .gn"
11+
12+
PLATFORM_SUBDIR="tpm2-simulator"
13+
14+
inherit cros-workon platform user
15+
16+
DESCRIPTION="TPM 2.0 Simulator"
17+
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/tpm2-simulator/"
18+
19+
LICENSE="BSD-Google"
20+
SLOT="0/0"
21+
KEYWORDS="~*"
22+
23+
IUSE="tpm tpm2"
24+
25+
COMMON_DEPEND="
26+
tpm? ( dev-libs/libtpms:= )
27+
tpm2? ( chromeos-base/tpm2:=[tpm2_simulator,tpm2_simulator_manufacturer] )
28+
chromeos-base/minijail:=
29+
chromeos-base/pinweaver:=
30+
chromeos-base/vboot_reference:=[tpm2_simulator]
31+
dev-libs/openssl:0=
32+
sys-libs/libselinux:=
33+
"
34+
35+
RDEPEND="${COMMON_DEPEND}"
36+
DEPEND="${COMMON_DEPEND}"
37+
38+
src_install() {
39+
platform_install
40+
}
41+
42+
pkg_preinst() {
43+
enewuser tpm2-simulator
44+
enewgroup tpm2-simulator
45+
}

0 commit comments

Comments
 (0)