VirtualBox Guest Additions编译

时间:2018-04-21 14:56:46

标签: c++ virtualbox kbuild

我正在根据官方documentation编译VirtualBox Guest Additions。单独构建64位和32位添加并尝试将其打包成iso映像。

目标系统是Windows 7 x64。根据文档的所有软件要求,包括确切的版本。只应添加补充(VBOX_ONLY_ADDITIONS:= LocalConfig.kmk中的1)

没有设置目标的32位编译

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x86 /win7
set BUILD_TARGET_ARCH=x86
set PATH=%PATH%;%~dp0kBuild\bin\win.x86
cscript configure.vbs --with-DDK=C:\WinDDK\7600.16385.1 --with-MinGW-w64=C:\mingw\mingw64 --with-MinGW32=C:\mingw\mingw32 --with-libSDL=C:\SDL\x86\SDL-1.2.15 --with-openssl=C:\OpenSSL\x32 --with-libcurl=C:\curl\x86 --with-Qt5=C:\Qt\5.6.3\x86\msvc2010 --with-python=C:/Python27
call env.bat
kmk KBUILD_TARGET_ARCH=x86

64位编译而不设置目标

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64 /win7
set BUILD_TARGET_ARCH=amd64
set PATH=%PATH%;%~dp0kBuild\bin\win.amd64
cscript configure.vbs --with-DDK=C:\WinDDK\7600.16385.1 --with-MinGW-w64=C:\mingw\mingw64 --with-MinGW32=C:\mingw\mingw32 --with-libSDL=C:\SDL\x64\SDL-1.2.15 --with-openssl=C:\OpenSSL\x64 --with-openssl32=C:\OpenSSL\x32 --with-libcurl=C:\curl\x64 --with-libcurl32=C:\curl\x86 --with-Qt5=C:\Qt\5.6.3\x64\msvc2010 --with-python=C:/Python27
call env.bat
kmk KBUILD_TARGET_ARCH=amd64

尝试构建x86添加(根据Makefile.kmk中的注释,必须在x64之前构建)

kmk additions-build-win.x86

获取错误

kBuild: Creating C:/Users/atatat/Projects/virtualbox/VirtualBox-5.2.2/out/win.x86/release/bin/additions/VBoxWHQLFake.exe
C:/Users/atatat/AppData/Local/Temp/make3416-1.sh: 1: Syntax error: "(" unexpected
kmk.exe[1]: *** [C:/Users/atatat/Projects/virtualbox/VirtualBox-5.2.2/out/win.x86/release/bin/additions/VBoxWHQLFake.exe] Error 2 (0x2)
kmk.exe[1]: Leaving directory `C:/Users/atatat/Projects/virtualbox/VirtualBox-5.2.2'
kmk_time: 0m2.823600s - exit code: 2
kmk: *** [additions-build-win.x86] Error 2 (0x2)

尝试构建x64版本时出现相同的错误:kmk additions-build-win.amd64

我的LocalConfig.kmk

VBOX_WITH_HARDENING :=
VBOX_PATH_WIX := C:\wix
VBOX_GSOAP_INSTALLED := 1
VBOX_PATH_GSOAP := C:\gsoap\gsoap-2.8\gsoap
VBOX_WITH_COMBINED_PACKAGE := 1
VBOX_WITH_QT_PAYLOAD := 1
VBOX_WITH_QTGUI_V5 := 1
VBOX_SIGNING_MODE := release
VBOX_TSA_URL := http://timestamp.digicert.com
VBOX_TSA_SHA2_URL := http://timestamp.digicert.com
VBOX_TSA_URL_ARGS := /t "$(VBOX_TSA_URL)"
VBOX_TSA_SHA2_URL_ARGS := /tr "$(VBOX_TSA_SHA2_URL)" /td sha256
VBOX_PATH_SIGN_TOOLS := C:\Program Files (x86)\Windows Kits\8.1\bin\x64
VBOX_PATH_SELFSIGN := C:\WinDDK\7600.16385.1\bin\selfsign
VBOX_PATH_WISUMINFO := "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\sysmgmt\msi\scripts\WiSumInf.vbs"
VBOX_PATH_WISUBSTG  := "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\sysmgmt\msi\scripts\WiSubStg.vbs"
VBOX_WITH_DOCS := 1
VBOX_WITH_DOCS_CHM := 1
VBOX_WITH_DOCS_PACKING := 1
VBOX_HAVE_XMLLINT := C:\xmllint\bin\xmllint.exe
VBOX_PATH_DOCBOOK        := C:/DocBook/xsl/
VBOX_PATH_DOCBOOK_DTD    := C:/DocBook/xml/
VBOX_XML_CATALOG         := $(PATH_TARGET)/manual/catalog
VBOX_XML_CATALOG_DOCBOOK := $(PATH_TARGET)/manual/docbook
VBOX_PATH_HTML_HELP_WORKSHOP := "C:\Program Files (x86)\HTML Help Workshop"
VBOX_PDFLATEX := "C:\Program Files\MikTeX\texmfs\install\miktex\bin\pdflatex.exe"
VBOX_PDFLATEX_CMD := $(VBOX_PDFLATEX) -halt-on-error -interaction batchmode
TOOL_CURL_FETCH := C:\curl\x64\curl.exe
PATH_TOOL_NASM := "C:\Program Files\NASM"
VBOX_INSTALLER_LANGUAGES := en_US
VBOX_WITH_TESTCASES :=
VBOX_WITH_VALIDATIONKIT :=
VBOX_WITH_VBOX_IMG := 1
VBOX_BUILD_PUBLISHER := 
VBOX_WITH_R0_LOGGING := 1
VBOX_PATH_DIFX := C:\WinDDK\7600.16385.1\redist\DIFx\DIFxAPI\amd64
VBOX_PATH_NSIS := C:\Program Files (x86)\NSIS
VBOX_MKISOFS := C:\cdrtools\win32
VBOX_PATH_AUTOIT3 := C:\Program Files (x86)\AutoIt3
VBOX_ONLY_ADDITIONS := 1

1 个答案:

答案 0 :(得分:1)

它似乎没有下载任何东西。相反,它告诉你它无法找到" zip.exe"。

您需要确保在PATH的某个地方安装该程序。

在这一步中似乎也没有制造iso。