1
0

feat(MP): add just recipe for full installation and run/stop

This commit is contained in:
2026-06-07 23:20:59 +02:00
parent 93c439abb8
commit 3097b3ae8d
4 changed files with 28 additions and 3 deletions

View File

@@ -4,6 +4,11 @@
@build:
make
@install:
install -m 0755 daemon /rootfs/usr/bin/daemon
echo "daemon installed successfully in /rootfs/usr/bin/"
@clean:
make clean
rm -f -- daemon
rm -f /rootfs/usr/bin/daemon

View File

@@ -2,21 +2,39 @@ mod kernel
mod daemon
mod cli
target_ssh := "root@192.168.53.14"
# List available recipes
@default:
just --list
# Build all components (kernel module, daemon, and cli)
@build:
just kernel::build
just daemon::build
just cli::build
# Install all components to the local rootfs
@install:
just kernel::install
just daemon::install
just cli::install
# Load the kernel module and start the daemon on the target
@run:
ssh {{target_ssh}} "modprobe temp_regulator"
ssh {{target_ssh}} "start-stop-daemon --start --background --exec /usr/bin/daemon"
# Stop the daemon and unload the kernel module on the target
@stop:
ssh {{target_ssh}} "start-stop-daemon --stop --exec /usr/bin/daemon || true"
ssh {{target_ssh}} "modprobe -r temp_regulator || true"
# Clean build artifacts and remove installed files from local rootfs
@clean:
just kernel::clean
just daemon::clean
just cli::clean
@all: clean build install
# Clean, build, install, and run everything
@all: clean build install run

View File

@@ -30,10 +30,12 @@ all:
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
rm -f $(MODPATH)/etc/modprobe.d/$(MODULE).conf
rm -f $(MODPATH)/lib/modules/*/extra/$(MODULE).ko
echo $(PATH)
install:
$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(MODPATH) modules_install
# install -D -m 0644 $(MODULE).conf $(MODPATH)/etc/modprobe.d/$(MODULE).conf
install -D -m 0644 $(MODULE).conf $(MODPATH)/etc/modprobe.d/$(MODULE).conf
endif

View File

@@ -8,4 +8,4 @@
make install
@clean:
make clean
make clean