qubes-builder

49 views
Skip to first unread message

swil...@protonmail.com

unread,
Jul 26, 2018, 8:33:36 PM7/26/18
to qubes-devel
I'm hoping someone can help me with building the windows-tools: https://github.com/QubesOS/qubes-builder-windows

I'm using Windows 7 x64.

Originally ran the get-be.ps1 script which I found to be broken (then noticed this was mentioned in readme.md). I was able to adapt the script for it to obtain packages (gpg, ming32). Found that ming32 was out of date, then followed manual install instructions as below:

Qubes-Builder installed at C:\Qubes\qubes-builder. Appears cloned from: https://github.com/QubesOS/qubes-builder

Installed wix. Created a junction to the installation folder at C:\wix
Installed python37 in c:\py
Installed visual studio pro 2013. Created a junction to the installation folder at C:\vs2013

I've downloaded msys64 and installed at: C:\Qubes\qubes-builder\cache\windows-prereqs\msys64

I'm using ming32.exe from that directory.

I've installed some ming32.exe prerequesites (pacman -S git make p7zip diffutils tar).

I've created the file C:\Qubes\qubes-builder\chroot-win7x64\.be-prepared - contents below:

/c/Qubes/qubes-builder/cache/windows-prereqs/msys64/mingw32
/c/windows
/c/py
/c/wix
/c/windows/py

I've adapted the builder.conf file from the repo (https://github.com/QubesOS/qubes-builder-windows - windows-tools.conf) with:

NO_SIGN = 1
VERBOSE = 2

I can download the sources with 'make get-sources', however 'make qubes' throws the following:


------

# make qubes
================================================================================
B U I L D I N F O
Items in red indicate it was automatically generated by configuration file(s)
Items in white indicate it was automatically removed by configuration file(s)
================================================================================
DISTS_VM:
win7x64,
DISTS_ALL:
win7x64,
DIST_DOM0:
win7x64,
BUILDER_PLUGINS:
builder-windows,
COMPONENTS:
builder-windows, vmm-xen-windows-pvdrivers, core-vchan-xen, windows-utils, core-qubesdb, core-agent-windows,
gui-common, gui-agent-windows, installer-qubes-os-windows-tools,
GIT_REPOS:
qubes-src/builder-windows, qubes-src/vmm-xen-windows-pvdrivers, qubes-src/core-vchan-xen,
qubes-src/windows-utils, qubes-src/core-qubesdb, qubes-src/core-agent-windows, qubes-src/gui-common,
qubes-src/gui-agent-windows, qubes-src/installer-qubes-os-windows-tools, .,
TEMPLATE:

TEMPLATE_FLAVOR_DIR:

TEMPLATE_ALIAS:

TEMPLATE_LABEL:

make[1]: Entering directory '/c/Qubes/qubes-builder'
-> Nothing to be done in builder-windows for win7x64 dom0
make[1]: Leaving directory '/c/Qubes/qubes-builder'
-> Nothing to be done in builder-windows for win7x64 vm
make[1]: Entering directory '/c/Qubes/qubes-builder'
-> Nothing to be done in vmm-xen-windows-pvdrivers for win7x64 dom0
make[1]: Leaving directory '/c/Qubes/qubes-builder'
Error: WriteFile failed => 0x3 (3)
Failed
PrivateCertStore
CertUtil: -exportPFX command FAILED: 0x80070002 (WIN32: 2)
CertUtil: The system cannot find the file specified.
make[1]: *** [/c/Qubes/qubes-builder/qubes-src/builder-windows/Makefile.windows:165: dist-prepare-chroot] Error 2
make: *** [Makefile:216: vmm-xen-windows-pvdrivers-vm] Error 1

---------

Appears to do with a path, likely related to .be-prepared.

Makefile.windows:165 code is: $(eval WIX := $(shell sed -n '4p' $(BE_MARKER)))

Unfortunately not enough detail to a specific file in the message, or what the code is looking for with a file (could even be a red herring).

Anybody have any clues?

FYI: I've never built qubes before, or worked with msys / ming32. I have general technical capabilities and dev experience however. Learning as I go and having a lot of fun.

Marek Marczykowski-Górecki

unread,
Jul 26, 2018, 8:40:24 PM7/26/18
to swil...@protonmail.com, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Thu, Jul 26, 2018 at 05:24:19PM -0700, swillett via qubes-devel wrote:
> I'm hoping someone can help me with building the windows-tools: https://github.com/QubesOS/qubes-builder-windows
>
> I'm using Windows 7 x64.
>
> Originally ran the get-be.ps1 script which I found to be broken (then noticed this was mentioned in readme.md). I was able to adapt the script for it to obtain packages (gpg, ming32). Found that ming32 was out of date, then followed manual install instructions as below:
>
> Qubes-Builder installed at C:\Qubes\qubes-builder. Appears cloned from: https://github.com/QubesOS/qubes-builder
>
> Installed wix. Created a junction to the installation folder at C:\wix
> Installed python37 in c:\py
> Installed visual studio pro 2013. Created a junction to the installation folder at C:\vs2013

