mirror of
https://github.com/vale981/phoebe
synced 2025-03-04 17:31:41 -05:00
secrets: Try to improve size estimates for the tmpfs
When creating the tmpfs we need to specify a size. Calculate the size based on the size of the tarball of the encrypted files, multiplied by 10.
This commit is contained in:
parent
4964d95974
commit
c5dc7d83be
1 changed files with 4 additions and 3 deletions
|
@ -64,12 +64,13 @@ calculate_mount_point() {
|
|||
}
|
||||
|
||||
################################################################################
|
||||
# Figure out how much space we need in the tmpfs.
|
||||
calculate_fs_size() {
|
||||
local directory=$1
|
||||
local size
|
||||
|
||||
size=$(du --bytes --summarize "$directory" | awk '{print $1}')
|
||||
echo $((size * 2))
|
||||
size=$(tar -cf - "$directory" | wc -c)
|
||||
echo $((size * 10 / 1024))k
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
@ -191,7 +192,7 @@ mount_secrets() {
|
|||
|
||||
while IFS= read -r -d '' file; do
|
||||
decrypt_file "$file" "$option_secrets" "$option_mount_point" "$symmetric_key"
|
||||
done < <(find "$option_secrets" -type f -print0)
|
||||
done < <(find "$option_secrets"/ -type f -print0)
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
Loading…
Add table
Reference in a new issue