Skip to content

Commit 392e0fa

Browse files
committed
Revise tpm API, add sanity check for mount proc
1. Update tpm2_getcap with new flag style 2. Installer fails vgchange in rare cases where /proc is not mounted in time, add failsafe checks to ensure it exists
1 parent 0f13fd2 commit 392e0fa

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

part2/stages/Functions/install-main

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ mk_xc_lvm()
4141
{
4242
local PARTITION_DEV="$1"
4343

44+
# Ensure /proc is mounted
45+
if !mountpoint -q /proc; then
46+
mount -t proc proc /proc || return 1
47+
fi
48+
4449
do_cmd vgchange -a n || return 1
4550

4651
do_cmd pvcreate -ff -y "${PARTITION_DEV}" || return 1

part2/stages/Remove-partitions

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
. ${DISK_CONF}
2323
# ^^^ defines ${TARGET_DISK}
2424

25+
# Ensure /proc is mounted
26+
if !mountpoint -q /proc; then
27+
mount -t proc proc /proc || return 1
28+
fi
29+
2530
# Deactivate LVs in all VGs.
2631
do_cmd vgchange -a n >&2
2732

part2/stages/TPM-Check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ log_tpm_attrs() {
6868
tpm2=$?
6969
if [ "${tpm2}" -eq 0 ];
7070
then
71-
tpm2_getcap --capability=properties-fixed >&2
71+
tpm2_getcap properties-fixed >&2
7272
else
7373
tpm_version >&2
7474
fi

0 commit comments

Comments
 (0)