-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QWT support #181
base: main
Are you sure you want to change the base?
Add QWT support #181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a full review yet, but I think I captured main point here already.
rpc/qubes.WinSign.CreateKey
Outdated
set -efo pipefail | ||
|
||
# shellcheck source=SCRIPTDIR/qubes.WinSign.common | ||
. /etc/qubes-rpc/qubes.WinSign.common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not hardcode the path here. Especially, it's convenient to install the RPC files in /usr/local/etc/qubes-rpc in a specific AppVM.
You can use $(dirname "$0")
to find the directory.
Similar comment to all the other services too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tools/windows/edit-iso.sh
Outdated
|
||
echo "[*] Copying the final iso from '${DISPVM}' to '${OUTPUT}'..." | ||
|
||
shell_call "${DISPVM}" "cat ~/win-build.iso" | cat > "${OUTPUT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why extra cat?
shell_call "${DISPVM}" "cat ~/win-build.iso" | cat > "${OUTPUT}" | |
shell_call "${DISPVM}" "cat ~/win-build.iso" > "${OUTPUT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
key_name=sign_key_name, | ||
) | ||
|
||
dvm.kill() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If starting dvm fails, this will fail too (UnboundLocalError: cannot access local variable 'dvm' where it is not associated with a value
). Either move starting dvm before the try
part, or initialize the variable early (with None
?) and check for it here.
But also, it looks like the dvm start can be moved much later? Currently it's at the start of the build, but it's used only after the build - so, if you move it later, you can save starting it in case of build failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
qubes.WinSign.CreateKey +Qubes__Windows__Tools work-qubesos vault-sign allow | ||
qubes.WinSign.DeleteKey +Qubes__Windows__Tools work-qubesos vault-sign allow | ||
qubes.WinSign.GetCert +Qubes__Windows__Tools work-qubesos vault-sign allow | ||
qubes.WinSign.Sign +Qubes__Windows__Tools work-qubesos vault-sign allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing policy for the timestamp service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
admin.vm.property.Get * work-qubesos win-build allow target=dom0 | ||
admin.vm.device.block.Attach * work-qubesos win-build allow target=dom0 | ||
|
||
qubes.WinSign.QueryKey +Qubes__Windows__Tools work-qubesos vault-sign allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally for builder-specific services we use qubesbuilder.
prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
def run( | ||
self, | ||
cmd: List[str], | ||
copy_in: List[Tuple[Path, PurePath]] = None, | ||
copy_out: List[Tuple[PurePath, Path]] = None, | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support building in DispVM, this should be able to create and start new DispVM first and kill it at the end.
It does mean fresh DispVM for each component - is that a problem? In other words - are there some hidden assumption about reusing the same VM (like, depending on some files being present from previous build)?
For development builds it probably make sense to retain option to reuse the same VM over and over, so the DispVM case can be under some config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be a DispVM all the time, for development I usually just do local builds without the builder.
qubesbuilder/executors/windows.py
Outdated
from qubesadmin import Qubes | ||
from qubesadmin.devices import DeviceAssignment, UnknownDevice | ||
from qubesadmin.exc import DeviceAlreadyAttached, QubesException | ||
from qubesadmin.utils import encode_for_vmexec | ||
from qubesadmin.vm import DispVM, QubesVM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to use qubes-builderv2 outside of Qubes VM too. It doesn't need to support building Windows code there, but it shouldn't crash on ImportError
. I think there need to be try / except ImportError
somewhere, that will catch it nicely. I have an idea where - see separate comment.
qubesbuilder/config.py
Outdated
@@ -31,6 +31,7 @@ | |||
from qubesbuilder.executors.container import ContainerExecutor | |||
from qubesbuilder.executors.local import LocalExecutor | |||
from qubesbuilder.executors.qubes import LinuxQubesExecutor | |||
from qubesbuilder.executors.windows import WindowsExecutor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can catch ImportError
here, and set some variable like windows_executor_available = False
qubesbuilder/config.py
Outdated
@@ -575,6 +576,8 @@ def get_executor(options): | |||
executor = LocalExecutor(**executor_options) # type: ignore | |||
elif executor_type == "qubes": | |||
executor = LinuxQubesExecutor(**executor_options) # type: ignore | |||
elif executor_type == "windows": | |||
executor = WindowsExecutor(**executor_options) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here throw an exception if windows_executor_available
is false.
from qubesbuilder.config import Config | ||
from qubesbuilder.distribution import QubesDistribution | ||
from qubesbuilder.executors import ExecutorError | ||
from qubesbuilder.executors.windows import WindowsExecutor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And similarly this (and the qubesadmin
imports above) can be problematic. It wants either some wrapping here (and raise an exception early in run
if qubesadmin is not available), or changing PluginManager
so that plugin import error is not fatal. IMO the first option is better if wouldn't clutter the code too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW several CI tests that are unrelated to QWT fail due to importing qubesadmin
. That could be a good check if it works as expected - tests not related to QWT should pass even if qubesadmin
cannot be imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the qubesadmin
dependency.
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Add option to not ask user to enable network discovery Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
…age options Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #181 +/- ##
==========================================
- Coverage 78.74% 75.12% -3.63%
==========================================
Files 47 51 +4
Lines 5388 5825 +437
==========================================
+ Hits 4243 4376 +133
- Misses 1145 1449 +304 ☔ View full report in Codecov by Sentry. |
Can you squash the fixup commits (just do |
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
…utor Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Signed-off-by: Rafał Wojdyła <[email protected]>
Amazing work @omeg ! Can't wait to test testing packages. Also really interesting piece of work in terms of complex qubes-builderv2 for a learner. Thanks! |
No description provided.