If you're building it for Qubes 4.0, use VS 2017. You can download
community version for free.

> I've downloaded msys64 and installed at: C:\Qubes\qubes-builder\cache\windows-prereqs\msys64

msys2?

> I'm using ming32.exe from that directory.
>
> I've installed some ming32.exe prerequesites (pacman -S git make p7zip diffutils tar).
>
> I've created the file C:\Qubes\qubes-builder\chroot-win7x64\.be-prepared - contents below:
>
> /c/Qubes/qubes-builder/cache/windows-prereqs/msys64/mingw32
> /c/windows
> /c/py
> /c/wix
> /c/windows/py
>
> I've adapted the builder.conf file from the repo (https://github.com/QubesOS/qubes-builder-windows - windows-tools.conf) with:
>
> NO_SIGN = 1
> VERBOSE = 2
>
> I can download the sources with 'make get-sources', however 'make qubes' throws the following:
>
> ------
(...)

> Error: WriteFile failed => 0x3 (3)
> Failed
> PrivateCertStore
> CertUtil: -exportPFX command FAILED: 0x80070002 (WIN32: 2)
> CertUtil: The system cannot find the file specified.

I think even if you set NO_SIGN=1, certificate is created if
WIN_CERT_FILENAME is set. In windows-tools.conf it is set to
c:\qubes-builder\qwt.pfx, which looks to be invalid in your setup.
Either set it to valid place (directory needs to exist), or comment it
out.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAltaafMACgkQ24/THMrX
1ywcGwgAibcWEqZJnC4VbZKxKLYwPpJdnnMPl9NLUqXG0aUW1RYeTvKtVmTKUKXt
lKy9TejjnBWvT+aUXtQ8EYN8RDKVClqmNoe7qsWiQTItit1QXAZYlKqa8BOJp6/4
pcMGEx1Ny0fnc2eNHqDhF1iwJ/IC+awqd73gLJuRXJKcVqbDoILoEB1Ar0K+RRrm
N2OOxwwCIlbN4UVUE76PmxVmb52DiEbbTabV68mjcOB0GoWbnKeoVeuHsDR/e4L0
VvVgDMPzgEnACtC5jbAl9KLoJoz19IJKn6gvtVGHKlQiLs3MBybEvEEa8geuWDy2
PkJDE5Lg+W/FlzXnRvooxdEPvK9bow==
=DO0p
-----END PGP SIGNATURE-----

Epinsion Polickye

unread,
Jul 26, 2018, 10:28:27 PM7/26/18
to qubes-devel

Thanks for your help. Yes I'm referring to msys2 when I say msys64 (reading up on it now: https://github.com/msys2/msys2/wiki/MSYS2-introduction).

I've made some progress. I can move forward commenting out WIN_SIGN_CMD lines in the makefile. Commenting out the first instance of the var through errors until I did this.

Appears to be issues at build.py now. It's attempting to open some files to write versions to. It appears to be in a different directory however (printing os.getcwd() shows the script is working within a xeniface dir, whereas it makes more sense if it was in the parent directory of this where the include and src dirs are to write versions). Causes issues on line 33, 83, and 244. Looking for a way to resolve (os.chdir('..') perhaps, or overwrite paths).

Also edited the function getVsVersion() around line 400 to simply return 'vs2017' - the script is looking for a batch script to return a version (vsvarsall.bat), however I can't find it on my file system at all, or other references to the script in files.

Epinsion Polickye

unread,
Jul 26, 2018, 10:40:55 PM7/26/18
to qubes-devel
On Friday, July 27, 2018 at 10:33:36 AM UTC+10, Epinsion Polickye wrote:

Ok looks like make get-sources didn't retrieve a xeniface repo. Checking again the latest pvdrivers repo is cloned, along with the xeniface repo

Epinsion Polickye

unread,
Jul 29, 2018, 6:26:54 PM7/29/18
to qubes-devel
On Friday, July 27, 2018 at 10:33:36 AM UTC+10, Epinsion Polickye wrote:

Script is now failing with a batch script and related vars: vcvarsall.bat

I can't find the file after a quick search in repos. Any ideas?

Epinsion Polickye

unread,
Jul 29, 2018, 7:26:18 PM7/29/18
to qubes-devel
On Friday, July 27, 2018 at 10:33:36 AM UTC+10, Epinsion Polickye wrote:

VS2017 - more prerequisites required by the looks. Adding python and vc++ packages and will see what happens.

Reply all
Reply to author
Forward
0 new messages