l: move ecryptfs-hack to wrapper
This commit is contained in:
parent
1fb17be4d1
commit
5433345ad4
@ -10,8 +10,6 @@ with import <stockholm/lib>;
|
|||||||
plain = ''
|
plain = ''
|
||||||
'';
|
'';
|
||||||
ecryptfs = ''
|
ecryptfs = ''
|
||||||
# we start and exit ecryptfs-manager again to circumvent a bug where mounting the ecryptfs fails
|
|
||||||
echo 4 | ${pkgs.ecryptfs}/bin/ecryptfs-manager
|
|
||||||
if ! mount | grep -q '${cfg.dataLocation}/${cname}/ecryptfs on /var/lib/containers/${cname}/var/state type ecryptfs'; then
|
if ! mount | grep -q '${cfg.dataLocation}/${cname}/ecryptfs on /var/lib/containers/${cname}/var/state type ecryptfs'; then
|
||||||
if [ -e ${cfg.dataLocation}/${cname}/ecryptfs/.cfg.json ]; then
|
if [ -e ${cfg.dataLocation}/${cname}/ecryptfs/.cfg.json ]; then
|
||||||
${pkgs.ecrypt}/bin/ecrypt mount ${cfg.dataLocation}/${cname}/ecryptfs /var/lib/containers/${cname}/var/state
|
${pkgs.ecrypt}/bin/ecrypt mount ${cfg.dataLocation}/${cname}/ecryptfs /var/lib/containers/${cname}/var/state
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#usage: ecrypt mount /var/crypted /var/unencrypted
|
#usage: ecrypt mount /var/crypted /var/unencrypted
|
||||||
pkgs.writers.writeDashBin "ecrypt" ''
|
pkgs.writers.writeDashBin "ecrypt" ''
|
||||||
set -euf
|
set -euf
|
||||||
set -x
|
|
||||||
|
|
||||||
PATH=${lib.makeBinPath (with pkgs; [
|
PATH=${lib.makeBinPath (with pkgs; [
|
||||||
coreutils
|
coreutils
|
||||||
@ -32,6 +31,8 @@ pkgs.writers.writeDashBin "ecrypt" ''
|
|||||||
echo 'destination dir is not empty, aborting'
|
echo 'destination dir is not empty, aborting'
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
# we start and exit ecryptfs-manager again to circumvent a bug where mounting the ecryptfs fails
|
||||||
|
echo 4 | ecryptfs-manager
|
||||||
stty -echo
|
stty -echo
|
||||||
printf "passphrase: "
|
printf "passphrase: "
|
||||||
read passphrase
|
read passphrase
|
||||||
@ -59,6 +60,8 @@ pkgs.writers.writeDashBin "ecrypt" ''
|
|||||||
if keyctl list @u | grep -q "$old_sig"; then
|
if keyctl list @u | grep -q "$old_sig"; then
|
||||||
echo 'pw already saved'
|
echo 'pw already saved'
|
||||||
else
|
else
|
||||||
|
# we start and exit ecryptfs-manager again to circumvent a bug where mounting the ecryptfs fails
|
||||||
|
echo 4 | ecryptfs-manager
|
||||||
stty -echo
|
stty -echo
|
||||||
printf "passphrase: "
|
printf "passphrase: "
|
||||||
read passphrase
|
read passphrase
|
||||||
|
Loading…
Reference in New Issue
Block a user