BUSY.. TODO

pull/15/head
qaidvoid 4 years ago
parent 720f4b468f
commit dd9130a331

1
.gitignore vendored

@ -0,0 +1 @@
.vscode

@ -1,9 +1,8 @@
CXX := g++
CXX_FLAGS := -Wall -Wextra -std=c++17
CXX := g++
CXX_FLAGS := -Wall -Wextra -std=c++17
BIN := bin
SRC := src
INCLUDE := include
SRC := src
INCLUDE := include
EXECUTABLE := passthrough

@ -1,5 +1,7 @@
## Automated Setup
###### Not well-tested. Only supports systemd init system. Installs packages, enables iommu and creates libvirt hooks for now.
###### Halted till December.
###### TODO: upstart, openrc, sysv support. Automatic VM creation and passthrough support. Libvirt script for window managers.
```sh
make
sudo ./passthrough

@ -1,4 +1,8 @@
#include <memory>
#include <iostream>
#include <algorithm>
std::string shell_cmd(char const *cmd);
void trim(std::string &s);
void rtrim(std::string &s);
void ltrim(std::string &s);

@ -0,0 +1,5 @@
#include <iostream>
#include <shell.h>
void create_vm();
void create_vm_with_libvirt();

Binary file not shown.

@ -6,6 +6,10 @@ int main()
{
try
{
std::string user = shell_cmd("echo $(whoami)");
if (user != "root")
throw std::runtime_error("\033[1;31mYou need to run the tool as root.\033[0m");
char cnf;
configure_iommu();

@ -12,5 +12,27 @@ std::string shell_cmd(char const *cmd)
{
resp += buffer.data();
}
trim(resp);
return resp;
}
void ltrim(std::string &s)
{
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
return !std::isspace(ch);
}));
}
void rtrim(std::string &s)
{
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
return !std::isspace(ch);
}).base(),
s.end());
}
void trim(std::string &s)
{
ltrim(s);
rtrim(s);
}

@ -0,0 +1,11 @@
#include <vm.h>
void create_vm()
{
// TODO
}
void create_vm_with_libvirt()
{
// TODO
}
Loading…
Cancel
Save