Skip to content

Commit b3786d2

Browse files
committed
tpmtotp and qrencode deps
1 parent 02f7045 commit b3786d2

2 files changed

Lines changed: 54 additions & 11 deletions

File tree

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ all: coreboot
33
force:
44
-rm $(linux_dir)/arch/x86/boot/bzImage
55

6+
# uclibc must be built after the kernel,
7+
# since 'make headers_install' must be run to generate the
8+
# headers that uclibc needs.
9+
uclibc_url := https://uclibc.org/downloads/uClibc-0.9.33.tar.xz
10+
11+
612
kexec_version := 2.0.12
713
kexec_dir := kexec-tools-$(kexec_version)
814
kexec_tar := kexec-tools-$(kexec_version).tar.gz
@@ -22,6 +28,32 @@ kexec: $(kexec_dir)
2228
make -C "$(kexec_dir)" -j 8
2329

2430

31+
qrencode_dir := qrencode-3.4.4
32+
qrencode_tar := qrencode-3.4.4.tar.gz
33+
qrencode_url := https://fukuchi.org/works/qrencode/$(qrencode_tar)
34+
qrencode_canary := $(qrencode_dir)/.canary
35+
36+
$(qrencode_tar):
37+
wget $(qrencode_url)
38+
39+
qrencode_lib := $(qrencode_dir)/.libs/libqrencode.so
40+
$(qrencode_canary): $(qrencode_tar)
41+
tar xvf "$<"
42+
touch "$@"
43+
44+
$(qrencode_lib): $(qrencode_canary)
45+
cd $(qrencode_dir) ; ./configure --without-tools
46+
make -C "$(qrencode_dir)"
47+
48+
49+
initrd/bin/unsealtotp: $(qrencode_lib)
50+
make -C tpmtotp unsealtotp
51+
cp tpmtotp/unsealtotp "$@"
52+
initrd/bin/sealtotp: $(qrencode_lib)
53+
make -C tpmtotp sealtotp
54+
cp tpmtotp/sealtotp "$@"
55+
56+
2557
busybox_version := 1.25.0
2658
busybox_dir := busybox-$(busybox_version)
2759
busybox_tar := busybox-$(busybox_version).tar.bz2

initrd/init

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/ash
2+
# First thing it is vital to mount the /dev and other system directories
3+
mkdir /proc /sys /dev /tmp /boot 2>&- 1>&-
4+
mount -t devtmpfs none /dev
5+
mount -t proc none /proc
6+
mount -t sysfs none /sys
7+
8+
# Now it is safe to print a banner
29
echo '====================================================='
310
echo ' _ _ _ ____ ___ __ __ '
411
echo '| | | | ___ __ _ __| |___ _ | _ \ / _ \| \/ |'
@@ -8,19 +15,23 @@ echo '|_| |_|\___|\__,_|\__,_|___/ (_) |_| \_\\___/|_| |_|'
815
echo ''
916
echo '====================================================='
1017

11-
# Mount the system directories
12-
mkdir /proc /sys /dev /tmp /boot 2>/dev/null
13-
14-
mount -t proc none /proc
15-
mount -t sysfs none /sys
16-
mount -t devtmpfs none /dev
17-
18-
## Ensure that we load libraries from our directory
19-
#export LD_LIBRARY_PATH=/lib64
20-
21-
# Start an interactive shell
18+
echo
2219
echo "Run './start-xen' to load the hypervisor"
2320
echo "Run 'kexec -e' to boot it"
2421
echo
2522

23+
# Load the date from the hardware clock, setting it in local time
24+
hwclock -l -s
25+
26+
# Verify the user's TPM secret
27+
date
28+
if [ -r /secret.totp ]; then
29+
echo
30+
echo -n "Verify TPM PCR: "
31+
unsealtotp /secret.totp
32+
echo
33+
fi
34+
35+
36+
# Start an interactive shell
2637
exec /bin/ash

0 commit comments

Comments
 (0)