Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ install -d -o root -g root -m 0700 \
/var/lib/t2-touchid /var/lib/t2-touchid/users \
/var/lib/t2-touchid/mutations /var/lib/t2-touchid/recovery-anchors \
/var/lib/t2-touchid/external-reconciliation-backups
# install -d applies -m only to the leaf; the parent must be root-private too.
install -d -o root -g root -m 0700 /run/t2-touchid
chmod 0700 /run/t2-touchid
install -d -o root -g root -m 0700 /run/t2-touchid/workers
install -o root -g root -m 0755 "$source_dir/src/"*.py "$target_dir/src/"
install -o root -g root -m 0755 "$source_dir/src/t2_touchid_cli.py" /usr/local/bin/t2touch
Expand Down Expand Up @@ -596,12 +599,21 @@ if [[ $identity_replacement == 1 ]]; then
fi
printf '%s\n' "$module_options" >/etc/modprobe.d/t2-sep-transport.conf
chmod 0644 /etc/modprobe.d/t2-sep-transport.conf
{
printf 'options applesmc t2_sep_boot_state=1 t2_sep_epoch_major=%s t2_sep_epoch_minor=%s\n' \
"$sep_epoch_major" "$sep_epoch_minor"
printf 'softdep t2_sep_transport pre: applesmc\n'
} >/etc/modprobe.d/t2-sep-boot-state.conf
chmod 0644 /etc/modprobe.d/t2-sep-boot-state.conf
if macsmc_active; then
# macsmc kernels publish boot state via t2-smc-boot-state.service, which
# reads the epoch from /etc/t2-touchid.conf.
rm -f -- /etc/modprobe.d/t2-sep-boot-state.conf
install -o root -g root -m 0644 \
"$source_dir/systemd/system/t2-smc-boot-state.service" \
/etc/systemd/system/t2-smc-boot-state.service
else
{
printf 'options applesmc t2_sep_boot_state=1 t2_sep_epoch_major=%s t2_sep_epoch_minor=%s\n' \
"$sep_epoch_major" "$sep_epoch_minor"
printf 'softdep t2_sep_transport pre: applesmc\n'
} >/etc/modprobe.d/t2-sep-boot-state.conf
chmod 0644 /etc/modprobe.d/t2-sep-boot-state.conf
fi

install -d -o "$target_user" -g "$target_gid" -m 0755 "$target_home/.config/systemd/user"
install -o "$target_user" -g "$target_gid" -m 0644 \
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LDHARDEN := -pie -Wl,-z,relro,-z,now,-z,noexecstack

.PHONY: all module recovery-tools clean

all: module t2-aks-tool t2-pam-fingerprint-prompt pam_t2touch_action_prompt.so t2-recovery-usb-observer
all: module t2-aks-tool t2-pam-fingerprint-prompt pam_t2touch_action_prompt.so t2-recovery-usb-observer t2-smc-boot-state

module:
$(MAKE) -C $(KDIR) M=$(CURDIR) modules
Expand All @@ -25,6 +25,9 @@ pam_t2touch_action_prompt.so: pam_t2touch_action_prompt.c
t2-recovery-usb-observer: t2-recovery-usb-observer.c
$(CC) -O2 -Wall -Wextra -Werror $(HARDEN) $(LDHARDEN) -o t2-recovery-usb-observer t2-recovery-usb-observer.c

t2-smc-boot-state: t2-smc-boot-state.c
$(CC) -O2 -Wall -Wextra -Werror $(HARDEN) $(LDHARDEN) -o t2-smc-boot-state t2-smc-boot-state.c

clean:
$(MAKE) -C $(KDIR) M=$(CURDIR) clean
$(RM) t2-aks-tool t2-pam-fingerprint-prompt pam_t2touch_action_prompt.so t2-recovery-usb-observer
$(RM) t2-aks-tool t2-pam-fingerprint-prompt pam_t2touch_action_prompt.so t2-recovery-usb-observer t2-smc-boot-state
Loading