From e0961d59b26d0221ebf86c662a5a32b2b5c8ab9f Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sun, 28 Jun 2015 15:30:22 +0200 Subject: [PATCH] pflask: rename --volatile option to --ephemeral It just makes more sense. --- README.rst | 8 ++++---- docs/pflask.rst | 2 +- etc/pflask.zsh-completion | 2 +- src/mount.c | 6 +++--- src/mount.h | 2 +- src/pflask.c | 10 +++++----- tools/pflask-debuild | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index b657fd4..dea3968 100644 --- a/README.rst +++ b/README.rst @@ -114,15 +114,15 @@ manpage for more information. .. _`types of mount points`: https://ghedo.github.io/pflask/pflask.html#mount -Volatile root filesystem -~~~~~~~~~~~~~~~~~~~~~~~~ +Ephemeral root filesystem +~~~~~~~~~~~~~~~~~~~~~~~~~ -Using the ``--volatile`` option it's possible to tell pflask to discard any +Using the ``--ephemeral`` option it's possible to tell pflask to discard any change applied to the root filesystem once the container terminates: .. code-block:: bash - $ sudo pflask --chroot=/path/to/rootfs --volatile -- /sbin/init + $ sudo pflask --chroot=/path/to/rootfs --ephemeral -- /sbin/init This can be used for example for a build environment, where dependencies can be installed at every run on a clean rootfs, without the need to recreate the diff --git a/docs/pflask.rst b/docs/pflask.rst index cb1af6b..5cd4350 100644 --- a/docs/pflask.rst +++ b/docs/pflask.rst @@ -57,7 +57,7 @@ OPTIONS Example: ``--user-map=0:100000,65536`` -.. option:: -w, --volatile +.. option:: -w, --ephemeral Discard any change to / once the container exits. This can only be used along with ``--chroot`` and requires support for the overlay_ mount type. diff --git a/etc/pflask.zsh-completion b/etc/pflask.zsh-completion index f39c6a0..6f27b44 100644 --- a/etc/pflask.zsh-completion +++ b/etc/pflask.zsh-completion @@ -12,7 +12,7 @@ _arguments -C -S \ {--user-map=,-e}'[Map container users to host users]:map' \ {--chroot=,-r}'[Change the root directory inside the container]:directory:_directories' \ {--chdir=,-c}'[Change the current directory inside the container]:directory' \ - {--volatile,-w}'[Discard changes to /]' \ + {--ephemeral,-w}'[Discard changes to /]' \ {--cgroup=,-g}'[Create new cgroups and move the container inside them]:cgroup spec' \ {--detach,-d}'[Detach from terminal]' \ {--attach=,-a}'[Attach to the specified detached process]:PID' \ diff --git a/src/mount.c b/src/mount.c index 3012825..0bc760b 100644 --- a/src/mount.c +++ b/src/mount.c @@ -161,7 +161,7 @@ void mount_add_from_spec(struct mount **mounts, const char *spec) { } } -void setup_mount(struct mount *mounts, const char *dest, bool is_volatile) { +void setup_mount(struct mount *mounts, const char *dest, bool is_ephemeral) { int rc; struct mount *sys_mounts = NULL; @@ -174,13 +174,13 @@ void setup_mount(struct mount *mounts, const char *dest, bool is_volatile) { _free_ char *procsys_dir = NULL; - char template[] = "/tmp/pflask-volatile-XXXXXX"; + char template[] = "/tmp/pflask-ephemeral-XXXXXX"; rc = mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL); if (rc < 0) sysf_printf("mount(MS_SLAVE)"); if (dest != NULL) { - if (is_volatile) { + if (is_ephemeral) { if (!mkdtemp(template)) sysf_printf("mkdtemp()"); diff --git a/src/mount.h b/src/mount.h index 8b7b3f1..96bcf7f 100644 --- a/src/mount.h +++ b/src/mount.h @@ -35,4 +35,4 @@ void mount_add(struct mount **mounts, const char *src, const char *dst, void mount_add_from_spec(struct mount **mounts, const char *spec); -void setup_mount(struct mount *mounts, const char *dest, bool is_volatile); +void setup_mount(struct mount *mounts, const char *dest, bool is_ephemeral); diff --git a/src/pflask.c b/src/pflask.c index 1d29416..d2f767a 100644 --- a/src/pflask.c +++ b/src/pflask.c @@ -63,7 +63,7 @@ static struct option long_opts[] = { { "user", required_argument, NULL, 'u' }, { "user-map", required_argument, NULL, 'e' }, { "chroot", required_argument, NULL, 'r' }, - { "volatile", no_argument, NULL, 'w' }, + { "ephemeral", no_argument, NULL, 'w' }, { "chdir", required_argument, NULL, 'c' }, { "cgroup", required_argument, NULL, 'g' }, { "detach", no_argument, NULL, 'd' }, @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) { bool detach = false; bool keepenv = false; - bool is_volatile = false; + bool is_ephemeral = false; siginfo_t status; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { break; case 'w': - is_volatile = 1; + is_ephemeral = 1; break; case 'g': @@ -321,7 +321,7 @@ int main(int argc, char *argv[]) { if (rc < 0) sysf_printf("sethostname()"); } - setup_mount(mounts, dest, is_volatile); + setup_mount(mounts, dest, is_ephemeral); if (dest != NULL) { setup_nodes(dest); @@ -523,7 +523,7 @@ static inline void help(void) { CMD_HELP("--user", "-u", "Run the command under the specified user"); CMD_HELP("--user-map", "-e", "Map container users to host users"); - CMD_HELP("--volatile", "-w", "Discard changes to /"); + CMD_HELP("--ephemeral", "-w", "Discard changes to /"); CMD_HELP("--cgroup", "-g", "Create a new cgroup and move the container inside it"); diff --git a/tools/pflask-debuild b/tools/pflask-debuild index 7206082..8b72eba 100755 --- a/tools/pflask-debuild +++ b/tools/pflask-debuild @@ -142,7 +142,7 @@ elif [ "$1" = "--update" ]; then -- \ sh -c "$APT_TOOL update && $APT_TOOL dist-upgrade && $APT_TOOL autoremove --purge && $APT_TOOL autoclean" else - $PFLASK_TOOL --keepenv --chroot $BASEDIR --volatile \ + $PFLASK_TOOL --keepenv --chroot $BASEDIR --ephemeral \ --mount "bind,$RESDIR,$TMPDIR" \ --chdir "/mnt/$PKGDIR" \ -- \