diff options
-rw-r--r-- | Makefile | 25 | ||||
m--------- | implementation/loop | 0 |
2 files changed, 24 insertions, 1 deletions
@@ -9,6 +9,7 @@ # Global configuration (file paths and config) #------------------------------------------------------------------------------ KERNEL_SRC_DIR := $(shell pwd)/implementation/loop +KERNEL_MOD_PATH := drivers/block/loop/ KERNEL_HDR_DIR := /lib/modules/$(shell uname -r)/build LOSETUP_SRC_DIR := $(shell pwd)/implementation/losetup KERNEL_MOD_CONFIG := $(shell pwd)/config/kernel-qcow2_x86-64_module.config @@ -19,7 +20,7 @@ LOCAL_MOD_CONFIG += CONFIG_BLK_DEV_LOOP_FILE_FMT_QCOW=m BUILD ?= vanilla KERNEL_DIR ?= $(KERNEL_SRC_DIR) CONFIG ?= KCONFIG_CONFIG=$(KERNEL_MOD_CONFIG) -TARGET_PATH_PREFX ?= drivers/block/loop/ +TARGET_PATH_PREFX ?= $(KERNEL_MOD_PATH) ifeq ($(BUILD),out-of-tree) PATCH = patch @@ -73,6 +74,28 @@ clean_losetup: @cd $(LOSETUP_SRC_DIR) && \ $(MAKE) --no-print-directory clean +ifeq ($(BUILD),out-of-tree) +loop.load: loop.ko +loop_file_fmt_raw.load: loop_file_fmt_raw.ko loop.load +loop_file_fmt_qcow.load: loop_file_fmt_qcow.ko loop.load + +loop.unload: loop_file_fmt_raw.unload loop_file_fmt_qcow.unload +loop_file_fmt_raw.unload: +loop_file_fmt_qcow.unload: + +load_modules: loop.load loop_file_fmt_raw.load loop_file_fmt_qcow.load + +unload_modules: loop_file_fmt_qcow.unload loop_file_fmt_raw.unload loop.unload + +%.load: + $(call print_heading,"Load kernel module $(basename $@)") + sudo insmod $(KERNEL_SRC_DIR)/$(KERNEL_MOD_PATH)$(basename $@).ko + +%.unload: + $(call print_heading,"Unload kernel module $(basename $@)") + sudo rmmod $(basename $@) +endif + #------------------------------------------------------------------------------ # Function definitions #------------------------------------------------------------------------------ diff --git a/implementation/loop b/implementation/loop -Subproject 6f5dc67946313ced450de6546fc7f28e0afdf1a +Subproject b9562e46df0f2ddfbd01b99a44a3c4eaa3f32fe |