Skip to content

Commit d57fedb

Browse files
Merge pull request #1 from gardenlinux/init
magic
2 parents cb43cd3 + dffa8ba commit d57fedb

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

debian/control

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Source: pcr-oracle
2+
Section: utils
3+
Priority: optional
4+
Maintainer: Garden Linux Builder <contact@gardenlinux.io>
5+
Build-Depends: debhelper-compat (= 13), gcc, make, pkg-config, libssl-dev, libtss2-dev, libjson-c-dev
6+
Standards-Version: 4.6.1
7+
Rules-Requires-Root: no
8+
9+
Package: pcr-oracle
10+
Architecture: any
11+
Multi-Arch: foreign
12+
Depends: ${misc:Depends}, ${shlibs:Depends}
13+
Description: pcr-oracle

debian/patches/01-magic.patch

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
diff --git a/Makefile.in b/Makefile.in
2+
index 02a915b..7449374 100644
3+
--- a/Makefile.in
4+
+++ b/Makefile.in
5+
@@ -3,9 +3,9 @@ PKGNAME = pcr-oracle-$(VERSION)
6+
7+
CCOPT = -O0 -g
8+
FIRSTBOOTDIR = /usr/share/jeos-firstboot
9+
-CFLAGS = -Wall @TSS2_ESYS_CFLAGS@ @JSON_CFLAGS@ $(CCOPT)
10+
+CFLAGS = -Wall @TSS2_ESYS_CFLAGS@ @JSON_C_CFLAGS@ $(CCOPT)
11+
TSS2_LINK = -ltss2-esys -ltss2-tctildr -ltss2-rc -ltss2-mu -lcrypto
12+
-JSON_LINK = -L@JSON_LIBDIR@ @JSON_LIBS@
13+
+JSON_LINK = -L@JSON_C_LIBDIR@ @JSON_C_LIBS@
14+
TOOLS = pcr-oracle
15+
16+
MANDIR = @MANDIR@
17+
diff --git a/microconf/stage1/03-json b/microconf/stage1/03-json
18+
index 1b75521..fab6807 100644
19+
--- a/microconf/stage1/03-json
20+
+++ b/microconf/stage1/03-json
21+
@@ -1,4 +1,4 @@
22+
-uc_add_option_with libjson
23+
+uc_add_option_with libjson-c
24+
uc_with_libjson=detect
25+
26+
uc_add_help <<EOH
27+
diff --git a/microconf/stage3/05-json b/microconf/stage3/05-json
28+
index 54ee1a4..4062d0f 100644
29+
--- a/microconf/stage3/05-json
30+
+++ b/microconf/stage3/05-json
31+
@@ -2,6 +2,6 @@
32+
# libjson version
33+
##################################################################
34+
if [ -z "$uc_with_libjson" -o "$uc_with_libjson" = "detect" ]; then
35+
- uc_pkg_config_check_package json
36+
+ uc_pkg_config_check_package json-c
37+
fi
38+
39+
diff --git a/src/runtime.c b/src/runtime.c
40+
index 39acb25..3bcf520 100644
41+
--- a/src/runtime.c
42+
+++ b/src/runtime.c
43+
@@ -145,15 +145,11 @@ __system_read_efi_variable(const char *var_name)
44+
return testcase_playback_efi_variable(testcase_playback, var_name);
45+
46+
/* First, try new efivars interface */
47+
- snprintf(filename, sizeof(filename), "/sys/firmware/efi/efivars/%s", var_name);
48+
+ snprintf(filename, sizeof(filename), "customvars/%s", var_name);
49+
result = buffer_read_file(filename, RUNTIME_SHORT_READ_OKAY | RUNTIME_MISSING_FILE_OKAY);
50+
if (result != NULL) {
51+
/* Skip over 4 bytes of variable attributes */
52+
buffer_skip(result, 4);
53+
- } else {
54+
- /* Fall back to old sysfs entries with their 1K limitation */
55+
- snprintf(filename, sizeof(filename), "/sys/firmware/efi/vars/%s/data", var_name);
56+
- result = buffer_read_file(filename, RUNTIME_SHORT_READ_OKAY | RUNTIME_MISSING_FILE_OKAY);
57+
}
58+
59+
if (result == NULL)
60+

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
01-magic.patch

debian/rules

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/make -f
2+
3+
%:
4+
dh $@
5+
6+
override_dh_auto_configure:
7+
./configure --prefix=/usr/
8+
9+
override_dh_auto_test:
10+
# mkdir -p debian/pcr-oracle/usr/local/share/man/man8/
11+
dh_auto_install

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

prepare_source

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pkg=pcr-oracle
2+
version_upstream=0.5.4
3+
version=$version_upstream-1
4+
version_suffix=gl0
5+
git_src -b $version_upstream https://github.com/okirch/pcr-oracle
6+
cp -r debian "$dir/src/"

0 commit comments

Comments
 (0)