wip
This commit is contained in:
parent
e3c9e93efa
commit
85f19d7842
1 changed files with 4 additions and 1 deletions
5
entry.sh
5
entry.sh
|
@ -17,6 +17,9 @@ function first_stage(){
|
||||||
apt install -y debootstrap cryptsetup btrfs-progs lvm2
|
apt install -y debootstrap cryptsetup btrfs-progs lvm2
|
||||||
|
|
||||||
if [ -d /dev/vg0 ]; then
|
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
|
swapoff /dev/vg0/swap || true
|
||||||
vgchange -an /dev/vg0
|
vgchange -an /dev/vg0
|
||||||
fi
|
fi
|
||||||
|
@ -55,7 +58,7 @@ function first_stage(){
|
||||||
|
|
||||||
LVM_SIZE=$(dev_size /dev/mapper/cryptlvm)
|
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))
|
ROOT_SIZE=$(($LVM_SIZE/1024/1024-SWAP_SIZE))
|
||||||
|
|
||||||
echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M
|
echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M
|
||||||
|
|
Loading…
Reference in a new issue