Commit Graph

6 Commits

Author SHA1 Message Date
David Gageot
f9f1ec7de4
Fix swap.sh (#3897)
The script used to compare “10M” with “10” as if
they were both integers.

Signed-off-by: David Gageot <david.gageot@docker.com>

Signed-off-by: David Gageot <david.gageot@docker.com>
2023-01-12 09:50:47 +00:00
David Scott
57dd4029c8 swap: speed up preferring a 1MiB blocksize
If the swap disk is larger than 1MiB, then use a 1MiB blocksize in `dd`

On my machine using a large block size speeds up swap file creation:

```
/ # time dd if=/dev/zero of=output bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
real    0m 4.61s
user    0m 0.79s
sys     0m 3.77s
/ # time dd if=/dev/zero of=output bs=1048576 count=1024
1024+0 records in
1024+0 records out
real    0m 1.06s
user    0m 0.00s
sys     0m 1.04s
```

Signed-off-by: David Scott <dave.scott@docker.com>
2019-11-22 20:48:31 +00:00
Guillaume Rose
fa1cd40a2a Create swap file only if absent
Signed-off-by: Guillaume Rose <guillaume.rose@docker.com>
2019-06-17 10:06:17 +02:00
Avi Deitcher
aebd255755 Add support for encrypted swap
Update examples/swap.yml to use latest linuxkit/swap image
Add comment to examples/swap.yml how to enable encryption
Add encrypt options to README
Make encrypted swap the default

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-04-30 11:07:56 +03:00
Avi Deitcher
f72a2e7bef 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 <avi@deitcher.net>
2017-04-29 22:18:42 +03:00
Avi Deitcher
715cfbd02c First cut of swap image and example
Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix spaces after commas

Remove MAINTAINER

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Simplify swap.yml example to remove files section

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Switch swap.sh to sh from bash and remove bash from image

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Replace fallocate with dd and update calculation function to support it

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix indentation

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Change link to swap to just swap.sh

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Fix indent

Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-04-26 23:05:45 +03:00