Created attachment 580232 [details] vboot-utils-76.ebuild This is an ebuild based on the current one in tree (vboot-utils-72_p20181229) Bumped to release-R76-12239.B, now EAPI7, new USE flag for making dependency on dev-libs/libzip optional (to be able to avoid Bug #687008), comes with a patch to be able to build on musl (so that Bug #687820 is resolved for real), drops patch for building with libressl (no longer necessary, cf. Bug #678594). Only tested on armv7a-unknown-linux-musleabihf so far. As it isn't based on the latest git commit any more, I dropped the _p20[...] part.
Created attachment 580234 [details] metadata.xml
Created attachment 580236 [details, diff] vboot-utils-76-musl-fts.patch
Due to "Can't use gitiles directly until b/19710536 is fixed." the source code needs to be obtained manually for now: https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/refs/heads/release-R76-12239.B.tar.gz
WRT to Bug #687820, I think that should be addressed upstream but there are no easy means to get in contact with them (google account required). On musl vboot-utils should depend on fts-standalone and it needs to be patched so that it links to libfts.so (cf. patch). So if someone has a google account or any other means to make them aware of this Bug and Bug #687820 that would be nice :)
Created attachment 580260 [details] vboot-utils-76.ebuild
Builds on AArch64 glibc with openssl.
(In reply to Alpha Bravo from comment #3) > Due to "Can't use gitiles directly until b/19710536 is fixed." the source > code needs to be obtained manually for now: > https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ > +archive/refs/heads/release-R76-12239.B.tar.gz To clarify: like the ebuilds for previous versions of vboot-utils this one, too, assumes that the source code is distributed according to SRC_URI="mirror://gentoo/${P}.tar.gz https://dev.gentoo.org/~zmedico/dist/${P}.tar.gz"
--- vboot-utils-72_p20181229-r1.ebuild +++ vboot-utils-76.ebuild @@ -1,33 +1,34 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 inherit eutils toolchain-funcs -# This is the latest commit in the latest branch. -GIT_SHA1="a32c930e8c46424a3bba3c296fd78b3e60f50aeb" +# This is the name of the latest release branch. +RELEASE="release-R76-12239.B" DESCRIPTION="Chrome OS verified boot tools" -HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ http://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" +HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ https://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" # Can't use gitiles directly until b/19710536 is fixed. -#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz" -SRC_URI="mirror://gentoo/${P}.tar.xz - https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" +#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/refs/heads/${RELEASE}.tar.gz -> ${P}.tar.gz" +SRC_URI="mirror://gentoo/${P}.tar.gz + https://dev.gentoo.org/~zmedico/dist/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -IUSE="libressl minimal static" +IUSE="libressl +libzip minimal static" LIB_DEPEND=" + libzip? ( dev-libs/libzip:=[static-libs(+)] ) dev-libs/libyaml:=[static-libs(+)] app-arch/xz-utils:=[static-libs(+)]" LIB_DEPEND_MINIMAL=" !libressl? ( dev-libs/openssl:0=[static-libs(+)] ) libressl? ( dev-libs/libressl:0=[static-libs(+)] ) - sys-apps/util-linux:=[static-libs(+)] - dev-libs/libzip:=[static-libs(+)]" + libzip? ( dev-libs/libzip:=[static-libs(+)] ) + sys-apps/util-linux:=[static-libs(+)]" RDEPEND="!static? ( ${LIB_DEPEND_MINIMAL//\[static-libs(+)]} !minimal? ( ${LIB_DEPEND//\[static-libs(+)]} ) @@ -43,7 +44,8 @@ S=${WORKDIR} src_prepare() { - eapply "${FILESDIR}"/${P}-libressl.patch + # Bug #687820 + use elibc_musl && eapply "${FILESDIR}"/${P}-musl-fts.patch default sed -i \
--- files/vboot-utils-76-musl-fts.patch +++ files/vboot-utils-76-musl-fts.patch @@ -0,0 +1,24 @@ +--- a/Makefile 2019-06-20 13:47:49.000000000 +0000 ++++ b/Makefile 2019-06-20 16:10:28.811544213 +0000 +@@ -232,6 +232,11 @@ + CFLAGS += -DHAVE_EXECINFO_H + endif + ++# Musl doesn't have fts.h so enable linking to the standalone lib. ++ifdef HAVE_MUSL ++ MUSL_LIBS:= -lfts ++endif ++ + # And a few more default utilities + LD = ${CC} + CXX ?= g++ +@@ -1114,7 +1119,7 @@ + futil: ${FUTIL_BIN} + + # FUTIL_LIBS is shared by FUTIL_BIN and TEST_FUTIL_BINS. +-FUTIL_LIBS = ${CRYPTO_LIBS} ${LIBZIP_LIBS} ++FUTIL_LIBS = ${CRYPTO_LIBS} ${LIBZIP_LIBS} ${MUSL_LIBS} + + ${FUTIL_BIN}: LDLIBS += ${FUTIL_LIBS} + ${FUTIL_BIN}: ${FUTIL_OBJS} ${UTILLIB} ${FWLIB20} ${UTILBDB} +
--- metadata.xml +++ metadata.xml @@ -9,4 +9,7 @@ <maintainer type="person"> <email>zmedico@gentoo.org</email> </maintainer> + <use> + <flag name="libzip">Use dev-libs/libzip.</flag> + </use> </pkgmetadata>
--- Manifest +++ Manifest @@ -1,6 +1,9 @@ AUX vboot-utils-72_p20181229-libressl.patch 426 BLAKE2B a67628074549b60e899f20a2589b64ab7dfe90f6476f44c2bb028f0f90b847173eb3e6ea975858a627a257bdaf2121865a7c83cd4d253cbc1d6ad412f0b8e84d SHA512 a78eaa53cc784845a99686025f20f7b10f5d285f4b145fa0e2371b4d242d489a21e91253e7a3b5cee12565c8412224556240acc555b0c9500d5a46b7b1356bb3 +AUX vboot-utils-76-musl-fts.patch 645 BLAKE2B d10f875252ed42bb3ea52f86aee91dc61f90bce9a808a9b9a2cf4c50ebea28d77806e0fa077a5124cdb0ad8cb6418cb376916f1c96ba0336328594c4d7c96548 SHA512 a082bd5705852812e47f4f297cf0a3207d15bd555b0fba3beb2ed45bc61bffc6fa906bc2d2918a90b051ccea208c474c4c80246ec6d3320047e532c902bb9fc6 DIST vboot-utils-59_p20170413.tar.xz 18431260 BLAKE2B 73853f92c5855a1fbcad55c696414317f46a06a69901529dd6da19be2abe4ca0337cf20dddc4f84f1d2a99357bb2f01df115b7d16c45f9af62dcd1b833580d46 SHA512 f92b9aed7a52ac7bab49b624725d4963564a22a03741619ad4ef1bc0a1fdee5123c68f3dad5bef9fb033f94f2a9ae99478c16386758fe4667a361bc91dda8048 DIST vboot-utils-72_p20181229.tar.xz 18489004 BLAKE2B 444eb0bc2c571ad79d26d473da724016d6d041207beaae161f6c1155768ff9d0b1c8b7b070b828083cc1396266cc77175a75e8067ce22613c75b4d77780dda75 SHA512 41df034dc5498bcbec0d49a472331ceb2fbc2eb3b4173d5c56e920d65ae485382b3d811e5f2c13cf45a1b05a5d6a24197924fa1c76ada9c3aac14fa3c4c363fe +DIST vboot-utils-76.tar.gz 35881572 BLAKE2B 79463fcc431cbf744633e5c437aa8d0e6ec06fa0539a098ef96cd29154cdfab54f39685ac3539569d177bce7c40e9da0658b9fdd800a942600e27d17cc48942c SHA512 ff432a1dd0e304b0a7141242588fe8cdfe878652495125ff3839c462a8ed3e2cbd22290878124598249da3d5019eb739ccb3358022edd8cc0c9ec89eab5c50b1 EBUILD vboot-utils-59_p20170413.ebuild 1961 BLAKE2B d519504ba8c955b164395dc95b2a0bc275548c97adcefe6c90ef81bd3ebe1ec8554f4fc42d2197227ee140d5c14a3b1f7097034cbdd42f065e756758b881a253 SHA512 90bab2830cab6eb87ccb8e85f1953c6b48c75accfc8c13a46a54fefeba2cd070497fab821b0103a0e4310c42e90bd546d3bb737dbff50a4b225f05d4dccc923e EBUILD vboot-utils-72_p20181229-r1.ebuild 2594 BLAKE2B f586492f5f860ddb24715616d788268f7576fd24a4b24e4b13c34cb0e88f28e1c3d1e83c6b2769b7db9b7abfc6e9260155366b44420e4d8acdebf65949e865f0 SHA512 146556fae5811a92a995e58b059f4f0afefd84e979e19d5b0869aac9cfe717966fa984eb19ef1398c149b9861bb6fd1d06f755b04a34b1d211c7fbbd5db8fe6e -MISC metadata.xml 488 BLAKE2B b3c656e8e93662a5fd2cfb7559ca150c9df50831789447fe1e4aa58b99b205daa70b5bcfc98e1e78e44cf0ef89ef9a6efc8563d31c2d3823aa7c07d1ec4cf3fb SHA512 b9c53eec1a6b1db1274f2baf51915691e36678eb1cc8e6b7cc1596b4912410b86e96175cd6cd614acc044a3b2fbf8ef350ba69daf6741802e926fc3ec2c73914 +EBUILD vboot-utils-76.ebuild 2682 BLAKE2B 1c7b855c3d0c28e9ca9b4495eb20dd788d280e9ec92544b436bc5c43547b5a16a22a32d0bf4e58bf5c850298e1fb797bfc13838a5a04cb5eb7a2007ee4f1bf96 SHA512 f8921955f6e6e02b85feb0a2d0adf5bb9d3829b6cc0b192433d70e2555b55c2ed02df7ec7507e94d353b1b1dfee6a73c50cb2224de90d5626c6d77b13d85036b +MISC metadata.xml 673 BLAKE2B 2bcbf300bb1da0537008d3bf7fcee2ac974136a6141fc9d77c1cc6f3ad1d07d23afbe046c7930e20300f63c9c9c6559c400974b718fb8975f56e1178830c3b48 SHA512 95b05c97dba2dcbf3a9db38873d9177610acca5b8c6d7c137f6f041e0992227b52b33e2b1a406f674dc2a71cab9523c85c8b569df11dec3a8ca6b5e22871889d
Disregard comment 11 (concerning the Manifest), that's wrong. The correct diff follows in the next comment.
--- Manifest +++ Manifest @@ -1,6 +1,9 @@ AUX vboot-utils-72_p20181229-libressl.patch 426 BLAKE2B a67628074549b60e899f20a2589b64ab7dfe90f6476f44c2bb028f0f90b847173eb3e6ea975858a627a257bdaf2121865a7c83cd4d253cbc1d6ad412f0b8e84d SHA512 a78eaa53cc784845a99686025f20f7b10f5d285f4b145fa0e2371b4d242d489a21e91253e7a3b5cee12565c8412224556240acc555b0c9500d5a46b7b1356bb3 +AUX vboot-utils-76-musl-fts.patch 645 BLAKE2B d10f875252ed42bb3ea52f86aee91dc61f90bce9a808a9b9a2cf4c50ebea28d77806e0fa077a5124cdb0ad8cb6418cb376916f1c96ba0336328594c4d7c96548 SHA512 a082bd5705852812e47f4f297cf0a3207d15bd555b0fba3beb2ed45bc61bffc6fa906bc2d2918a90b051ccea208c474c4c80246ec6d3320047e532c902bb9fc6 DIST vboot-utils-59_p20170413.tar.xz 18431260 BLAKE2B 73853f92c5855a1fbcad55c696414317f46a06a69901529dd6da19be2abe4ca0337cf20dddc4f84f1d2a99357bb2f01df115b7d16c45f9af62dcd1b833580d46 SHA512 f92b9aed7a52ac7bab49b624725d4963564a22a03741619ad4ef1bc0a1fdee5123c68f3dad5bef9fb033f94f2a9ae99478c16386758fe4667a361bc91dda8048 DIST vboot-utils-72_p20181229.tar.xz 18489004 BLAKE2B 444eb0bc2c571ad79d26d473da724016d6d041207beaae161f6c1155768ff9d0b1c8b7b070b828083cc1396266cc77175a75e8067ce22613c75b4d77780dda75 SHA512 41df034dc5498bcbec0d49a472331ceb2fbc2eb3b4173d5c56e920d65ae485382b3d811e5f2c13cf45a1b05a5d6a24197924fa1c76ada9c3aac14fa3c4c363fe +DIST vboot-utils-76.tar.gz 35881572 BLAKE2B 79463fcc431cbf744633e5c437aa8d0e6ec06fa0539a098ef96cd29154cdfab54f39685ac3539569d177bce7c40e9da0658b9fdd800a942600e27d17cc48942c SHA512 ff432a1dd0e304b0a7141242588fe8cdfe878652495125ff3839c462a8ed3e2cbd22290878124598249da3d5019eb739ccb3358022edd8cc0c9ec89eab5c50b1 EBUILD vboot-utils-59_p20170413.ebuild 1961 BLAKE2B d519504ba8c955b164395dc95b2a0bc275548c97adcefe6c90ef81bd3ebe1ec8554f4fc42d2197227ee140d5c14a3b1f7097034cbdd42f065e756758b881a253 SHA512 90bab2830cab6eb87ccb8e85f1953c6b48c75accfc8c13a46a54fefeba2cd070497fab821b0103a0e4310c42e90bd546d3bb737dbff50a4b225f05d4dccc923e EBUILD vboot-utils-72_p20181229-r1.ebuild 2594 BLAKE2B f586492f5f860ddb24715616d788268f7576fd24a4b24e4b13c34cb0e88f28e1c3d1e83c6b2769b7db9b7abfc6e9260155366b44420e4d8acdebf65949e865f0 SHA512 146556fae5811a92a995e58b059f4f0afefd84e979e19d5b0869aac9cfe717966fa984eb19ef1398c149b9861bb6fd1d06f755b04a34b1d211c7fbbd5db8fe6e -MISC metadata.xml 488 BLAKE2B b3c656e8e93662a5fd2cfb7559ca150c9df50831789447fe1e4aa58b99b205daa70b5bcfc98e1e78e44cf0ef89ef9a6efc8563d31c2d3823aa7c07d1ec4cf3fb SHA512 b9c53eec1a6b1db1274f2baf51915691e36678eb1cc8e6b7cc1596b4912410b86e96175cd6cd614acc044a3b2fbf8ef350ba69daf6741802e926fc3ec2c73914 +EBUILD vboot-utils-76.ebuild 2682 BLAKE2B 1c7b855c3d0c28e9ca9b4495eb20dd788d280e9ec92544b436bc5c43547b5a16a22a32d0bf4e58bf5c850298e1fb797bfc13838a5a04cb5eb7a2007ee4f1bf96 SHA512 f8921955f6e6e02b85feb0a2d0adf5bb9d3829b6cc0b192433d70e2555b55c2ed02df7ec7507e94d353b1b1dfee6a73c50cb2224de90d5626c6d77b13d85036b +MISC metadata.xml 553 BLAKE2B 72ea256da9ad1fbaae817af4d55654b5870ef8185c04ed0099e65ec871d8f49a26744952477a53d6f3789d5c0a3f9c58dca579a4fbf59edd766468a983990acf SHA512 d62e04a91ad77ddba49a34b14f1239f3aac926a58568e65387fe47911826f869f85ec8e5d724c4c118ed15b8b3fd8e1e6ac4e53e668ff2b63a900a1d57364afa
In contrast to the previously uploaded ebuild the updated version from the diff by default sets the USE flag "libzip", to minimize the behavioural differences compared to the version currently in tree. Comment 7 is still relevant.
I hit this today on armv7, and this works fine for me on glibc/hardened. I can also try musl after I get snow to boot my kernel again (and we absolutely need a fix for arm on chromebooks).
Created attachment 595812 [details] An ebuild for the vboot-utils R79 branch Is there anything blocking this update that needs help? One issue with it: I think it needs to add HAVE_LIBZIP=$(usev libzip) to the make command so that its behavior follows the USE flag rather than what packages are installed. I've updated to R79 today prior to looking for this bug, and the ebuild is attached in case there is anything useful in it. (There are some minor updates like dropping obsolete stuff.) I don't have an ARM environment set up to test the fixes in the R76 ebuild, so this attachment shouldn't replace it.
Created attachment 596226 [details, diff] vboot-utils-79-musl-fts.patch
Created attachment 596230 [details, diff] vboot-utils-79-libzip.patch
Created attachment 596232 [details] vboot-utils-79.ebuild Updated to R79, incorporated most changes from David Michael (comment 16). Builds on armv7a-unknown-linux-musleabihf and the kernel boots on veyron-speedy. Following David's suggestion now with patch regarding HAVE_LIBZIP, I kept the patches seperate as I still hope the musl patch gets upstreamed (shouldn't be specific to gentoo), cf. comment 4.
Created attachment 596262 [details] vboot-utils-79.ebuild Fixed building with USE="static"
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e25b4aa1598f53a0712d6229df67f5564687285 commit 5e25b4aa1598f53a0712d6229df67f5564687285 Author: Alpha Bravo <aos@ungwana.de> AuthorDate: 2020-01-13 00:40:39 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-01-13 01:07:44 +0000 sys-boot/vboot-utils: Bump to version 80_p20200108 Closes: https://bugs.gentoo.org/688396 Closes: https://bugs.gentoo.org/687820 Closes: https://bugs.gentoo.org/678594 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-boot/vboot-utils/Manifest | 1 + .../files/vboot-utils-80-musl-fts.patch | 17 ++++ sys-boot/vboot-utils/metadata.xml | 5 +- .../vboot-utils/vboot-utils-80_p20200108.ebuild | 104 +++++++++++++++++++++ 4 files changed, 126 insertions(+), 1 deletion(-)
Thanks!