Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ SRCS = $(SRC_DIR)/main.c \
$(SRC_DIR)/ds_dhcp.c \
$(SRC_DIR)/ds_dns_proxy.c \
$(SRC_DIR)/daemon.c \
$(SRC_DIR)/check.c
$(SRC_DIR)/check.c \
$(SRC_DIR)/virtualize.c

# Compiler flags - hardened warning set, all warnings are errors
CFLAGS = -Wall -Wextra -Wpedantic -Werror -O2 -flto=auto -std=gnu99 -I$(SRC_DIR) -no-pie -pthread
Expand Down
13 changes: 13 additions & 0 deletions src/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "droidspace.h"
#include "virtualize.h"
#include <linux/capability.h>
#include <sys/prctl.h>

Expand Down Expand Up @@ -461,6 +462,18 @@ int internal_boot(struct ds_config *cfg) {
/* Apply jail mask after pivot_root for correct path resolution */
ds_apply_jail_mask(cfg->hw_access, cfg->privileged_mask);

/* 18b. Resource Virtualization (meminfo, cpuinfo, etc) */
if (cfg->virtualization) {
/* Verify /proc is mounted inside container before init */
if (is_mountpoint("/proc")) {
if (ds_virtualize_init(cfg) < 0) {
ds_warn("Resource virtualization initialization failed.");
}
} else {
ds_warn("Resource virtualization skipped: /proc is not mounted.");
}
}

/* 19. Configure rootfs networking (hostname, resolv.conf, etc) */
fix_networking_rootfs(cfg);

Expand Down
Loading
Loading