summaryrefslogtreecommitdiffstats
path: root/makeluks.sh
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2022-11-29 12:27:06 +0100
committerGeorg Pfuetzenreuter2022-11-29 12:27:06 +0100
commit15042704b931e02b4dbcfcee1d0dab586c4c16ef (patch)
tree9b3dd3d7de0ef6fcd28fb5fa1f6049605c1beb8c /makeluks.sh
downloadopensuse-bootstrap-master.tar.gz
opensuse-bootstrap-master.tar.bz2
opensuse-bootstrap-master.zip
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
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