2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
7 export SYSTEMD_LOG_LEVEL
=debug
9 portablectl attach
--now --runtime /usr
/share
/minimal_0.raw app0
11 systemctl is-active app0.service
12 systemctl is-active app0-foo.service
15 systemctl is-active app0-bar.service
&& exit 1
19 portablectl reattach
--now --runtime /usr
/share
/minimal_1.raw app0
21 systemctl is-active app0.service
22 systemctl is-active app0-bar.service
25 systemctl is-active app0-foo.service
&& exit 1
29 portablectl list |
grep -q -F "minimal_1"
31 portablectl detach
--now --runtime /usr
/share
/minimal_1.raw app0
33 portablectl list |
grep -q -F "No images."
35 # portablectl also works with directory paths rather than images
37 unsquashfs
-dest /tmp
/minimal_0
/usr
/share
/minimal_0.raw
38 unsquashfs
-dest /tmp
/minimal_1
/usr
/share
/minimal_1.raw
40 portablectl attach
--copy=symlink
--now --runtime /tmp
/minimal_0 app0
42 systemctl is-active app0.service
43 systemctl is-active app0-foo.service
46 systemctl is-active app0-bar.service
&& exit 1
50 portablectl reattach
--now --enable --runtime /tmp
/minimal_1 app0
52 systemctl is-active app0.service
53 systemctl is-active app0-bar.service
56 systemctl is-active app0-foo.service
&& exit 1
60 portablectl list |
grep -q -F "minimal_1"
62 portablectl detach
--now --enable --runtime /tmp
/minimal_1 app0
64 portablectl list |
grep -q -F "No images."
66 root
="/usr/share/minimal_0.raw"
67 app1
="/usr/share/app1.raw"
69 portablectl attach
--now --runtime --extension ${app1} ${root} app1
71 systemctl is-active app1.service
73 portablectl reattach
--now --runtime --extension ${app1} ${root} app1
75 systemctl is-active app1.service
77 portablectl detach
--now --runtime --extension ${app1} ${root} app1
79 # portablectl also works with directory paths rather than images
81 mkdir
/tmp
/rootdir
/tmp
/app1
/tmp
/overlay
82 mount
${app1} /tmp
/app1
83 mount
${root} /tmp
/rootdir
84 mount
-t overlay overlay
-o lowerdir
=/tmp
/app1
:/tmp
/rootdir
/tmp
/overlay
86 portablectl attach
--copy=symlink
--now --runtime /tmp
/overlay app1
88 systemctl is-active app1.service
90 portablectl detach
--now --runtime overlay app1