From f72a2e7bef692c1e34698d27bac5467d89c5d3fc Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Fri, 28 Apr 2017 17:19:26 +0300 Subject: [PATCH] use updated kernel and correct path in examples/swap.yml for swap.sh, take any command-line options, not just those with an arg that in turn requires a new hash on the example Use latest 4.9.x kernel to keep in line with other examples Replace (bash) herestring with (posix) heredoc in swap.sh, and update hash to match Signed-off-by: Avi Deitcher --- examples/swap.yml | 4 ++-- pkg/swap/swap.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/swap.yml b/examples/swap.yml index 0dae1b677..0511c5862 100644 --- a/examples/swap.yml +++ b/examples/swap.yml @@ -48,7 +48,7 @@ onboot: rootfsPropagation: shared command: ["/mount.sh", "/var/external"] - name: swap - image: "linuxkit/swap:edd74ce7ced2b97dba5075012f497570c5490299" + image: "linuxkit/swap:d089b31acad8a5f6a5f1c368ddd1dfe1d049b100" net: host pid: host capabilities: @@ -57,7 +57,7 @@ onboot: binds: - /var:/var - /dev:/dev - command: ["swap.sh", "--path", "/var/external/swap", "--size","1G"] + command: ["/swap.sh", "--path", "/var/external/swap", "--size", "1G"] services: - name: rngd image: "linuxkit/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9" diff --git a/pkg/swap/swap.sh b/pkg/swap/swap.sh index 77eff3358..18d9081a1 100755 --- a/pkg/swap/swap.sh +++ b/pkg/swap/swap.sh @@ -2,7 +2,7 @@ set -e -while [ $# -gt 1 ]; do +while [ $# -ge 1 ]; do key="$1" case $key in @@ -74,7 +74,9 @@ fi ## check each of our conditions for cond in $CONDITIONS; do # split the condition parts - IFS=: read condtype arg1 arg2 arg3 arg4 <<< "$cond" + IFS=: read condtype arg1 arg2 arg3 arg4 <