summaryrefslogtreecommitdiffstats
path: root/makeluks.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makeluks.sh')
-rwxr-xr-xmakeluks.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/makeluks.sh b/makeluks.sh
new file mode 100755
index 0000000..e8ffdb0
--- /dev/null
+++ b/makeluks.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -Ceux
+
+partswap="${1}3"
+partroot="${1}4"
+lukspass="$2"
+
+echo "$lukspass" | cryptsetup -q luksFormat "$partswap"
+echo "$lukspass" | cryptsetup -q luksFormat "$partroot"
+
+echo "$lukspass" | cryptsetup -q luksOpen "$partswap" cr_swap
+echo "$lukspass" | cryptsetup -q luksOpen "$partroot" cr_root