From b0c2a8ece0ade270dbeabfc9a7943bc1883868f1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 9 Jun 2019 00:04:21 +0200 Subject: [PATCH] - add init-script to deactivate swap --- archive-imagefiles/scripts/swap.init | 12 ++++++++++++ make/system-scripts.mk | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 archive-imagefiles/scripts/swap.init diff --git a/archive-imagefiles/scripts/swap.init b/archive-imagefiles/scripts/swap.init new file mode 100644 index 00000000..647a8fa5 --- /dev/null +++ b/archive-imagefiles/scripts/swap.init @@ -0,0 +1,12 @@ +#!/bin/sh + +. /etc/init.d/globals + +case $1 in + stop) + swapoff -a + ;; + *) + echo "[${BASENAME}] Usage: $0 {stop}" + ;; +esac diff --git a/make/system-scripts.mk b/make/system-scripts.mk index 9a42cc6c..49f84318 100644 --- a/make/system-scripts.mk +++ b/make/system-scripts.mk @@ -11,7 +11,8 @@ init-scripts: \ $(TARGET_DIR)/etc/init.d/coredump \ $(TARGET_DIR)/etc/init.d/crond \ $(TARGET_DIR)/etc/init.d/hostname \ - $(TARGET_DIR)/etc/init.d/inetd + $(TARGET_DIR)/etc/init.d/inetd \ + $(TARGET_DIR)/etc/init.d/swap $(TARGET_DIR)/etc/init.d/globals: install -D -m 0644 $(IMAGEFILES)/scripts/init.globals $@ @@ -41,6 +42,12 @@ $(TARGET_DIR)/etc/init.d/hostname: $(TARGET_DIR)/etc/init.d/inetd: install -D -m 0755 $(IMAGEFILES)/scripts/inetd.init $@ +$(TARGET_DIR)/etc/init.d/swap: +ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd51)) + install -D -m 0755 $(IMAGEFILES)/scripts/swap.init $@ + ln -sf swap $(TARGET_DIR)/etc/init.d/K99swap +endif + # ----------------------------------------------------------------------------- scripts: \