Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/tboot/, sys-boot/tboot/files/
Date: Fri, 30 Dec 2016 17:03:20
Message-Id: 1483091643.b46b07e906bce2e6697c2c42ba2c446c2e7734b2.perfinion@gentoo
1 commit: b46b07e906bce2e6697c2c42ba2c446c2e7734b2
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 30 09:52:08 2016 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 30 09:54:03 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b46b07e9
7
8 sys-boot/tboot: bump to 1.9.5
9
10 Package-Manager: portage-2.3.0
11
12 sys-boot/tboot/Manifest | 1 +
13 .../tboot/files/tboot-1.9.5-genkernel-path.patch | 58 +++++++++++++++++
14 sys-boot/tboot/tboot-1.9.5.ebuild | 72 ++++++++++++++++++++++
15 3 files changed, 131 insertions(+)
16
17 diff --git a/sys-boot/tboot/Manifest b/sys-boot/tboot/Manifest
18 index a627cac..6d9c045 100644
19 --- a/sys-boot/tboot/Manifest
20 +++ b/sys-boot/tboot/Manifest
21 @@ -1,2 +1,3 @@
22 DIST tboot-1.9.4.tar.gz 2107175 SHA256 7167e5615def4ac0f25b2f9139b3d361a0a20d91386d80b1d865107b3f552f39 SHA512 93db95be54a1286dffe87cf6f5d1e31ac0c4a452b11a11789fec66255c847a9e14251579de0f6ba4c5c122423b45e83751a8287d37e27ea3acba608774d7ac0b WHIRLPOOL 2bf9220317dc5bbc927fb10d07a1d7f5cef2d5351fbf81e45f276b5f317785c1cfc1f1e4b78ac426bceb66641339d7179bff8fbbb867b67aa215544193a5baa1
23 DIST tboot-1.9.4_p20161101.tar.gz 578097 SHA256 d6a399488fde1d0993a65bcb283cec218c7c8572972d2fdda8422fc2a1b5513f SHA512 6a38148d7be4faf8ec86f2f8e3c342321b7d8d4920a631b0e1b74bd27578039f4ae20faffae877ed8db5dd14500c059a3efd3eed24f22099820e87a67d3ecc17 WHIRLPOOL 316e3ac4965108a63ebf6075b50fb24b5c0a0c1527cb43309b95c64e60a0b6e5b3287e4b19faa8405ab10cf268b975cfd93d6348253a2d3fa07e78f38ef1eac8
24 +DIST tboot-1.9.5.tar.gz 685460 SHA256 c7032e367ac0129493c9bb1fcd1437f400ff5533c970119ddce281ff4d58a13f SHA512 d806b692d3d57d0aaf4095ef514a2859b2b054ec695cb5589b3a6133eec7f7a9a0e76544e4b557df02add5ed67c3c15fb3ee5f17d6438252b659d6e5c7d17fe9 WHIRLPOOL 04843854b1a646d6126079a3b46bacf0c8191d5b5c322f8bc04ea39c0d5470bba2f7f2499761d42aa258552c1dfbeb626275e7473628b21719a6fe59bc05029c
25
26 diff --git a/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch b/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch
27 new file mode 100644
28 index 00000000..63e67f1
29 --- /dev/null
30 +++ b/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch
31 @@ -0,0 +1,58 @@
32 +diff -ur tboot-1.9.5.orig/tboot/20_linux_tboot tboot-1.9.5/tboot/20_linux_tboot
33 +--- tboot-1.9.5.orig/tboot/20_linux_tboot 2016-12-30 17:37:08.625535208 +0800
34 ++++ tboot-1.9.5/tboot/20_linux_tboot 2016-12-30 17:42:38.405714435 +0800
35 +@@ -171,6 +171,14 @@
36 + EOF
37 + }
38 +
39 ++case "$machine" in
40 ++ i?86) GENKERNEL_ARCH="x86" ;;
41 ++ mips|mips64) GENKERNEL_ARCH="mips" ;;
42 ++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
43 ++ arm*) GENKERNEL_ARCH="arm" ;;
44 ++ *) GENKERNEL_ARCH="$machine" ;;
45 ++esac
46 ++
47 + linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
48 + basename=$(basename $i)
49 + version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
50 +@@ -217,7 +225,9 @@
51 + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
52 + "initrd-${alt_version}" "initramfs-${alt_version}.img" \
53 + "initramfs-genkernel-${version}" \
54 +- "initramfs-genkernel-${alt_version}"; do
55 ++ "initramfs-genkernel-${alt_version}" \
56 ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
57 ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
58 + if test -e "${dirname}/${i}" ; then
59 + initrd="$i"
60 + break
61 +diff -ur tboot-1.9.5.orig/tboot/20_linux_xen_tboot tboot-1.9.5/tboot/20_linux_xen_tboot
62 +--- tboot-1.9.5.orig/tboot/20_linux_xen_tboot 2016-12-30 17:37:08.628535191 +0800
63 ++++ tboot-1.9.5/tboot/20_linux_xen_tboot 2016-12-30 17:43:39.112379262 +0800
64 +@@ -165,6 +165,14 @@
65 + EOF
66 + }
67 +
68 ++case "$machine" in
69 ++ i?86) GENKERNEL_ARCH="x86" ;;
70 ++ mips|mips64) GENKERNEL_ARCH="mips" ;;
71 ++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
72 ++ arm*) GENKERNEL_ARCH="arm" ;;
73 ++ *) GENKERNEL_ARCH="$machine" ;;
74 ++esac
75 ++
76 + linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
77 + if grub_file_is_not_garbage "$i"; then
78 + basename=$(basename $i)
79 +@@ -232,7 +240,9 @@
80 + "initrd-${version}" "initrd.img-${alt_version}" \
81 + "initrd-${alt_version}.img" "initrd-${alt_version}" \
82 + "initramfs-genkernel-${version}" \
83 +- "initramfs-genkernel-${alt_version}" ; do
84 ++ "initramfs-genkernel-${alt_version}" \
85 ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
86 ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
87 + if test -e "${dirname}/${i}" ; then
88 + initrd="$i"
89 + break
90
91 diff --git a/sys-boot/tboot/tboot-1.9.5.ebuild b/sys-boot/tboot/tboot-1.9.5.ebuild
92 new file mode 100644
93 index 00000000..6e926b8
94 --- /dev/null
95 +++ b/sys-boot/tboot/tboot-1.9.5.ebuild
96 @@ -0,0 +1,72 @@
97 +# Copyright 1999-2016 Gentoo Foundation
98 +# Distributed under the terms of the GNU General Public License v2
99 +# $Id$
100 +
101 +EAPI=6
102 +
103 +inherit flag-o-matic mount-boot
104 +
105 +DESCRIPTION="Performs a measured and verified boot using Intel Trusted Execution Technology"
106 +HOMEPAGE="https://sourceforge.net/projects/tboot/"
107 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
108 +
109 +LICENSE="BSD"
110 +SLOT="0"
111 +KEYWORDS="~amd64 ~x86 -*"
112 +IUSE="custom-cflags selinux"
113 +
114 +# requires patching the kernel src
115 +RESTRICT="test"
116 +
117 +DEPEND="app-crypt/trousers
118 +app-crypt/tpm-tools
119 +dev-libs/openssl:0=[-bindist]"
120 +
121 +RDEPEND="${DEPEND}
122 +sys-boot/grub:2
123 +selinux? ( sec-policy/selinux-tboot )"
124 +
125 +DOCS=(README COPYING CHANGELOG)
126 +PATCHES=( "${FILESDIR}/${PN}-1.9.5-genkernel-path.patch" )
127 +
128 +src_prepare() {
129 + sed -i 's/ -Werror//g' Config.mk || die
130 + sed -i 's/^INSTALL_STRIP = -s$//' Config.mk || die # QA Errors
131 +
132 + default
133 +}
134 +
135 +src_compile() {
136 + use custom-cflags && export TBOOT_CFLAGS=${CFLAGS} || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
137 +
138 + if use amd64; then
139 + export MAKEARGS="TARGET_ARCH=x86_64"
140 + else
141 + export MAKEARGS="TARGET_ARCH=i686"
142 + fi
143 +
144 + default
145 +}
146 +
147 +src_install() {
148 + emake DISTDIR="${D}" install
149 +
150 + dodoc "${DOCS[@]}"
151 + dodoc docs/*.txt lcptools/*.{txt,pdf} || die "docs failed"
152 +
153 + cd "${D}"
154 + mkdir -p usr/lib/tboot/ || die
155 + mv boot usr/lib/tboot/ || die
156 +}
157 +
158 +pkg_postinst() {
159 + mount-boot_mount_boot_partition
160 +
161 + cp ${ROOT%/}/usr/lib/tboot/boot/* ${ROOT%/}/boot/
162 +
163 + mount-boot_pkg_postinst
164 +
165 + ewarn "Please remember to download the SINIT AC Module relevant"
166 + ewarn "for your platform from:"
167 + ewarn "http://software.intel.com/en-us/articles/intel-trusted-execution-technology/"
168 +}