From 5180beec7347da6fe7793960f55d08f00faa8d38 Mon Sep 17 00:00:00 2001 From: Dan Kelleher Date: Thu, 20 Aug 2015 11:09:35 -0400 Subject: [PATCH] Rewrite 04-mount-swap to swap on all swap partitions. The 04-mount-swap was only mounting on swap with a label swap. This will now swap on all swap type partitions. --- base/etc/one-context.d/04-mount-swap | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/base/etc/one-context.d/04-mount-swap b/base/etc/one-context.d/04-mount-swap index e42ca2e..06881e0 100755 --- a/base/etc/one-context.d/04-mount-swap +++ b/base/etc/one-context.d/04-mount-swap @@ -1 +1,15 @@ -swapon -L swap +#!/bin/bash + +activate_swaps() { + + SWAP_DRIVES=$(blkid | grep 'TYPE=\"swap\"' | cut -d':' -f1) + for SWAP in $SWAP_DRIVES ; do + if [ -z "$(swapon -s | grep $SWAP)"]; then + swapon $SWAP + fi + done + +} + +activate_swaps +