From 85f19d78425768394b806af80033799a017cf6a2 Mon Sep 17 00:00:00 2001 From: jedi Date: Fri, 31 Jan 2020 11:57:22 +0100 Subject: [PATCH] wip --- entry.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entry.sh b/entry.sh index 5bd06b1..7faf23e 100755 --- a/entry.sh +++ b/entry.sh @@ -17,6 +17,9 @@ function first_stage(){ apt install -y debootstrap cryptsetup btrfs-progs lvm2 if [ -d /dev/vg0 ]; then + mount | grep target | awk '{print $3}'| sort -r | while read LINE; do + umount -l $LINE; + done swapoff /dev/vg0/swap || true vgchange -an /dev/vg0 fi @@ -55,7 +58,7 @@ function first_stage(){ LVM_SIZE=$(dev_size /dev/mapper/cryptlvm) - SWAP_SIZE=$(($(mem_size)/1000/1000)) + SWAP_SIZE=$(($(mem_size)/1024/1024)) ROOT_SIZE=$(($LVM_SIZE/1024/1024-SWAP_SIZE)) echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M